r14203 by cbradney - Allow new user interface prefs pane to load/save data

scribus-commit scribus-commit at lists.scribus.net
Tue Oct 20 22:05:35 CEST 2009


Revision: 14203
Author: cbradney
Date: 2009-10-20T17:23:03.583542Z
Commit message: Allow new user interface prefs pane to load/save data

Changeset: 
M  /trunk/Scribus/scribus/prefsmanager.cpp
M  /trunk/Scribus/scribus/scribus.cpp
M  /trunk/Scribus/scribus/ui/prefs_userinterface.cpp
M  /trunk/Scribus/scribus/prefsstructs.h
M  /trunk/Scribus/scribus/ui/preferencesdialog.cpp
M  /trunk/Scribus/scribus/ui/prefs_userinterfacebase.ui
M  /trunk/Scribus/scribus/scribuscore.cpp

Diffs:
Index: scribus/scribuscore.cpp
===================================================================
--- scribus/scribuscore.cpp	(revision 14202)
+++ scribus/scribuscore.cpp	(revision 14203)
@@ -182,6 +182,7 @@
 		prefsManager->ReadPrefs();
 	else
 		prefsManager->ReadPrefs(prefsUserFile);
+	prefsManager->appPrefs.uiPrefs.showSplashOnStartup=showSplash;
 //	setSplashStatus( tr("Applying User Shortcuts") );
 //	prefsManager->applyLoadedShortCuts();
 		
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(revision 14202)
+++ scribus/prefsmanager.cpp	(revision 14203)
@@ -425,6 +425,7 @@
 	appPrefs.miscPrefs.useStandardLI = false;
 	appPrefs.miscPrefs.paragraphsLI = 10;
 	appPrefs.uiPrefs.showStartupDialog = true;
+	appPrefs.uiPrefs.showSplashOnStartup = true;
 	appPrefs.uiPrefs.useSmallWidgets = false;
 	initDefaultCheckerPrefs(&appPrefs.checkerPrefsList);
 	appPrefs.curCheckProfile = CommonStrings::PostScript;
@@ -1269,6 +1270,7 @@
 	dc.setAttribute("STEFONT", appPrefs.storyEditorPrefs.guiFont);
 	dc.setAttribute("STYLEPREVIEW", static_cast<int>(appPrefs.miscPrefs.haveStylePreview));
 	dc.setAttribute("UI_SHOWSTARTUPDIALOG", static_cast<int>(appPrefs.uiPrefs.showStartupDialog));
+	dc.setAttribute("UI_SHOWSPLASHSCREEN", static_cast<int>(appPrefs.uiPrefs.showSplashOnStartup));
 	dc.setAttribute("UI_USESMALLWIDGETS", static_cast<int>(appPrefs.uiPrefs.useSmallWidgets));
 	dc.setAttribute("ToolTips", static_cast<int>(appPrefs.displayPrefs.showToolTips));
 	dc.setAttribute("showMouseCoordinates", static_cast<int>(appPrefs.displayPrefs.showMouseCoordinates));
@@ -1816,6 +1818,7 @@
 				appPrefs.uiPrefs.showStartupDialog = dc.attribute("StartUp").toInt();
 			else
 				appPrefs.uiPrefs.showStartupDialog = static_cast<bool>(dc.attribute("UI_SHOWSTARTUPDIALOG", "1").toInt());
+			appPrefs.uiPrefs.showSplashOnStartup = static_cast<bool>(dc.attribute("UI_SHOWSPLASHSCREEN", "1").toInt());
 			if (dc.hasAttribute("UseSmallWidgets"))
 				appPrefs.uiPrefs.useSmallWidgets = dc.attribute("UseSmallWidgets").toInt();
 			else
Index: scribus/prefsstructs.h
===================================================================
--- scribus/prefsstructs.h	(revision 14202)
+++ scribus/prefsstructs.h	(revision 14203)
@@ -82,6 +82,7 @@
 	QString language; //! Language of the user interface
 	bool useSmallWidgets; //! Use small widgets in the palettes
 	bool showStartupDialog; //! Whether to show the startup dialog or not
+	bool showSplashOnStartup; //! Whether to show the splashscreen or not
 	bool stickyTools; //! Whether a user's tool section remains after use or the normal tool is reselected
 	bool grayscaleIcons; //! Show icons in toolbars as grayscale
 	WindowPrefs mainWinSettings;
