r21082 by craig -
scribus-commit
scribus-commit at lists.scribus.net
Sun Mar 13 11:11:14 UTC 2016
Author: craig
Date: Sun Mar 13 11:11:14 2016
New Revision: 21082
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21082
Log:
Move swatch to palette
Modified:
trunk/Scribus/scribus/colorsetmanager.cpp
trunk/Scribus/scribus/scpaths.cpp
trunk/Scribus/scribus/scpaths.h
trunk/Scribus/scribus/ui/resourcemanager.cpp
trunk/Scribus/scribus/ui/resourcemanager.h
Modified: trunk/Scribus/scribus/colorsetmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21082&path=/trunk/Scribus/scribus/colorsetmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/colorsetmanager.cpp (original)
+++ trunk/Scribus/scribus/colorsetmanager.cpp Sun Mar 13 11:11:14 2016
@@ -222,7 +222,7 @@
void ColorSetManager::findUserPalettes(QTreeWidgetItem* parent)
{
userPalettes.clear();
- searchDir(ScPaths::getUserSwatchFilesDir(true), userPalettes, parent);
+ searchDir(ScPaths::getUserPaletteFilesDir(true), userPalettes, parent);
}
QStringList ColorSetManager::paletteNames()
Modified: trunk/Scribus/scribus/scpaths.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21082&path=/trunk/Scribus/scribus/scpaths.cpp
==============================================================================
--- trunk/Scribus/scribus/scpaths.cpp (original)
+++ trunk/Scribus/scribus/scpaths.cpp Sun Mar 13 11:11:14 2016
@@ -560,9 +560,9 @@
return useFilesDirectory.absolutePath()+"/";
}
-QString ScPaths::getUserSwatchFilesDir(bool createIfNotExists)
-{
- QDir useFilesDirectory(getApplicationDataDir() + "swatches/");
+QString ScPaths::getUserPaletteFilesDir(bool createIfNotExists)
+{
+ QDir useFilesDirectory(getApplicationDataDir() + "palettes/");
if(createIfNotExists)
{
if (!useFilesDirectory.exists())
Modified: trunk/Scribus/scribus/scpaths.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21082&path=/trunk/Scribus/scribus/scpaths.h
==============================================================================
--- trunk/Scribus/scribus/scpaths.h (original)
+++ trunk/Scribus/scribus/scpaths.h Sun Mar 13 11:11:14 2016
@@ -79,7 +79,7 @@
/** @brief Return path to application data dir for downloaded docs*/
static QString getUserHelpFilesDir(bool createIfNotExists);
/** @brief Return path to application data dir for downloaded swatches*/
- static QString getUserSwatchFilesDir(bool createIfNotExists);
+ static QString getUserPaletteFilesDir(bool createIfNotExists);
/** @brief Return path to image cache dir*/
static QString getImageCacheDir(void);
/** @brief Return path to plugin data dir*/
Modified: trunk/Scribus/scribus/ui/resourcemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21082&path=/trunk/Scribus/scribus/ui/resourcemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/resourcemanager.cpp (original)
+++ trunk/Scribus/scribus/ui/resourcemanager.cpp Sun Mar 13 11:11:14 2016
@@ -76,7 +76,7 @@
resourceCategories.insert(RM_HYPH, tr("Hyphenation Dictionaries"));
resourceCategories.insert(RM_SPELL, tr("Spelling Dictionaries"));
resourceCategories.insert(RM_HELP, tr("Help Manuals"));
- resourceCategories.insert(RM_SWATCHES, tr("Swatches"));
+ resourceCategories.insert(RM_PALETTES, tr("Palettes"));
//resourceCategories.insert(RM_TEMPLATES, tr("Templates"));
//resourceCategories.insert(RM_PROFILES, tr("Color Profiles"));
// resourceCategories.insert(RM_TEST, tr("Test"));
@@ -86,7 +86,7 @@
dataFiles.insert(RM_HYPH, "scribus_hyph_dicts.xml");
dataFiles.insert(RM_SPELL, "scribus_spell_dicts.xml");
dataFiles.insert(RM_HELP, "scribus_help.xml");
- dataFiles.insert(RM_SWATCHES, "scribus_swatches.xml");
+ dataFiles.insert(RM_PALETTES, "scribus_palettes.xml");
//dataFiles.insert(RM_TEMPLATES, "scribus_templates.xml");
//dataFiles.insert(RM_PROFILES, "scribus_profiles.xml");
// dataFiles.insert(RM_TEST, "test.txt");
@@ -212,7 +212,7 @@
installedTableWidget->clear();
}
-void ResourceManager::updateInstalledSwatches()
+void ResourceManager::updateInstalledPalettes()
{
dictionaryMap.clear();
installedTableWidget->clear();
@@ -622,9 +622,9 @@
downloadButton->setEnabled(true);
}
-void ResourceManager::updateAvailableSwatches()
-{
- QFile dataFile(ScPaths::downloadDir() + dataFiles[RM_SWATCHES]);
+void ResourceManager::updateAvailablePalettes()
+{
+ QFile dataFile(ScPaths::downloadDir() + dataFiles[RM_PALETTES]);
if (!dataFile.exists())
return;
dataFile.open(QIODevice::ReadOnly);
@@ -633,7 +633,7 @@
QString errorMsg;
int eline;
int ecol;
- QDomDocument doc( QString(dataFiles[RM_SWATCHES]).remove(".xml") );
+ QDomDocument doc( QString(dataFiles[RM_PALETTES]).remove(".xml") );
QString data(ts.readAll());
dataFile.close();
if ( !doc.setContent( data, &errorMsg, &eline, &ecol ))
@@ -644,7 +644,7 @@
qDebug()<<"Could not open file"<<dataFile.fileName();
return;
}
- swatchList.clear();
+ paletteList.clear();
QDomElement docElem = doc.documentElement();
QDomNode n = docElem.firstChild();
while( !n.isNull() )
@@ -652,7 +652,7 @@
QDomElement e = n.toElement();
if( !e.isNull() )
{
- if (e.tagName()=="swatch")
+ if (e.tagName()=="palette")
{
if (e.hasAttribute("type") && e.hasAttribute("filetype"))
{
@@ -671,7 +671,7 @@
d.type=e.attribute("type");
QUrl url(d.url);
if (url.isValid() && !url.isEmpty() && !url.host().isEmpty())
- swatchList.append(d);
+ paletteList.append(d);
}
}
}
@@ -679,16 +679,16 @@
n = n.nextSibling();
}
availableTableWidget->clear();
- if(swatchList.isEmpty())
+ if(paletteList.isEmpty())
{
downloadButton->setEnabled(false);
return;
}
- availableTableWidget->setRowCount(swatchList.count());
+ availableTableWidget->setRowCount(paletteList.count());
availableTableWidget->setColumnCount(5);
availableTableWidget->setSortingEnabled(false);
int row=0;
- foreach(DownloadItem d, swatchList)
+ foreach(DownloadItem d, paletteList)
{
int column=0;
QTableWidgetItem *newItem1 = new QTableWidgetItem(d.desc);
@@ -747,8 +747,8 @@
case RM_HELP:
destinationFolder=ScPaths::getUserHelpFilesDir(true);
break;
- case RM_SWATCHES:
- destinationFolder=ScPaths::getUserSwatchFilesDir(true);
+ case RM_PALETTES:
+ destinationFolder=ScPaths::getUserPaletteFilesDir(true);
break;
case RM_TEST:
destinationFolder=ScPaths::downloadDir();
@@ -782,9 +782,9 @@
updateInstalledHelp();
updateAvailableHelp();
break;
- case RM_SWATCHES:
- updateInstalledSwatches();
- updateAvailableSwatches();
+ case RM_PALETTES:
+ updateInstalledPalettes();
+ updateAvailablePalettes();
break;
case RM_TEST:
updateInstalledTest();
@@ -846,11 +846,11 @@
else
qDebug()<<"Help Failure :(";
break;
- case RM_SWATCHES:
+ case RM_PALETTES:
if (fileOk)
- updateAvailableSwatches();
+ updateAvailablePalettes();
else
- qDebug()<<"Swatch Failure :(";
+ qDebug()<<"Palette Failure :(";
break;
case RM_TEST:
if (fileOk)
@@ -1183,8 +1183,8 @@
}
}
break;
- case RM_SWATCHES:
- foreach(DownloadItem d, swatchList)
+ case RM_PALETTES:
+ foreach(DownloadItem d, paletteList)
{
// qDebug()<<d.desc;
if (filesToDownload.contains(d.desc))
@@ -1283,8 +1283,8 @@
}
}
break;
- case RM_SWATCHES:
- foreach(DownloadItem d, swatchList)
+ case RM_PALETTES:
+ foreach(DownloadItem d, paletteList)
{
if (filesToDownload.contains(d.desc))
{
Modified: trunk/Scribus/scribus/ui/resourcemanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21082&path=/trunk/Scribus/scribus/ui/resourcemanager.h
==============================================================================
--- trunk/Scribus/scribus/ui/resourcemanager.h (original)
+++ trunk/Scribus/scribus/ui/resourcemanager.h Sun Mar 13 11:11:14 2016
@@ -46,7 +46,7 @@
RM_SPELL,
RM_TEMPLATES,
RM_HELP,
- RM_SWATCHES,
+ RM_PALETTES,
RM_TEST=99
};
public:
@@ -65,7 +65,7 @@
void updateInstalledSpell();
void updateInstalledTemplates();
void updateInstalledHelp();
- void updateInstalledSwatches();
+ void updateInstalledPalettes();
void updateInstalledTest();
void updateAvailableFonts();
@@ -73,7 +73,7 @@
void updateAvailableSpell();
void updateAvailableTemplates();
void updateAvailableHelp();
- void updateAvailableSwatches();
+ void updateAvailablePalettes();
void updateAvailableTest();
QString currentCategory;
@@ -86,7 +86,7 @@
QList <DownloadItem> fontList;
QList <DownloadItem> templateList;
QList <DownloadItem> helpList;
- QList <DownloadItem> swatchList;
+ QList <DownloadItem> paletteList;
QList <DownloadItem> profileList;
QList <DownloadItem> downloadList;
QList <DownloadItem> testList;
More information about the scribus-commit
mailing list