Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 7116 → Rev 7117

/branches/Version13x/Scribus/scribus/prefs.cpp
332,10 → 332,10
prefsManager->appPrefs.Wheelval = tabGeneral->wheelJumpSpin->value();
prefsManager->appPrefs.moveTimeout = tabGeneral->spinTimeout->value();
prefsManager->appPrefs.RecentDCount = tabGeneral->recentDocs->value();
prefsManager->appPrefs.DocDir = tabGeneral->Docs->text();
prefsManager->appPrefs.ProfileDir = tabGeneral->ProPfad->text();
prefsManager->appPrefs.ScriptDir = tabGeneral->ScriptPfad->text();
prefsManager->appPrefs.documentTemplatesDir = tabGeneral->DocumentTemplateDir->text();
prefsManager->appPrefs.DocDir = ScPaths::separatorsToSlashes( tabGeneral->Docs->text() );
prefsManager->appPrefs.ProfileDir = ScPaths::separatorsToSlashes( tabGeneral->ProPfad->text() );
prefsManager->appPrefs.ScriptDir = ScPaths::separatorsToSlashes( tabGeneral->ScriptPfad->text() );
prefsManager->appPrefs.documentTemplatesDir = ScPaths::separatorsToSlashes( tabGeneral->DocumentTemplateDir->text() );
prefsManager->appPrefs.guiLanguage=tabGeneral->selectedGUILang;
prefsManager->appPrefs.GUI = tabGeneral->GUICombo->currentText();
 
/branches/Version13x/Scribus/scribus/newfile.cpp
7,6 → 7,7
#include "newfile.h"
#include "newfile.moc"
 
#include <qdir.h>
#include <qtooltip.h>
#include <qobjectlist.h>
#include <qpoint.h>
326,7 → 327,7
recentDocLayout->addWidget(recentDocListBox);
uint max = QMIN(prefsManager->appPrefs.RecentDCount, recentDocList.count());
for (uint m = 0; m < max; ++m)
recentDocListBox->insertItem(recentDocList[m]);
recentDocListBox->insertItem( QDir::convertSeparators(recentDocList[m]) );
}
 
void NewDoc::setWidth(int)
/branches/Version13x/Scribus/scribus/scpaths.h
29,6 → 29,8
/*** The separator used between path list entries in environment variables */
static const char envPathSeparator;
 
static QString separatorsToSlashes(const QString& path);
 
/** @brief Return path to documentation directory */
const QString& docDir() const;
/** @brief Return path to icons directory*/
/branches/Version13x/Scribus/scribus/scribus.cpp
1832,7 → 1832,7
{
QString fileName(dia->recentDocListBox->currentText());
if (!fileName.isEmpty())
loadRecent(fileName);
loadRecent(ScPaths::separatorsToSlashes(fileName));
}
}
}
/branches/Version13x/Scribus/scribus/scpaths.cpp
130,6 → 130,13
 
ScPaths::~ScPaths() {};
 
QString ScPaths::separatorsToSlashes(const QString& path)
{
QString qtPath(path);
qtPath.replace( QDir::separator(), '/' );
return qtPath;
}
 
