Author: dmacvicar Date: Sat Dec 8 03:08:43 2007 New Revision: 42845 URL: http://svn.opensuse.org/viewcvs/yast?rev=42845&view=rev Log: YQPackageSelector QT3_SUPPORT last one, from now, whole yast2-qt4 is Qt3Support free Modified: trunk/qt4/src/pkg/CMakeLists.txt trunk/qt4/src/pkg/YQPackageSelector.cc Modified: trunk/qt4/src/pkg/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt4/src/pkg/CMakeLists.txt?rev=42845&r1=42844&r2=42845&view=diff ============================================================================== --- trunk/qt4/src/pkg/CMakeLists.txt (original) +++ trunk/qt4/src/pkg/CMakeLists.txt Sat Dec 8 03:08:43 2007 @@ -8,7 +8,6 @@ ADD_DEFINITIONS( -DY2LOG=\\\"QT4\\\" ${QT_DEFINITIONS} -#-DQT3_SUPPORT -DICONDIR=\\"${Y2QT_ICONDIR}\\" -DLOCALEDIR=\\\"${Y2QT_LOCALEDIR}\\\" -DTHEMEDIR=\\\"${Y2QT_THEMEDIR}\\\" Modified: trunk/qt4/src/pkg/YQPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt4/src/pkg/YQPackageSelector.cc?rev=42845&r1=42844&r2=42845&view=diff ============================================================================== --- trunk/qt4/src/pkg/YQPackageSelector.cc (original) +++ trunk/qt4/src/pkg/YQPackageSelector.cc Sat Dec 8 03:08:43 2007 @@ -19,8 +19,6 @@ /-*/ -#define QT3_SUPPORT 1 - #define CHECK_DEPENDENCIES_ON_STARTUP 1 #define DEPENDENCY_FEEDBACK_IF_OK 1 #define AUTO_CHECK_DEPENDENCIES_DEFAULT true @@ -230,8 +228,8 @@ QWidget * right_pane = layoutRightPane( outer_splitter ); - outer_splitter->setResizeMode( left_pane, QSplitter::KeepSize ); - outer_splitter->setResizeMode( right_pane, QSplitter::Stretch ); + outer_splitter->setStretchFactor(outer_splitter->indexOf(left_pane), 0); + outer_splitter->setStretchFactor(outer_splitter->indexOf(right_pane), 1); } @@ -240,7 +238,6 @@ { QSplitter * splitter = new QSplitter( Qt::Vertical, parent ); Q_CHECK_PTR( splitter ); - splitter->setMargin( MARGIN ); QWidget * upper_vbox = new QWidget( splitter ); QVBoxLayout *layout = new QVBoxLayout(upper_vbox); @@ -259,9 +256,9 @@ Q_CHECK_PTR( _diskUsageList ); layout->addWidget(_diskUsageList); - splitter->setResizeMode( upper_vbox, QSplitter::Stretch ); - splitter->setResizeMode( lower_vbox, QSplitter::KeepSize ); - + splitter->setStretchFactor(splitter->indexOf(upper_vbox), 0); + splitter->setStretchFactor(splitter->indexOf(lower_vbox), 1); + return splitter; } @@ -475,7 +472,7 @@ layout->addWidget(_detailsViews); Q_CHECK_PTR( _detailsViews ); - _detailsViews->setMargin( MARGIN ); + //FIXME _detailsViews->setMargin( MARGIN ); // _detailsViews->setTabPosition( QTabWidget::Bottom ); @@ -588,7 +585,7 @@ Q_CHECK_PTR( _checkDependenciesButton ); _checkDependenciesButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) ); // hor/vert - _normalButtonBackground = _checkDependenciesButton->paletteBackgroundColor(); + _normalButtonBackground = _checkDependenciesButton->palette().color(QPalette::Background);; connect( _checkDependenciesButton, SIGNAL( clicked() ), this, SLOT ( manualResolvePackageDependencies() ) ); @@ -653,15 +650,16 @@ _fileMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _fileMenu ); - _menuBar->insertItem( _( "&File" ), _fileMenu ); + QAction *action = _menuBar->addMenu( _fileMenu ); + action->setText(( "&File" )); - _fileMenu->insertItem( _( "&Import..." ), this, SLOT( pkgImport() ) ); - _fileMenu->insertItem( _( "&Export..." ), this, SLOT( pkgExport() ) ); + _fileMenu->addAction( _( "&Import..." ), this, SLOT( pkgImport() ) ); + _fileMenu->addAction( _( "&Export..." ), this, SLOT( pkgExport() ) ); - _fileMenu->insertSeparator(); + _fileMenu->addSeparator(); - _fileMenu->insertItem( _( "E&xit -- Discard Changes" ), this, SLOT( reject() ) ); - _fileMenu->insertItem( _( "&Quit -- Save Changes" ), this, SLOT( accept() ) ); + _fileMenu->addAction( _( "E&xit -- Discard Changes" ), this, SLOT( reject() ) ); + _fileMenu->addAction( _( "&Quit -- Save Changes" ), this, SLOT( accept() ) ); if ( _pkgList ) @@ -672,20 +670,21 @@ _viewMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _viewMenu ); - _menuBar->insertItem( _( "&View" ), _viewMenu ); + QAction *action = _menuBar->addMenu( _viewMenu ); + action->setText(_( "&View" )); // Translators: This is about packages ending in "-devel", so don't translate that "-devel"! - _viewShowDevelID = _viewMenu->insertItem( _( "Show -de&vel Packages" ), + action = _viewMenu->addAction( _( "Show -de&vel Packages" ), this, SLOT( pkgExcludeRulesChanged( int ) ), Qt::Key_F7 ); - _viewMenu->setItemChecked( _viewShowDevelID, true ); + action->setChecked(true); _excludeDevelPkgs = new YQPkgObjList::ExcludeRule( _pkgList, QRegExp( ".*-devel(-\\d+bit)?$" ), _pkgList->nameCol() ); Q_CHECK_PTR( _excludeDevelPkgs ); _excludeDevelPkgs->enable( false ); // Translators: This is about packages ending in "-debuginfo", so don't translate that "-debuginfo"! - _viewShowDebugInfoID = _viewMenu->insertItem( _( "Show -&debuginfo Packages" ), + action = _viewMenu->addAction( _( "Show -&debuginfo Packages" ), this, SLOT( pkgExcludeRulesChanged( int ) ), Qt::Key_F8 ); - _viewMenu->setItemChecked( _viewShowDebugInfoID, true ); + action->setChecked(true); _excludeDebugInfoPkgs = new YQPkgObjList::ExcludeRule( _pkgList, QRegExp( ".*-debuginfo$" ), _pkgList->nameCol() ); Q_CHECK_PTR( _excludeDebugInfoPkgs ); _excludeDebugInfoPkgs->enable( false ); @@ -697,29 +696,29 @@ _pkgMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _pkgMenu ); - _menuBar->insertItem( _( "&Package" ), _pkgMenu ); + action = _menuBar->addMenu( _pkgMenu ); + action->setText(_( "&Package" )); - _pkgList->actionSetCurrentInstall->addTo( _pkgMenu ); - _pkgList->actionSetCurrentDontInstall->addTo( _pkgMenu ); - _pkgList->actionSetCurrentKeepInstalled->addTo( _pkgMenu ); - _pkgList->actionSetCurrentDelete->addTo( _pkgMenu ); - _pkgList->actionSetCurrentUpdate->addTo( _pkgMenu ); - _pkgList->actionSetCurrentTaboo->addTo( _pkgMenu ); - _pkgList->actionSetCurrentProtected->addTo( _pkgMenu ); + _pkgMenu->addAction(_pkgList->actionSetCurrentInstall); + _pkgMenu->addAction(_pkgList->actionSetCurrentDontInstall); + _pkgMenu->addAction(_pkgList->actionSetCurrentKeepInstalled); + _pkgMenu->addAction(_pkgList->actionSetCurrentDelete); + _pkgMenu->addAction(_pkgList->actionSetCurrentUpdate); + _pkgMenu->addAction(_pkgList->actionSetCurrentTaboo); - _pkgMenu->insertSeparator(); + _pkgMenu->addSeparator(); - _pkgList->actionInstallSourceRpm->addTo( _pkgMenu ); - _pkgList->actionDontInstallSourceRpm->addTo( _pkgMenu ); + _pkgMenu->addAction(_pkgList->actionInstallSourceRpm); + _pkgMenu->addAction(_pkgList->actionDontInstallSourceRpm); - _pkgMenu->insertSeparator(); + _pkgMenu->addSeparator(); QMenu * submenu = _pkgList->addAllInListSubMenu( _pkgMenu ); Q_CHECK_PTR( submenu ); - submenu->insertSeparator(); - _pkgList->actionInstallListSourceRpms->addTo( submenu ); - _pkgList->actionDontInstallListSourceRpms->addTo( submenu ); - + submenu->addSeparator(); + + _pkgMenu->addAction(_pkgList->actionInstallListSourceRpms); + _pkgMenu->addAction(_pkgList->actionDontInstallListSourceRpms); // // Submenu for all packages @@ -731,12 +730,13 @@ // Translators: Unlike the "all in this list" submenu, this submenu // refers to all packages globally, not only to those that are // currently visible in the packages list. - _pkgMenu->insertItem( _( "All Packages" ), submenu ); + action = _pkgMenu->addMenu( submenu ); + action->setText(_( "All Packages" )); - submenu->insertItem( _( "Update if newer version available" ), + submenu->addAction( _( "Update if newer version available" ), this, SLOT( globalUpdatePkg() ) ); - submenu->insertItem( _( "Update unconditionally" ), + submenu->addAction( _( "Update unconditionally" ), this, SLOT( globalUpdatePkgForce() ) ); } @@ -749,18 +749,20 @@ _patchMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _patchMenu ); - _menuBar->insertItem( _( "&Patch" ), _patchMenu ); + action = _menuBar->addMenu( _patchMenu ); + action->setText(_( "&Patch" )); + + _patchMenu->addAction(_patchList->actionSetCurrentInstall); + _patchMenu->addAction(_patchList->actionSetCurrentDontInstall); + _patchMenu->addAction(_patchList->actionSetCurrentKeepInstalled); - _patchList->actionSetCurrentInstall->addTo( _patchMenu ); - _patchList->actionSetCurrentDontInstall->addTo( _patchMenu ); - _patchList->actionSetCurrentKeepInstalled->addTo( _patchMenu ); #if ENABLE_DELETING_PATCHES - _patchList->actionSetCurrentDelete->addTo( _patchMenu ); + _patchMenu->addAction(_patchList->actionSetCurrentDelete); #endif - _patchList->actionSetCurrentUpdate->addTo( _patchMenu ); - _patchList->actionSetCurrentTaboo->addTo( _patchMenu ); + _patchMenu->addAction(_patchList->actionSetCurrentUpdate); + _patchMenu->addAction(_patchList->actionSetCurrentTaboo); - _patchMenu->insertSeparator(); + _patchMenu->addSeparator(); _patchList->addAllInListSubMenu( _patchMenu ); } @@ -771,33 +773,34 @@ _extrasMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _extrasMenu ); - _menuBar->insertItem( _( "&Extras" ), _extrasMenu ); + action = _menuBar->addMenu( _extrasMenu ); + action->setText(_( "&Extras" )); - _extrasMenu->insertItem( _( "Show &Products" ), this, SLOT( showProducts() ) ); - _extrasMenu->insertItem( _( "Show &Automatic Package Changes" ), this, SLOT( showAutoPkgList() ), Qt::CTRL + Qt::Key_A ); - _extrasMenu->insertItem( _( "&Verify System" ), this, SLOT( verifySystem() ) ); + _extrasMenu->addAction( _( "Show &Products" ), this, SLOT( showProducts() ) ); + _extrasMenu->addAction( _( "Show &Automatic Package Changes" ), this, SLOT( showAutoPkgList() ), Qt::CTRL + Qt::Key_A ); + _extrasMenu->addAction( _( "&Verify System" ), this, SLOT( verifySystem() ) ); - _extrasMenu->insertSeparator(); + _extrasMenu->addSeparator(); // Translators: This is about packages ending in "-devel", so don't translate that "-devel"! - _extrasMenu->insertItem( _( "Install All Matching -&devel Packages" ), this, SLOT( installDevelPkgs() ) ); + _extrasMenu->addAction( _( "Install All Matching -&devel Packages" ), this, SLOT( installDevelPkgs() ) ); // Translators: This is about packages ending in "-debuginfo", so don't translate that "-debuginfo"! - _extrasMenu->insertItem( _( "Install All Matching -de&buginfo Packages" ), this, SLOT( installDebugInfoPkgs() ) ); + _extrasMenu->addAction( _( "Install All Matching -de&buginfo Packages" ), this, SLOT( installDebugInfoPkgs() ) ); - _extrasMenu->insertSeparator(); + _extrasMenu->addSeparator(); if ( _pkgConflictDialog ) - _extrasMenu->insertItem( _( "Generate Dependency Resolver &Test Case" ), + _extrasMenu->addAction( _( "Generate Dependency Resolver &Test Case" ), _pkgConflictDialog, SLOT( askCreateSolverTestCase() ) ); if ( _actionResetIgnoredDependencyProblems ) - _actionResetIgnoredDependencyProblems->addTo( _extrasMenu ); + _extrasMenu->addAction(_actionResetIgnoredDependencyProblems); #ifdef FIXME if ( _patchList ) - _patchList->actionShowRawPatchInfo->addTo( _extrasMenu ); + _extrasMenu->addAction(_patchList->actionShowRawPatchInfo); #endif @@ -807,20 +810,21 @@ _helpMenu = new QMenu( _menuBar ); Q_CHECK_PTR( _helpMenu ); - _menuBar->insertSeparator(); - _menuBar->insertItem( _( "&Help" ), _helpMenu ); + _menuBar->addSeparator(); + action = _menuBar->addMenu( _helpMenu ); + action->setText(_( "&Help" )); // Note: The help functions and their texts are moved out // to a separate source file YQPackageSelectorHelp.cc // Menu entry for help overview - _helpMenu->insertItem( _( "&Overview" ), this, SLOT( help() ), Qt::Key_F1 ); + _helpMenu->addAction( _( "&Overview" ), this, SLOT( help() ), Qt::Key_F1 ); // Menu entry for help about used symbols ( icons ) - _helpMenu->insertItem( _( "&Symbols" ), this, SLOT( symbolHelp() ), Qt::SHIFT + Qt::Key_F1 ); + _helpMenu->addAction( _( "&Symbols" ), this, SLOT( symbolHelp() ), Qt::SHIFT + Qt::Key_F1 ); // Menu entry for keyboard help - _helpMenu->insertItem( _( "&Keys" ), this, SLOT( keyboardHelp() ) ); + _helpMenu->addAction( _( "&Keys" ), this, SLOT( keyboardHelp() ) ); } @@ -982,7 +986,9 @@ { if ( _checkDependenciesButton ) { - _checkDependenciesButton->setPaletteBackgroundColor( QColor( 0xE0, 0xE0, 0xF8 ) ); + QPalette p = _checkDependenciesButton->palette(); + p.setColor(QPalette::Background, QColor( 0xE0, 0xE0, 0xF8 )); + _checkDependenciesButton->setPalette(p); _checkDependenciesButton->repaint(); } } @@ -992,7 +998,11 @@ YQPackageSelector::restoreCheckButton() { if ( _checkDependenciesButton ) - _checkDependenciesButton->setPaletteBackgroundColor( _normalButtonBackground ); + { + QPalette p = _checkDependenciesButton->palette(); + p.setColor(QPalette::Background, _normalButtonBackground); + _checkDependenciesButton->setPalette(p); + } } @@ -1125,11 +1135,11 @@ exportFile.exceptions( std::ios_base::badbit | std::ios_base::failbit ); exportFile << writer; - y2milestone( "Package list exported to %s", (const char *) filename ); + y2milestone( "Package list exported to %s", qPrintable(filename) ); } catch ( std::exception & exception ) { - y2warning( "Error exporting package list to %s", (const char *) filename ); + y2warning( "Error exporting package list to %s", qPrintable(filename) ); // The export might have left over a partially written file. // Try to delete it. Don't care if it doesn't exist and unlink() fails. -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org