Author: gs
Date: Tue Nov 20 16:33:28 2007
New Revision: 42230
URL: http://svn.opensuse.org/viewcvs/yast?rev=42230&view=rev
Log:
first version of the package selector without reading the
ycp layout file (not yet complete)
Modified:
trunk/ncurses/src/NCPackageSelectorPlugin.cc
trunk/ncurses/src/NCPackageSelectorStart.cc
trunk/ncurses/src/NCPackageSelectorStart.h
trunk/ncurses/src/NCPkgTable.cc
trunk/ncurses/src/NCPkgTable.h
trunk/ncurses/src/pkg/NCPackageSelector.cc
trunk/ncurses/src/pkg/NCPackageSelector.h
Modified: trunk/ncurses/src/NCPackageSelectorPlugin.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCPackageSelectorPlugin.cc?rev=42230&r1=42229&r2=42230&view=diff
==============================================================================
--- trunk/ncurses/src/NCPackageSelectorPlugin.cc (original)
+++ trunk/ncurses/src/NCPackageSelectorPlugin.cc Tue Nov 20 16:33:28 2007
@@ -160,7 +160,7 @@
{
ncSelector->showDefaultList();
NCDialog * ncd = static_cast( dialog );
-
+ NCMIL << "NCDialog: " << ncd << endl;
do
{
event = ncd->userInput();
Modified: trunk/ncurses/src/NCPackageSelectorStart.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCPackageSelectorStart.cc?rev=42230&r1=42229&r2=42230&view=diff
==============================================================================
--- trunk/ncurses/src/NCPackageSelectorStart.cc (original)
+++ trunk/ncurses/src/NCPackageSelectorStart.cc Tue Nov 20 16:33:28 2007
@@ -20,6 +20,7 @@
#include "NCurses.h"
#include "NCPackageSelectorStart.h"
#include "NCPushButton.h"
+#include "NCSpacing.h"
#include "NCPkgTable.h"
#include "NCLabel.h"
#include "NCPkgNames.h"
@@ -62,84 +63,31 @@
if ( modeFlags & YPkg_UpdateMode )
updateMode = true;
-
- // Read the layout file and create the widget tree
- YCPTerm pkgLayout = YCPNull();
- if ( youMode )
- {
- pkgLayout = readLayoutFile( "/usr/share/YaST2/data/you_layout.ycp" );
- }
- else
- {
- pkgLayout = readLayoutFile( "/usr/share/YaST2/data/pkg_layout.ycp" );
- //pkgLayout = readLayoutFile( "/usr/share/YaST2/data/test_layout.ycp" );
- }
-
- if ( ! pkgLayout.isNull() && ui )
- {
- // widgetRoot = (YContainerWidget *)ui->createWidgetTree( dynamic_cast(parent),
- // childrenOpt, 0, pkgLayout );
-
- widgetRoot = YCPDialogParser::parseWidgetTreeTerm( this,
- pkgLayout );
- }
-
- // create the PackageSelector (creation with 'new' is required because initialization
- // in the list of member variables causes problems with untranslated messages)
-
- if ( widgetRoot )
- {
- NCMIL << "Widget tree of NCPackageSelector created" << endl;
-
- packager = new NCPackageSelector( ui, widgetRoot, modeFlags );
-
- // child handling is done by libyui now
- //this->addChild( widgetRoot );
- //widgetRoot->setParent( this );
- // get the widget ID of the package table
- YWidget * pkg = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Packages() );
- pkgList = dynamic_cast(pkg);
+ // NEW NEW
+ packager = new NCPackageSelector( ui, widgetRoot, modeFlags );
- if ( pkgList )
- {
- NCMIL << "Set package table type" << endl;
- // set the type of the table
- NCPkgStatusStrategy * strategy;
- if ( youMode )
- {
- strategy = new PatchStatStrategy();
-
- pkgList->setTableType( NCPkgTable::T_Patches, strategy );
- }
- else if ( updateMode )
- {
- strategy = new UpdateStatStrategy();
- pkgList->setTableType( NCPkgTable::T_Update, strategy );
- }
- else
- {
- strategy = new PackageStatStrategy();
- pkgList->setTableType( NCPkgTable::T_Packages, strategy );
- }
-
- // set the pointer to the packager object
- pkgList->setPackager( packager );
+ NCPkgTable::NCPkgTableType type;
- // fill the table header
- pkgList->fillHeader( );
- }
- }
+ if ( youMode )
+ type = NCPkgTable::T_Patches;
+ else if ( updateMode )
+ type = NCPkgTable::T_Update;
else
+ type = NCPkgTable::T_Packages;
+
+ if ( packager )
{
- NCERR << "ERROR: could not create the NCPackageSelector" << endl;
+ if ( !youMode )
+ packager->createPkgLayout( this, type );
+ else
+ packager->createYouLayout( this, type );
}
-
+
WIDDBG << endl;
wstate = NC::WSdumb;
}
-
///////////////////////////////////////////////////////////////////
//
//
@@ -182,38 +130,29 @@
void NCPackageSelectorStart::showDefaultList()
{
// fill the package table with packages belonging to the default filter
- if ( pkgList )
+
+ if ( packager )
{
- if ( packager )
- {
- packager->createPopups();
- }
-
- // fill the list with packages (or patches)
- pkgList->fillDefaultList( );
+ // create the NCPkgPoups
+ packager->createPopups();
+ // fill package list with packages belonging to default RPM group
+ packager->fillDefaultList();
- pkgList->setKeyboardFocus();
+ // always do an initial dependency solving
+ packager->showPackageDependencies( true );
- if ( packager )
+ if ( youMode )
{
- // always do an initial dependency solving
- packager->showPackageDependencies( true );
-
- if ( youMode )
- // show download size
- packager->showDownloadSize();
- else
- {
- // show the required diskspace
- packager->showDiskSpace();
- // show appropriate filter menu entries
- packager->createFilterMenu();
- }
+ // FIXME - show download size
+ // packager->showDownloadSize();
+ }
+ else
+ {
+ // FIXME - show the required diskspace
+ // packager->showDiskSpace();
+ // FIXME - show appropriate filter menu entries
+ // packager->createFilterMenu();
}
- }
- else
- {
- NCERR << "Package table does not exist" << endl;
}
}
@@ -234,53 +173,3 @@
}
-///////////////////////////////////////////////////////////////////
-//
-// readLayoutFile
-//
-// Read a layout file (containing a YCPTerm)
-//
-YCPTerm NCPackageSelectorStart::readLayoutFile( const char * layoutFilename )
-{
- YCPTerm pkgLayout = YCPNull();
-
- FILE * layoutFile = fopen( layoutFilename, "r" );
-
- if ( ! layoutFile )
- {
- NCERR << "Can't open layout file " << layoutFilename << endl;
- }
- else
- {
- NCMIL << "Loading layout file " << layoutFilename << endl;
-
- Parser parser( layoutFile, layoutFilename );
- YCodePtr parsed_code = parser.parse ();
- YCPValue layout = YCPNull ();
-
- if ( parsed_code != NULL )
- layout = parsed_code->evaluate ();
-
- if ( layout.isNull() )
- {
- NCERR << "Error parsing layout file - layout reading aborted" << endl;
- }
- else
- {
- if ( !layout->isTerm() )
- {
- NCERR << "Error evaluating layout file - layout must be a term" << endl;
- }
- else
- {
- pkgLayout = layout->asTerm();
- NCDBG << "LAYOUT TERM: " << layout->toString() << endl;
- }
- }
-
- fclose( layoutFile );
- }
-
- return pkgLayout;
-}
-
Modified: trunk/ncurses/src/NCPackageSelectorStart.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCPackageSelectorStart.h?rev=42230&r1=42229&r2=42230&view=diff
==============================================================================
--- trunk/ncurses/src/NCPackageSelectorStart.h (original)
+++ trunk/ncurses/src/NCPackageSelectorStart.h Tue Nov 20 16:33:28 2007
@@ -29,9 +29,9 @@
#include "NCPopupTable.h"
-
class NCPkgTable;
class NCPackageSelector;
+class NCPushButton;
/**
* @short the package selector widget
@@ -48,8 +48,6 @@
YWidget * widgetRoot; // root of the widget tree of the package selection dialog
- NCPkgTable * pkgList; // the package table widget
-
NCPackageSelector *packager; // packager object contains the data and handles events
bool youMode;
@@ -107,13 +105,6 @@
YWidget * root( ) const { return widgetRoot; };
- /**
- * Helper function; reads a file containing a YCP term
- * @param layoutFilename The filename
- * @return YCPTerm
- */
- YCPTerm readLayoutFile( const char * layoutFilename );
-
};
///////////////////////////////////////////////////////////////////
Modified: trunk/ncurses/src/NCPkgTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCPkgTable.cc?rev=42230&r1=42229&r2=42230&view=diff
==============================================================================
--- trunk/ncurses/src/NCPkgTable.cc (original)
+++ trunk/ncurses/src/NCPkgTable.cc Tue Nov 20 16:33:28 2007
@@ -808,7 +808,7 @@
if ( !packager )
return false;
-
+ NCMIL << "SHOW info" << endl;
switch ( tableType )
{
case T_Packages:
Modified: trunk/ncurses/src/NCPkgTable.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCPkgTable.h?rev=42230&r1=42229&r2=42230&view=diff
==============================================================================
--- trunk/ncurses/src/NCPkgTable.h (original)
+++ trunk/ncurses/src/NCPkgTable.h Tue Nov 20 16:33:28 2007
@@ -256,6 +256,8 @@
return true;
}
+ NCPkgTableType getTableType() { return tableType; }
+
/**
* Gets the data pointer of a certain package.
* @param index The index in package table (the line)
Modified: trunk/ncurses/src/pkg/NCPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/pkg/NCPackageSelector.cc?rev=42230&r1=42229&r2=42230&view=diff
==============================================================================
--- trunk/ncurses/src/pkg/NCPackageSelector.cc (original)
+++ trunk/ncurses/src/pkg/NCPackageSelector.cc Tue Nov 20 16:33:28 2007
@@ -17,9 +17,12 @@
/-*/
#include "NCurses.h"
+#include "NCWidgetFactory.h"
#include "NCPushButton.h"
+#include "NCMenuButton.h"
#include "NCTable.h"
#include "NCPkgTable.h"
+#include "NCSpacing.h"
#include "NCRichText.h"
#include "NCLabel.h"
#include "NCPkgPopupSearch.h"
@@ -33,6 +36,7 @@
#include "NCPkgPopupTable.h"
#include "NCPkgPopupDescr.h"
#include "NCPackageSelector.h"
+#include "NCLayoutBox.h"
#include "YSelectionBox.h"
#include "YNCursesUI.h"
#include "NCi18n.h"
@@ -498,57 +502,30 @@
bool NCPackageSelector::handleEvent ( const NCursesEvent& event )
{
bool retVal = false;
- string currentId = "";
+
+ // TODO: handle hyperlinks
+ // string currentId = "";
+ // if (currentId->asString()->value().substr(0, 4) == "pkg:" )
if ( event == NCursesEvent::handled )
return false;
- // Get the id of the widget which is affected
+ // Call the appropriate handler
if ( event == NCursesEvent::button )
{
- YWidget * widget = dynamic_cast(event.widget);
- if ( widget )
- currentId = getButtonId( widget );
+ if ( event.widget == okButton )
+ retVal = OkButtonHandler( event );
+ else if ( event.widget == cancelButton )
+ retVal = CancelHandler( event );
+
}
else if ( event == NCursesEvent::menu )
{
- currentId = getMenuId(event.selection);
- }
-
- // Find the handler-function for the given widget-nameId
- if ( currentId != "" )
- {
- UIMIL << "Selected widget id: " << currentId << endl;
- // remove '"' at begin and end of cuurentId
- string linkId = currentId.substr(1,currentId.substr().length()-2);
- // hyperlink
- //if ( currentId->isString()
- // && currentId->asString()->value().substr(0, 4) == "pkg:" )
- if ( linkId.substr(0,4) == "pkg:" )
- {
- //LinkHandler( currentId->asString()->value() );
- LinkHandler( linkId );
- return true;
- }
-
- tHandlerMap::iterator it = eventHandlerMap.find ( currentId );
-
- if (it != eventHandlerMap.end()) // if currentId found in map
- {
- tHandlerFctPtr pFct = (*it).second;
- retVal = (this->*pFct) ( event ); // call handler
- }
- else
- {
- UIERR << "Unhandled event for widget-Id: " << currentId << endl;
+ if ( event.widget == filterMenu )
+ retVal = FilterHandler( event );
+ else if ( event.widget == actionMenu )
+ retVal = StatusHandler( event );
- // return true means: don't leave the event loop in runPkgSelection
- retVal = true;
- }
- }
- else
- {
- UIERR << "Unknown event or id not valid" << endl;
}
return retVal;
@@ -691,11 +668,9 @@
NCDBG << "Filter: " << label->toString() << endl;
// show the selected filter label
- // YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
- YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
- static_cast(filterLabel)->setLabel( label->toString() );
+ filterLabel->setLabel( label->toString() );
}
}
@@ -786,11 +761,9 @@
packageList->drawList();
// set filter label to 'Search'
- // YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
- YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
- static_cast(filterLabel)->setLabel( NCPkgNames::SearchResults() );
+ filterLabel->setText( NCPkgNames::SearchResults() );
}
return true;
@@ -836,12 +809,9 @@
packageList->drawList();
// set filter label to 'Search'
- //YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
- YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
-
if ( filterLabel )
{
- static_cast(filterLabel)->setLabel( NCPkgNames::SearchResults() );
+ filterLabel->setLabel( NCPkgNames::SearchResults() );
}
return true;
@@ -893,22 +863,20 @@
packageList->drawList();
// show the selected filter label
- YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
-
if ( filterLabel )
{
if ( filter == "installable" )
{
// show common label "Online Update Patches"
- static_cast(filterLabel)->setLabel( NCPkgNames::YOUPatches() );
+ filterLabel->setLabel( NCPkgNames::YOUPatches() );
}
else if ( filter == "installed" )
{
- static_cast(filterLabel)->setLabel( NCPkgNames::InstPatches() );
+ filterLabel->setLabel( NCPkgNames::InstPatches() );
}
else
{
- static_cast(filterLabel)->setLabel( NCPkgNames::Patches() );
+ filterLabel->setLabel( NCPkgNames::Patches() );
}
}
@@ -960,10 +928,9 @@
packageList->drawList();
// show the selected filter label
- YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
- static_cast(filterLabel)->setLabel( NCPkgNames::UpdateProblem() );
+ filterLabel->setLabel( NCPkgNames::UpdateProblem() );
}
return true;
@@ -1141,10 +1108,9 @@
packageList->drawList();
// show the selected filter label
- YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
- static_cast(filterLabel)->setLabel( NCPkgNames::InstSummary() );
+ filterLabel->setLabel( NCPkgNames::InstSummary() );
}
return true;
@@ -1207,14 +1173,15 @@
// show the package list
packageList->drawList();
-
+
+ NCMIL << "Fill package list" << endl;
+
if ( !label.isNull() )
{
// show the selected filter label
- YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
- static_cast(filterLabel)->setLabel( label->toString() );
+ filterLabel->setText( label->toString() );
}
}
@@ -1287,14 +1254,12 @@
//and show the whole stuff to the user
pkgList->drawList();
- YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
-
if ( repoPopup && filterLabel )
{
ZyppProduct product = repoPopup->findProductForRepo( repo );
if ( product )
{
- static_cast(filterLabel)->setLabel( product->summary() );
+ filterLabel->setLabel( product->summary() );
}
}
@@ -1858,10 +1823,10 @@
{
return false;
}
+
string selId = getMenuId( event.selection );
-
- // if ( event.selection->compare( NCPkgNames::RpmGroups() ) == YO_EQUAL )
- if ( selId == NCPkgNames::RpmGroups()->toString() )
+
+ if ( event.selection == groupsItem )
{
if ( filterPopup )
{
@@ -1870,8 +1835,7 @@
retEvent = filterPopup->showFilterPopup( );
}
}
- // else if ( event.selection->compare( NCPkgNames::Selections() ) == YO_EQUAL )
- else if ( selId == NCPkgNames::Selections()->toString() )
+ else if ( event.selection == patternsItem )
{
if ( selectionPopup )
{
@@ -1879,8 +1843,7 @@
retEvent = selectionPopup->showSelectionPopup( );
}
}
- // else if ( event.selection->compare( NCPkgNames::Patterns() ) == YO_EQUAL )
- else if ( selId == NCPkgNames::Patterns()->toString() )
+ else if ( event.selection == patternsItem )
{
if ( patternPopup )
{
@@ -1888,8 +1851,7 @@
retEvent = patternPopup->showSelectionPopup( );
}
}
- // else if ( event.selection->compare( NCPkgNames::Languages() ) == YO_EQUAL )
- else if ( selId == NCPkgNames::Languages()->toString() )
+ else if ( event.selection == languagesItem )
{
if ( languagePopup )
{
@@ -1897,7 +1859,7 @@
retEvent = languagePopup->showSelectionPopup( );
}
}
- else if ( selId == NCPkgNames::Repositories()->toString() )
+ else if ( event.selection == reposItem )
{
if ( repoPopup )
{
@@ -1905,6 +1867,11 @@
retEvent = repoPopup->showRepoPopup( );
}
}
+ else if ( event.selection == searchItem )
+ {
+ // start package search
+ SearchHandler( event );
+ }
// patches
// else if ( event.selection->compare( NCPkgNames::Recommended() ) == YO_EQUAL )
else if ( selId == NCPkgNames::Recommended()->toString() )
@@ -2735,11 +2702,9 @@
descr += createDescrText( value );
// show the description
- YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
-
- if ( descrInfo )
+ if ( infoText )
{
- static_cast(descrInfo)->setText( descr );
+ infoText->setText( descr );
}
}
// else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
@@ -2857,7 +2822,8 @@
NCERR << "Selectable not valid" << endl;
return false;
}
-
+
+ NCMIL << "SHOW package info " << visibleInfo << endl;
// if ( visibleInfo->compare( NCPkgNames::LongDescr() ) == YO_EQUAL )
if ( visibleInfo == NCPkgNames::LongDescr()->toString() )
{
@@ -2978,11 +2944,9 @@
}
// show the description
- YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
-
- if ( descrInfo )
+ if ( infoText )
{
- static_cast(descrInfo)->setText( text );
+ infoText->setText( text );
}
}
// else if ( visibleInfo->compare( NCPkgNames::Versions() ) == YO_EQUAL )
@@ -3334,7 +3298,141 @@
//
NCPkgTable * NCPackageSelector::getPackageList()
{
- YWidget * packages = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Packages() );
+ //YWidget * packages = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Packages() );
- return ( dynamic_cast(packages) );
+ //return ( dynamic_cast(packages) );
+ return pkgList;
+}
+
+void NCPackageSelector::createYouLayout( YWidget * selector, NCPkgTable::NCPkgTableType type )
+{
+ // TODO
+}
+
+void NCPackageSelector::createPkgLayout( YWidget * selector, NCPkgTable::NCPkgTableType type )
+{
+ // the vertical split is the (only) child of the dialog
+ NCLayoutBox * split = dynamic_cast(YUI::widgetFactory()->createLayoutBox( selector, YD_VERT ));
+
+ NCLayoutBox * hSplit = new NCLayoutBox( split, YD_HORIZ );
+
+ filterMenu = new NCMenuButton( hSplit, _("&Filter") );
+ filterMenu->setFunctionKey( 4 );
+
+ YItemCollection itemCollection;
+ groupsItem = new YMenuItem( _("RPM &Groups") );
+ itemCollection.push_back( groupsItem );
+ patternsItem = new YMenuItem( _("Pa&tterns") );
+ itemCollection.push_back( patternsItem );
+ languagesItem = new YMenuItem( _("&Languages") );
+ itemCollection.push_back( languagesItem );
+ reposItem = new YMenuItem( _("&Repositories" ) );
+ itemCollection.push_back( reposItem );
+ searchItem = new YMenuItem( _("&Search" ) );
+ itemCollection.push_back( searchItem );
+
+ filterMenu->addItems( itemCollection );
+
+ YTableHeader * tableHeader = new YTableHeader();
+
+ // add the package table (use default type T_Packages)
+ pkgList = new NCPkgTable( split, tableHeader );
+ YUI_CHECK_NEW( pkgList );
+
+ NCPkgStatusStrategy * strategy;
+ switch ( type )
+ {
+ case NCPkgTable::T_Patches:
+ strategy = new PatchStatStrategy();
+ pkgList->setTableType( NCPkgTable::T_Patches, strategy );
+ case NCPkgTable::T_Update:
+ strategy = new UpdateStatStrategy();
+ pkgList->setTableType( NCPkgTable::T_Update, strategy );
+ default:
+ strategy = new PackageStatStrategy();
+ pkgList->setTableType( NCPkgTable::T_Packages, strategy );
+ }
+ // set the pointer to the packager object
+ pkgList->setPackager( this );
+
+ // HBox for the buttons
+ NCLayoutBox * hSplit2 = new NCLayoutBox( split, YD_HORIZ );
+
+ filterLabel = new NCLabel ( hSplit2, "...." );
+ diskSpaceLabel = new NCLabel ( hSplit2, _("Required Disk Space: ") );
+
+ NCLayoutBox * vSplit = new NCLayoutBox( split, YD_VERT );
+ infoText = new NCRichText( vSplit, " " );
+
+ NCLayoutBox * hSplit3 = new NCLayoutBox( vSplit, YD_HORIZ );
+
+ //new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 ); // stretchable = true
+
+ // add the OK button
+ okButton = new NCPushButton( hSplit3, NCPkgNames::OKLabel() );
+ YStringWidgetID * okID = new YStringWidgetID( "ok" );
+ okButton->setId( okID );
+
+ // add the Cancel button
+ cancelButton = new NCPushButton( hSplit3, NCPkgNames::CancelLabel() );
+ YStringWidgetID * cancelID = new YStringWidgetID( "cancel" );
+ cancelButton->setId( cancelID );
+}
+
+bool NCPackageSelector::fillDefaultList( )
+{
+ if ( !pkgList )
+ return false;
+
+ NCMIL << "Fill list: " << pkgList << endl;
+ switch ( pkgList->getTableType() )
+ {
+ case NCPkgTable::T_Patches: {
+ fillPatchList( "installable" ); // default: installable patches
+
+ // set the visible info to long description
+ setVisibleInfo ( NCPkgNames::PatchDescr()->toString() );
+
+ // show the package description of the current item
+ pkgList->showInformation ();
+ break;
+ }
+ case NCPkgTable::T_Update: {
+ if ( ! zypp::getZYpp()->resolver()->problematicUpdateItems().empty() )
+ {
+ fillUpdateList();
+ // set the visible info to package description
+ setVisibleInfo ( NCPkgNames::PkgInfo()->toString() );
+ // show the package description of the current item
+ pkgList->showInformation ();
+ break;
+ }
+ }
+ case NCPkgTable::T_Packages: {
+ YStringTreeItem * defaultGroup = getDefaultRpmGroup();
+
+ if ( defaultGroup )
+ {
+ NCMIL << "default RPM group: " << defaultGroup->value().translation() << endl;
+ fillPackageList ( YCPString( defaultGroup->value().translation()),
+ defaultGroup );
+
+ // set the visible info to package description
+ setVisibleInfo ( NCPkgNames::PkgInfo()->toString() );
+ // show the package description of the current item
+ pkgList->showInformation ();
+ }
+ else
+ {
+ NCERR << "No default RPM group available" << endl;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ pkgList->setKeyboardFocus();
+
+ return true;
}
Modified: trunk/ncurses/src/pkg/NCPackageSelector.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/pkg/NCPackageSelector.h?rev=42230&r1=42229&r2=42230&view=diff
==============================================================================
--- trunk/ncurses/src/pkg/NCPackageSelector.h (original)
+++ trunk/ncurses/src/pkg/NCPackageSelector.h Tue Nov 20 16:33:28 2007
@@ -47,8 +47,9 @@
class NCPkgPopupDiskspace;
class NCPkgPopupSearch;
class NCPkgPopupFile;
+class NCPushButton;
class YNCursesUI;
-
+class NCMenuButton;
///////////////////////////////////////////////////////////////////
//
@@ -98,6 +99,35 @@
bool autoCheck; // flag for automatic dependency check on/off
YRpmGroupsTree * _rpmGroupsTree; // rpm groups of the found packages
+ // the package table
+ NCPkgTable * pkgList;
+ // filter menu and items
+ NCMenuButton * filterMenu;
+ YMenuItem * groupsItem;
+ YMenuItem * patternsItem;
+ YMenuItem * languagesItem;
+ YMenuItem * reposItem;
+ YMenuItem * searchItem;
+ YMenuItem * whatifItem;
+ // action menu and items
+ NCMenuButton * actionMenu;
+ YMenuItem * toggleItem;
+ YMenuItem * selectItem;
+
+ // information menu and items
+ NCMenuButton * infoMenu;
+ YMenuItem * pkgInfo;
+
+ // labels
+ NCLabel * filterLabel;
+ NCLabel * diskSpaceLabel;
+
+ // info text
+ NCRichText * infoText;
+
+ NCPushButton * okButton;
+ NCPushButton * cancelButton;
+
string visibleInfo; // visible package info (description, file list, ...)
// internal helper functions (format list of string)
@@ -105,7 +135,7 @@
// internal use (copies tree items got from YPkgRpmGroupTagsFilterView)
void cloneTree( YStringTreeItem * parentOrig, YTreeItem * parentClone );
- // the package (patch) list
+ // returns the package table widget
NCPkgTable * getPackageList();
// Mapping from ZyppPkg to the correspoinding ZyppSel.
@@ -133,7 +163,20 @@
*/
virtual ~NCPackageSelector();
+ /**
+ * Create all NCPkgPopus
+ * @return void
+ */
void createPopups();
+
+ /**
+ * Create layout for the PackageSelector
+ * @param parent Parent is PackageSelectorStart
+ * @param type The package table type
+ * @return void
+ */
+ void createPkgLayout( YWidget * parent, NCPkgTable::NCPkgTableType type );
+ void createYouLayout( YWidget * parent, NCPkgTable::NCPkgTableType type );
/**
* Fills the package table
@@ -200,6 +243,8 @@
bool fillPatchSearchList( const string & expr );
+ bool fillDefaultList();
+
/**
*Fills the package table with packages from selected repository
*@param repo zypp::Repository
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org