const QString& ScPaths::docDir() const
{
return m_docDir;
/branches/Version13x/Scribus/scribus/pdfopts.cpp
17,6 → 17,7
 
#include <qmessagebox.h>
 
#include "scconfig.h"
#include "customfdialog.h"
#include "prefsmanager.h"
#include "prefsfile.h"
24,8 → 25,9
#include "pdfoptions.h"
#include "util.h"
#include "commonstrings.h"
#include "scconfig.h"
#include "scpaths.h"
 
 
PDFExportDialog::PDFExportDialog( QWidget* parent, const QString & docFileName,
const QMap<QString, int > & DocFonts,
ScribusView *currView, PDFOptions & pdfOptions,
56,12 → 58,15
fileNameLineEdit = new QLineEdit( Name, "fileNameLineEdit" );
fileNameLineEdit->setMinimumSize( QSize( 268, 22 ) );
if (!Opts.Datei.isEmpty())
fileNameLineEdit->setText(Opts.Datei);
fileNameLineEdit->setText( QDir::convertSeparators(Opts.Datei) );
else
{
QFileInfo fi(docFileName);
if (fi.exists())
fileNameLineEdit->setText(fi.dirPath()+"/"+fi.baseName()+".pdf");
{
QString fileName(fi.dirPath()+"/"+fi.baseName()+".pdf");
fileNameLineEdit->setText( QDir::convertSeparators(fileName) );
}
else
{
PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
68,7 → 73,8
QString pdfdir = dirs->get("pdf", fi.dirPath());
if (pdfdir.right(1) != "/")
pdfdir += "/";
fileNameLineEdit->setText(pdfdir+fi.baseName()+".pdf");
QString fileName(pdfdir+fi.baseName()+".pdf");
fileNameLineEdit->setText( QDir::convertSeparators(fileName) );
}
}
NameLayout->addWidget( fileNameLineEdit, 0, 0 );
125,7 → 131,7
 
void PDFExportDialog::DoExport()
{
QString fn = fileNameLineEdit->text();
QString fn = ScPaths::separatorsToSlashes(fileNameLineEdit->text());
// Checking if the path exists
QFileInfo fi(fn);
QString dirPath = QDir::convertSeparators(fi.dirPath(true));
201,17 → 207,18
}
else
return;
fileNameLineEdit->setText(fn);
fileNameLineEdit->setText( QDir::convertSeparators(fn) );
}
 
void PDFExportDialog::fileNameChanged()
{
fileNameLineEdit->setText(checkFileExtension(fileNameLineEdit->text(),"pdf"));
QString fileName = checkFileExtension(fileNameLineEdit->text(),"pdf");
fileNameLineEdit->setText( QDir::convertSeparators(fileName) );
}
 
void PDFExportDialog::updateDocOptions()
{
Opts.Datei = fileNameLineEdit->text();
Opts.Datei = ScPaths::separatorsToSlashes(fileNameLineEdit->text());
Opts.doMultiFile = multiFile->isChecked();
Opts.Thumbnails = Options->CheckBox1->isChecked();
Opts.Compress = Options->Compression->isChecked();
/branches/Version13x/Scribus/scribus/tabexternaltoolswidget.cpp
27,6 → 27,7
#include "tabexternaltoolswidget.h"
#include "tabexternaltoolswidget.moc"
#include "gsutil.h"
#include "scpaths.h"
 
TabExternalToolsWidget::TabExternalToolsWidget(struct ApplicationPrefs *prefsData, QWidget* parent, const char*name)
: TabExternalToolsWidgetBase(parent, name)
44,6 → 45,21
{
}
 
const QString TabExternalToolsWidget::newPSTool() const
{
return ScPaths::separatorsToSlashes(psToolLineEdit->text());
}
 
const QString TabExternalToolsWidget::newImageTool() const
{
return ScPaths::separatorsToSlashes(imageToolLineEdit->text());
}
 
const QString TabExternalToolsWidget::newExtBrowserTool() const
{
return ScPaths::separatorsToSlashes(extBrowserToolLineEdit->text());
}
 
void TabExternalToolsWidget::restoreDefaults(struct ApplicationPrefs *prefsData)
{
psToolLineEdit->setText(QDir::convertSeparators(prefsData->gs_exe));
59,7 → 75,7
QFileInfo fi(psToolLineEdit->text());
QString s = QFileDialog::getOpenFileName(fi.dirPath(), QString::null, this, "changeGhostscript", tr("Locate Ghostscript"));
if (!s.isEmpty())
psToolLineEdit->setText(s);
psToolLineEdit->setText( QDir::convertSeparators(s) );
}
 
void TabExternalToolsWidget::changeImageTool()
67,7 → 83,7
QFileInfo fi(imageToolLineEdit->text());
QString s = QFileDialog::getOpenFileName(fi.dirPath(), QString::null, this, "changeImageEditor", tr("Locate your image editor"));
if (!s.isEmpty())
imageToolLineEdit->setText(s);
imageToolLineEdit->setText( QDir::convertSeparators(s) );
}
 
void TabExternalToolsWidget::changeExtBrowserTool()
75,7 → 91,7
QFileInfo fi(extBrowserToolLineEdit->text());
QString s = QFileDialog::getOpenFileName(fi.dirPath(), QString::null, this, "changeextBrowser", tr("Locate your web browser"));
if (!s.isEmpty())
extBrowserToolLineEdit->setText(s);
extBrowserToolLineEdit->setText( QDir::convertSeparators(s) );
}
 
