r14224 by fschmid - Fixed Bug #6057: "Tabs as a document switcher."

scribus-commit scribus-commit at lists.scribus.net
Sun Oct 25 12:30:33 CET 2009


Revision: 14224
Author: fschmid
Date: 2009-10-25T07:54:51.411842Z
Commit message: Fixed Bug #6057: "Tabs as a document switcher."

Changeset: 
M  /trunk/Scribus/scribus/prefsmanager.cpp
M  /trunk/Scribus/scribus/scribus.cpp
M  /trunk/Scribus/scribus/prefsstructs.h
M  /trunk/Scribus/scribus/ui/prefs.cpp
M  /trunk/Scribus/scribus/ui/tabgeneral.ui
M  /trunk/Scribus/scribus/ui/tabgeneral.cpp

Diffs:
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(revision 14223)
+++ scribus/prefsmanager.cpp	(revision 14224)
@@ -427,6 +427,7 @@
 	appPrefs.uiPrefs.showStartupDialog = true;
 	appPrefs.uiPrefs.showSplashOnStartup = true;
 	appPrefs.uiPrefs.useSmallWidgets = false;
+	appPrefs.uiPrefs.useTabs = false;
 	initDefaultCheckerPrefs(&appPrefs.checkerPrefsList);
 	appPrefs.curCheckProfile = CommonStrings::PostScript;
 	appPrefs.pdfPrefs.Thumbnails = false;
@@ -1272,6 +1273,7 @@
 	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("UI_USESTABS", static_cast<int>(appPrefs.uiPrefs.useTabs));
 	dc.setAttribute("ToolTips", static_cast<int>(appPrefs.displayPrefs.showToolTips));
 	dc.setAttribute("showMouseCoordinates", static_cast<int>(appPrefs.displayPrefs.showMouseCoordinates));
 	dc.setAttribute("stickyTools", static_cast<int>(appPrefs.uiPrefs.stickyTools));
@@ -1823,6 +1825,7 @@
 				appPrefs.uiPrefs.useSmallWidgets = dc.attribute("UseSmallWidgets").toInt();
 			else
 				appPrefs.uiPrefs.useSmallWidgets = static_cast<bool>(dc.attribute("UI_USESMALLWIDGETS", "0").toInt());
+			appPrefs.uiPrefs.useTabs = static_cast<bool>(dc.attribute("UI_USETABS", "0").toInt());
 			appPrefs.pathPrefs.documents = dc.attribute("DOC","");
 			appPrefs.pathPrefs.colorProfiles = dc.attribute("PROFILES","");
 			appPrefs.pathPrefs.scripts = dc.attribute("SCRIPTS","");
Index: scribus/prefsstructs.h
===================================================================
--- scribus/prefsstructs.h	(revision 14223)
+++ scribus/prefsstructs.h	(revision 14224)
@@ -81,6 +81,7 @@
 	QStringList RecentDocs; //! List of recent documents
 	QString language; //! Language of the user interface
 	bool useSmallWidgets; //! Use small widgets in the palettes
+	bool useTabs;         //! Use a tabbed MainWidget a la FireFox 
 	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
Index: scribus/ui/tabgeneral.ui
===================================================================
--- scribus/ui/tabgeneral.ui	(revision 14223)
+++ scribus/ui/tabgeneral.ui	(revision 14224)
@@ -1,119 +1,120 @@
-<ui version="4.0" >
- <author>Petr Vanek &lt;petr at scribus.info></author>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <author>Petr Vanek &lt;petr at scribus.info&gt;</author>
  <comment>General prefs panel</comment>
  <class>TabGeneral</class>
- <widget class="QWidget" name="TabGeneral" >
-  <property name="geometry" >
+ <widget class="QWidget" name="TabGeneral">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>631</width>
-    <height>518</height>
+    <width>529</width>
+    <height>414</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>TabGeneralBase</string>
   </property>
-  <layout class="QGridLayout" >
-   <item row="0" column="0" >
-    <widget class="QGroupBox" name="groupBox1" >
-     <property name="title" >
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QGroupBox" name="groupBox1">
+     <property name="title">
       <string>User Interface</string>
      </property>
