r14105 by cbradney - #7297: Rename Face to Family. More new prefs window updates

scribus-commit scribus-commit at lists.scribus.net
Wed Oct 7 00:04:18 CEST 2009


Revision: 14105
Author: cbradney
Date: 2009-10-06T19:41:03.032943Z
Commit message: #7297: Rename Face to Family. More new prefs window updates

Changeset: 
M  /trunk/Scribus/scribus/ui/prefs_userinterface.cpp
M  /trunk/Scribus/scribus/ui/prefs_userinterface.h
M  /trunk/Scribus/scribus/ui/prefs_userinterfacebase.ui
M  /trunk/Scribus/scribus/ui/fontcombo.cpp
M  /trunk/Scribus/scribus/ui/smcstylewidget.cpp

Diffs:
Index: scribus/ui/smcstylewidget.cpp
===================================================================
--- scribus/ui/smcstylewidget.cpp	(revision 14104)
+++ scribus/ui/smcstylewidget.cpp	(revision 14105)
@@ -81,7 +81,7 @@
 // as in character styles and in paragraph style's character style
 
 	parentCombo->setToolTip(     tr("Parent Style"));
-	fontFace_->setToolTip(       tr("Font Face"));
+	fontFace_->setToolTip(       tr("Font Family"));
 	fontSize_->setToolTip(       tr("Font Size"));
 	tracking_->setToolTip(       tr("Tracking"));
 	widthSpaceSpin->setToolTip(  tr("Default width for space"));
Index: scribus/ui/prefs_userinterface.h
===================================================================
--- scribus/ui/prefs_userinterface.h	(revision 14104)
+++ scribus/ui/prefs_userinterface.h	(revision 14105)
@@ -9,18 +9,28 @@
 #define PREFS_USERINTERFACE_H
 
 #include "ui_prefs_userinterfacebase.h"
+#include "prefs_pane.h"
 #include "scribusapi.h"
 
-class SCRIBUS_API Prefs_UserInterface : public QWidget, Ui::Prefs_UserInterface
+class SCRIBUS_API Prefs_UserInterface : public Prefs_Pane, Ui::Prefs_UserInterface
 {
 	Q_OBJECT
 
 	public:
 		Prefs_UserInterface(QWidget* parent=0);
 		~Prefs_UserInterface();
+		virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
+		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
 
-//		setValues();
+	public slots:
+		void languageChange();
 
+	protected:
+		QString selectedGUILang;
+
+	private slots:
+		void setSelectedGUILang( const QString &newLang );
+
 };
 
 #endif // PREFS_USERINTERFACE_H
Index: scribus/ui/prefs_userinterface.cpp
===================================================================
--- scribus/ui/prefs_userinterface.cpp	(revision 14104)
+++ scribus/ui/prefs_userinterface.cpp	(revision 14105)
@@ -5,16 +5,93 @@
 for which a new license (GPL+exception) is in place.
 */
 
+#include <QStyleFactory>
+
+#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)
-	: QWidget(parent)
+	: Prefs_Pane(parent)
 {
 	setupUi(this);
+	languageChange();
 
+	QStringList languageList;
+	LanguageManager::instance()->fillInstalledStringList(&languageList, true);
+	languageList.sort();
+	languageComboBox->addItems( languageList );
+
+	// qt styles
+	QStringList styleList = QStyleFactory::keys();
+	themeComboBox->addItem("");
+	for (int i = 0; i < styleList.count(); ++i)
+		themeComboBox->addItem(styleList[i]);
+
+	connect(languageComboBox, SIGNAL(activated(const QString &)), this, SLOT(setSelectedGUILang(const QString &)));
+
 }
 
 Prefs_UserInterface::~Prefs_UserInterface()
 {
 }
 