void TabExternalToolsWidget::rescanForTools()
82,7 → 98,10
{
QFileInfo fi(psToolLineEdit->text());
if (!fi.exists())
psToolLineEdit->setText(getGSDefaultExeName());
{
QString gsDef = getGSDefaultExeName();
psToolLineEdit->setText( QDir::convertSeparators(gsDef) );
}
QFileInfo fi2(imageToolLineEdit->text());
if (!fi2.exists())
imageToolLineEdit->setText("gimp");
/branches/Version13x/Scribus/scribus/druck.cpp
9,6 → 9,7
 
#include "scconfig.h"
 
#include "scpaths.h"
#include "scribusdoc.h"
#include "createrange.h"
#include "commonstrings.h"
107,7 → 108,7
Layout1 = new QHBoxLayout;
Layout1->setSpacing( 5 );
Layout1->setMargin( 0 );
LineEdit1 = new QLineEdit( PDatei, Drucker, "LineEdit1" );
LineEdit1 = new QLineEdit( QDir::convertSeparators(PDatei), Drucker, "LineEdit1" );
LineEdit1->setMinimumSize( QSize( 240, 22 ) );
LineEdit1->setEnabled(false);
DateiT = new QLabel( LineEdit1, tr( "&File:" ), Drucker, "DateiT" );
607,7 → 608,7
{
QString selectedFile = dia.selectedFile();
dirs->set("druck", selectedFile.left(selectedFile.findRev("/")));
LineEdit1->setText(selectedFile);
LineEdit1->setText( QDir::convertSeparators(selectedFile) );
}
}
 
623,7 → 624,7
getOptions(); // options were not set get last options with this hack
 
m_doc->Print_Options.printer = PrintDest->currentText();
m_doc->Print_Options.filename = LineEdit1->text();
m_doc->Print_Options.filename = ScPaths::separatorsToSlashes(LineEdit1->text());
m_doc->Print_Options.toFile = ToFile;
m_doc->Print_Options.copies = numCopies();
m_doc->Print_Options.outputSeparations = outputSeparations();
845,7 → 846,7
 
QString Druck::outputFileName()
{
return LineEdit1->text();
return ScPaths::separatorsToSlashes(LineEdit1->text());
}
 
bool Druck::outputToFile()
/branches/Version13x/Scribus/scribus/tabgeneral.cpp
105,7 → 105,7
{
QString s = QFileDialog::getExistingDirectory(Docs->text(), this, "d", tr("Choose a Directory"), true);
if (!s.isEmpty())
Docs->setText(s);
Docs->setText( QDir::convertSeparators(s) );
}
 
void TabGeneral::changeProfs()
112,7 → 112,7
{
QString s = QFileDialog::getExistingDirectory(ProPfad->text(), this, "d", tr("Choose a Directory"), true);
if (!s.isEmpty())
ProPfad->setText(s);
ProPfad->setText( QDir::convertSeparators(s) );
}
 
void TabGeneral::changeScripts()
119,7 → 119,7
{
QString s = QFileDialog::getExistingDirectory(ScriptPfad->text(), this, "d", tr("Choose a Directory"), true);
if (!s.isEmpty())
ScriptPfad->setText(s);
ScriptPfad->setText( QDir::convertSeparators(s) );
}
 
void TabGeneral::changeDocumentTemplates()
126,5 → 126,5
{
QString s = QFileDialog::getExistingDirectory(DocumentTemplateDir->text(), this, "d", tr("Choose a Directory"), true);
if (!s.isEmpty())
DocumentTemplateDir->setText(s);
DocumentTemplateDir->setText( QDir::convertSeparators(s) );
}
/branches/Version13x/Scribus/scribus/tabexternaltoolswidget.h
34,6 → 34,7
#include <qpushbutton.h>
#include <qspinbox.h>
 
#include "scpaths.h"
#include "tabexternaltoolswidgetbase.h"
#include "prefsstructs.h"
#include "scribusapi.h"
47,12 → 48,12
~TabExternalToolsWidget();
void restoreDefaults(struct ApplicationPrefs *prefsData);
const QString newPSTool() const { return psToolLineEdit->text();};
const QString newImageTool() const { return imageToolLineEdit->text();};
const QString newExtBrowserTool() const { return extBrowserToolLineEdit->text();};
bool newAntialiasText() const { return psAntialiasTextCheckBox->isChecked();};
bool newAntialiasGraphics() const { return psAntialiasGraphicsCheckBox->isChecked();};
int newPSToolResolution() const { return psResolutionSpinBox->value();};
const QString newPSTool() const;
const QString newImageTool() const;
const QString newExtBrowserTool() const;
bool newAntialiasText() const { return psAntialiasTextCheckBox->isChecked();}
bool newAntialiasGraphics() const { return psAntialiasGraphicsCheckBox->isChecked();}
int newPSToolResolution() const { return psResolutionSpinBox->value();}
public slots:
void changePostScriptTool();