322,7 → 322,7 |
qApp->setStyleSheet(QString(stylesheet)); |
} |
|
qApp->setLayoutDirection(QLocale(ScCore->getGuiLanguage()).textDirection()); |
QApplication::setLayoutDirection(QLocale(ScCore->getGuiLanguage()).textDirection()); |
previewDinUse = false; |
printDinUse = false; |
internalCopy = false; |
364,7 → 364,7 |
initDefaultValues(); |
initStatusBar(); |
|
qApp->processEvents(); |
QApplication::processEvents(); |
|
actionManager->init(this); |
|
530,7 → 530,7 |
|
void ScribusMainWindow::getScreenPosition(int& xPos, int& yPos) const |
{ |
QScreen* screen(getScreen()); |
const QScreen* screen(getScreen()); |
QRect screenGeom = screen->geometry(); |
xPos = screenGeom.left(); |
yPos = screenGeom.top(); |
538,7 → 538,7 |
|
void ScribusMainWindow::getScreenDPI(int& dpiX, int& dpiY) const |
{ |
QScreen* screen(getScreen()); |
const QScreen* screen(getScreen()); |
dpiX = screen->physicalDotsPerInchX(); |
dpiY = screen->physicalDotsPerInchY(); |
} |
2269,7 → 2269,7 |
nftdialog* nftdia = new nftdialog(this, ScCore->getGuiLanguage()); |
if (nftdia->exec() && nftdia->isTemplateSelected()) |
{ |
qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
nfttemplate* currentTemplate = nftdia->currentTemplate(); |
if (loadDoc(QDir::cleanPath(currentTemplate->file))) |
{ |
2280,7 → 2280,7 |
QDir::setCurrent(PrefsManager::instance().documentDir()); |
removeRecent(QDir::cleanPath(currentTemplate->file)); |
} |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
} |
delete nftdia; |
} |
3152,7 → 3152,7 |
activeTransaction = m_undoManager->beginTransaction(Um::ImportPage, Um::IGroup, Um::ImportPage, nullptr, Um::ILock); |
|
m_mainWindowStatusLabel->setText( tr("Importing Pages...")); |
qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
std::vector<int> pageNs; |
parsePagesString(dia->getPageNumbers(), &pageNs, dia->getPageCounter()); |
int startPage=0, nrToImport=pageNs.size(); |
3179,7 → 3179,7 |
startPage = doc->currentPage()->pageNr() + 1; |
if (nrToImport > (doc->DocPages.count() - doc->currentPage()->pageNr())) |
{ |
qApp->setOverrideCursor(QCursor(Qt::ArrowCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); |
ScMessageBox msgBox; |
msgBox.setIcon(QMessageBox::Information); |
msgBox.setText(tr("Import Page(s)")); |
3209,7 → 3209,7 |
doIt = false; |
m_mainWindowStatusLabel->setText(""); |
} |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
} |
} |
if (doIt) |
3236,7 → 3236,7 |
doIt = false; |
} |
} |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
ret = doIt; |
|
if (activeTransaction) |
3309,7 → 3309,7 |
return false; |
} |
|
qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
if (HaveDoc) |
outlinePalette->buildReopenVals(); |
bool ret = false; |
3335,7 → 3335,7 |
|
if (docNameUnmodified == platfName) |
{ |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
ScMessageBox::information(this, tr("Document is already opened"), tr("This document is already open. It will be set as the active document.")); |
windowsMenuActivated(i); |
return true; |
3349,7 → 3349,7 |
if (testResult == -1) |
{ |
delete fileLoader; |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
QString title = tr("Fatal Error") ; |
QString msg = "<qt>"+ tr("File %1 is not in an acceptable format").arg(filename)+"</qt>"; |
QString infoMsg = "<qt>" + tr("The file may be damaged or may have been produced in a later version of Scribus.") + "</qt>"; |
3363,7 → 3363,7 |
bool is12doc=false; |
if (testResult == 0) |
{ |
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor)); |
QApplication::changeOverrideCursor(QCursor(Qt::ArrowCursor)); |
//Scribus 1.3.x warning, remove at a later stage |
is12doc=true; |
} |
3425,7 → 3425,7 |
view = nullptr; |
doc = nullptr; |
setScriptRunning(false); |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
m_mainWindowStatusLabel->setText(""); |
mainWindowProgressBar->reset(); |
ActWin = nullptr; |
3553,7 → 3553,7 |
} |
if (missingMap.count() > 0) |
{ |
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor)); |
QApplication::changeOverrideCursor(QCursor(Qt::ArrowCursor)); |
QString mess = tr("Some color profiles used by this document are not installed:")+"\n\n"; |
for (auto it = missingMap.constBegin(); it != missingMap.constEnd(); ++it) |
{ |
3712,7 → 3712,7 |
|
m_undoManager->switchStack(doc->documentFileName()); |
pagePalette->rebuild(); |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
doc->setModified(false); |
foreach (NotesStyle* NS, doc->m_docNotesStylesList) |
doc->updateNotesFramesStyles(NS); |
3752,7 → 3752,7 |
QString docDir = dirsContext->get("images", prefsDocDir.isEmpty() ? "." : prefsDocDir); |
|
QStringList fileNames; |
CustomFDialog *dia = new CustomFDialog(qApp->activeWindow(), docDir, tr("Open"), formatD, fdShowPreview | fdExistingFilesI | fdDisableOk); |
CustomFDialog *dia = new CustomFDialog(QApplication::activeWindow(), docDir, tr("Open"), formatD, fdShowPreview | fdExistingFilesI | fdDisableOk); |
if (dia->exec() == QDialog::Accepted) |
fileNames = dia->selectedFiles(); |
delete dia; |
3895,8 → 3895,8 |
currItem->EmbeddedProfile.clear(); |
currItem->ImageProfile = doc->cmsSettings().DefaultImageRGBProfile; |
currItem->ImageIntent = doc->cmsSettings().DefaultIntentImages; |
qApp->setOverrideCursor( QCursor(Qt::WaitCursor) ); |
qApp->processEvents(QEventLoop::ExcludeUserInputEvents); |
QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
|
currItem->isInlineImage = true; |
currItem->isTempFile = true; |
3905,11 → 3905,11 |
// Call to showScaleAndOffset() is now very likely unnecessary |
// due to mechanisms used to update properties in PP in 1.5.x+ |
//propertiesPalette->imagePal->showScaleAndOffset(currItem->imageXScale(), currItem->imageYScale(), currItem->imageXOffset(), currItem->imageYOffset()); |
qApp->processEvents(QEventLoop::ExcludeUserInputEvents); |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
view->DrawNew(); |
emit UpdateRequest(reqColorsUpdate | reqCmsOptionsUpdate); |
currItem->emitAllToGUI(); |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
} |
|
void ScribusMainWindow::toogleInlineState() |
4018,7 → 4018,7 |
if (doc==storyEditor->currentDocument()) |
storyEditor->close(); |
slotFileClose(); |
qApp->processEvents(); |
QApplication::processEvents(); |
loadDoc(fn); |
m_undoManager->clearStack(); |
} |
4120,7 → 4120,7 |
m_mainWindowStatusLabel->setText( tr("Saving...")); |
mainWindowProgressBar->reset(); |
bool ret = doc->save(fileName, savedFileName); |
qApp->processEvents(); |
QApplication::processEvents(); |
if (ret) |
{ |
updateActiveWindowCaption(fileName); |
4289,15 → 4289,20 |
QFileInfo fi(doc->documentFileName()); |
QString completeBaseName = fi.completeBaseName(); |
if (completeBaseName.endsWith(".sla", Qt::CaseInsensitive)) |
if (completeBaseName.length() > 4) completeBaseName.chop(4); |
{ |
if (completeBaseName.length() > 4) |
completeBaseName.chop(4); |
} |
if (completeBaseName.endsWith(".gz", Qt::CaseInsensitive)) |
if (completeBaseName.length() > 3) completeBaseName.chop(3); |
doc->Print_Options.filename = fi.path()+"/"+completeBaseName+".ps"; |
{ |
if (completeBaseName.length() > 3) |
completeBaseName.chop(3); |
} |
doc->Print_Options.filename = fi.path() + "/" + completeBaseName + ".ps"; |
} |
else |
{ |
QDir di = QDir(); |
doc->Print_Options.filename = di.currentPath()+"/"+doc->documentFileName()+".ps"; |
doc->Print_Options.filename = QDir::currentPath() + "/" + doc->documentFileName() + ".ps"; |
} |
} |
doc->Print_Options.copies = 1; |
4309,7 → 4314,7 |
if (printer->exec()) |
{ |
ReOrderText(doc, view); |
qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
doc->Print_Options.pageNumbers.clear(); |
if (printer->doPrintCurrentPage()) |
doc->Print_Options.pageNumbers.push_back(doc->currentPage()->pageNr()+1); |
4322,7 → 4327,7 |
} |
m_PrinterUsed = true; |
done = doPrint(doc->Print_Options, printError); |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
if (!done) |
{ |
QString message = tr("Printing failed!"); |
4356,13 → 4361,13 |
QString filename(options.filename); |
if (options.toFile) |
{ |
qApp->setOverrideCursor(QCursor(Qt::ArrowCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor)); |
if (!overwrite(this, filename)) |
{ |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
return true; |
} |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
} |
ScCore->fileWatcher->forceScan(); |
ScCore->fileWatcher->stop(); |
4465,8 → 4470,7 |
{ |
if ((currItem->isSingleSel) && (currItem->isGroup())) |
return; |
ScriXmlDoc ss; |
QString BufferS = ss.writeElem(doc, doc->m_Selection); |
QString BufferS = ScriXmlDoc::writeElem(doc, doc->m_Selection); |
if ((m_prefsManager.appPrefs.scrapbookPrefs.doCopyToScrapbook) && (!internalCopy)) |
{ |
scrapbookPalette->objFromCopyAction(BufferS, currItem->itemName()); |
4547,8 → 4551,7 |
tempSelection.removeItem(doc->m_Selection->itemAt(i)); |
} |
|
ScriXmlDoc ss; |
QString BufferS = ss.writeElem(doc, &tempSelection); |
QString BufferS = ScriXmlDoc::writeElem(doc, &tempSelection); |
if (!internalCopy) |
{ |
if ((m_prefsManager.appPrefs.scrapbookPrefs.doCopyToScrapbook) && (!internalCopy)) |
4888,19 → 4891,19 |
bool Resize = false; |
dia->getUsedAttributesValues(Type, fill, line, LWidth, Print, Locked, Resize); |
LWidth = LWidth / doc->unitRatio(); |
if ((useType) && (Type != currItem->realItemType())) |
if (useType && (Type != currItem->realItemType())) |
continue; |
if ((useFill) && ((fill != currItem->fillColor()) || (currItem->GrType != 0))) |
if (useFill && ((fill != currItem->fillColor()) || (currItem->GrType != 0))) |
continue; |
if ((useLine) && (line != currItem->lineColor())) |
if (useLine && (line != currItem->lineColor())) |
continue; |
if ((useLWidth) && ((LWidth != currItem->lineWidth()) || (currItem->lineColor() == CommonStrings::None))) |
if (useLWidth && ((LWidth != currItem->lineWidth()) || (currItem->lineColor() == CommonStrings::None))) |
continue; |
if ((usePrint) && (Print != currItem->printEnabled())) |
if (usePrint && (Print != currItem->printEnabled())) |
continue; |
if ((useLocked) && (Locked != currItem->locked())) |
if (useLocked && (Locked != currItem->locked())) |
continue; |
if ((useResize) && (Resize != currItem->sizeLocked())) |
if (useResize && (Resize != currItem->sizeLocked())) |
continue; |
doc->m_Selection->addItem(currItem); |
} |
5265,7 → 5268,7 |
else if (where == 2) |
wot = doc->Pages->count(); |
|
qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
view->updatesOn(false); |
const PageSet& pageSet = doc->pageSets()[doc->pagePositioning()]; |
ScPage* currentPage = doc->currentPage(); |
5288,7 → 5291,7 |
} |
doc->setCurrentPage(currentPage); |
view->updatesOn(true); |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
//Use wo, the dialog currently returns a page Index +1 due to old numbering scheme, function now does the -1 as required |
doc->changed(); |
doc->addPageToAnnotLinks(wot, where, numPages); |
5380,11 → 5383,11 |
//Zoom to Fit |
if (zoomFactor == -100.0) |
{ |
finalZoomFactor = (view->height() - 70) / (doc->currentPage()->height()+30); |
finalZoomFactor = (view->height() - 70) / (doc->currentPage()->height() + 30); |
} |
else if (zoomFactor == -200.0) |
{ |
finalZoomFactor = (view->width() - 50) / (doc->currentPage()->width()+30); |
finalZoomFactor = (view->width() - 50) / (doc->currentPage()->width() + 30); |
} |
//Zoom to % |
else |
6385,7 → 6388,7 |
itemPage = parentItem->OwnPage; |
parentItem = parentItem->Parent; |
} |
if ((itemPage != -1) && (itemPage != static_cast<int>(doc->currentPage()->pageNr()))) |
if ((itemPage != -1) && (itemPage != doc->currentPage()->pageNr())) |
view->GotoPage(itemPage); |
} |
doc->m_Selection->delaySignalsOn(); |
6476,7 → 6479,7 |
styleName = newUIStyle; |
QStyle * newStyle = QStyleFactory::create(styleName); |
if (newStyle) |
ScQApp->setStyle(newStyle); |
ScribusQApp::setStyle(newStyle); |
else |
m_prefsManager.appPrefs.uiPrefs.style = oldPrefs.uiPrefs.style; |
} |
6488,9 → 6491,9 |
int newUIFontSize = m_prefsManager.guiFontSize(); |
if (oldPrefs.uiPrefs.applicationFontSize != newUIFontSize) |
{ |
QFont apf = qApp->font(); |
QFont apf = QApplication::font(); |
apf.setPointSize(newUIFontSize); |
qApp->setFont(apf); |
QApplication::setFont(apf); |
} |
emit UpdateRequest(reqDefFontListUpdate); |
if (m_prefsManager.appPrefs.uiPrefs.useTabs) |
6584,10 → 6587,10 |
{ |
setStatusBarInfoText( tr("Updating Images")); |
mainWindowProgressBar->reset(); |
qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); |
qApp->processEvents(); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::processEvents(); |
doc->recalcPicturesRes(ScribusDoc::RecalcPicRes_ApplyNewRes); |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
setStatusBarInfoText(""); |
mainWindowProgressBar->reset(); |
viewToolBar->setDoc(doc); |
6946,7 → 6949,7 |
PSLib *pslib = new PSLib(doc, options, PSLib::OutputEPS); |
if (pslib != nullptr) |
{ |
qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
int psRet = pslib->createPS(fn); |
if (psRet == 1) |
{ |
6954,7 → 6957,7 |
return_value = false; |
} |
delete pslib; |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
} |
ScCore->fileWatcher->start(); |
return return_value; |
7125,7 → 7128,7 |
if (!dia.exec()) |
return; |
|
qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
dia.updateDocOptions(); |
doc->pdfOptions().firstUse = false; |
ReOrderText(doc, view); |
7191,7 → 7194,7 |
QString realName = QDir::toNativeSeparators(path + "/" + name + tr("-Page%1").arg(pageNs[aa], 3, 10, QChar('0')) + "." + ext); |
if (!getPDFDriver(realName, pageNs2, thumbs, errorMsg, &cancelled)) |
{ |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
QString message = tr("Cannot write the file: \n%1").arg(doc->pdfOptions().fileName); |
if (!errorMsg.isEmpty()) |
message = QString("%1\n%2").arg(message, errorMsg); |
7205,7 → 7208,7 |
{ |
if (!getPDFDriver(fileName, pageNs, allThumbs, errorMsg)) |
{ |
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor)); |
QApplication::changeOverrideCursor(QCursor(Qt::ArrowCursor)); |
QString message = tr("Cannot write the file: \n%1").arg(doc->pdfOptions().fileName); |
if (!errorMsg.isEmpty()) |
message = QString("%1\n%2").arg(message, errorMsg); |
7214,7 → 7217,7 |
} |
if (doc->pdfOptions().useDocBleeds) |
doc->pdfOptions().bleeds = optBleeds; |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
if (errorMsg.isEmpty() && doc->pdfOptions().openAfterExport && !doc->pdfOptions().doMultiFile) |
{ |
QString pdfViewer(PrefsManager::instance().appPrefs.extToolPrefs.pdfViewerExecutable); |
7946,7 → 7949,7 |
{ |
// changed from "this" to qApp->activeWindow() to be sure it will be opened |
// with the current active window as parent. E.g. it won't hide StoryEditor etc. -- PV |
CustomFDialog *dia = new CustomFDialog(qApp->activeWindow(), workingDirectory, dialogCaption, fileFilter, optionFlags); |
CustomFDialog *dia = new CustomFDialog(QApplication::activeWindow(), workingDirectory, dialogCaption, fileFilter, optionFlags); |
if (!defaultFilename.isEmpty()) |
{ |
QString tmpFileName = defaultFilename; |
8059,8 → 8062,8 |
return; |
if (doc->m_Selection->isEmpty()) |
return; |
ScriXmlDoc ss; |
QString objectString = ss.writeElem(doc, doc->m_Selection); |
|
QString objectString = ScriXmlDoc::writeElem(doc, doc->m_Selection); |
QDomDocument docu("scridoc"); |
docu.setContent(objectString); |
QDomElement elem = docu.documentElement(); |
8549,7 → 8552,7 |
m_prefsManager.languageChange(); |
CommonStrings::languageChange(); |
LanguageManager::instance()->languageChange(); |
qApp->setLayoutDirection(QLocale(ScCore->getGuiLanguage()).textDirection()); |
QApplication::setLayoutDirection(QLocale(ScCore->getGuiLanguage()).textDirection()); |
//Update actions |
if (actionManager != nullptr) |
{ |
8610,7 → 8613,7 |
if (!doc->masterPageMode()) |
return; |
editMasterPagesEnd(); |
qApp->processEvents(); |
QApplication::processEvents(); |
} |
|
void ScribusMainWindow::updateActiveWindowCaption(const QString &newCaption) |
8746,13 → 8749,11 |
|
void ScribusMainWindow::slotEditCopyContents() |
{ |
PageItem *currItem = nullptr; |
if (!HaveDoc || (currItem = doc->m_Selection->itemAt(0)) == nullptr) |
PageItem* currItem = HaveDoc ? doc->m_Selection->itemAt(0) : nullptr; |
if (!currItem || currItem->itemType() != PageItem::ImageFrame) |
return; |
if (currItem->itemType() != PageItem::ImageFrame) |
return; |
|
PageItem_ImageFrame* imageItem = currItem->asImageFrame(); |
const PageItem_ImageFrame* imageItem = currItem->asImageFrame(); |
if (!imageItem->imageIsAvailable) |
return; |
contentsBuffer.contentsFileName.clear(); |
8797,8 → 8798,8 |
imageItem->ImageProfile = doc->cmsSettings().DefaultImageRGBProfile; |
imageItem->ImageIntent = doc->cmsSettings().DefaultIntentImages; |
imageItem->effectsInUse = contentsBuffer.effects; |
qApp->setOverrideCursor( QCursor(Qt::WaitCursor) ); |
qApp->processEvents(QEventLoop::ExcludeUserInputEvents); |
QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
doc->loadPict(contentsBuffer.contentsFileName, imageItem); |
imageItem->setImageXYScale(contentsBuffer.LocalScX, contentsBuffer.LocalScY); |
if (absolute == 0) |
8810,13 → 8811,13 |
imageItem->ImageProfile = contentsBuffer.inputProfile; |
imageItem->ImageIntent = contentsBuffer.renderingIntent; |
imageItem->UseEmbedded = contentsBuffer.useEmbedded; |
qApp->processEvents(QEventLoop::ExcludeUserInputEvents); |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
view->DrawNew(); |
propertiesPalette->updateColorList(); |
contentPalette->updateColorList(); |
emit UpdateRequest(reqCmsOptionsUpdate); |
currItem->emitAllToGUI(); |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
} |
|
void ScribusMainWindow::slotInsertFrame() |
8850,12 → 8851,12 |
UndoTransaction trans; |
if (UndoManager::undoEnabled()) |
trans = m_undoManager->beginTransaction(Um::Selection, Um::IPolygon, Um::Transform, QString(), Um::IMove); |
qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); |
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); |
int count=td.getCount(); |
QTransform matrix(td.getTransformMatrix()); |
int basepoint=td.getBasepoint(); |
doc->itemSelection_Transform(count, matrix, basepoint); |
qApp->restoreOverrideCursor(); |
QApplication::restoreOverrideCursor(); |
if (trans) |
{ |
trans.commit(); |
9724,7 → 9725,8 |
editMDialog->setWindowTitle(tr("Edit %1").arg(editMDialog->windowTitle())); |
if (editMDialog->exec()) |
{ |
QString label, text; |
QString label; |
QString text; |
QString oldLabel = mrk->label; |
MarkData oldData = mrk->getData(); |
QString oldStr = mrk->getString(); |