-     <layout class="QGridLayout" >
-      <item row="0" column="0" >
-       <widget class="QLabel" name="textLabel1" >
-        <property name="text" >
+     <layout class="QGridLayout" name="gridLayout">
+      <item row="0" column="0">
+       <widget class="QLabel" name="textLabel1">
+        <property name="text">
          <string>&amp;Language:</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>false</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>guiLangCombo</cstring>
         </property>
        </widget>
       </item>
-      <item row="0" column="1" colspan="2" >
-       <widget class="QComboBox" name="guiLangCombo" />
+      <item row="0" column="1">
+       <widget class="QComboBox" name="guiLangCombo"/>
       </item>
-      <item row="0" column="4" >
-       <widget class="QLabel" name="textLabel5" >
-        <property name="text" >
+      <item row="0" column="4">
+       <widget class="QLabel" name="textLabel5">
+        <property name="text">
          <string>&amp;Wheel Jump:</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>false</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>wheelJumpSpin</cstring>
         </property>
        </widget>
       </item>
-      <item row="0" column="5" >
-       <widget class="QSpinBox" name="wheelJumpSpin" />
+      <item row="0" column="5">
+       <widget class="QSpinBox" name="wheelJumpSpin"/>
       </item>
-      <item row="1" column="0" >
-       <widget class="QLabel" name="textLabel2" >
-        <property name="text" >
+      <item row="1" column="0">
+       <widget class="QLabel" name="textLabel2">
+        <property name="text">
          <string>&amp;Theme:</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>false</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>GUICombo</cstring>
         </property>
        </widget>
       </item>
-      <item row="1" column="1" colspan="2" >
-       <widget class="QComboBox" name="GUICombo" />
+      <item row="1" column="1">
+       <widget class="QComboBox" name="GUICombo"/>
       </item>
-      <item row="1" column="4" >
-       <widget class="QLabel" name="textLabel6" >
-        <property name="text" >
+      <item row="1" column="4">
+       <widget class="QLabel" name="textLabel6">
+        <property name="text">
          <string>&amp;Recent Documents:</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>false</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>recentDocs</cstring>
         </property>
        </widget>
       </item>
-      <item row="1" column="5" >
-       <widget class="QSpinBox" name="recentDocs" />
+      <item row="1" column="5">
+       <widget class="QSpinBox" name="recentDocs"/>
       </item>
-      <item row="2" column="0" colspan="2" >
-       <widget class="QLabel" name="textLabel4" >
-        <property name="text" >
+      <item row="2" column="0" colspan="2">
+       <widget class="QLabel" name="textLabel4">
+        <property name="text">
          <string>&amp;Font Size (Menus):</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>false</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>GFsize</cstring>
         </property>
        </widget>
       </item>
-      <item row="2" column="2" >
-       <widget class="QSpinBox" name="GFsize" >
-        <property name="suffix" >
+      <item row="2" column="2">
+       <widget class="QSpinBox" name="GFsize">
+        <property name="suffix">
          <string> pt</string>
         </property>
        </widget>
       </item>
-      <item rowspan="2" row="2" column="3" >
+      <item row="2" column="3">
        <spacer>
-        <property name="orientation" >
+        <property name="orientation">
          <enum>Qt::Horizontal</enum>
         </property>
-        <property name="sizeType" >
+        <property name="sizeType">
          <enum>QSizePolicy::Minimum</enum>
         </property>
-        <property name="sizeHint" stdset="0" >
+        <property name="sizeHint" stdset="0">
          <size>
           <width>4</width>
           <height>20</height>
@@ -121,91 +122,91 @@
         </property>
        </spacer>
       </item>
-      <item row="2" column="4" colspan="2" >
-       <widget class="QCheckBox" name="startUpDialog" >
-        <property name="text" >
+      <item row="2" column="4" colspan="2">
+       <widget class="QCheckBox" name="startUpDialog">
+        <property name="text">
          <string>Show Startup Dialog</string>
         </property>
        </widget>
       </item>
-      <item row="3" column="0" colspan="2" >
-       <widget class="QLabel" name="textLabel4_2" >
-        <property name="text" >
+      <item row="3" column="0" colspan="2">
+       <widget class="QLabel" name="textLabel4_2">
+        <property name="text">
          <string>Font Size (&amp;Palettes):</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>false</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>GTFsize</cstring>
         </property>
        </widget>
       </item>
