Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 6714 → Rev 6715

/branches/Version13x/Scribus/scribus/checkDocument.cpp
817,10 → 817,7
void CheckDocument::setIgnoreEnabled(bool state)
{
noButton = !state;
if (state)
ignoreErrors->show();
else
ignoreErrors->hide();
ignoreErrors->setShown(state);
}
 
bool CheckDocument::isIgnoreEnabled()
/branches/Version13x/Scribus/scribus/scribus.cpp
1878,10 → 1878,10
//CB NOTE should be all done now
doc->setPage(width, height, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, columnCount, autoTextFrames, pageArrangement);
doc->setMasterPageMode(false);
doc->addMasterPage(0, "Normal");
doc->addMasterPage(0, CommonStrings::masterPageNormal);
int createCount=QMAX(pageCount,1);
for (int i = 0; i < createCount; ++i)
doc->addPage(i, "Normal", true);
doc->addPage(i, CommonStrings::masterPageNormal, true);
doc->addSection();
doc->setFirstSectionFromFirstPageNumber();
doc->setModified(false);
1966,60 → 1966,8
//CB NOTE should be all done now
tempDoc->setPage(width, height, topMargin, leftMargin, rightMargin, bottomMargin, columnCount, columnDistance, autoTextFrames, pageArrangement);
tempDoc->setMasterPageMode(false);
int setcol = tempDoc->pageSets[tempDoc->currentPageLayout].Columns;
if (setcol == 1)
{
tempDoc->addMasterPage(0, tr("Normal"));
int createCount=QMAX(pageCount,1);
for (int i = 0; i < createCount; ++i)
tempDoc->addPage(i, tr("Normal"), true);
}
else if (setcol == 2)
{
Page *lp = tempDoc->addMasterPage(0, tr("Normal Left"));
lp->LeftPg = 1;
lp->Margins.Left = lp->initialMargins.Right;
lp->Margins.Right = lp->initialMargins.Left;
lp = tempDoc->addMasterPage(1, tr("Normal Right"));
lp->LeftPg = 0;
lp->Margins.Right = lp->initialMargins.Right;
lp->Margins.Left = lp->initialMargins.Left;
int createCount=QMAX(pageCount,1);
for (int i = 0; i < createCount; ++i)
{
PageLocation pageLoc = tempDoc->locationOfPage(i);
if (pageLoc == LeftPage)
tempDoc->addPage(i, tr("Normal Left"), true);
else
tempDoc->addPage(i, tr("Normal Right"), true);
}
}
else if ((setcol == 3) || (setcol == 4))
{
Page *lp = tempDoc->addMasterPage(0, tr("Normal Left"));
lp->LeftPg = 1;
lp->Margins.Left = lp->initialMargins.Right;
lp->Margins.Right = lp->initialMargins.Left;
lp = tempDoc->addMasterPage(1, tr("Normal Right"));
lp->LeftPg = 0;
lp->Margins.Right = lp->initialMargins.Right;
lp->Margins.Left = lp->initialMargins.Left;
lp = tempDoc->addMasterPage(2, tr("Normal Middle"));
lp->LeftPg = 2;
lp->Margins.Left = lp->initialMargins.Left;
lp->Margins.Right = lp->initialMargins.Left;
int createCount=QMAX(pageCount,1);
for (int i = 0; i < createCount; ++i)
{
PageLocation pageLoc = tempDoc->locationOfPage(i);
if (pageLoc == LeftPage)
tempDoc->addPage(i, tr("Normal Left"), true);
else if (pageLoc == RightPage)
tempDoc->addPage(i, tr("Normal Right"), true);
else
tempDoc->addPage(i, tr("Normal Middle"), true);
}
}
tempDoc->createDefaultMasterPages();
tempDoc->createNewDocPages(pageCount);
tempDoc->addSection();
tempDoc->setFirstSectionFromFirstPageNumber();
tempDoc->setModified(false);
3670,7 → 3618,7
propertiesPalette->updateCList();
doc->hasName = true;
if (doc->MasterPages.count() == 0)
doc->addMasterPage(0, "Normal");
doc->addMasterPage(0, CommonStrings::masterPageNormal);
//Add doc sections if we have none
if (doc->sections.count()==0)
{
4237,8 → 4185,7
{
if (doc->checkerProfiles[doc->curCheckProfile].autoCheck)
{
scanDocument();
if ((doc->docItemErrors.count() != 0) || (doc->masterItemErrors.count() != 0) || (doc->docLayerErrors.count() != 0))
if (scanDocument())
{
if (doc->checkerProfiles[doc->curCheckProfile].ignoreErrors)
{
5172,11 → 5119,11
{
int setcol = doc->pageSets[doc->currentPageLayout].Columns;
if (setcol == 1)
ss->set("BASED", tr("Normal"));
ss->set("BASED", CommonStrings::trMasterPageNormal);
else if (setcol == 2)
ss->set("BASED", tr("Normal Left")+"|"+ tr("Normal Right"));
ss->set("BASED", CommonStrings::trMasterPageNormalLeft+"|"+ CommonStrings::trMasterPageNormalRight);
else if ((setcol == 3) || (setcol == 4))
ss->set("BASED", tr("Normal Left")+"|"+ tr("Normal Middle")+"|"+ tr("Normal Right"));
ss->set("BASED", CommonStrings::trMasterPageNormalLeft+"|"+ CommonStrings::trMasterPageNormalMiddle+"|"+ CommonStrings::trMasterPageNormalRight);
}
ss->set("HEIGHT", height);
ss->set("WIDTH", width);
5194,24 → 5141,24
{
int setcol = doc->pageSets[doc->currentPageLayout].Columns;
if (setcol == 1)
base.append( tr("Normal"));
base.append( CommonStrings::trMasterPageNormal);
else if (setcol == 2)
{
base.append( tr("Normal Left"));
base.append( tr("Normal Right"));
base.append( CommonStrings::trMasterPageNormalLeft);
base.append( CommonStrings::trMasterPageNormalRight);
}
else if (setcol == 3)
{
base.append( tr("Normal Left"));
base.append( tr("Normal Middle"));
base.append( tr("Normal Right"));
base.append( CommonStrings::trMasterPageNormalLeft);
base.append( CommonStrings::trMasterPageNormalMiddle);
base.append( CommonStrings::trMasterPageNormalRight);
}
else if (setcol == 4)
{
base.append( tr("Normal Left"));
base.append( tr("Normal Middle"));
base.append( tr("Normal Middle"));
base.append( tr("Normal Right"));
base.append( CommonStrings::trMasterPageNormalLeft);
base.append( CommonStrings::trMasterPageNormalMiddle);
base.append( CommonStrings::trMasterPageNormalMiddle);
base.append( CommonStrings::trMasterPageNormalRight);
}
}
else
5288,7 → 5235,7
diaLinksCount=static_cast<int>(dia->Links->count());
}
QString masterPageName = dia->Answer->text();
while (doc->MasterNames.contains(masterPageName) || (masterPageName == "Normal"))
while (doc->MasterNames.contains(masterPageName) || (masterPageName == CommonStrings::masterPageNormal))
{
if (!dia->exec())
{
7382,8 → 7329,7
{
if (doc->checkerProfiles[doc->curCheckProfile].autoCheck)
{
scanDocument();
if ((doc->docItemErrors.count() != 0) || (doc->masterItemErrors.count() != 0) || (doc->docLayerErrors.count() != 0))
if (scanDocument())
{
if (doc->checkerProfiles[doc->curCheckProfile].ignoreErrors)
{
7441,8 → 7387,7
{
if (doc->checkerProfiles[doc->curCheckProfile].autoCheck)
{
scanDocument();
if ((doc->docItemErrors.count() != 0) || (doc->masterItemErrors.count() != 0) || (doc->docLayerErrors.count() != 0))
if (scanDocument())
{
if (doc->checkerProfiles[doc->curCheckProfile].ignoreErrors)
{
7521,8 → 7466,7
{
if (doc->checkerProfiles[doc->curCheckProfile].autoCheck)
{
scanDocument();
if ((doc->docItemErrors.count() != 0) || (doc->masterItemErrors.count() != 0) || (doc->docLayerErrors.count() != 0))
if (scanDocument())
{
if (doc->checkerProfiles[doc->curCheckProfile].ignoreErrors)
{
8635,10 → 8579,10
}
}
 
void ScribusMainWindow::scanDocument()
bool ScribusMainWindow::scanDocument()
{
DocumentChecker docChecker;
docChecker.checkDocument(doc);
return docChecker.checkDocument(doc);
}
 
void ScribusMainWindow::HaveRaster(bool art)
/branches/Version13x/Scribus/scribus/documentchecker.h
34,7 → 34,8
class SCRIBUS_API DocumentChecker
{
public:
static void checkDocument(ScribusDoc *currDoc);
//! Check the passed document for errors, return true on error found
static bool checkDocument(ScribusDoc *currDoc);
};
 
#endif
/branches/Version13x/Scribus/scribus/documentchecker.cpp
29,7 → 29,7
#include "text/nlsconfig.h"
#include "util.h"
 
void DocumentChecker::checkDocument(ScribusDoc *currDoc)
bool DocumentChecker::checkDocument(ScribusDoc *currDoc)
{
PageItem* currItem;
QString chstr;
298,4 → 298,6
if (itemError.count() != 0)
currDoc->docItemErrors.insert(currItem->ItemNr, itemError);
}
return ((currDoc->docItemErrors.count() != 0) || (currDoc->masterItemErrors.count() != 0) || (currDoc->docLayerErrors.count() != 0));
}
/branches/Version13x/Scribus/scribus/margindialog.cpp
127,11 → 127,11
masterLayout->addWidget( masterPageLabel );
masterPageComboBox = new QComboBox( false, groupMaster, "masterPageComboBox" );
QString Nam = doc->currentPage()->MPageNam;
QString na = Nam == "Normal" ? tr("Normal") : Nam, in;
QString na = Nam == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : Nam, in;
int cc = 0;
for (QMap<QString,int>::Iterator it = doc->MasterNames.begin(); it != doc->MasterNames.end(); ++it)
{
in = it.key() == "Normal" ? tr("Normal") : it.key();
in = it.key() == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : it.key();
masterPageComboBox->insertItem(in);
if (in == na)
masterPageComboBox->setCurrentItem(cc);
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
1110,7 → 1110,7
 
bool ScribusDoc::renameMasterPage(const QString& oldPageName, const QString& newPageName)
{
Q_ASSERT(oldPageName!="Normal" && oldPageName!=tr("Normal"));
Q_ASSERT(oldPageName!=CommonStrings::masterPageNormal && oldPageName!=CommonStrings::trMasterPageNormal);
if (MasterNames.contains(oldPageName) && !MasterNames.contains(newPageName))
{
//Rename our master page lists
1155,7 → 1155,7
for (Page* docPage = DocPages.first(); docPage; docPage = DocPages.next() )
{
if (docPage->MPageNam == oldPageName)
docPage->MPageNam = "Normal";
docPage->MPageNam = CommonStrings::masterPageNormal;
}
*/
//QPtrList docs: The item after the removed item becomes the new current list item if the removed item is not the last item in the list. If the last item is removed, the new last item becomes the current item.
2632,10 → 2632,10
}
 
QString mna = pageName;
if (mna == tr("Normal"))
mna = "Normal";
if (mna == CommonStrings::trMasterPageNormal)
mna = CommonStrings::masterPageNormal;
if (!MasterNames.contains(mna))
mna = "Normal";
mna = CommonStrings::masterPageNormal;
Page* Ap = DocPages.at(pageNumber);
Ap->MPageNam = mna;
int MpNr = MasterNames[mna];
4271,9 → 4271,7
int setcol=pageSets[currentPageLayout].Columns;
if (setcol==1)
return LeftPage;
// int myCol=(pageIndex+pageSets[currentPageLayout].FirstPage)%setcol;
int myCol = ((pageIndex % setcol)+pageSets[currentPageLayout].FirstPage)%setcol;
 
if (myCol==0) //Left hand page
return LeftPage;
else if (myCol>= setcol-1) // Right hand page
8051,3 → 8049,73
changed();
}
}
 
void ScribusDoc::createDefaultMasterPages()
{
int setcol = pageSets[currentPageLayout].Columns;
if (setcol == 1)
{
addMasterPage(0, CommonStrings::trMasterPageNormal);
}
else if (setcol == 2)
{
Page *lp = addMasterPage(0, CommonStrings::trMasterPageNormalLeft);
lp->LeftPg = 1;
lp->Margins.Left = lp->initialMargins.Right;
lp->Margins.Right = lp->initialMargins.Left;
lp = addMasterPage(1, CommonStrings::trMasterPageNormalRight);
lp->LeftPg = 0;
lp->Margins.Right = lp->initialMargins.Right;
lp->Margins.Left = lp->initialMargins.Left;
}
else if ((setcol == 3) || (setcol == 4))
{
Page *lp = addMasterPage(0, CommonStrings::trMasterPageNormalLeft);
lp->LeftPg = 1;
lp->Margins.Left = lp->initialMargins.Right;
lp->Margins.Right = lp->initialMargins.Left;
lp = addMasterPage(1, CommonStrings::trMasterPageNormalRight);
lp->LeftPg = 0;
lp->Margins.Right = lp->initialMargins.Right;
lp->Margins.Left = lp->initialMargins.Left;
lp = addMasterPage(2, CommonStrings::trMasterPageNormalMiddle);
lp->LeftPg = 2;
lp->Margins.Left = lp->initialMargins.Left;
lp->Margins.Right = lp->initialMargins.Left;
}
}
 
void ScribusDoc::createNewDocPages(int pageCount)
{
int setcol = pageSets[currentPageLayout].Columns;
int createCount=QMAX(pageCount,1);
if (setcol == 1)
{
for (int i = 0; i < createCount; ++i)
addPage(i, CommonStrings::trMasterPageNormal, true);
}
else if (setcol == 2)
{
for (int i = 0; i < createCount; ++i)
{
PageLocation pageLoc = locationOfPage(i);
if (pageLoc == LeftPage)
addPage(i, CommonStrings::trMasterPageNormalLeft, true);
else
addPage(i, CommonStrings::trMasterPageNormalRight, true);
}
}
else if ((setcol == 3) || (setcol == 4))
{
for (int i = 0; i < createCount; ++i)
{
PageLocation pageLoc = locationOfPage(i);
if (pageLoc == LeftPage)
addPage(i, CommonStrings::trMasterPageNormalLeft, true);
else if (pageLoc == RightPage)
addPage(i, CommonStrings::trMasterPageNormalRight, true);
else
addPage(i, CommonStrings::trMasterPageNormalMiddle, true);
}
}
}
/branches/Version13x/Scribus/scribus/applytemplatedialog.cpp
147,11 → 147,11
 
void ApplyMasterPageDialog::setup(ScribusDoc *view, QString Nam)
{
QString na = Nam == "Normal" ? tr("Normal") : Nam, in;
QString na = Nam == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : Nam, in;
int cc = 0;
for (QMap<QString,int>::Iterator it = view->MasterNames.begin(); it != view->MasterNames.end(); ++it)
{
in = it.key() == "Normal" ? tr("Normal") : it.key();
in = it.key() == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : it.key();
masterPageComboBox->insertItem(in);
if (in == na)
masterPageComboBox->setCurrentItem(cc);
/branches/Version13x/Scribus/scribus/commonstrings.cpp
62,6 → 62,15
QString CommonStrings::trPageLocMiddleRight = "";
QString CommonStrings::trPageLocRight = "";
 
QString CommonStrings:: masterPageNormal = "";
QString CommonStrings:: trMasterPageNormal = "";
QString CommonStrings:: masterPageNormalLeft = "";
QString CommonStrings:: trMasterPageNormalLeft = "";
QString CommonStrings:: masterPageNormalMiddle = "";
QString CommonStrings:: trMasterPageNormalMiddle = "";
QString CommonStrings:: masterPageNormalRight = "";
QString CommonStrings:: trMasterPageNormalRight = "";
 
QString CommonStrings::trPenStyle_SolidLine = "";
QString CommonStrings::trPenStyle_DashedLine = "";
QString CommonStrings::trPenStyle_DottedLine = "";
185,6 → 194,15
CommonStrings::trPageLocMiddleRight = tr( "Middle Right" );
CommonStrings::trPageLocRight = tr( "Right Page" );
CommonStrings:: masterPageNormal = "Normal";
CommonStrings:: trMasterPageNormal = tr( "Normal" );
CommonStrings:: masterPageNormalLeft = "Normal Left";
CommonStrings:: trMasterPageNormalLeft = tr( "Normal Left" );
CommonStrings:: masterPageNormalMiddle = "Normal Middle";
CommonStrings:: trMasterPageNormalMiddle = tr( "Normal Middle" );
CommonStrings:: masterPageNormalRight = "Normal Right";
CommonStrings:: trMasterPageNormalRight = tr( "Normal Right" );
CommonStrings::trPenStyle_SolidLine = "Solid Line";
CommonStrings::trPenStyle_DashedLine = "Dashed Line";
CommonStrings::trPenStyle_DottedLine = "Dotted Line";
/branches/Version13x/Scribus/scribus/seiten.cpp
7,6 → 7,7
#include "seiten.h"
#include "seiten.moc"
#include <qcursor.h>
#include "commonstrings.h"
#include "scribus.h"
#include "scribusview.h"
#include "dynamictip.h"
544,7 → 545,7
 
void PagePalette::DelMPage(QString tmp)
{
if (tmp == tr("Normal"))
if (tmp == CommonStrings::trMasterPageNormal)
return;
int Nr = currView->Doc->MasterNames[tmp];
Page* Seite = currView->Doc->MasterPages.at(Nr);
572,7 → 573,7
for (uint b=0; b<currView->Doc->DocPages.count(); ++b)
{
if (currView->Doc->DocPages.at(b)->MPageNam == tmp)
currView->Doc->DocPages.at(b)->MPageNam = "Normal";
currView->Doc->DocPages.at(b)->MPageNam = CommonStrings::masterPageNormal;
}
currView->DrawNew();
RebuildTemp();
651,10 → 652,10
if (masterPageList->Thumb)
{
pm.convertFromImage(currView->MPageToPixmap(it.key(),60));
masterPageList->insertItem(pm, it.key() == "Normal" ? tr("Normal") : it.key());
masterPageList->insertItem(pm, it.key() == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : it.key());
}
else
masterPageList->insertItem(it.key() == "Normal" ? tr("Normal") : it.key());
masterPageList->insertItem(it.key() == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : it.key());
}
}
 
/branches/Version13x/Scribus/scribus/scribusdoc.h
101,15 → 101,16
// Add, delete and move pages
Page* addPage(const int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false);
void deleteMasterPage(const int);
void deletePage(const int);
/**
* @brief Add a master page with this function, do not use addPage
*/
//! @brief Add a master page with this function, do not use addPage
Page* addMasterPage(const int, const QString&);
void deleteMasterPage(const int);
//! @brief Rename a master page
bool renameMasterPage(const QString& oldPageName, const QString& newPageName);
 
//! @brief Create the default master pages based on the layout selected by the user, ie, Normal, Normal Left, etc.
void createDefaultMasterPages();
//! @brief Create the requested pages in a new document, run after createDefaultMasterPages()
void createNewDocPages(int pageCount);
/**
* @brief Add the automatic text frame to the page
* @param pageNumber page number
/branches/Version13x/Scribus/scribus/commonstrings.h
124,6 → 124,16
static QString trPageLocMiddleRight;
static QString trPageLocRight;
//Master Page Default Names
static QString masterPageNormal;
static QString trMasterPageNormal;
static QString masterPageNormalLeft;
static QString trMasterPageNormalLeft;
static QString masterPageNormalMiddle;
static QString trMasterPageNormalMiddle;
static QString masterPageNormalRight;
static QString trMasterPageNormalRight;
//Pen Styles
static QString trPenStyle_SolidLine;
static QString trPenStyle_DashedLine;
/branches/Version13x/Scribus/scribus/muster.cpp
59,7 → 59,7
 
if (masterPageName.isEmpty())
{
// sMuster = "Normal";
// sMuster = CommonStrings::masterPageNormal;
sMuster = currentDoc->MasterNames.begin().key();
updateMasterPageList(sMuster);
currentView->showMasterPage(0);
100,7 → 100,7
 
void MasterPagesPalette::deleteMasterPage()
{
if ((sMuster == "Normal") || (sMuster == tr("Normal")) || (sMuster == tr("Normal Left")) || (sMuster == tr("Normal Middle")) || (sMuster == tr("Normal Right")))
if ((sMuster == CommonStrings::masterPageNormal) || (sMuster == CommonStrings::trMasterPageNormal) || (sMuster == CommonStrings::trMasterPageNormalLeft) || (sMuster == CommonStrings::trMasterPageNormalMiddle) || (sMuster == CommonStrings::trMasterPageNormalRight))
return;
int exit=ScMessageBox::warning(this,
CommonStrings::trWarning,
126,28 → 126,28
PageLocation pageLoc = currentDoc->locationOfPage(pageIndex);
if (pageLoc == LeftPage)
{
if (currentDoc->MasterNames.contains( tr("Normal Left")))
docPage->MPageNam = tr("Normal Left");
else if (currentDoc->MasterNames.contains( tr("Normal")))
docPage->MPageNam = tr("Normal");
if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormalLeft))
docPage->MPageNam = CommonStrings::trMasterPageNormalLeft;
else if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormal))
docPage->MPageNam = CommonStrings::trMasterPageNormal;
else
docPage->MPageNam = it.key();
}
else if (pageLoc == RightPage)
{
if (currentDoc->MasterNames.contains( tr("Normal Right")))
docPage->MPageNam = tr("Normal Right");
else if (currentDoc->MasterNames.contains( tr("Normal")))
docPage->MPageNam = tr("Normal");
if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormalRight))
docPage->MPageNam = CommonStrings::trMasterPageNormalRight;
else if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormal))
docPage->MPageNam = CommonStrings::trMasterPageNormal;
else
docPage->MPageNam = it.key();
}
else
{
if (currentDoc->MasterNames.contains( tr("Normal Middle")))
docPage->MPageNam = tr("Normal Middle");
else if (currentDoc->MasterNames.contains( tr("Normal")))
docPage->MPageNam = tr("Normal");
if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormalMiddle))
docPage->MPageNam = CommonStrings::trMasterPageNormalMiddle;
else if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormal))
docPage->MPageNam = CommonStrings::trMasterPageNormal;
else
docPage->MPageNam = it.key();
}
173,7 → 173,7
if (dia->exec())
{
QString MasterPageName = dia->Answer->text();
while (currentDoc->MasterNames.contains(MasterPageName) || ((MasterPageName == "Normal") || (MasterPageName == tr("Normal")) || (MasterPageName == tr("Normal Left")) || (MasterPageName == tr("Normal Middle")) || (MasterPageName == tr("Normal Right"))))
while (currentDoc->MasterNames.contains(MasterPageName) || ((MasterPageName == CommonStrings::masterPageNormal) || (MasterPageName == CommonStrings::trMasterPageNormal) || (MasterPageName == CommonStrings::trMasterPageNormalLeft) || (MasterPageName == CommonStrings::trMasterPageNormalMiddle) || (MasterPageName == CommonStrings::trMasterPageNormalRight)))
{
if (!dia->exec())
{
297,7 → 297,7
if (dia->exec())
{
MasterPageName = dia->Answer->text();
while (currentDoc->MasterNames.contains(MasterPageName) || ((MasterPageName == "Normal") || (MasterPageName == tr("Normal")) || (MasterPageName == tr("Normal Left")) || (MasterPageName == tr("Normal Middle")) || (MasterPageName == tr("Normal Right"))))
while (currentDoc->MasterNames.contains(MasterPageName) || ((MasterPageName == CommonStrings::masterPageNormal) || (MasterPageName == CommonStrings::trMasterPageNormal) || (MasterPageName == CommonStrings::trMasterPageNormalLeft) || (MasterPageName == CommonStrings::trMasterPageNormalMiddle) || (MasterPageName == CommonStrings::trMasterPageNormalRight)))
{
if (!dia->exec())
{
377,9 → 377,9
{
sMuster = item->text();
deleteButton->setEnabled(currentDoc->MasterNames.count() == 1 ? false : true);
if (sMuster == tr("Normal"))
if (sMuster == CommonStrings::trMasterPageNormal)
{
sMuster = "Normal";
sMuster = CommonStrings::masterPageNormal;
deleteButton->setEnabled(false);
}
else
391,9 → 391,9
{
sMuster = name;
deleteButton->setEnabled(currentDoc->MasterNames.count() == 1 ? false : true);
if (sMuster == tr("Normal"))
if (sMuster == CommonStrings::trMasterPageNormal)
{
sMuster = "Normal";
sMuster = CommonStrings::masterPageNormal;
deleteButton->setEnabled(false);
}
else
405,11 → 405,11
{
masterPageListBox->clear();
for (QMap<QString,int>::Iterator it = currentDoc->MasterNames.begin(); it != currentDoc->MasterNames.end(); ++it)
masterPageListBox->insertItem(it.key() == "Normal" ? tr("Normal") : it.key());
masterPageListBox->insertItem(it.key() == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : it.key());
deleteButton->setEnabled(currentDoc->MasterNames.count() == 1 ? false : true);
if (MasterPageName == "Normal")
if (MasterPageName == CommonStrings::masterPageNormal)
{
MasterPageName = tr("Normal");
MasterPageName = CommonStrings::trMasterPageNormal;
deleteButton->setEnabled(false);
}
masterPageListBox->setSelected(masterPageListBox->index(masterPageListBox->findItem(MasterPageName)), true);
418,7 → 418,7
void MasterPagesPalette::renameMasterPage(QListBoxItem * item)
{
QString oldName(item->text());
if ((oldName == "Normal") || (oldName == tr("Normal")) || (oldName == tr("Normal Left")) || (oldName == tr("Normal Middle")) || (oldName == tr("Normal Right")))
if ((oldName == CommonStrings::masterPageNormal) || (oldName == CommonStrings::trMasterPageNormal) || (oldName == CommonStrings::trMasterPageNormalLeft) || (oldName == CommonStrings::trMasterPageNormalMiddle) || (oldName == CommonStrings::trMasterPageNormalRight))
{
QMessageBox::information( this, tr("Unable to Rename Master Page"), tr("The Normal page is not allowed to be renamed."), QMessageBox::Ok );
return;
/branches/Version13x/Scribus/scribus/scribus.h
508,7 → 508,8
/*! \brief call gimp and wait upon completion */
void callImageEditor();
void docCheckToggle(bool visible);
void scanDocument();
//! \brief Scan a document for errors, return true on errors found
bool scanDocument();
void setUndoMode(bool isObjectSpecific);
//! \brief Apply a Lorem Ipsum to the each item in a selection
void insertSampleText();
/branches/Version13x/Scribus/scribus/inspage.cpp
71,7 → 71,7
{
QComboBox* pageData = new QComboBox(false, masterPageGroup, "masterPageData");
for (QMap<QString,int>::Iterator it = currentDoc->MasterNames.begin(); it != currentDoc->MasterNames.end(); ++it)
pageData->insertItem(it.key() == "Normal" ? tr("Normal") : it.key());
pageData->insertItem(it.key() == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : it.key());
masterPageLabel = new QLabel(pageData, tr("&Master Page:"), masterPageGroup, "text");
masterPageLayout->addWidget( masterPageLabel, 0, 0 );
masterPageLayout->addWidget(pageData, 0, 1);
84,23 → 84,23
{
QComboBox* pageData = new QComboBox(false, masterPageGroup, "pageData");
for (QMap<QString,int>::Iterator it = currentDoc->MasterNames.begin(); it != currentDoc->MasterNames.end(); ++it)
pageData->insertItem(it.key() == "Normal" ? tr("Normal") : it.key());
pageData->insertItem(it.key() == CommonStrings::masterPageNormal ? CommonStrings::trMasterPageNormal : it.key());
if (mp == 0)
{
if (currentDoc->MasterNames.contains( tr("Normal Left")))
pageData->setCurrentText( tr("Normal Left"));
if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormalLeft))
pageData->setCurrentText( CommonStrings::trMasterPageNormalLeft);
}
else if (mp == 1)
{
if (currentDoc->pageSets[currentDoc->currentPageLayout].pageNames.count() > 2)
{
if (currentDoc->MasterNames.contains( tr("Normal Middle")))
pageData->setCurrentText( tr("Normal Middle"));
if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormalMiddle))
pageData->setCurrentText( CommonStrings::trMasterPageNormalMiddle);
}
else
{
if (currentDoc->MasterNames.contains( tr("Normal Right")))
pageData->setCurrentText( tr("Normal Right"));
if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormalRight))
pageData->setCurrentText( CommonStrings::trMasterPageNormalRight);
}
}
else if (mp == 2)
107,19 → 107,19
{
if (currentDoc->pageSets[currentDoc->currentPageLayout].pageNames.count() > 3)
{
if (currentDoc->MasterNames.contains( tr("Normal Middle")))
pageData->setCurrentText( tr("Normal Middle"));
if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormalMiddle))
pageData->setCurrentText( CommonStrings::trMasterPageNormalMiddle);
}
else
{
if (currentDoc->MasterNames.contains( tr("Normal Right")))
pageData->setCurrentText( tr("Normal Right"));
if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormalRight))
pageData->setCurrentText( CommonStrings::trMasterPageNormalRight);
}
}
else if (mp == 3)
{
if (currentDoc->MasterNames.contains( tr("Normal Right")))
pageData->setCurrentText( tr("Normal Right"));
if (currentDoc->MasterNames.contains( CommonStrings::trMasterPageNormalRight))
pageData->setCurrentText( CommonStrings::trMasterPageNormalRight);
}
QLabel* pageLabel = new QLabel(pageData, currentDoc->pageSets[currentDoc->currentPageLayout].pageNames[mp], masterPageGroup, "text");
masterPageLayout->addWidget(pageLabel, row, 0 );