[yast-commit] r66285 - in /trunk/qt-pkg: VERSION.cmake package/yast2-qt-pkg.changes src/YQPackageSelector.cc src/YQPackageSelector.h
Author: tgoettlicher Date: Thu Oct 6 13:40:46 2011 New Revision: 66285 URL: http://svn.opensuse.org/viewcvs/yast?rev=66285&view=rev Log: - Made settings persistant (fate #307220 ) - 2.21.9 Modified: trunk/qt-pkg/VERSION.cmake trunk/qt-pkg/package/yast2-qt-pkg.changes trunk/qt-pkg/src/YQPackageSelector.cc trunk/qt-pkg/src/YQPackageSelector.h Modified: trunk/qt-pkg/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/VERSION.cmake?rev=66285&r1=66284&r2=66285&view=diff ============================================================================== --- trunk/qt-pkg/VERSION.cmake (original) +++ trunk/qt-pkg/VERSION.cmake Thu Oct 6 13:40:46 2011 @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "2") SET(VERSION_MINOR "21") -SET(VERSION_PATCH "8") +SET(VERSION_PATCH "9") Modified: trunk/qt-pkg/package/yast2-qt-pkg.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/package/yast2-qt-pkg.changes?rev=66285&r1=66284&r2=66285&view=diff ============================================================================== --- trunk/qt-pkg/package/yast2-qt-pkg.changes (original) +++ trunk/qt-pkg/package/yast2-qt-pkg.changes Thu Oct 6 13:40:46 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Oct 6 13:39:33 CEST 2011 - tgoettlicher@suse.de + +- Made settings persistant (fate #307220 ) +- 2.21.9 + +------------------------------------------------------------------- Wed Oct 5 08:34:23 CEST 2011 - tgoettlicher@suse.de - Applied Stano's patch to make installation history accessible Modified: trunk/qt-pkg/src/YQPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPackageSelector.cc?rev=66285&r1=66284&r2=66285&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPackageSelector.cc (original) +++ trunk/qt-pkg/src/YQPackageSelector.cc Thu Oct 6 13:40:46 2011 @@ -72,6 +72,7 @@ #include <QTabWidget> #include <QTimer> #include <QMenu> +#include <QSettings> #define YUILogComponent "qt-pkg" #include "YUILog.h" @@ -129,6 +130,9 @@ #define DEFAULT_EXPORT_FILE_NAME "user-packages.xml" #define FAST_SOLVER 1 +#define SETTINGS_DIR "YaST2" + + YQPackageSelector::YQPackageSelector( YWidget * parent, @@ -164,6 +168,7 @@ basicLayout(); addMenus(); // Only after all widgets are created! + loadSettings(); // Only after menus are created! makeConnections(); emit loadData(); @@ -426,6 +431,11 @@ } +YQPackageSelector::~YQPackageSelector() +{ + saveSettings(); +} + QWidget * YQPackageSelector::layoutRightPane( QWidget *parent ) { @@ -650,6 +660,8 @@ void YQPackageSelector::addMenus() { + + // // File menu // @@ -779,7 +791,6 @@ _dependencyMenu->addAction( _( "&Check Now" ), this, SLOT( manualResolvePackageDependencies() ) ); _autoDependenciesAction = new QAction( _( "&Autocheck" ), this ); _autoDependenciesAction->setCheckable( true ); - _autoDependenciesAction->setChecked( AUTO_CHECK_DEPENDENCIES_DEFAULT ); _dependencyMenu->addAction( _autoDependenciesAction ); @@ -797,7 +808,6 @@ _showDevelAction = _optionsMenu->addAction( _( "Show -de&vel Packages" ), this, SLOT( pkgExcludeDevelChanged( bool ) ), Qt::Key_F7 ); _showDevelAction->setCheckable(true); - _showDevelAction->setChecked(true); _excludeDevelPkgs = new YQPkgObjList::ExcludeRule( _pkgList, QRegExp( ".*-devel(-\\d+bit)?$" ), _pkgList->nameCol() ); YUI_CHECK_NEW( _excludeDevelPkgs ); @@ -807,7 +817,6 @@ _showDebugAction = _optionsMenu->addAction( _( "Show -&debuginfo/-debugsource Packages" ), this, SLOT( pkgExcludeDebugChanged( bool ) ), Qt::Key_F8 ); _showDebugAction->setCheckable(true); - _showDebugAction->setChecked(true); _excludeDebugInfoPkgs = new YQPkgObjList::ExcludeRule( _pkgList, QRegExp( ".*-(debuginfo|debugsource)(-32bit)?$" ), _pkgList->nameCol() ); YUI_CHECK_NEW( _excludeDebugInfoPkgs ); _excludeDebugInfoPkgs->enable( false ); @@ -816,27 +825,21 @@ _verifySystemModeAction = _optionsMenu->addAction( _( "&System Verification Mode" ), this, SLOT( pkgVerifySytemModeChanged( bool ) ) ); _verifySystemModeAction->setCheckable(true); - _verifySystemModeAction->setChecked( zypp::getZYpp()->resolver()->systemVerification() ); _ignoreAlreadyRecommendAction = _optionsMenu->addAction( _( "&Ignore Recommended Packages for Already Installed Packages" ), this, SLOT( pkgIgnoreAlreadyRecommendedChanged( bool ) ) ); _ignoreAlreadyRecommendAction->setCheckable(true); - _ignoreAlreadyRecommendAction->setChecked( zypp::getZYpp()->resolver()->ignoreAlreadyRecommended() ); + _cleanDepsOnRemoveAction = _optionsMenu->addAction( _( "&Cleanup when deleting packages" ), this, SLOT( pkgCleanDepsOnRemoveChanged( bool ) ) ); _cleanDepsOnRemoveAction->setCheckable(true); - _cleanDepsOnRemoveAction->setChecked( zypp::getZYpp()->resolver()->cleandepsOnRemove() ); - - _allowVendorChangeAction = _optionsMenu->addAction( _( "&Allow vendor change" ), this, SLOT( pkgAllowVendorChangeChanged( bool ) ) ); _allowVendorChangeAction->setCheckable(true); - _allowVendorChangeAction->setChecked( zypp::getZYpp()->resolver()->allowVendorChange() ); - @@ -1693,5 +1696,45 @@ YQPkgChangesDialog::OptionNone ); // showIfEmpty } +void +YQPackageSelector::loadSettings() +{ + QSettings settings( QSettings::UserScope, SETTINGS_DIR ); + + _autoDependenciesAction->setChecked( settings.value("Options/AutocheckDependencies", + AUTO_CHECK_DEPENDENCIES_DEFAULT ).toBool() ) ; + + _showDevelAction->setChecked(settings.value("Options/showDevelPackages", true).toBool()); + + _showDebugAction->setChecked(settings.value("Options/showDebugPackages", true).toBool()); + + _verifySystemModeAction->setChecked( settings.value("Options/systemVerificationMode", + zypp::getZYpp()->resolver()->systemVerification() ).toBool() ); + + _ignoreAlreadyRecommendAction->setChecked( settings.value("Options/IgnoreRecommendedPackagesForAlreadyInstalledPackages", + zypp::getZYpp()->resolver()->ignoreAlreadyRecommended() ).toBool() ); + + _cleanDepsOnRemoveAction->setChecked( settings.value("Options/CleanupWhenDeletingPackages", + zypp::getZYpp()->resolver()->cleandepsOnRemove()).toBool() ); + + _allowVendorChangeAction->setChecked( settings.value("Options/AllowVendorChange", + zypp::getZYpp()->resolver()->allowVendorChange() ).toBool() ); + +} + +void +YQPackageSelector::saveSettings() +{ + QSettings settings( QSettings::UserScope, SETTINGS_DIR ); + + settings.setValue("Options/AutocheckDependencies", _autoDependenciesAction->isChecked() ); + settings.setValue("Options/showDevelPackages", _showDevelAction->isChecked() ); + settings.setValue("Options/showDebugPackages", _showDebugAction->isChecked() ); + settings.setValue("Options/systemVerificationMode", _verifySystemModeAction->isChecked() ); + settings.setValue("Options/IgnoreRecommendedPackagesForAlreadyInstalledPackages", _ignoreAlreadyRecommendAction->isChecked() ); + settings.setValue("Options/CleanupWhenDeletingPackages", _cleanDepsOnRemoveAction->isChecked() ); + settings.setValue("Options/AllowVendorChange", _allowVendorChangeAction->isChecked() ); + +} #include "YQPackageSelector.moc" Modified: trunk/qt-pkg/src/YQPackageSelector.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt-pkg/src/YQPackageSelector.h?rev=66285&r1=66284&r2=66285&view=diff ============================================================================== --- trunk/qt-pkg/src/YQPackageSelector.h (original) +++ trunk/qt-pkg/src/YQPackageSelector.h Thu Oct 6 13:40:46 2011 @@ -89,6 +89,7 @@ public: YQPackageSelector( YWidget * parent, long modeFlags = 0 ); + ~YQPackageSelector(); public slots: @@ -191,6 +192,16 @@ */ void updateRepositoryUpgradeLabel(); + /** + * loads settings for the checkboxes in the option menu + */ + void loadSettings(); + + /** + * saves settings of the checkboxes in the option menu + */ + void saveSettings(); + signals: /** -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
tgoettlicher@svn2.opensuse.org