r14755 by jghali - improvements to #8833 fix : - change ScriptRunning type from bool to int and use it as a counter - make ScriptRunning private and implement appropriate methods to increment/decrement counter
scribus-commit
scribus-commit at lists.scribus.net
Wed Feb 17 23:12:57 CET 2010
Revision: 14755
Author: jghali
Date: 2010-02-17T22:08:03.314786Z
Commit message: improvements to #8833 fix :
- change ScriptRunning type from bool to int and use it as a counter
- make ScriptRunning private and implement appropriate methods to increment/decrement counter
Changeset:
M /branches/Version135/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
M /branches/Version135/Scribus/scribus/scribus.cpp
M /branches/Version135/Scribus/scribus/pagepalette.cpp
M /branches/Version135/Scribus/scribus/plugins/psimport/importps.cpp
M /branches/Version135/Scribus/scribus/plugins/xfigimplugin/importxfig.cpp
M /branches/Version135/Scribus/scribus/propertiespalette.cpp
M /branches/Version135/Scribus/scribus/outlinepalette.cpp
M /branches/Version135/Scribus/scribus/scribus.h
M /branches/Version135/Scribus/scribus/scribusdoc.cpp
M /branches/Version135/Scribus/scribus/plugins/aiimplugin/importai.cpp
M /branches/Version135/Scribus/scribus/plugins/fileloader/oodraw/oodrawimp.cpp
M /branches/Version135/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
M /branches/Version135/Scribus/scribus/plugins/wmfimplugin/wmfimport.cpp
M /branches/Version135/Scribus/scribus/plugins/tools/transform/transformeffect.cpp
M /branches/Version135/Scribus/scribus/scribusview.cpp
Diffs:
Index: scribus/pagepalette.cpp
===================================================================
--- scribus/pagepalette.cpp (revision 14754)
+++ scribus/pagepalette.cpp (revision 14755)
@@ -712,7 +712,7 @@
void PagePalette::rebuildMasters()
{
- if (m_scMW->ScriptRunning)
+ if (m_scMW->scriptIsRunning())
return;
masterPageList->clear();
if (currView == 0)
@@ -733,7 +733,7 @@
void PagePalette::rebuildPages()
{
- if (m_scMW->ScriptRunning)
+ if (m_scMW->scriptIsRunning())
return;
QString str;
disconnect(pageLayout, SIGNAL(selectedLayout(int )), this, SLOT(handlePageLayout(int )));
@@ -861,7 +861,7 @@
void PagePalette::setView(ScribusView *view)
{
- if (m_scMW->ScriptRunning)
+ if (m_scMW->scriptIsRunning())
return;
currView = view;
}
@@ -939,3 +939,4 @@
return masterPageList->Thumb;
}
+
Index: scribus/scribusview.cpp
===================================================================
--- scribus/scribusview.cpp (revision 14754)
+++ scribus/scribusview.cpp (revision 14755)
@@ -469,7 +469,7 @@
m_oldCanvasWidth = newCanvasWidth;
m_oldCanvasHeight = newCanvasHeight;
}
- if (!Doc->isLoading() && !m_ScMW->ScriptRunning)
+ if (!Doc->isLoading() && !m_ScMW->scriptIsRunning())
{
// qDebug() << "ScribusView-changed(): changed region:" << re;
m_canvas->m_viewMode.forceRedraw = true;
@@ -895,7 +895,7 @@
e->acceptProposedAction();
//<<#3524
activateWindow();
- if (!m_ScMW->ScriptRunning)
+ if (!m_ScMW->scriptIsRunning())
raise();
m_ScMW->newActWin(Doc->WinHan);
updateContents();
@@ -2423,7 +2423,7 @@
void ScribusView::setRulerPos(int x, int y)
{
- if (m_ScMW->ScriptRunning)
+ if (m_ScMW->scriptIsRunning())
return;
if (Doc->guidesSettings.rulerMode)
{
@@ -2498,7 +2498,7 @@
void ScribusView::reformPages(bool moveObjects)
{
Doc->reformPages(moveObjects);
- if (!m_ScMW->ScriptRunning)
+ if (!m_ScMW->scriptIsRunning())
setContentsPos(qRound((Doc->currentPage()->xOffset()-10 - 0*Doc->minCanvasCoordinate.x()) * m_canvas->scale()), qRound((Doc->currentPage()->yOffset()-10 - 0*Doc->minCanvasCoordinate.y()) * m_canvas->scale()));
if (!Doc->isLoading())
{
@@ -2666,7 +2666,7 @@
void ScribusView::setMenTxt(int Seite)
{
- if (m_ScMW->ScriptRunning)
+ if (m_ScMW->scriptIsRunning())
return;
disconnect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(GotoPa(int)));
pageSelector->setMaximum(Doc->masterPageMode() ? 1 : Doc->Pages->count());
@@ -2778,7 +2778,7 @@
{
// qDebug("ScribusView::DrawNew");
// printBacktrace(24);
- if (m_ScMW->ScriptRunning)
+ if (m_ScMW->scriptIsRunning())
return;
m_canvas->m_viewMode.forceRedraw = true;
m_canvas->resetRenderMode();
@@ -2792,7 +2792,7 @@
void ScribusView::SetCCPo(double x, double y)
{
- if (m_ScMW->ScriptRunning)
+ if (m_ScMW->scriptIsRunning())
return;
QPoint nx = m_canvas->canvasToLocal(FPoint(x, y));
QSize viewsize = viewport()->size();
@@ -2802,7 +2802,7 @@
void ScribusView::SetCPo(double x, double y)
{
- if (m_ScMW->ScriptRunning)
+ if (m_ScMW->scriptIsRunning())
return;
QPoint nx = m_canvas->canvasToLocal(FPoint(x, y));
setContentsPos(nx.x(), nx.y());
@@ -2867,7 +2867,7 @@
void ScribusView::GotoPage(int Seite)
{
Doc->setCurrentPage(Doc->Pages->at(Seite));
- if (m_ScMW->ScriptRunning)
+ if (m_ScMW->scriptIsRunning())
return;
setMenTxt(Seite);
SetCPo(Doc->currentPage()->xOffset() - 10, Doc->currentPage()->yOffset() - 10);
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp (revision 14754)
+++ scribus/scribus.cpp (revision 14755)
@@ -420,7 +420,7 @@
void ScribusMainWindow::initDefaultValues()
{
HaveDoc = false;
- ScriptRunning = false;
+ ScriptRunning = 0;
view = NULL;
doc = NULL;
DocNr = 1;
@@ -3902,7 +3902,7 @@
view->updatesOn(false);
doc->SoftProofing = false;
doc->Gamut = false;
- ScriptRunning = true;
+ setScriptRunning(true);
bool loadSuccess=fileLoader->LoadFile(doc);
//Do the font replacement check from here, when we have a GUI. TODO do this also somehow without the GUI
//This also gives the user the opportunity to cancel the load when finding theres a replacement required.
@@ -3917,7 +3917,7 @@
delete w;
view=NULL;
doc=NULL;
- ScriptRunning = false;
+ setScriptRunning(false);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
mainWindowStatusLabel->setText("");
mainWindowProgressBar->reset();
@@ -3931,7 +3931,7 @@
fileLoader->informReplacementFonts();
setCurrentComboItem(view->unitSwitcher, unitGetStrFromIndex(doc->unitIndex()));
view->unitChange();
- ScriptRunning = false;
+ setScriptRunning(false);
view->Deselect(true);
mainWindowStatusLabel->setText("");
mainWindowProgressBar->reset();
@@ -6583,7 +6583,7 @@
void ScribusMainWindow::setMainWindowActive()
{
activateWindow();
- if (!ScriptRunning)
+ if (!scriptIsRunning())
raise();
}
@@ -7676,7 +7676,7 @@
// pdfToolBar->initVisibility();
activateWindow();
- if (!ScriptRunning)
+ if (!scriptIsRunning())
raise();
}
Index: scribus/propertiespalette.cpp
===================================================================
--- scribus/propertiespalette.cpp (revision 14754)
+++ scribus/propertiespalette.cpp (revision 14755)
@@ -1635,7 +1635,7 @@
void PropertiesPalette::closeEvent(QCloseEvent *closeEvent)
{
- if (m_ScMW && !m_ScMW->ScriptRunning)
+ if (m_ScMW && !m_ScMW->scriptIsRunning())
{
if ((HaveDoc) && (HaveItem))
{
@@ -1674,7 +1674,7 @@
void PropertiesPalette::SelTab(int t)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
// fix for #5991: Property Palette text input box focus stays even when on another tab
// Disable widgets in all pages except current one - PV
@@ -1820,7 +1820,7 @@
void PropertiesPalette::setDoc(ScribusDoc *d)
{
- if(doc == d || (m_ScMW && m_ScMW->ScriptRunning))
+ if(doc == d || (m_ScMW && m_ScMW->scriptIsRunning()))
return;
disconnect(this->Cpal, SIGNAL(NewTrans(double)), 0, 0);
@@ -1961,7 +1961,7 @@
void PropertiesPalette::setTextFlowMode(PageItem::TextFlowMode mode)
{
- if (!m_ScMW || m_ScMW->ScriptRunning || !HaveItem)
+ if (!m_ScMW || m_ScMW->scriptIsRunning() || !HaveItem)
return;
if (CurItem->isGroupControl)
{
@@ -2001,7 +2001,7 @@
void PropertiesPalette::SetCurItem(PageItem *i)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
//CB We shouldnt really need to process this if our item is the same one
//maybe we do if the item has been changed by scripter.. but that should probably
@@ -2396,7 +2396,7 @@
void PropertiesPalette::NewSel(int nr)
{
- if (!HaveDoc || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
return;
int visID;
PageItem *i=0;
@@ -2755,7 +2755,7 @@
void PropertiesPalette::setXY(double x, double y)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
@@ -2823,7 +2823,7 @@
void PropertiesPalette::setBH(double x, double y)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -2850,7 +2850,7 @@
void PropertiesPalette::setR(double r)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
double rr = r;
@@ -2863,7 +2863,7 @@
void PropertiesPalette::setRR(double r)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -2873,7 +2873,7 @@
void PropertiesPalette::setCols(int r, double g)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -2924,7 +2924,7 @@
void PropertiesPalette::setLsp(double r)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -2948,7 +2948,7 @@
void PropertiesPalette::setTextToFrameDistances(double left, double top, double bottom, double right)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -2961,7 +2961,7 @@
void PropertiesPalette::setFontFace(const QString& newFont)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -2974,7 +2974,7 @@
void PropertiesPalette::setSize(double s)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -2984,7 +2984,7 @@
void PropertiesPalette::setExtra(double e)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -2994,7 +2994,7 @@
void PropertiesPalette::ChangeScaling()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (FreeScale == sender())
{
@@ -3031,7 +3031,7 @@
void PropertiesPalette::setScaleAndOffset(double scx, double scy, double x, double y)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -3075,7 +3075,7 @@
void PropertiesPalette::setLineWidth(double s)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -3098,7 +3098,7 @@
void PropertiesPalette::setLIvalue(Qt::PenStyle p, Qt::PenCapStyle pc, Qt::PenJoinStyle pj)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -3180,7 +3180,7 @@
void PropertiesPalette::updateStyle(const ParagraphStyle& newCurrent)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -3209,7 +3209,7 @@
void PropertiesPalette::setStil(int s)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
StrokeIcon->setEnabled(false);
TxStroke->setEnabled(false);
@@ -3225,7 +3225,7 @@
void PropertiesPalette::setAli(int e)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -3237,7 +3237,7 @@
void PropertiesPalette::setParStyle(const QString& name)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -3248,7 +3248,7 @@
void PropertiesPalette::setCharStyle(const QString& name)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -3258,7 +3258,7 @@
void PropertiesPalette::setOpticalMargins()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
int omt(ParagraphStyle::OM_None);
// if (optMarginCheckLeftProtruding->isChecked()) omt+=ParagraphStyle::OM_LeftProtruding;
@@ -3274,7 +3274,7 @@
void PropertiesPalette::resetOpticalMargins()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_resetOpticalMargins();
}
@@ -3295,7 +3295,7 @@
void PropertiesPalette::setMinWordTracking()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
ParagraphStyle newStyle;
newStyle.setMinWordTracking(minWordTrackingSpinBox->value() / 100.0);
@@ -3305,7 +3305,7 @@
void PropertiesPalette::setNormWordTracking()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
ParagraphStyle newStyle;
// newStyle.setNormWordTracking(percent / 100.0);
@@ -3315,7 +3315,7 @@
void PropertiesPalette::setMinGlyphExtension()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
ParagraphStyle newStyle;
newStyle.setMinGlyphExtension(minGlyphExtSpinBox->value() / 100.0);
@@ -3324,7 +3324,7 @@
void PropertiesPalette::setMaxGlyphExtension()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
ParagraphStyle newStyle;
newStyle.setMaxGlyphExtension(maxGlyphExtSpinBox->value() / 100.0);
@@ -3334,7 +3334,7 @@
void PropertiesPalette::setTScaleV(double e)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -3344,21 +3344,21 @@
void PropertiesPalette::NewTScaleV()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetScaleV(qRound(ChScaleV->value() * 10));
}
void PropertiesPalette::NewTBase()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetBaselineOffset(qRound(ChBase->value() * 10));
}
void PropertiesPalette::setTScale(double e)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -3368,7 +3368,7 @@
void PropertiesPalette::setTBase(double e)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
bool tmp = HaveItem;
HaveItem = false;
@@ -3378,14 +3378,14 @@
void PropertiesPalette::NewTScale()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetScaleH(qRound(ChScale->value() * 10));
}
void PropertiesPalette::NewX()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -3467,7 +3467,7 @@
void PropertiesPalette::NewY()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
double x,y,w,h, gx, gy, gh, gw, base;
@@ -3547,7 +3547,7 @@
void PropertiesPalette::NewW()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
double x,y,w,h, gx, gy, gh, gw;
@@ -3654,7 +3654,7 @@
void PropertiesPalette::NewH()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -3763,7 +3763,7 @@
void PropertiesPalette::setRotation()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
double gx, gy, gh, gw;
if ((HaveDoc) && (HaveItem))
@@ -3792,7 +3792,7 @@
void PropertiesPalette::NewCornerRadius()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
CurItem->setCornerRadius(RoundRect->value() / m_unitRatio);
m_ScMW->view->SetFrameRounded();
@@ -3802,14 +3802,14 @@
void PropertiesPalette::NewLineSpacing()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetLineSpacing(LineSp->value());
}
void PropertiesPalette::HandleGapSwitch()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
setCols(CurItem->Cols, CurItem->ColGap);
dGap->setToolTip("");
@@ -3822,7 +3822,7 @@
void PropertiesPalette::NewCols()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
CurItem->Cols = DCol->value();
setCols(CurItem->Cols, CurItem->ColGap);
@@ -3832,7 +3832,7 @@
void PropertiesPalette::NewPage()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
bool reallynew = (CurItem->pixm.imgInfo.actualPageNumber != imagePageNumber->value());
CurItem->pixm.imgInfo.actualPageNumber = imagePageNumber->value();
@@ -3843,7 +3843,7 @@
void PropertiesPalette::NewGap()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
if (colgapLabel->currentIndex() == 0)
CurItem->ColGap = dGap->value() / m_unitRatio;
@@ -3864,28 +3864,28 @@
void PropertiesPalette::NewSize()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetFontSize(qRound(Size->value()*10.0));
}
void PropertiesPalette::NewTracking()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetTracking(qRound(Extra->value() * 10.0));
}
void PropertiesPalette::NewLocalXY()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetImageOffset(imageXOffsetSpinBox->value() / m_unitRatio / CurItem->imageXScale(), imageYOffsetSpinBox->value() / m_unitRatio / CurItem->imageYScale());
}
void PropertiesPalette::NewLocalSC()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -3905,7 +3905,7 @@
void PropertiesPalette::NewLocalDpi()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -3926,14 +3926,14 @@
void PropertiesPalette::handleImageEffects()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->ImageEffects();
}
void PropertiesPalette::handleExtImgProperties()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->view->editExtendedImageProperties();
emit DocChanged();
@@ -3941,7 +3941,7 @@
void PropertiesPalette::NewLineWidth()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -3971,14 +3971,14 @@
void PropertiesPalette::setStartArrow(int id)
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_ApplyArrowHead(id,-1);
}
void PropertiesPalette::setEndArrow(int id)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
doc->itemSelection_ApplyArrowHead(-1, id);
@@ -3986,7 +3986,7 @@
void PropertiesPalette::NewLineStyle()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -4023,7 +4023,7 @@
void PropertiesPalette::dashChange()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -4039,7 +4039,7 @@
void PropertiesPalette::NewLineMode()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (LineMode->currentIndex() == 0)
{
@@ -4069,7 +4069,7 @@
void PropertiesPalette::NewLineJoin()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
Qt::PenJoinStyle c = Qt::MiterJoin;
switch (LJoinStyle->currentIndex())
@@ -4090,7 +4090,7 @@
void PropertiesPalette::NewLineEnd()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
Qt::PenCapStyle c = Qt::FlatCap;
switch (LEndStyle->currentIndex())
@@ -4111,7 +4111,7 @@
void PropertiesPalette::ToggleKette()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
@@ -4151,7 +4151,7 @@
void PropertiesPalette::ToggleKetteD()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
disconnect(imgDpiX, SIGNAL(valueChanged(double)), this, SLOT(HChangeD()));
disconnect(imgDpiY, SIGNAL(valueChanged(double)), this, SLOT(VChangeD()));
@@ -4191,14 +4191,14 @@
void PropertiesPalette::NewAlignement(int a)
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetAlignment(a);
}
void PropertiesPalette::setTypeStyle(int s)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
emit NewEffects(s);
}
@@ -4215,7 +4215,7 @@
void PropertiesPalette::setShadowOffs(double x, double y)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
disconnect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
disconnect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
@@ -4237,7 +4237,7 @@
void PropertiesPalette::setUnderline(double p, double w)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
disconnect(SeStyle->UnderlineVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
disconnect(SeStyle->UnderlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newUnderline()));
@@ -4259,7 +4259,7 @@
void PropertiesPalette::setStrike(double p, double w)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
disconnect(SeStyle->StrikeVal->LPos, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
disconnect(SeStyle->StrikeVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newStrike()));
@@ -4271,7 +4271,7 @@
void PropertiesPalette::setOutlineW(double x)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
disconnect(SeStyle->OutlineVal->LWidth, SIGNAL(valueChanged(double)), this, SLOT(newOutlineW()));
SeStyle->OutlineVal->LWidth->setValue(x / 10.0);
@@ -4287,35 +4287,35 @@
void PropertiesPalette::DoLower()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->view->LowerItem();
}
void PropertiesPalette::DoRaise()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->view->RaiseItem();
}
void PropertiesPalette::DoFront()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->view->ToFront();
}
void PropertiesPalette::DoBack()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->view->ToBack();
}
void PropertiesPalette::NewRotMode(int m)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
double inX, inY, gx, gy, gh, gw;
inX = 0;
@@ -4424,7 +4424,7 @@
void PropertiesPalette::DoFlow()
{
PageItem::TextFlowMode mode = PageItem::TextFlowDisabled;
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -4462,7 +4462,7 @@
void PropertiesPalette::MakeIrre(int f, int c, qreal *vals)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -4528,7 +4528,7 @@
void PropertiesPalette::handleShapeEdit()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -4540,7 +4540,7 @@
void PropertiesPalette::NewTDist()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -4553,7 +4553,7 @@
void PropertiesPalette::NewSpGradient(double x1, double y1, double x2, double y2)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -4571,7 +4571,7 @@
void PropertiesPalette::toggleGradientEdit()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -4585,14 +4585,14 @@
void PropertiesPalette::NewTFont(QString c)
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
emit NewFont(c);
}
void PropertiesPalette::DoRevert()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
bool setter=Revert->isChecked();
CurItem->setImageFlippedH(setter);
@@ -4604,7 +4604,7 @@
void PropertiesPalette::doClearCStyle()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (HaveDoc)
{
@@ -4615,7 +4615,7 @@
void PropertiesPalette::doClearPStyle()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (HaveDoc)
{
@@ -4628,7 +4628,7 @@
void PropertiesPalette::SetLineFormats(ScribusDoc *dd)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
disconnect(StyledLine, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SetSTline(QListWidgetItem*)));
StyledLine->clear();
@@ -4647,7 +4647,7 @@
void PropertiesPalette::SetSTline(QListWidgetItem *c)
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (c == NULL)
return;
@@ -4661,7 +4661,7 @@
void PropertiesPalette::updateColorList()
{
- if (!HaveDoc || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !m_ScMW || m_ScMW->scriptIsRunning())
return;
Cpal->SetColors(doc->PageColors);
Cpal->SetPatterns(&doc->docPatterns);
@@ -4674,7 +4674,7 @@
void PropertiesPalette::updateCmsList()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (HaveDoc)
{
@@ -4741,21 +4741,21 @@
void PropertiesPalette::ChangeProfile(const QString& prn)
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetColorProfile(InputP->currentText());
}
void PropertiesPalette::ChangeIntent()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetRenderIntent(MonitorI->currentIndex());
}
void PropertiesPalette::ShowCMS()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if (HaveItem)
updateCmsList();
@@ -4765,21 +4765,21 @@
void PropertiesPalette::newTxtFill()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetFillColor(TxFill->currentColor());
}
void PropertiesPalette::newTxtStroke()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetStrokeColor(TxStroke->currentColor());
}
void PropertiesPalette::setActShade()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
int b;
if (PM1 == sender())
@@ -4796,7 +4796,7 @@
void PropertiesPalette::setActFarben(QString p, QString b, double shp, double shb)
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
ColorList::Iterator it;
int c = 0;
@@ -4829,28 +4829,28 @@
void PropertiesPalette::handleLock()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->scrActions["itemLock"]->toggle();
}
void PropertiesPalette::handleLockSize()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->scrActions["itemLockSize"]->toggle();
}
void PropertiesPalette::handlePrint()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->scrActions["itemPrintingEnabled"]->toggle();
}
void PropertiesPalette::handleFlipH()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->scrActions["itemFlipH"]->toggle();
/*
@@ -4867,7 +4867,7 @@
void PropertiesPalette::handleFlipV()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
m_ScMW->scrActions["itemFlipV"]->toggle();
/*
@@ -4885,7 +4885,7 @@
void PropertiesPalette::handlePathType()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
CurItem->textPathType = pathTextType->currentIndex();
CurItem->update();
@@ -4894,7 +4894,7 @@
void PropertiesPalette::handlePathFlip()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
CurItem->textPathFlipped = flippedPathText->isChecked();
CurItem->updatePolyClip();
@@ -4904,7 +4904,7 @@
void PropertiesPalette::handlePathLine()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
CurItem->PoShow = showcurveCheckBox->isChecked();
CurItem->update();
@@ -4913,7 +4913,7 @@
void PropertiesPalette::handlePathDist()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
CurItem->setTextToFrameDistLeft(Dist->value());
doc->AdjustItemSize(CurItem);
@@ -4924,7 +4924,7 @@
void PropertiesPalette::handlePathOffs()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
CurItem->BaseOffs = -LineW->value();
doc->AdjustItemSize(CurItem);
@@ -4935,7 +4935,7 @@
void PropertiesPalette::handleFillRule()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
CurItem->fillRule = EvenOdd->isChecked();
CurItem->update();
@@ -4944,14 +4944,14 @@
void PropertiesPalette::handleOverprint()
{
- if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+ if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->scriptIsRunning())
return;
doc->itemSelection_SetOverprint(Overprint->isChecked());
}
void PropertiesPalette::NewName()
{
- if (m_ScMW->ScriptRunning || !HaveDoc || !HaveItem)
+ if (m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
return;
QString NameOld = CurItem->itemName();
QString NameNew = NameEdit->text();
@@ -4990,7 +4990,7 @@
{
QStringList sortList;
QMap<QString,QString>::Iterator it;
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
langCombo->clear();
for (it = langMap.begin(); it != langMap.end(); ++it)
@@ -5698,7 +5698,7 @@
void PropertiesPalette::handleShapeEdit2()
{
- if (!m_ScMW || m_ScMW->ScriptRunning)
+ if (!m_ScMW || m_ScMW->scriptIsRunning())
return;
if ((HaveDoc) && (HaveItem))
{
@@ -5728,7 +5728,7 @@
void PropertiesPalette::flop(int radioFlop)
{
- if (!m_ScMW || m_ScMW->ScriptRunning || !HaveDoc || !HaveItem)
+ if (!m_ScMW || m_ScMW->scriptIsRunning() || !HaveDoc || !HaveItem)
return;
// qDebug("%s", QString("rF %1").arg(radioFlop).toAscii());
if( radioFlop == 0)
@@ -5742,3 +5742,4 @@
}
+
Index: scribus/outlinepalette.cpp
===================================================================
--- scribus/outlinepalette.cpp (revision 14754)
+++ scribus/outlinepalette.cpp (revision 14755)
@@ -237,7 +237,7 @@
void OutlinePalette::slotRightClick(QPoint point)
{
- if (!m_MainWindow || m_MainWindow->ScriptRunning)
+ if (!m_MainWindow || m_MainWindow->scriptIsRunning())
return;
QTreeWidgetItem *ite = reportDisplay->itemAt(point);
if (ite == NULL)
@@ -271,7 +271,7 @@
void OutlinePalette::slotDoRename(QTreeWidgetItem *ite , int col)
{
- if (!m_MainWindow || m_MainWindow->ScriptRunning)
+ if (!m_MainWindow || m_MainWindow->scriptIsRunning())
return;
disconnect(reportDisplay, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(slotDoRename(QTreeWidgetItem*, int)));
OutlineTreeItem *item = (OutlineTreeItem*)ite;
@@ -387,7 +387,7 @@
void OutlinePalette::slotShowSelect(uint SNr, int Nr)
{
- if (!m_MainWindow || m_MainWindow->ScriptRunning)
+ if (!m_MainWindow || m_MainWindow->scriptIsRunning())
return;
if (currDoc==NULL)
return;
@@ -480,7 +480,7 @@
void OutlinePalette::reopenTree()
{
- if (!m_MainWindow || m_MainWindow->ScriptRunning)
+ if (!m_MainWindow || m_MainWindow->scriptIsRunning())
return;
if (currDoc->OpenNodes.count() == 0)
return;
@@ -535,7 +535,7 @@
void OutlinePalette::slotMultiSelect()
{
- if (!m_MainWindow || m_MainWindow->ScriptRunning)
+ if (!m_MainWindow || m_MainWindow->scriptIsRunning())
return;
if (currDoc==NULL)
return;
@@ -588,7 +588,7 @@
void OutlinePalette::slotSelect(QTreeWidgetItem* ite, int col)
{
- if (!m_MainWindow || m_MainWindow->ScriptRunning)
+ if (!m_MainWindow || m_MainWindow->scriptIsRunning())
return;
selectionTriggered = true;
OutlineTreeItem *item = (OutlineTreeItem*)ite;
@@ -644,7 +644,7 @@
*/
void OutlinePalette::BuildTree(bool storeVals)
{
- if (!m_MainWindow || m_MainWindow->ScriptRunning)
+ if (!m_MainWindow || m_MainWindow->scriptIsRunning())
return;
if (currDoc==NULL)
return;
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp (revision 14754)
+++ scribus/scribusdoc.cpp (revision 14755)
@@ -8983,7 +8983,7 @@
DoDrawing = false;
view()->updatesOn(false);
m_Selection->delaySignalsOn();
- m_ScMW->ScriptRunning = true;
+ m_ScMW->setScriptRunning(true);
if (mdData.type==0) // Copy and offset or set a gap
{
double dH = mdData.copyShiftGapH / docUnitRatio;
@@ -9073,7 +9073,7 @@
DoDrawing = true;
m_Selection->delaySignalsOff();
view()->updatesOn(true);
- m_ScMW->ScriptRunning = false;
+ m_ScMW->setScriptRunning(false);
//FIXME: stop using m_View
m_View->Deselect(true);
view()->DrawNew();
Index: scribus/plugins/scriptplugin/scriptercore.cpp
===================================================================
--- scribus/plugins/scriptplugin/scriptercore.cpp (revision 14754)
+++ scribus/plugins/scriptplugin/scriptercore.cpp (revision 14755)
@@ -266,7 +266,7 @@
{
ScCore->primaryMainWindow()->propertiesPalette->unsetDoc();
ScCore->primaryMainWindow()->pagePalette->setView(NULL);
- ScCore->primaryMainWindow()->ScriptRunning = true;
+ ScCore->primaryMainWindow()->setScriptRunning(true);
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
// Create the sub-interpreter
// FIXME: This calls abort() in a Python debug build. We're doing something wrong.
@@ -371,15 +371,15 @@
Py_EndInterpreter(state);
PyEval_RestoreThread(stateo);
// qApp->restoreOverrideCursor();
+ ScCore->primaryMainWindow()->setScriptRunning(false);
}
- ScCore->primaryMainWindow()->ScriptRunning = false;
}
void ScripterCore::slotRunScript(const QString Script)
{
ScCore->primaryMainWindow()->propertiesPalette->unsetDoc();
ScCore->primaryMainWindow()->pagePalette->setView(NULL);
- ScCore->primaryMainWindow()->ScriptRunning = true;
+ ScCore->primaryMainWindow()->setScriptRunning(true);
inValue = Script;
QString cm;
cm = "# -*- coding: utf8 -*- \n";
@@ -442,7 +442,7 @@
// Because 'result' may be NULL, not a PyObject*, we must call PyXDECREF not Py_DECREF
Py_XDECREF(result);
}
- ScCore->primaryMainWindow()->ScriptRunning = false;
+ ScCore->primaryMainWindow()->setScriptRunning(false);
}
void ScripterCore::slotInteractiveScript(bool visible)
Index: scribus/plugins/wmfimplugin/wmfimport.cpp
===================================================================
--- scribus/plugins/wmfimplugin/wmfimport.cpp (revision 14754)
+++ scribus/plugins/wmfimplugin/wmfimport.cpp (revision 14755)
@@ -574,8 +574,7 @@
m_Doc->setLoading(true);
m_Doc->DoDrawing = false;
m_Doc->view()->updatesOn(false);
- bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
- m_Doc->scMW()->ScriptRunning = true;
+ m_Doc->scMW()->setScriptRunning(true);
qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
//gc->Family = m_Doc->toolSettings.defFont;
m_Doc->PageColors.ensureBlackAndWhite();
@@ -660,7 +659,7 @@
}
}
m_Doc->DoDrawing = true;
- m_Doc->scMW()->ScriptRunning = wasScriptRunning;
+ m_Doc->scMW()->setScriptRunning(false);
if (interactive)
m_Doc->setLoading(false);
qApp->setOverrideCursor(QCursor(Qt::ArrowCursor));
Index: scribus/plugins/aiimplugin/importai.cpp
===================================================================
--- scribus/plugins/aiimplugin/importai.cpp (revision 14754)
+++ scribus/plugins/aiimplugin/importai.cpp (revision 14755)
@@ -207,8 +207,7 @@
m_Doc->setLoading(true);
m_Doc->DoDrawing = false;
m_Doc->view()->updatesOn(false);
- bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
- m_Doc->scMW()->ScriptRunning = true;
+ m_Doc->scMW()->setScriptRunning(true);
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
QString CurDirP = QDir::currentPath();
QDir::setCurrent(fi.path());
@@ -276,7 +275,7 @@
}
}
m_Doc->DoDrawing = true;
- m_Doc->scMW()->ScriptRunning = wasScriptRunning;
+ m_Doc->scMW()->setScriptRunning(false);
m_Doc->setLoading(false);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -341,7 +340,7 @@
{
QDir::setCurrent(CurDirP);
m_Doc->DoDrawing = true;
- m_Doc->scMW()->ScriptRunning = wasScriptRunning;
+ m_Doc->scMW()->setScriptRunning(false);
m_Doc->view()->updatesOn(true);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
}
Index: scribus/plugins/tools/transform/transformeffect.cpp
===================================================================
--- scribus/plugins/tools/transform/transformeffect.cpp (revision 14754)
+++ scribus/plugins/tools/transform/transformeffect.cpp (revision 14755)
@@ -177,7 +177,7 @@
currDoc->DoDrawing = false;
currDoc->view()->updatesOn(false);
currDoc->m_Selection->delaySignalsOn();
- currDoc->scMW()->ScriptRunning = true;
+ currDoc->scMW()->setScriptRunning(true);
QMatrix comulatedMatrix = matrix;
PageItem *currItem = currDoc->m_Selection->itemAt(0);
Elements.append(currItem);
@@ -254,7 +254,7 @@
currDoc->DoDrawing = true;
currDoc->m_Selection->delaySignalsOff();
currDoc->view()->updatesOn(true);
- currDoc->scMW()->ScriptRunning = false;
+ currDoc->scMW()->setScriptRunning(false);
currDoc->m_Selection->connectItemToGUI();
}
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
Index: scribus/plugins/xfigimplugin/importxfig.cpp
===================================================================
--- scribus/plugins/xfigimplugin/importxfig.cpp (revision 14754)
+++ scribus/plugins/xfigimplugin/importxfig.cpp (revision 14755)
@@ -224,8 +224,7 @@
m_Doc->setLoading(true);
m_Doc->DoDrawing = false;
m_Doc->view()->updatesOn(false);
- bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
- m_Doc->scMW()->ScriptRunning = true;
+ m_Doc->scMW()->setScriptRunning(true);
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
QString CurDirP = QDir::currentPath();
QDir::setCurrent(fi.path());
@@ -294,7 +293,7 @@
}
}
m_Doc->DoDrawing = true;
- m_Doc->scMW()->ScriptRunning = wasScriptRunning;
+ m_Doc->scMW()->setScriptRunning(false);
m_Doc->setLoading(false);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -359,7 +358,7 @@
{
QDir::setCurrent(CurDirP);
m_Doc->DoDrawing = true;
- m_Doc->scMW()->ScriptRunning = wasScriptRunning;
+ m_Doc->scMW()->setScriptRunning(false);
m_Doc->view()->updatesOn(true);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
}
Index: scribus/plugins/svgimplugin/svgplugin.cpp
===================================================================
--- scribus/plugins/svgimplugin/svgplugin.cpp (revision 14754)
+++ scribus/plugins/svgimplugin/svgplugin.cpp (revision 14755)
@@ -305,8 +305,7 @@
m_Doc->setLoading(true);
m_Doc->DoDrawing = false;
m_Doc->view()->updatesOn(false);
- bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
- m_Doc->scMW()->ScriptRunning = true;
+ m_Doc->scMW()->setScriptRunning(true);
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
gc->FontFamily = m_Doc->toolSettings.defFont;
if (!m_Doc->PageColors.contains("Black"))
@@ -423,7 +422,7 @@
}
}
m_Doc->DoDrawing = true;
- m_Doc->scMW()->ScriptRunning = wasScriptRunning;
+ m_Doc->scMW()->setScriptRunning(false);
if (interactive)
m_Doc->setLoading(false);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
Index: scribus/plugins/fileloader/oodraw/oodrawimp.cpp
===================================================================
--- scribus/plugins/fileloader/oodraw/oodrawimp.cpp (revision 14754)
+++ scribus/plugins/fileloader/oodraw/oodrawimp.cpp (revision 14755)
@@ -387,8 +387,7 @@
m_Doc->setLoading(true);
m_Doc->DoDrawing = false;
m_Doc->view()->updatesOn(false);
- bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
- m_Doc->scMW()->ScriptRunning = true;
+ m_Doc->scMW()->setScriptRunning(true);
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
if (!m_Doc->PageColors.contains("Black"))
m_Doc->PageColors.insert("Black", ScColor(0, 0, 0, 255));
@@ -483,7 +482,7 @@
}
}
m_Doc->DoDrawing = true;
- m_Doc->scMW()->ScriptRunning = wasScriptRunning;
+ m_Doc->scMW()->setScriptRunning(false);
if (interactive)
m_Doc->setLoading(false);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
@@ -2015,3 +2014,4 @@
}
+
Index: scribus/plugins/psimport/importps.cpp
===================================================================
--- scribus/plugins/psimport/importps.cpp (revision 14754)
+++ scribus/plugins/psimport/importps.cpp (revision 14755)
@@ -222,8 +222,7 @@
m_Doc->setLoading(true);
m_Doc->DoDrawing = false;
m_Doc->view()->updatesOn(false);
- bool wasScriptRunning = m_Doc->scMW()->ScriptRunning;
- m_Doc->scMW()->ScriptRunning = true;
+ m_Doc->scMW()->setScriptRunning(true);
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
QString CurDirP = QDir::currentPath();
QDir::setCurrent(fi.path());
@@ -294,7 +293,7 @@
}
}
m_Doc->DoDrawing = true;
- m_Doc->scMW()->ScriptRunning = wasScriptRunning;
+ m_Doc->scMW()->setScriptRunning(false);
m_Doc->setLoading(false);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
if ((Elements.count() > 0) && (!ret) && (interactive))
@@ -359,7 +358,7 @@
{
QDir::setCurrent(CurDirP);
m_Doc->DoDrawing = true;
- m_Doc->scMW()->ScriptRunning = wasScriptRunning;
+ m_Doc->scMW()->setScriptRunning(false);
m_Doc->view()->updatesOn(true);
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
}
Index: scribus/scribus.h
===================================================================
--- scribus/scribus.h (revision 14754)
+++ scribus/scribus.h (revision 14755)
@@ -141,6 +141,9 @@
void setDefaultPrinter(const QString&, const QString&, const QString&);
void getDefaultPrinter(QString& name, QString& file, QString& command);
+ inline bool scriptIsRunning(void) const { return (ScriptRunning > 0); }
+ inline void setScriptRunning(bool value) { ScriptRunning += (value ? 1 : -1); }
+
ScribusDoc *doFileNew(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString& defaultPageSize, bool requiresGUI, int pageCount=1, bool showView=true, int marginPreset=0);
ScribusDoc *newDoc(double width, double height, double topMargin, double leftMargin, double rightMargin, double bottomMargin, double columnDistance, double columnCount, bool autoTextFrames, int pageArrangement, int unitIndex, int firstPageLocation, int orientation, int firstPageNumber, const QString& defaultPageSize, bool requiresGUI, int pageCount=1, bool showView=true, int marginPreset=0);
bool DoFileSave(const QString& fileName, QString* savedFileName = NULL);
@@ -227,7 +230,6 @@
ScribusWin* ActWin;
QClipboard *ClipB;
QString LoadEnc;
- bool ScriptRunning;
QMap<QString, QStringList> InstLang;
QMap<QString,QString> LangTransl;
@@ -581,6 +583,8 @@
void ToggleFrameEdit();
void NoFrameEdit();
+ int ScriptRunning;
+
QLabel* mainWindowStatusLabel;
QString recentFileMenuName;
QString recentPasteMenuName;
More information about the scribus-commit
mailing list