Author: gs
Date: Tue Nov 13 10:56:58 2007
New Revision: 41994
URL: http://svn.opensuse.org/viewcvs/yast?rev=41994&view=rev
Log:
add class NCRpmGroupItem to build NCTree of rpm groups
(tree isn't yet built correctly)
Modified:
branches/tmp/sh/mod-ui/ncurses/src/README_mod-ui
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.h
Modified: branches/tmp/sh/mod-ui/ncurses/src/README_mod-ui
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/README_mod-ui?rev=41994&r1=41993&r2=41994&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/README_mod-ui (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/README_mod-ui Tue Nov 13 10:56:58 2007
@@ -6,6 +6,11 @@
with_threads = false;
+YWidget generates a core if the widget is created on stack
+----------------------------------------------------------
+
+
+
NCTree
------
YItemIterator itemsBegin()/itemsEnd() used to iterate over toplevel items
@@ -105,9 +110,8 @@
NCTable/NCPkgTable
------------------
TODO: initialize header in constructor, set each header item separately
-
- setHeader(): call YTable::setTableHeader ???
-
+ setHeader(): call YTable::setTableHeader ???
+ NCPopupMenu
Common issues:
- Use WidgetFactory create methods, e.g. in NCAskForDirectory/File
@@ -130,6 +134,3 @@
TODO: hyper links doesn't yet work
-NCPkgPopupDiskspace
--------------------
-TODO: addItem() for partition table not yet called (NCPkgPopupDiskSpace.cc line 181)
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc?rev=41994&r1=41993&r2=41994&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc Tue Nov 13 10:56:58 2007
@@ -1636,7 +1636,7 @@
info->setNiceSize( 35, 5 );
string selId = getMenuId( event.selection );
- // ( event.selection->compare( NCPkgNames::ShowDeps() ) == YO_EQUAL )
+
if ( selId == NCPkgNames::ShowDeps()->toString() )
{
bool ok = false;
@@ -1647,21 +1647,22 @@
depsPopup->showDependencies( NCPkgPopupDeps::S_Solve, &ok );
}
- if ( ok )
+ if ( ok )
+ {
info->showInfoPopup();
+ YDialog::deleteTopmostDialog();
+ }
// update the package list and the disk space info
updatePackageList();
showDiskSpace();
}
- // else if ( event.selection->compare( NCPkgNames::VerifySystem() ) == YO_EQUAL )
else if ( selId == NCPkgNames::VerifySystem()->toString() )
{
verifyPackageDependencies();
updatePackageList();
showDiskSpace();
}
- // else if ( event.selection->compare( NCPkgNames::AutoDeps() ) == YO_EQUAL )
else if ( selId == NCPkgNames::AutoDeps()->toString() )
{
char menu[2000];
@@ -1862,8 +1863,6 @@
packageList->showInformation();
packageList->setKeyboardFocus();
- YDialog::deleteTopmostDialog(); // delete NCPopupInfo dialog
-
// return true means: don't leave the event loop in runPkgSelection
return true;
}
@@ -2714,8 +2713,6 @@
NCPkgPopupTable * autoChangePopup = new NCPkgPopupTable( wpos( 3, 8 ), this );
NCursesEvent input = autoChangePopup->showInfoPopup();
- YDialog::deleteTopmostDialog();
-
if ( input == NCursesEvent::cancel )
{
// user clicked on Cancel
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.cc?rev=41994&r1=41993&r2=41994&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.cc Tue Nov 13 10:56:58 2007
@@ -29,6 +29,37 @@
#include "NCZypp.h"
+
+
+class NCRpmGroupItem : public YTreeItem {
+
+private:
+ YStringTreeItem * rpmGroupItem;
+
+public:
+
+ NCRpmGroupItem( YTreeItem * parent,
+ const string & label,
+ YStringTreeItem * origItem )
+ : YTreeItem( parent, label ),
+ rpmGroupItem( origItem )
+ {
+
+ }
+
+ NCRpmGroupItem( const string & label,
+ YStringTreeItem * origItem )
+ : YTreeItem( label ),
+ rpmGroupItem( origItem )
+ {
+
+ }
+
+ YStringTreeItem * getOrigItem() { return rpmGroupItem; }
+
+};
+
+
///////////////////////////////////////////////////////////////////
//
//
@@ -74,8 +105,6 @@
//
void NCPkgPopupTree::createLayout( const string & label )
{
- YWidgetOpt opt;
- opt.notifyMode.setValue( true );
// FIXME
//opt.vWeight.setValue( 70 );
@@ -145,21 +174,29 @@
///////////////////////////////////////////////////////////////////
//
//
-// METHOD NAME : NCPkgPopupTree::niceSize
-// METHOD TYPE : void
-//
-// DESCRIPTION :
+// METHOD NAME : NCPkgPopupTree::preferredWidth
+// METHOD TYPE : int
//
+int NCPkgPopupTree::preferredWidth()
+{
+ return NCurses::cols()/2;
+}
-long NCPkgPopupTree::nicesize(YUIDimension dim)
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCPkgPopupTree::preferredHeight
+// METHOD TYPE : int
+//
+int NCPkgPopupTree::preferredHeight()
{
- long vdim;
+ int vdim;
if ( NCurses::lines() > 20 )
vdim = 20;
else
vdim = NCurses::lines()-4;
-
- return ( dim == YD_HORIZ ? NCurses::cols()/2 : vdim );
+
+ return vdim;
}
///////////////////////////////////////////////////////////////////
@@ -247,18 +284,22 @@
// Adds all tree items got from YPkgRpmGroupTagsFilterView to
// the filter popup tree
//
-void NCPkgPopupTree::cloneTree( YStringTreeItem * parentOrig, YTreeItem * parentClone )
+void NCPkgPopupTree::cloneTree( YStringTreeItem * parentOrig, NCRpmGroupItem * parentClone )
{
// methods of YStringTreeItem see ../libyui/src/include/TreeItem.h: SortedTreeItem
YStringTreeItem * child = parentOrig->firstChild();
- YTreeItem * clone;
+ NCRpmGroupItem * clone;
while ( child )
{
- NCDBG << "TRANSLATION: " << child->value().translation() << endl;
+ NCMIL << "Rpm group (translated): " << child->value().translation() << endl;
+
+ if ( !parentClone )
+ clone = new NCRpmGroupItem( child->value().translation(), child );
+ else
+ clone = new NCRpmGroupItem( parentClone, child->value().translation(), child );
- if ( parentClone )
- addItem( parentClone );
+ addItem( clone );
clone = parentClone;
cloneTree( child, clone );
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.h?rev=41994&r1=41993&r2=41994&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTree.h Tue Nov 13 10:56:58 2007
@@ -32,9 +32,8 @@
#include