-      <item row="3" column="2" >
-       <widget class="QSpinBox" name="GTFsize" >
-        <property name="suffix" >
+      <item row="3" column="2">
+       <widget class="QSpinBox" name="GTFsize">
+        <property name="suffix">
          <string> pt</string>
         </property>
        </widget>
       </item>
-      <item row="3" column="4" colspan="2" >
-       <widget class="QCheckBox" name="showSplashCheckBox" >
-        <property name="text" >
+      <item row="3" column="4" colspan="2">
+       <widget class="QCheckBox" name="showSplashCheckBox">
+        <property name="text">
          <string>Show Splashscreen on Startup</string>
         </property>
-        <property name="shortcut" >
+        <property name="shortcut">
          <string/>
         </property>
        </widget>
       </item>
-      <item row="4" column="0" colspan="2" >
-       <widget class="QLabel" name="textLabel3" >
-        <property name="text" >
+      <item row="4" column="0" colspan="2">
+       <widget class="QLabel" name="textLabel3">
+        <property name="text">
          <string>Time before a Move or Resize starts:</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>true</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>showSplashCheckBox</cstring>
         </property>
        </widget>
       </item>
-      <item row="4" column="2" >
-       <widget class="QSpinBox" name="spinTimeout" >
-        <property name="suffix" >
+      <item row="4" column="2">
+       <widget class="QSpinBox" name="spinTimeout">
+        <property name="suffix">
          <string> ms</string>
         </property>
-        <property name="minimum" >
+        <property name="minimum">
          <number>10</number>
         </property>
-        <property name="maximum" >
+        <property name="maximum">
          <number>1500</number>
         </property>
-        <property name="singleStep" >
+        <property name="singleStep">
          <number>10</number>
         </property>
-        <property name="value" >
+        <property name="value">
          <number>150</number>
         </property>
        </widget>
       </item>
-      <item row="4" column="4" colspan="2" >
-       <widget class="QCheckBox" name="useSmallWidgetsCheck" >
-        <property name="text" >
+      <item row="4" column="4" colspan="2">
+       <widget class="QCheckBox" name="useSmallWidgetsCheck">
+        <property name="text">
          <string>Use Small Widgets in Palettes</string>
         </property>
        </widget>
       </item>
-      <item row="5" column="0" >
+      <item row="5" column="0">
        <spacer>
-        <property name="orientation" >
+        <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
-        <property name="sizeType" >
+        <property name="sizeType">
          <enum>QSizePolicy::Expanding</enum>
         </property>
-        <property name="sizeHint" stdset="0" >
+        <property name="sizeHint" stdset="0">
          <size>
           <width>20</width>
           <height>3</height>
@@ -213,15 +214,22 @@
         </property>
        </spacer>
       </item>
-      <item row="5" column="4" colspan="2" >
+      <item row="5" column="4" colspan="2">
+       <widget class="QCheckBox" name="useTabsForDocs">
+        <property name="text">
+         <string>Use Tabs for Documents</string>
+        </property>
+       </widget>
+      </item>
+      <item row="6" column="4">
        <spacer>
-        <property name="orientation" >
+        <property name="orientation">
          <enum>Qt::Vertical</enum>
         </property>
-        <property name="sizeType" >
+        <property name="sizeType">
          <enum>QSizePolicy::Expanding</enum>
         </property>
-        <property name="sizeHint" stdset="0" >
+        <property name="sizeHint" stdset="0">
          <size>
           <width>20</width>
           <height>5</height>
@@ -232,21 +240,21 @@
      </layout>
     </widget>
    </item>
-   <item row="1" column="0" >
-    <widget class="QGroupBox" name="groupBox2" >
-     <property name="title" >
+   <item>
+    <widget class="QGroupBox" name="groupBox2">
+     <property name="title">
       <string>Paths</string>
      </property>
-     <layout class="QGridLayout" >
-      <property name="margin" >
+     <layout class="QGridLayout">
+      <property name="margin">
        <number>9</number>
       </property>
-      <property name="spacing" >
+      <property name="spacing">
        <number>6</number>
       </property>
-      <item row="2" column="1" >
-       <widget class="QLineEdit" name="ScriptPfad" >
-        <property name="minimumSize" >
+      <item row="2" column="1">
+       <widget class="QLineEdit" name="ScriptPfad">
+        <property name="minimumSize">
          <size>
           <width>268</width>
           <height>0</height>