Index: scribus/ui/prefs_userinterface.cpp
===================================================================
--- scribus/ui/prefs_userinterface.cpp	(revision 14202)
+++ scribus/ui/prefs_userinterface.cpp	(revision 14203)
@@ -10,10 +10,8 @@
 #include "langmgr.h"
 #include "prefs_userinterface.h"
 #include "prefsstructs.h"
-#include "scribusapp.h"
 #include "util.h"
 
-extern ScribusQApp* ScQApp;
 
 Prefs_UserInterface::Prefs_UserInterface(QWidget* parent)
 	: Prefs_Pane(parent)
@@ -78,15 +76,22 @@
 	resizeMoveDelaySpinBox->setValue(prefsData->uiPrefs.mouseMoveTimeout);
 	recentDocumentsSpinBox->setValue( prefsData->uiPrefs.recentDocCount );
 	showStartupDialogCheckBox->setChecked(prefsData->uiPrefs.showStartupDialog);
-	showSplashCheckBox->setChecked( !ScQApp->neverSplashExists() );
+	showSplashCheckBox->setChecked(prefsData->uiPrefs.showSplashOnStartup);
 	useSmallWidgetsCheckBox->setChecked(prefsData->uiPrefs.useSmallWidgets);
 }
 
 void Prefs_UserInterface::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
 {
-//	prefsData->scrapbookPrefs.doCopyToScrapbook=languageComboBox->isChecked();
-//	prefsData->scrapbookPrefs.persistentScrapbook=keepCopiedAcrossSessionsCheckBox->isChecked();
-//	prefsData->scrapbookPrefs.numScrapbookCopies=itemCountKeptInScrapbookSpinBox->value();
+	prefsData->uiPrefs.language=selectedGUILang;
+	prefsData->uiPrefs.style=themeComboBox->currentText();
+	prefsData->uiPrefs.applicationFontSize=fontSizeMenuSpinBox->value();
+	prefsData->uiPrefs.paletteFontSize=fontSizePaletteSpinBox->value();
+	prefsData->uiPrefs.wheelJump=wheelJumpSpinBox->value();
+	prefsData->uiPrefs.mouseMoveTimeout=resizeMoveDelaySpinBox->value();
+	prefsData->uiPrefs.recentDocCount=recentDocumentsSpinBox->value();
+	prefsData->uiPrefs.showStartupDialog=showStartupDialogCheckBox->isChecked();
+	prefsData->uiPrefs.showSplashOnStartup=showSplashCheckBox->isChecked();
+	prefsData->uiPrefs.useSmallWidgets=useSmallWidgetsCheckBox->isChecked();
 }
 
 
Index: scribus/ui/preferencesdialog.cpp
===================================================================
--- scribus/ui/preferencesdialog.cpp	(revision 14202)
+++ scribus/ui/preferencesdialog.cpp	(revision 14203)
@@ -104,6 +104,7 @@
 
 void PreferencesDialog::setupGui()
 {
+	prefs_UserInterface->restoreDefaults(&localPrefs);
 	prefs_Scrapbook->restoreDefaults(&localPrefs);
 	prefs_Display->restoreDefaults(&localPrefs);
 }
@@ -234,6 +235,7 @@
 
 void PreferencesDialog::saveGuiToPrefs()
 {
+	prefs_UserInterface->saveGuiToPrefs(&localPrefs);
 	prefs_Scrapbook->saveGuiToPrefs(&localPrefs);
 	prefs_Display->saveGuiToPrefs(&localPrefs);
 }
Index: scribus/ui/prefs_userinterfacebase.ui
===================================================================
--- scribus/ui/prefs_userinterfacebase.ui	(revision 14202)
+++ scribus/ui/prefs_userinterfacebase.ui	(revision 14203)
@@ -315,6 +315,9 @@
            <property name="suffix">
             <string> ms</string>
            </property>
+           <property name="maximum">
+            <number>9999</number>
+           </property>
           </widget>
          </item>
          <item>
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 14202)
+++ scribus/scribus.cpp	(revision 14203)
@@ -7634,6 +7634,7 @@
 		struct ApplicationPrefs newPrefs(prefsDialog.prefs());
 		prefsManager->setNewPrefs(newPrefs);
 		prefsManager->SavePrefs();
+		ScQApp->neverSplash(!prefsManager->appPrefs.uiPrefs.showSplashOnStartup);
 	}
 }
 




More information about the scribus-commit mailing list