Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 409 → Rev 410

/trunk/Scribus/scribus/libprefs/prefs.cpp
229,6 → 229,17
GroupBox200Layout->addWidget( ScriptPfad, 2, 1 );
GroupBox200Layout->addWidget( FileC3, 2, 2 );
 
TemplateDir = new QLineEdit( GroupBox200, "Datei1" );
TemplateDir->setMinimumSize( QSize( 268, 22 ) );
TemplateDir->setText(Vor->TemplateDir);
PfadText4 = new QLabel( TemplateDir, tr("T&emplates:"), GroupBox200, "Pfadtext1" );
FileC4 = new QToolButton( GroupBox200, "FileC4" );
FileC4->setMinimumSize( QSize( 88, 24 ) );
FileC4->setText( tr( "Cha&nge..." ) );
GroupBox200Layout->addWidget( PfadText4, 3, 0 );
GroupBox200Layout->addWidget( TemplateDir, 3, 1 );
GroupBox200Layout->addWidget( FileC4, 3, 2 );
 
tabLayout->addMultiCellWidget( GroupBox200, 2, 2, 0, 1 );
 
TabWidget3->addWidget( tab, 0 );
1487,6 → 1498,8
QWidget::setTabOrder( ProPfad, FileC2 );
QWidget::setTabOrder( FileC2, ScriptPfad );
QWidget::setTabOrder( ScriptPfad, FileC3 );
QWidget::setTabOrder( FileC3, TemplateDir );
QWidget::setTabOrder( TemplateDir, FileC4 );
 
 
QWidget::setTabOrder( TopR, BottomR );
1504,6 → 1517,7
QToolTip::add( Docs, tr( "Default documents directory" ) );
QToolTip::add( ProPfad, tr( "Default ICC profiles directory" ) );
QToolTip::add( ScriptPfad, tr( "Default Scripter scripts directory" ) );
QToolTip::add( TemplateDir, tr( "Additional Directory for Document Templates" ) );
 
QToolTip::add( GZComboF, tr( "Default page size, either a standard size or a custom size" ) );
QToolTip::add( GZComboO, tr( "Default orientation of document pages" ) );
1646,6 → 1660,7
connect(FileC, SIGNAL(clicked()), this, SLOT(ChangeDocs()));
connect(FileC2, SIGNAL(clicked()), this, SLOT(ChangeProfs()));
connect(FileC3, SIGNAL(clicked()), this, SLOT(ChangeScripts()));
connect(FileC4, SIGNAL(clicked()), this, SLOT(ChangeTemplates()));
connect(CaliSlider, SIGNAL(valueChanged(int)), this, SLOT(SetDisScale()));
connect(TabListe, SIGNAL(highlighted(int)), TabWidget3, SLOT(raiseWidget(int)));
setSize(Vor->PageFormat);
1715,6 → 1730,21
}
 
/*!
\fn void Preferences::ChangeTemplates()
\author Riku Leino
\date
\brief Runs QFileDialog to get Preferences (General) Path to Templates directory
\param None
\retval None
*/
void Preferences::ChangeTemplates()
{
QString s = QFileDialog::getExistingDirectory(Docs->text(), this, "d", tr("Choose a Directory"), true);
if (s != "")
TemplateDir->setText(s);
}
 
/*!
\fn void Preferences::ChangeScaling()
\author Franz Schmid
\date
/trunk/Scribus/scribus/libprefs/prefs.h
68,6 → 68,9
QLabel* PfadText3;
QLineEdit* ScriptPfad;
QToolButton* FileC3;
QLabel* PfadText4;
QLineEdit* TemplateDir;
QToolButton* FileC4;
QButtonGroup* ButtonGroup2;
QButtonGroup* ButtonGroup5;
QButtonGroup* ButtonGroup6;
274,6 → 277,7
void ChangeDocs();
void ChangeProfs();
void ChangeScripts();
void ChangeTemplates();
void ChangeScaling();
void ChangeGrid();
void setDS();
/trunk/Scribus/scribus/scribusdoc.cpp
16,8 → 16,17
***************************************************************************/
 
#include "scribusdoc.h"
#include "scribusXml.h"
#include "scribus.h"
#include <qfile.h>
 
/*
* We need to be able to see ScApp so we can get the
* Prefs struct.
*/
// Is this the right place for this declaration?
extern ScribusApp *ScApp;
 
ScribusDoc::ScribusDoc()
{
modified = false;
238,3 → 247,64
FT_Done_Face( face );
return ret;
}
 
