Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 408 → Rev 409

/trunk/Scribus/ChangeLogCVS
1,5 → 1,9
Changes since 1.2
 
14.09.2004
* feature #1064: Polish Translation Update
* feature #1072: Make it possible to change the document templates directory in settings
 
11.09.2004
* bug #1058: Incorrect PDF output for dotted/dashed straight single-segment PolyLines with a non-'None' background colour
* bug #1059: Adjusting the width or height of a PolyLine or freehand line causes it to become a square
/trunk/Scribus/scribus/po/scribus.pl_PL.ts
189,6 → 189,10
<source>&amp;Close</source>
<translation>&amp;Zamknij</translation>
</message>
<message>
<source>Swedish:</source>
<translation>Szwedzki:</translation>
</message>
</context>
<context>
<name>AdvOptions</name>
10228,6 → 10232,18
<source>CSV_header</source>
<translation>nagłówek_CSV</translation>
</message>
<message>
<source>Template: </source>
<translation>Szablon:</translation>
</message>
<message>
<source>
External Links
</source>
<translation>
Zewnętrzne dowiązania
</translation>
</message>
</context>
<context>
<name>QTextEdit</name>
12146,6 → 12162,14
<source>&amp;Edit Shape</source>
<translation>&amp;Edytuj kształt</translation>
</message>
<message>
<source>File %1 is not in Scribus format</source>
<translation>Plik %1 nie jest w formacie Scribusa</translation>
</message>
<message>
<source>Afrikaans</source>
<translation>Afrykanerski</translation>
</message>
</context>
<context>
<name>ScribusDoc</name>
/trunk/Scribus/scribus/scribusXml.cpp
2838,6 → 2838,7
dc.setAttribute("DOC", Vor->DocDir);
dc.setAttribute("PROFILES", Vor->ProfileDir);
dc.setAttribute("SCRIPTS", Vor->ScriptDir);
dc.setAttribute("TEMPLATES", Vor->TemplateDir);
dc.setAttribute("SHOWGUIDES", static_cast<int>(Vor->GuidesShown));
dc.setAttribute("FRV", static_cast<int>(Vor->FramesShown));
dc.setAttribute("SHOWMARGIN", static_cast<int>(Vor->MarginsShown));
3108,6 → 3109,7
Vorein->DocDir = dc.attribute("DOC","");
Vorein->ProfileDir = dc.attribute("PROFILES","");
Vorein->ScriptDir = dc.attribute("SCRIPTS","");
Vorein->TemplateDir = dc.attribute("TEMPLATES","");
Vorein->GuidesShown = static_cast<bool>(QStoInt(dc.attribute("SHOWGUIDES","1")));
Vorein->FramesShown = static_cast<bool>(QStoInt(dc.attribute("FRV","1")));
Vorein->MarginsShown = static_cast<bool>(QStoInt(dc.attribute("SHOWMARGIN","1")));
/trunk/Scribus/scribus/qm/scribus.pl.qm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Scribus/scribus/scribusdoc.h
459,6 → 459,7
QString DocDir;
QString ProfileDir;
QString ScriptDir;
QString TemplateDir;
QMap<QString,QString> GFontSub;
bool PDFTransparency;
bool AutoSave;
/trunk/Scribus/scribus/scribus.cpp
388,6 → 388,7
Prefs.DocDir = QDir::homeDirPath();
Prefs.ProfileDir = "";
Prefs.ScriptDir = "";
Prefs.TemplateDir = "";
Prefs.CustomColorSets.clear();
Prefs.PrPr_Mode = false;
Prefs.Gcr_Mode = true;
6545,6 → 6546,7
DocDir = Prefs.DocDir;
Prefs.ProfileDir = dia->ProPfad->text();
Prefs.ScriptDir = dia->ScriptPfad->text();
Prefs.TemplateDir = dia->TemplateDir->text();
GetCMSProfiles();
switch (dia->PreviewSize->currentItem())
{
/trunk/Scribus/scribus/plugins/newfromtemplateplugin/nftemplate.cpp
49,7 → 49,7
 
void MenuNFT::RunNFTPlug()
{
nftdialog* nftdia = new nftdialog(par, Carrier->GuiLanguage);
nftdialog* nftdia = new nftdialog(par, Carrier->GuiLanguage, Carrier->Prefs.TemplateDir);
if (nftdia->exec())
{
qApp->setOverrideCursor(QCursor(Qt::WaitCursor), true);
/trunk/Scribus/scribus/plugins/newfromtemplateplugin/nftrcreader.cpp
97,7 → 97,7
if (tmp.left(1) == "/")
tmpTemplate->tnail = tmp;
else
tmpTemplate->tnail = currentDir + "/" + tmp;
tmpTemplate->tnail = currentDir + "/" + tmp;
} else if (inImg)
{
if (tmp.left(1) == "/")
/trunk/Scribus/scribus/plugins/newfromtemplateplugin/nftdialog.cpp
7,9 → 7,9
 
extern QPixmap loadIcon(QString nam);
 
nftdialog::nftdialog(QWidget* parent, QString lang) : QDialog(parent, "nftdialog", TRUE)
nftdialog::nftdialog(QWidget* parent, QString lang, QString templateDir) : QDialog(parent, "nftdialog", TRUE)
{
settings = new nftsettings(lang);
settings = new nftsettings(lang, templateDir);
setCaption( tr("New From Template"));
setIcon(loadIcon("AppIcon.png"));
/trunk/Scribus/scribus/plugins/newfromtemplateplugin/nftsettings.cpp
3,44 → 3,36
***************************************************************************/
#include "nftsettings.h"
 
nftsettings::nftsettings(QString guilang)
nftsettings::nftsettings(QString guilang, QString templateDir)
{
lang = guilang;
scribusShare = PREL;
scribusShare += "/share/scribus";
scribusUserHome = QDir::convertSeparators(QDir::homeDirPath()+"/.scribus");
nftRCFile = QDir::convertSeparators(scribusUserHome+"/nftrc.xml");
userTemplateDir = templateDir;
if (userTemplateDir.right(1) == "/")
userTemplateDir = userTemplateDir.left(userTemplateDir.length() - 1);
read();
}
 
void nftsettings::read()
{
QDir scribus(scribusUserHome);
if (!scribus.exists("nftrc.xml")) {
getDefaults();
}
handler = new nftrcreader(&templates,scribusUserHome);
QFile* rc = new QFile(nftRCFile);
QXmlInputSource* source = new QXmlInputSource(rc);
reader = new QXmlSimpleReader();
reader->setContentHandler(handler);
reader->parse(source);
delete source;
delete rc;
addTemplates(scribusShare);
addTemplates(scribusUserHome);
 
addTemplates(scribusShare+"/templates");
addTemplates(scribusUserHome+"/templates");
if ((userTemplateDir != NULL) && (userTemplateDir != ""))
addTemplates(userTemplateDir);
}
 
void nftsettings::addTemplates(QString dir) // dir will be searched for a sub folder called templates
{
// Add templates from the dir itself
QString tmplFile = findTemplateXml(dir + "/templates");
QString tmplFile = findTemplateXml(dir);
QFile* tmplxml = new QFile(QDir::convertSeparators(tmplFile));
handler->setSourceDir(dir + "/templates");
handler->setSourceDir(dir);
handler->setSourceFile(tmplFile);
if (tmplxml->exists())
{
52,7 → 44,7
// And from all the subdirectories. template.xml file is only searched one dir level deeper than the dir
QDir tmpldir(dir + "/templates");
QDir tmpldir(dir);
if (tmpldir.exists())
{
tmpldir.setFilter(QDir::Dirs);
60,9 → 52,9
for (uint i = 0; i < dirs.size(); ++i)
{
if ((dirs[i] != ".") && (dirs[i] != "..")) {
tmplFile = findTemplateXml(dir + "/templates/" + dirs[i]);
tmplFile = findTemplateXml(dir + "/" + dirs[i]);
QFile* tmplxml = new QFile(QDir::convertSeparators(tmplFile));
handler->setSourceDir(dir+"/templates/"+dirs[i]);
handler->setSourceDir(dir+"/"+dirs[i]);
handler->setSourceFile(tmplFile);
if (tmplxml->exists())
{
76,32 → 68,6
}
}
 
void nftsettings::write()
{
// QFile rc(nftRCFile);
}
 
void nftsettings::getDefaults()
{
QString tPrel = PREL;
QString tmplDir = tPrel + "/share/scribus/templates";
// Create the defaults ~/.scribus/nft/nftrc.xml file
QString text = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
text += "<nft>\n";
text += "\t<settings>\n";
text += "\t</settings>\n";
text += "</nft>\n";
 
QFile rc(nftRCFile);
if ( rc.open( IO_WriteOnly ) )
{
QTextStream stream(&rc);
stream.setEncoding(QTextStream::UnicodeUTF8);
stream << text;
rc.close();
}
}
 
QString nftsettings::findTemplateXml(QString dir)
{
QString tmp = dir + "/template." + lang + ".xml";
/trunk/Scribus/scribus/plugins/newfromtemplateplugin/nftdialog.h
55,7 → 55,7
void setupAbout();
public:
nfttemplate* currentTemplate;
nftdialog(QWidget* parent, QString lang);
nftdialog(QWidget* parent, QString lang, QString templateDir);
~nftdialog();
private slots:
void setTNails();
/trunk/Scribus/scribus/plugins/newfromtemplateplugin/nftsettings.h
17,19 → 17,17
private:
QString scribusShare;
QString scribusUserHome;
QString userTemplateDir;
QString nftHomeDir;
QString nftRCFile;
QString lang;
nftrcreader* handler;
QXmlSimpleReader* reader;
void read();
void write();
void getDefaults();
void addTemplates(QString dir);
QString findTemplateXml(QString dir);
public:
std::vector<nfttemplate*> templates;
nftsettings(QString guilang);
nftsettings(QString guilang, QString templateDir);
~nftsettings();
};
 
/trunk/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp
53,7 → 53,15
QString currentFile = Carrier->doc->DocName;
bool hasName = Carrier->doc->hasName;
bool isModified = Carrier->doc->isModified();
QDir::setCurrent(QDir::homeDirPath() + "/.scribus/templates");
QString userTemplatesDir = Carrier->Prefs.TemplateDir;
if (userTemplatesDir == "")
QDir::setCurrent(QDir::homeDirPath() + "/.scribus/templates");
else
{
if (userTemplatesDir.right(1) == "/")
userTemplatesDir = userTemplatesDir.left(userTemplatesDir.length() - 1);
QDir::setCurrent(userTemplatesDir);
}
if (Carrier->Collect() == "")
return;
QString docPath = Carrier->doc->DocName;
62,7 → 70,7
docName = docName.left(docName.findRev(".s"));
 
if (currentFile != Carrier->doc->DocName)
{ // TODO Check if the collect was canceled.
{
satdialog* satdia = new satdialog(par,docName,
static_cast<int>(Carrier->doc->PageB + 0.5),
static_cast<int>(Carrier->doc->PageH + 0.5));