r21040 by fschmid -

scribus-commit scribus-commit at lists.scribus.net
Sat Feb 27 10:36:30 UTC 2016


Author: fschmid
Date: Sat Feb 27 10:36:30 2016
New Revision: 21040

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21040
Log:
Fixed Bug #11544: Docked palettes position / size is not saved between sessions

Modified:
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/prefsstructs.h
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/scdockpalette.cpp

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21040&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp	(original)
+++ trunk/Scribus/scribus/prefsmanager.cpp	Sat Feb 27 10:36:30 2016
@@ -938,6 +938,22 @@
 		{
 			appPrefs.uiPrefs.language = userprefsContext->get("gui_language","");
 			appPrefs.uiPrefs.mainWinState = QByteArray::fromBase64(userprefsContext->get("mainwinstate","").toLatin1());
+			appPrefs.uiPrefs.tabbedPalettes.clear();
+			PrefsTable *tabsTable = userprefsContext->getTable("tabbedPalettes");
+			if (tabsTable)
+			{
+				for (int r = 0; r < tabsTable->getRowCount(); r++)
+				{
+					QStringList tabs;
+					for (int c = 0; c < tabsTable->getColCount(); c++)
+					{
+						QString tabName = tabsTable->get(r, c);
+						if (!tabName.isEmpty())
+							tabs.append(tabsTable->get(r, c));
+					}
+					appPrefs.uiPrefs.tabbedPalettes.append(tabs);
+				}
+			}
 			//continue here...
 			//Prefs."blah blah" =...
 		}
@@ -992,6 +1008,32 @@
 		{
 			userprefsContext->set("gui_language", appPrefs.uiPrefs.language);
 			userprefsContext->set("mainwinstate", QString::fromLatin1(appPrefs.uiPrefs.mainWinState.toBase64()));
+			if (!appPrefs.uiPrefs.tabbedPalettes.isEmpty())
+			{
+				int maxCols = 0;
+				for (int a = 0; a < appPrefs.uiPrefs.tabbedPalettes.count(); a++)
+				{
+					maxCols = qMax(maxCols, appPrefs.uiPrefs.tabbedPalettes[a].count());
+				}
+				PrefsTable *tabsTable = userprefsContext->getTable("tabbedPalettes");
+				tabsTable->clear();
+				for (int a = 0; a < appPrefs.uiPrefs.tabbedPalettes.count(); a++)
+				{
+					QStringList actTab = appPrefs.uiPrefs.tabbedPalettes[a];
+					for (int i = 0; i < actTab.count(); i++)
+					{
+						tabsTable->set(a, i, actTab[i]);
+					}
+					if (actTab.count() < maxCols)
+					{
+						for (int i = actTab.count(); i < maxCols; i++)
+						{
+							tabsTable->set(a, i, "dummy");
+						}
+					}
+
+				}
+			}
 			//continue here...
 			//Prefs."blah blah" =...
 		}

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21040&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h	(original)
+++ trunk/Scribus/scribus/prefsstructs.h	Sat Feb 27 10:36:30 2016
@@ -145,6 +145,7 @@
 	QString iconSet; //! Icon set name
 	WindowPrefs mainWinSettings;
 	QByteArray mainWinState;
+	QList<QStringList> tabbedPalettes;
 };
 
 //Paths

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21040&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Sat Feb 27 10:36:30 2016
@@ -1932,6 +1932,23 @@
 	editToolBar->connectPrefsSlot(false);
 	modeToolBar->connectPrefsSlot(false);
 	pdfToolBar->connectPrefsSlot(false);
+
+	m_prefsManager->appPrefs.uiPrefs.tabbedPalettes.clear();
+	QList<QTabBar *> bars = findChildren<QTabBar *>(QString());
+	for (int i = 0; i < bars.count(); ++i)
+	{
+		QTabBar *bar = bars[i];
+		QStringList currentTab;
+		for (int ii = 0; ii < bar->count(); ii++)
+		{
+			QObject *obj = (QObject*)bar->tabData(ii).toULongLong();
+			if (obj != NULL)
+				currentTab.append(obj->objectName());
+		}
+		if (!currentTab.isEmpty())
+			m_prefsManager->appPrefs.uiPrefs.tabbedPalettes.append(currentTab);
+	}
+
 	propertiesPalette->hide();
 	outlinePalette->hide();
 	scrapbookPalette->hide();
@@ -6615,6 +6632,25 @@
 	marksManager->startup();
 	nsEditor->startup();
 	symbolPalette->startup();
+	if (!m_prefsManager->appPrefs.uiPrefs.tabbedPalettes.isEmpty())
+	{
+		for (int a = 0; a < m_prefsManager->appPrefs.uiPrefs.tabbedPalettes.count(); a++)
+		{
+			QStringList actTab = m_prefsManager->appPrefs.uiPrefs.tabbedPalettes[a];
+			QDockWidget *container = findChild<QDockWidget *>(actTab[0]);
+			if (container)
+			{
+				for (int i = 1; i < actTab.count(); i++)
+				{
+					QDockWidget *content = findChild<QDockWidget *>(actTab[i]);
+					if (content)
+						tabifyDockWidget(container, content);
+				}
+			}
+		}
+		move(m_prefsManager->appPrefs.uiPrefs.mainWinSettings.xPosition, m_prefsManager->appPrefs.uiPrefs.mainWinSettings.yPosition);
+		resize(m_prefsManager->appPrefs.uiPrefs.mainWinSettings.width, m_prefsManager->appPrefs.uiPrefs.mainWinSettings.height);
+	}
 
 	// init the toolbars
 	fileToolBar->initVisibility();

Modified: trunk/Scribus/scribus/ui/scdockpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21040&path=/trunk/Scribus/scribus/ui/scdockpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scdockpalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/scdockpalette.cpp	Sat Feb 27 10:36:30 2016
@@ -207,6 +207,7 @@
 	{
 		storePosition();
 		storeSize();
+		storeDockState();
 		QDockWidget::hide();
 	}
 }




More information about the scribus-commit mailing list