+void Prefs_UserInterface::languageChange()
+{
+	/*
+	  languageComboBox
+	  themeComboBox
+	  useSmallWidgetsCheckBox
+	  recentDocumentsSpinBox
+	  fontSizeMenuSpinBox
+	  fontSizePaletteSpinBox
+	  resizeMoveDelaySpinBox
+	  wheelJumpSpinBox
+	  showSplashCheckBox
+	  showStartupDialogCheckBox
+	  */
+	languageComboBox->setToolTip( "<qt>" + tr( "Select your default language for Scribus to run with. Leave this blank to choose based on environment variables. You can still override this by passing a command line option when starting Scribus" )+"</qt>");
+	themeComboBox->setToolTip( "<qt>" + tr( "Choose the default window decoration and looks. Scribus inherits any available KDE or Qt themes, if Qt is configured to search KDE plugins." ) + "</qt>");
+	useSmallWidgetsCheckBox->setToolTip( "<qt>" + tr( "Palette windows will use smaller (space savy) widgets. Requires application restart" ) + "</qt>");
+	recentDocumentsSpinBox->setToolTip( "<qt>" + tr( "Number of recently edited documents to show in the File menu" ) + "</qt>");
+	fontSizeMenuSpinBox->setToolTip( "<qt>" + tr( "Default font size for the menus and windows" ) + "</qt>");
+	fontSizePaletteSpinBox->setToolTip( "<qt>" + tr( "Default font size for the tool windows" ) + "</qt>");
+	resizeMoveDelaySpinBox->setToolTip( "<qt>" + tr( "" ) + "</qt>");
+	wheelJumpSpinBox->setToolTip( "<qt>" + tr( "Number of lines Scribus will scroll for each move of the mouse wheel" ) + "</qt>");
+	showSplashCheckBox->setToolTip( "<qt>" + tr( "" ) + "</qt>");
+	showStartupDialogCheckBox->setToolTip( "<qt>" + tr( "" ) + "</qt>");
+
+}
+
+void Prefs_UserInterface::restoreDefaults(struct ApplicationPrefs *prefsData)
+{
+	selectedGUILang = prefsData->uiPrefs.language;
+	setCurrentComboItem(languageComboBox, LanguageManager::instance()->getLangFromAbbrev(selectedGUILang));
+	setCurrentComboItem(themeComboBox, prefsData->uiPrefs.style);
+	fontSizeMenuSpinBox->setValue( prefsData->uiPrefs.applicationFontSize );
+	fontSizePaletteSpinBox->setValue( prefsData->uiPrefs.paletteFontSize);
+	wheelJumpSpinBox->setValue( prefsData->uiPrefs.wheelJump );
+	resizeMoveDelaySpinBox->setValue(prefsData->uiPrefs.mouseMoveTimeout);
+	recentDocumentsSpinBox->setValue( prefsData->uiPrefs.recentDocCount );
+	showStartupDialogCheckBox->setChecked(prefsData->uiPrefs.showStartupDialog);
+	showSplashCheckBox->setChecked( !ScQApp->neverSplashExists() );
+	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();
+}
+
+
+void Prefs_UserInterface::setSelectedGUILang( const QString &newLang )
+{
+	selectedGUILang = LanguageManager::instance()->getAbbrevFromLang(newLang);
+}
+
Index: scribus/ui/fontcombo.cpp
===================================================================
--- scribus/ui/fontcombo.cpp	(revision 14104)
+++ scribus/ui/fontcombo.cpp	(revision 14105)
@@ -145,7 +145,7 @@
 {
 	if(showLabels)
 	{
-		fontFaceLabel->setText( tr("Face:"));
+		fontFaceLabel->setText( tr("Family:"));
 		fontStyleLabel->setText( tr("Style:"));
 	}
 }
Index: scribus/ui/prefs_userinterfacebase.ui
===================================================================
--- scribus/ui/prefs_userinterfacebase.ui	(revision 14104)
+++ scribus/ui/prefs_userinterfacebase.ui	(revision 14105)
@@ -219,7 +219,7 @@
            <item row="0" column="1">
             <widget class="QSpinBox" name="fontSizeMenuSpinBox">
              <property name="suffix">
-              <string>pt</string>
+              <string> pt</string>
              </property>
             </widget>
            </item>
@@ -236,7 +236,7 @@
            <item row="1" column="1">
             <widget class="QSpinBox" name="fontSizePaletteSpinBox">
              <property name="suffix">
-              <string>pt</string>
+              <string> pt</string>
              </property>
             </widget>
            </item>
@@ -313,7 +313,7 @@
          <item>
           <widget class="QSpinBox" name="resizeMoveDelaySpinBox">
            <property name="suffix">
-            <string>ms</string>
+            <string> ms</string>
            </property>
           </widget>
          </item>




More information about the scribus-commit mailing list