r15676 by fschmid - Set the lock status of palettes in the paint manager according to the file permissions of the palette file.

scribus-commit scribus-commit at lists.scribus.net
Fri Oct 29 00:08:42 CEST 2010


Author: fschmid
Date: Thu Oct 28 22:08:42 2010
New Revision: 15676

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15676
Log:
Set the lock status of palettes in the paint manager according to the file permissions of the palette file.

Modified:
    trunk/Scribus/scribus/ui/paintmanager.cpp

Modified: trunk/Scribus/scribus/ui/paintmanager.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15676&path=/trunk/Scribus/scribus/ui/paintmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/paintmanager.cpp (original)
+++ trunk/Scribus/scribus/ui/paintmanager.cpp Thu Oct 28 22:08:42 2010
@@ -110,6 +110,22 @@
 	{
 		label->setText( tr("Merge Color Set"));
 		m_doc->getUsedColors(inDocUsedColors);
+		paletteLocked = false;
+	}
+	else
+	{
+		QString pfad = "";
+		if (custColSet.contains(docColSet))
+		{
+			QString Fname = docColSet;
+			Fname.replace(" ", "_");
+			Fname += ".xml";
+			pfad = QDir::convertSeparators(ScPaths::getApplicationDataDir()+Fname);
+		}
+		else
+			pfad = csm.paletteFileFromName(docColSet);
+		QFileInfo fi(pfad);
+		paletteLocked = !fi.isWritable();
 	}
 	importButton->setEnabled(false);
 	newButton->setEnabled(false);
@@ -1132,9 +1148,13 @@
 			Fname += ".xml";
 			pfadC2 = QDir::convertSeparators(ScPaths::getApplicationDataDir()+Fname);
 		}
-
-		QFileInfo fi(pfadC2);
-		paletteLocked = csm.paletteLocationLocked(fi.absolutePath()+"/");
+		if (m_doc == 0)
+		{
+			QFileInfo fi(pfadC2);
+			paletteLocked = !fi.isWritable();
+		}
+		else
+			paletteLocked = false;
 	}
 	if (txt != "Scribus Small")
 	{
@@ -1168,7 +1188,7 @@
 	QString Name = LoadColSet->text();
 	Query* dia = new Query(this, "Name", 1, 0, tr("&Name:"), tr("Choose a Name"));
 	if ((Name == "Scribus Basic") || (Name == "Scribus Small") || (Name == "X11 RGB-Set") || (Name == "OpenOffice.org-Set")
-	        || (Name == "X11 Grey-Set") || (Name == "Gnome-Set") || (Name == "SVG-Set"))
+	        || (Name == "X11 Grey-Set") || (Name == "Gnome-Set") || (Name == "SVG-Set") || paletteLocked)
 		dia->setEditText("", false);
 	else
 		dia->setEditText(Name, false);




More information about the scribus-commit mailing list