/*
* Split out from loadStyles in editFormats.cpp so it's callable from anywhere,
* including plugins.
* - 2004-09-14 Craig Ringer
*/
void ScribusDoc::loadStylesFromFile(QString fileName, QValueList<StVorL> *tempStyles)
{
// This won't create the QValueList<StVorL> will it?
QValueList<StVorL> *wrkStyles = NULL;
/*
* Use the working styles struct if passed, or work directly
* on the document styles otherwise. Note that tempStyles,
* if passed, MUST have the first five styles initialised already
* or this function will segfault.
*/
if (tempStyles != NULL)
{
wrkStyles = tempStyles;
} else {
wrkStyles = &Vorlagen;
}
if (!fileName.isEmpty())
{
ScriXmlDoc *ss = new ScriXmlDoc();
ss->Vorlagen.clear();
for (uint x = 5; x < wrkStyles->count(); ++x)
ss->Vorlagen.append((*wrkStyles)[x]);
uint old = wrkStyles->count()-5;
if (ss->ReadStyles(fileName, this, &ScApp->Prefs))
{
if (ss->Vorlagen.count() > old)
{
for (uint xx=old; xx<ss->Vorlagen.count(); ++xx)
{
struct StVorL sty;
sty.Vname = ss->Vorlagen[xx].Vname;
sty.LineSpa = ss->Vorlagen[xx].LineSpa;
sty.Ausri = ss->Vorlagen[xx].Ausri;
sty.Indent = ss->Vorlagen[xx].Indent;
sty.First = ss->Vorlagen[xx].First;
sty.Avor = ss->Vorlagen[xx].Avor;
sty.Anach = ss->Vorlagen[xx].Anach;
sty.Font = ss->Vorlagen[xx].Font;
sty.FontSize = ss->Vorlagen[xx].FontSize;
sty.TabValues = ss->Vorlagen[xx].TabValues;
sty.Drop = ss->Vorlagen[xx].Drop;
sty.DropLin = ss->Vorlagen[xx].DropLin;
sty.FontEffect = ss->Vorlagen[xx].FontEffect;
sty.FColor = ss->Vorlagen[xx].FColor;
sty.FShade = ss->Vorlagen[xx].FShade;
sty.SColor = ss->Vorlagen[xx].SColor;
sty.SShade = ss->Vorlagen[xx].SShade;
sty.BaseAdj = ss->Vorlagen[xx].BaseAdj;
wrkStyles->append(sty);
}
}
}
delete ss;
}
}
/trunk/Scribus/scribus/editformats.cpp
3,7 → 3,7
#include "edit1format.h"
#include <qmessagebox.h>
#include "customfdialog.h"
#include "scribusXml.h"
 
extern QPixmap loadIcon(QString nam);
 
StilFormate::StilFormate( QWidget* parent, ScribusDoc *doc, preV *avail)
198,7 → 198,6
 
void StilFormate::loadStyles()
{
QString fileName;
#ifdef HAVE_LIBZ
CustomFDialog dia(this, tr("Open"), tr("Documents (*.sla *.sla.gz *.scd *.scd.gz);;All Files (*)"));
#else
205,57 → 204,13
CustomFDialog dia(this, tr("Open"), tr("Documents (*.sla *.scd);;All Files (*)"));
#endif
if (dia.exec() == QDialog::Accepted)
loadStylesFromFile(dia.selectedFile());
else
return;
}
 
/*
* Taken from loadStyles so that styles can be imported
* non-interactively via plugin/script -- Craig Ringer, 2004-09-10
*/
void StilFormate::loadStylesFromFile(QString fileName)
{
if (!fileName.isEmpty())
{
ScriXmlDoc *ss = new ScriXmlDoc();
ss->Vorlagen.clear();
for (uint x = 5; x < TempVorl.count(); ++x)
ss->Vorlagen.append(TempVorl[x]);
uint old = TempVorl.count()-5;
if (ss->ReadStyles(fileName, Docu, fon))
{
if (ss->Vorlagen.count() > old)
{
for (uint xx=old; xx<ss->Vorlagen.count(); ++xx)
{
struct StVorL sty;
sty.Vname = ss->Vorlagen[xx].Vname;
sty.LineSpa = ss->Vorlagen[xx].LineSpa;
sty.Ausri = ss->Vorlagen[xx].Ausri;
sty.Indent = ss->Vorlagen[xx].Indent;
sty.First = ss->Vorlagen[xx].First;
sty.Avor = ss->Vorlagen[xx].Avor;
sty.Anach = ss->Vorlagen[xx].Anach;
sty.Font = ss->Vorlagen[xx].Font;
sty.FontSize = ss->Vorlagen[xx].FontSize;
sty.TabValues = ss->Vorlagen[xx].TabValues;
sty.Drop = ss->Vorlagen[xx].Drop;
sty.DropLin = ss->Vorlagen[xx].DropLin;
sty.FontEffect = ss->Vorlagen[xx].FontEffect;
sty.FColor = ss->Vorlagen[xx].FColor;
sty.FShade = ss->Vorlagen[xx].FShade;
sty.SColor = ss->Vorlagen[xx].SColor;
sty.SShade = ss->Vorlagen[xx].SShade;
sty.BaseAdj = ss->Vorlagen[xx].BaseAdj;
TempVorl.append(sty);
}
}
Docu->loadStylesFromFile(dia.selectedFile(), &TempVorl);
UpdateFList();
}
delete ss;
else
return;
}
}
 
void StilFormate::UpdateFList()
{
/trunk/Scribus/scribus/editformats.h
30,7 → 30,6
preV *fon;
ScribusDoc *Docu;
void UpdateFList();
void loadStylesFromFile(QString fileName);
 
public slots:
void saveIt();
/trunk/Scribus/scribus/scribusdoc.h
511,7 → 511,9
void setPage(double b, double h, double t, double l, double r, double bo, double sp, double ab, bool atf, bool fp);
void resetPage(double t, double l, double r, double bo, bool fp);
bool AddFont(QString name, QFont fo);
void loadStylesFromFile(QString fileName, QValueList<StVorL> *tempStyles = NULL);
 
 
protected:
bool modified;