[yast-commit] r45088 - in /branches/tmp/bubli/ncurses-pkg/src: NCPackageSelector.cc NCPackageSelector.h NCPkgMenuDeps.cc NCPkgMenuDeps.h NCPkgPopupTable.h

Author: kmachalkova Date: Wed Feb 27 17:35:45 2008 New Revision: 45088 URL: http://svn.opensuse.org/viewcvs/yast?rev=45088&view=rev Log: 'check deps now' and 'verify system' moved Modified: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h branches/tmp/bubli/ncurses-pkg/src/NCPkgMenuDeps.cc branches/tmp/bubli/ncurses-pkg/src/NCPkgMenuDeps.h branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.h Modified: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPa... ============================================================================== --- branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc (original) +++ branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.cc Wed Feb 27 17:35:45 2008 @@ -33,7 +33,7 @@ #include "NCPkgPopupRepo.h" #include "NCPkgPopupDeps.h" #include "NCPkgPopupDiskspace.h" -#include "NCPkgPopupTable.h" +//#include "NCPkgPopupTable.h" #include "NCPkgPopupDescr.h" #include "NCPackageSelector.h" #include "NCLayoutBox.h" @@ -523,7 +523,11 @@ retVal = OkButtonHandler( event ); else if ( event.widget == cancelButton ) retVal = CancelHandler( event ); - + else if ( event.widget == filterPopup ) + { + retVal = true; + NCINT << "porn.bat" << endl; + } } else if ( event == NCursesEvent::menu ) { @@ -2545,7 +2549,8 @@ { saveState(); //call the solver (with S_Verify it displays no popup) - cancel = depsPopup->showDependencies( NCPkgPopupDeps::S_Verify, &ok ); + //cancel = depsPopup->showDependencies( NCPkgPopupDeps::S_Verify, &ok ); + cancel = verifySystem ( &ok ); //display the popup with automatic changes NCPkgPopupTable * autoChangePopup = new NCPkgPopupTable( wpos( 3, 8 ), this ); Modified: branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPa... ============================================================================== --- branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h (original) +++ branches/tmp/bubli/ncurses-pkg/src/NCPackageSelector.h Wed Feb 27 17:35:45 2008 @@ -42,7 +42,8 @@ #include "NCPkgMenuView.h" #include "NCPkgMenuExtras.h" #include "NCPkgMenuHelp.h" -#include "NCPkgMenuAction.h" +#include "NCPkgMenuAction.h" +#include "NCPkgPopupDeps.h" #include "NCPkgFilterMain.h" #include "NCPkgSelMapper.h" @@ -231,6 +232,11 @@ // returns the package table widget NCPkgTable * PackageList(); + NCPkgPopupDeps *DepsPopup() {return depsPopup; } + + bool checkNow( bool *ok ) { return depsPopup->showDependencies( NCPkgPopupDeps::S_Solve, ok ); } + + bool verifySystem( bool *ok ) { return depsPopup->showDependencies( NCPkgPopupDeps::S_Verify, ok ); } /** * Fills the package table Modified: branches/tmp/bubli/ncurses-pkg/src/NCPkgMenuDeps.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPk... ============================================================================== --- branches/tmp/bubli/ncurses-pkg/src/NCPkgMenuDeps.cc (original) +++ branches/tmp/bubli/ncurses-pkg/src/NCPkgMenuDeps.cc Wed Feb 27 17:35:45 2008 @@ -58,11 +58,11 @@ return false; if (event.selection == checkNow ) - NCINT << "checkNow" << endl; + return checkDependencies(); else if (event.selection == autoCheckDeps) return setAutoCheck(); else if (event.selection == verifySystem) - NCINT << "verify" << endl; + return verify(); else if (event.selection == testCase) return generateTestcase(); return true; @@ -70,7 +70,29 @@ bool NCPkgMenuDeps::checkDependencies() { - NCINT << "Zatim nic" << endl; + NCPopupInfo * info = new NCPopupInfo( wpos( (NCurses::lines()-5)/2, (NCurses::cols()-35)/2 ), "", + _( "All package dependencies are OK." ), + NCPkgNames::OKLabel() ); + info->setNiceSize( 35, 5 ); + + bool ok = false; + + if ( pkg->DepsPopup() ) + { + NCMIL << "Checking dependencies" << endl; + pkg->checkNow ( &ok ); + } + + if ( ok ) + { + info->showInfoPopup(); + YDialog::deleteTopmostDialog(); + } + + // update the package list and the disk space info + pkg->updatePackageList(); + pkg->showDiskSpace(); + return true; } @@ -111,8 +133,52 @@ pkg->AutoCheck( true ); } - //setItems( items ); - return true; } +bool NCPkgMenuDeps::verify() +{ + bool ok = false; + bool cancel = false; + + + NCMIL << "Verifying system" << endl; + + if ( pkg->DepsPopup() ) + { + pkg->saveState(); + //call the solver (with S_Verify it displays no popup) + //cancel = depsPopup->showDependencies( NCPkgPopupDeps::S_Verify, &ok ); + cancel = pkg->verifySystem ( &ok ); + + //display the popup with automatic changes + NCPkgPopupTable * autoChangePopup = new NCPkgPopupTable( wpos( 3, 8 ), pkg ); + NCursesEvent input = autoChangePopup->showInfoPopup(); + + if ( input == NCursesEvent::cancel ) + { + // user clicked on Cancel + pkg->restoreState(); + cancel = true; + } + if ( ok && input == NCursesEvent::button ) + { + // dependencies OK, no automatic changes/the user has accepted the changes + NCPopupInfo * info = new NCPopupInfo( wpos( (NCurses::lines()-5)/2, (NCurses::cols()-30)/2 ), + "", + _( "System dependencies verify OK." ), + NCPkgNames::OKLabel() + ); + info->setNiceSize( 35, 5 ); + info->showInfoPopup(); + YDialog::deleteTopmostDialog(); + } + } + + YDialog::deleteTopmostDialog(); // delete NCPopupInfo dialog + + pkg->updatePackageList(); + pkg->showDiskSpace(); + + return true; +} Modified: branches/tmp/bubli/ncurses-pkg/src/NCPkgMenuDeps.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPk... ============================================================================== --- branches/tmp/bubli/ncurses-pkg/src/NCPkgMenuDeps.h (original) +++ branches/tmp/bubli/ncurses-pkg/src/NCPkgMenuDeps.h Wed Feb 27 17:35:45 2008 @@ -25,6 +25,7 @@ #include "NCMenuButton.h" #include "NCPackageSelector.h" #include "NCPopupInfo.h" +#include "NCPkgPopupTable.h" #include "NCZypp.h" @@ -56,6 +57,8 @@ bool generateTestcase(); bool setAutoCheck(); + + bool verify(); }; #endif Modified: branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses-pkg/src/NCPk... ============================================================================== --- branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.h (original) +++ branches/tmp/bubli/ncurses-pkg/src/NCPkgPopupTable.h Wed Feb 27 17:35:45 2008 @@ -16,7 +16,7 @@ Maintainer: Michael Andres <ma@suse.de> /-*/ -#ifndef NCPkgPopupTablek_h +#ifndef NCPkgPopupTable_h #define NCPkgPopupTable_h #include <iosfwd> -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org