@@ -254,9 +262,9 @@
         </property>
        </widget>
       </item>
-      <item row="0" column="1" >
-       <widget class="QLineEdit" name="Docs" >
-        <property name="minimumSize" >
+      <item row="0" column="1">
+       <widget class="QLineEdit" name="Docs">
+        <property name="minimumSize">
          <size>
           <width>268</width>
           <height>0</height>
@@ -264,9 +272,9 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="1" >
-       <widget class="QLineEdit" name="ProPfad" >
-        <property name="minimumSize" >
+      <item row="1" column="1">
+       <widget class="QLineEdit" name="ProPfad">
+        <property name="minimumSize">
          <size>
           <width>268</width>
           <height>0</height>
@@ -274,48 +282,48 @@
         </property>
        </widget>
       </item>
-      <item row="0" column="2" >
-       <widget class="QPushButton" name="FileC" >
-        <property name="minimumSize" >
+      <item row="0" column="2">
+       <widget class="QPushButton" name="FileC">
+        <property name="minimumSize">
          <size>
           <width>88</width>
           <height>0</height>
          </size>
         </property>
-        <property name="text" >
+        <property name="text">
          <string>&amp;Change...</string>
         </property>
-        <property name="shortcut" >
+        <property name="shortcut">
          <string>Alt+C</string>
         </property>
        </widget>
       </item>
-      <item row="1" column="2" >
-       <widget class="QPushButton" name="FileC2" >
-        <property name="text" >
+      <item row="1" column="2">
+       <widget class="QPushButton" name="FileC2">
+        <property name="text">
          <string>C&amp;hange...</string>
         </property>
-        <property name="shortcut" >
+        <property name="shortcut">
          <string>Alt+H</string>
         </property>
        </widget>
       </item>
-      <item row="2" column="0" >
-       <widget class="QLabel" name="textLabel9" >
-        <property name="text" >
+      <item row="2" column="0">
+       <widget class="QLabel" name="textLabel9">
+        <property name="text">
          <string>&amp;Scripts:</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>false</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>ScriptPfad</cstring>
         </property>
        </widget>
       </item>
-      <item row="3" column="1" >
-       <widget class="QLineEdit" name="DocumentTemplateDir" >
-        <property name="minimumSize" >
+      <item row="3" column="1">
+       <widget class="QLineEdit" name="DocumentTemplateDir">
+        <property name="minimumSize">
          <size>
           <width>268</width>
           <height>0</height>
@@ -323,61 +331,61 @@
         </property>
        </widget>
       </item>
-      <item row="3" column="2" >
-       <widget class="QPushButton" name="FileC4" >
-        <property name="text" >
+      <item row="3" column="2">
+       <widget class="QPushButton" name="FileC4">
+        <property name="text">
          <string>Cha&amp;nge...</string>
         </property>
-        <property name="shortcut" >
+        <property name="shortcut">
          <string>Alt+N</string>
         </property>
        </widget>
       </item>
-      <item row="1" column="0" >
-       <widget class="QLabel" name="textLabel8" >
-        <property name="text" >
+      <item row="1" column="0">
+       <widget class="QLabel" name="textLabel8">
+        <property name="text">
          <string>&amp;ICC Profiles:</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>false</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>ProPfad</cstring>
         </property>
        </widget>
       </item>
-      <item row="0" column="0" >
-       <widget class="QLabel" name="textLabel7" >
-        <property name="text" >
+      <item row="0" column="0">
+       <widget class="QLabel" name="textLabel7">
+        <property name="text">
          <string>&amp;Documents:</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>false</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>Docs</cstring>
         </property>
        </widget>
       </item>
-      <item row="3" column="0" >
-       <widget class="QLabel" name="textLabel10" >
-        <property name="text" >
+      <item row="3" column="0">
+       <widget class="QLabel" name="textLabel10">
+        <property name="text">
          <string>Document &amp;Templates:</string>
         </property>
-        <property name="wordWrap" >
+        <property name="wordWrap">
          <bool>false</bool>
         </property>
-        <property name="buddy" >
+        <property name="buddy">
          <cstring>DocumentTemplateDir</cstring>
         </property>
        </widget>
       </item>
-      <item row="2" column="2" >
-       <widget class="QPushButton" name="FileC3" >
-        <property name="text" >
+      <item row="2" column="2">
+       <widget class="QPushButton" name="FileC3">
+        <property name="text">
          <string>Ch&amp;ange...</string>
         </property>
-        <property name="shortcut" >
+        <property name="shortcut">
          <string>Alt+A</string>
         </property>
        </widget>
@@ -385,15 +393,15 @@
      </layout>
     </widget>
    </item>
-   <item row="2" column="0" >
+   <item>
     <spacer>
-     <property name="orientation" >
+     <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
-     <property name="sizeType" >
+     <property name="sizeType">
       <enum>QSizePolicy::Expanding</enum>
      </property>
-     <property name="sizeHint" stdset="0" >
+     <property name="sizeHint" stdset="0">
       <size>
        <width>51</width>
        <height>51</height>
@@ -403,7 +411,7 @@
    </item>
   </layout>
  </widget>
- <layoutdefault spacing="6" margin="11" />
+ <layoutdefault spacing="6" margin="11"/>
  <tabstops>
   <tabstop>guiLangCombo</tabstop>
   <tabstop>GUICombo</tabstop>
Index: scribus/ui/prefs.cpp
===================================================================
--- scribus/ui/prefs.cpp	(revision 14223)
+++ scribus/ui/prefs.cpp	(revision 14224)
@@ -357,6 +357,7 @@
 	prefsManager->appPrefs.uiPrefs.language=tabGeneral->selectedGUILang;
 	prefsManager->appPrefs.uiPrefs.style = tabGeneral->GUICombo->currentText();
 	prefsManager->appPrefs.uiPrefs.useSmallWidgets = tabGeneral->useSmallWidgetsCheck->isChecked();
+	prefsManager->appPrefs.uiPrefs.useTabs = tabGeneral->useTabsForDocs->isChecked();
 
 	prefsManager->appPrefs.displayPrefs.pageGapHorizontal = tabView->gapHorizontal->value() / prefsUnitRatio;
 	prefsManager->appPrefs.displayPrefs.pageGapVertical = tabView->gapVertical->value() / prefsUnitRatio;
Index: scribus/ui/tabgeneral.cpp
===================================================================
--- scribus/ui/tabgeneral.cpp	(revision 14223)
+++ scribus/ui/tabgeneral.cpp	(revision 14224)
@@ -86,6 +86,7 @@
 	startUpDialog->setChecked(prefsData->uiPrefs.showStartupDialog);
 	showSplashCheckBox->setChecked( !ScQApp->neverSplashExists() );
 	useSmallWidgetsCheck->setChecked(prefsData->uiPrefs.useSmallWidgets);
+	useTabsForDocs->setChecked(prefsData->uiPrefs.useTabs);
 }
 
 void TabGeneral::setSelectedGUILang( const QString &newLang )
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 14223)
+++ scribus/scribus.cpp	(revision 14224)
@@ -332,7 +332,10 @@
 	mdiArea = new QMdiArea(this);
 	mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
 	mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
-//	mdiArea->setViewMode(QMdiArea::TabbedView);
+	if (prefsManager->appPrefs.uiPrefs.useTabs)
+		mdiArea->setViewMode(QMdiArea::TabbedView);
+	else
+		mdiArea->setViewMode(QMdiArea::SubWindowView);
 	setCentralWidget( mdiArea );
 	connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(newActWin(QMdiSubWindow *)));
 	//Connect windows cascade and tile actions to the workspace after its created. Only depends on mdiArea created.
@@ -7599,6 +7602,10 @@
 	if (oldImageQuality != newImageQuality)
 		view->previewQualitySwitcher->setCurrentIndex(newImageQuality);
 
+	if (prefsManager->appPrefs.uiPrefs.useTabs)
+		mdiArea->setViewMode(QMdiArea::TabbedView);
+	else
+		mdiArea->setViewMode(QMdiArea::SubWindowView);
 	QList<QMdiSubWindow *> windows = mdiArea->subWindowList();
 	bool shadowChanged = oldShowPageShadow != prefsManager->showPageShadow();
 	if (!windows.isEmpty())




More information about the scribus-commit mailing list