KApplication > QApplication

parent b3ab699e
......@@ -23,7 +23,6 @@
#include <QDebug>
#include <KMessageBox>
#include <KApplication>
#include <QDialog>
#include <QProcess>
......@@ -101,7 +100,7 @@ KUrl SamplePlugin::generatedClip(const QString &renderer, const QString &generat
if (generatorProcess.exitStatus() == QProcess::CrashExit) {
//qDebug() << "/// Generator failed: ";
QString error = QString::fromLocal8Bit(generatorProcess.readAllStandardError());
KMessageBox::sorry(kapp->activeWindow(), i18n("Failed to generate clip:\n%1", error, i18n("Generator Failed")));
KMessageBox::sorry(QApplication::activeWindow(), i18n("Failed to generate clip:\n%1", error, i18n("Generator Failed")));
}
else {
result = view.path->url();
......@@ -109,7 +108,7 @@ KUrl SamplePlugin::generatedClip(const QString &renderer, const QString &generat
} else {
//qDebug() << "/// Generator failed: ";
QString error = QString::fromLocal8Bit(generatorProcess.readAllStandardError());
KMessageBox::sorry(kapp->activeWindow(), i18n("Failed to generate clip:\n%1", error, i18n("Generator Failed")));
KMessageBox::sorry(QApplication::activeWindow(), i18n("Failed to generate clip:\n%1", error, i18n("Generator Failed")));
}
}
delete d;
......
......@@ -29,7 +29,6 @@
#include "project/clipmanager.h"
#include "project/dialogs/slideshowclip.h"
#include <KApplication>
#include <QDebug>
#include <QCryptographicHash>
......@@ -1315,7 +1314,7 @@ void DocClipBase::setAnalysisData(const QString &name, const QString &data, int
if (data.isEmpty()) m_analysisdata.remove(name);
else {
if (m_analysisdata.contains(name)) {
if (KMessageBox::questionYesNo(kapp->activeWindow(), i18n("Clip already contains analysis data %1", name), QString(), KGuiItem(i18n("Merge")), KGuiItem(i18n("Add"))) == KMessageBox::Yes) {
if (KMessageBox::questionYesNo(QApplication::activeWindow(), i18n("Clip already contains analysis data %1", name), QString(), KGuiItem(i18n("Merge")), KGuiItem(i18n("Add"))) == KMessageBox::Yes) {
// Merge data
Mlt::Profile *profile = m_baseTrackProducers.at(0)->profile();
Mlt::Geometry geometry(m_analysisdata.value(name).toUtf8().data(), m_properties.value("duration").toInt(), profile->width(), profile->height());
......
......@@ -27,7 +27,6 @@
#include "kdenlivesettings.h"
#include <QDebug>
#include <KApplication>
#include <KUrlRequesterDialog>
#include <KMessageBox>
#include <QFontDatabase>
......
......@@ -26,7 +26,6 @@
#include <QDebug>
#include <KMessageBox>
#include <KApplication>
#include <KLocalizedString>
#include <QFile>
......@@ -82,11 +81,11 @@ bool DocumentValidator::validate(const double currentVersion)
char *separator = localeconv()->decimal_point;
if (newLocale.isEmpty()) {
// Requested locale not available, ask for install
KMessageBox::sorry(kapp->activeWindow(), i18n("The document was created in \"%1\" locale, which is not installed on your system. Please install that language pack. Until then, Kdenlive might not be able to correctly open the document.", mlt.attribute("LC_NUMERIC")));
KMessageBox::sorry(QApplication::activeWindow(), i18n("The document was created in \"%1\" locale, which is not installed on your system. Please install that language pack. Until then, Kdenlive might not be able to correctly open the document.", mlt.attribute("LC_NUMERIC")));
}
if (separator != documentLocale.decimalPoint()) {
KMessageBox::sorry(kapp->activeWindow(), i18n("There is a locale conflict on your system. The document uses locale %1 which uses a \"%2\" as numeric separator (in system libraries) but Qt expects \"%3\". You might not be able to correctly open the project.", mlt.attribute("LC_NUMERIC"), separator, documentLocale.decimalPoint()));
KMessageBox::sorry(QApplication::activeWindow(), i18n("There is a locale conflict on your system. The document uses locale %1 which uses a \"%2\" as numeric separator (in system libraries) but Qt expects \"%3\". You might not be able to correctly open the project.", mlt.attribute("LC_NUMERIC"), separator, documentLocale.decimalPoint()));
//qDebug()<<"------\n!!! system locale is not similar to Qt's locale... be prepared for bugs!!!\n------";
// HACK: There is a locale conflict, so set locale to at least have correct decimal point
if (strncmp(separator, ".", 1) == 0) documentLocale = QLocale::c();
......@@ -243,14 +242,14 @@ bool DocumentValidator::upgrade(double version, const double currentVersion)
// The document is too new
if (version > currentVersion) {
//qDebug() << "Unable to open document with version " << version;
KMessageBox::sorry(kapp->activeWindow(), i18n("This project type is unsupported (version %1) and can't be loaded.\nPlease consider upgrading your Kdenlive version.", version), i18n("Unable to open project"));
KMessageBox::sorry(QApplication::activeWindow(), i18n("This project type is unsupported (version %1) and can't be loaded.\nPlease consider upgrading your Kdenlive version.", version), i18n("Unable to open project"));
return false;
}
// Unsupported document versions
if (version == 0.5 || version == 0.7) {
//qDebug() << "Unable to open document with version " << version;
KMessageBox::sorry(kapp->activeWindow(), i18n("This project type is unsupported (version %1) and can't be loaded.", version), i18n("Unable to open project"));
KMessageBox::sorry(QApplication::activeWindow(), i18n("This project type is unsupported (version %1) and can't be loaded.", version), i18n("Unable to open project"));
return false;
}
......@@ -798,7 +797,7 @@ bool DocumentValidator::upgrade(double version, const double currentVersion)
if (textProperties.namedItem("font-pixel-size").isNull() && !textProperties.namedItem("font-size").isNull()) {
// Ask the user if he wants to convert
if (convert != KMessageBox::Yes && convert != KMessageBox::No)
convert = (KMessageBox::ButtonCode)KMessageBox::warningYesNo(kapp->activeWindow(), i18n("Some of your text clips were saved with size in points, which means different sizes on different displays. Do you want to convert them to pixel size, making them portable? It is recommended you do this on the computer they were first created on, or you could have to adjust their size."), i18n("Update Text Clips"));
convert = (KMessageBox::ButtonCode)KMessageBox::warningYesNo(QApplication::activeWindow(), i18n("Some of your text clips were saved with size in points, which means different sizes on different displays. Do you want to convert them to pixel size, making them portable? It is recommended you do this on the computer they were first created on, or you could have to adjust their size."), i18n("Update Text Clips"));
if (convert == KMessageBox::Yes) {
QFont font;
font.setPointSize(textProperties.namedItem("font-size").nodeValue().toInt());
......
This diff is collapsed.
......@@ -38,7 +38,6 @@
#include <KComboBox>
#include <KLocalizedString>
#include <KMessageBox>
#include <KApplication>
CollapsibleEffect::CollapsibleEffect(const QDomElement &effect, const QDomElement &original_effect, const ItemInfo &info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent) :
......@@ -158,7 +157,7 @@ void CollapsibleEffect::slotCreateRegion()
{
QString allExtensions = ProjectList::getExtensions().join(" ");
const QString dialogFilter = allExtensions + ' ' + QLatin1Char('|') + i18n("All Supported Files") + "\n* " + QLatin1Char('|') + i18n("All Files");
QPointer<QFileDialog> d = new QFileDialog(kapp->activeWindow(), QString(), "kfiledialog:///clipfolder", dialogFilter);
QPointer<QFileDialog> d = new QFileDialog(QApplication::activeWindow(), QString(), "kfiledialog:///clipfolder", dialogFilter);
d->setFileMode(QFileDialog::ExistingFile);
if (d->exec() == QDialog::Accepted && !d->selectedUrls().isEmpty()) {
emit createRegion(effectIndex(), d->selectedUrls().first());
......
......@@ -60,7 +60,6 @@
#include "jogshuttle/jogmanager.h"
#endif
#include <KApplication>
#include <QAction>
#include <KLocalizedString>
#include <KActionCollection>
......
......@@ -35,7 +35,6 @@
#include <KComboBox>
#include <KFileItem>
#include <KMessageBox>
#include <KApplication>
#include <KDiskFreeSpaceInfo>
#include <QMouseEvent>
......@@ -368,7 +367,7 @@ QPixmap RecMonitor::mergeSideBySide(const QPixmap& pix, const QString &txt)
res.fill(Qt::transparent);
p.begin(&res);
p.drawPixmap(0, 0, pix);
p.setPen(kapp->palette().text().color());
p.setPen(palette().text().color());
p.drawText(QRect(pixWidth + 8, 0, strWidth, strHeight), 0, txt);
p.end();
return res;
......
......@@ -32,9 +32,8 @@
#include <mlt++/Mlt.h>
#include <QDebug>
#include <KMessageBox>
#include <KApplication>
#include <KIO/JobUiDelegate>
#include <KIO/MkdirJob>
#include <solid/device.h>
......@@ -44,6 +43,7 @@
#include <QGraphicsItemGroup>
#include <QtConcurrent>
#include <QApplication>
#include <KFileMetaInfo>
#include <KMimeType>
......@@ -550,7 +550,7 @@ void ClipManager::slotAddClipList(const QList<QUrl> &urls, const QMap <QString,
copyjob->addMetaData("group", data.value("group"));
copyjob->addMetaData("groupId", data.value("groupId"));
copyjob->addMetaData("comment", data.value("comment"));
KJobWidgets::setWindow(copyjob, kapp->activeWindow());
KJobWidgets::setWindow(copyjob, QApplication::activeWindow());
connect(copyjob, SIGNAL(copyingDone(KIO::Job*,QUrl,QUrl,time_t,bool,bool)), this, SLOT(slotAddClip(KIO::Job*,QUrl,QUrl)));
continue;
}
......
......@@ -30,11 +30,8 @@
#include <QDebug>
#include <KIO/MkdirJob>
#include <KJobWidgets>
#include <KApplication>
#include <kio/directorysizejob.h>
#if KDE_IS_VERSION(4,7,0)
#include <KMessageWidget>
#endif
#include <QTreeWidget>
#include <QtConcurrent>
......@@ -951,7 +948,7 @@ void ArchiveWidget::slotExtractingFinished()
}
}
if (error) {
KMessageBox::sorry(kapp->activeWindow(), i18n("Cannot open project file %1", extractedProjectFile()), i18n("Cannot open file"));
KMessageBox::sorry(QApplication::activeWindow(), i18n("Cannot open project file %1", extractedProjectFile()), i18n("Cannot open file"));
reject();
}
else accept();
......
......@@ -49,7 +49,6 @@
#include <KLocalizedString>
#include <KMessageBox>
#include <KFileItem>
#include <KApplication>
#include <KDialog>
#include <KColorScheme>
......@@ -596,13 +595,13 @@ void ProjectList::slotOpenClip()
if (item) {
if (item->clipType() == Image) {
if (KdenliveSettings::defaultimageapp().isEmpty())
KMessageBox::sorry(kapp->activeWindow(), i18n("Please set a default application to open images in the Settings dialog"));
KMessageBox::sorry(QApplication::activeWindow(), i18n("Please set a default application to open images in the Settings dialog"));
else
QProcess::startDetached(KdenliveSettings::defaultimageapp(), QStringList() << item->clipUrl().path());
}
if (item->clipType() == Audio) {
if (KdenliveSettings::defaultaudioapp().isEmpty())
KMessageBox::sorry(kapp->activeWindow(), i18n("Please set a default application to open audio files in the Settings dialog"));
KMessageBox::sorry(QApplication::activeWindow(), i18n("Please set a default application to open audio files in the Settings dialog"));
else
QProcess::startDetached(KdenliveSettings::defaultaudioapp(), QStringList() << item->clipUrl().path());
}
......@@ -1146,7 +1145,7 @@ void ProjectList::slotRemoveClip()
folderids[folder->groupName()] = folder->clipId();
int children = folder->childCount();
if (children > 0 && KMessageBox::questionYesNo(kapp->activeWindow(), i18np("Delete folder <b>%2</b>?<br />This will also remove the clip in that folder", "Delete folder <b>%2</b>?<br />This will also remove the %1 clips in that folder", children, folder->text(1)), i18n("Delete Folder")) != KMessageBox::Yes)
if (children > 0 && KMessageBox::questionYesNo(QApplication::activeWindow(), i18np("Delete folder <b>%2</b>?<br />This will also remove the clip in that folder", "Delete folder <b>%2</b>?<br />This will also remove the %1 clips in that folder", children, folder->text(1)), i18n("Delete Folder")) != KMessageBox::Yes)
return;
for (int i = 0; i < children; ++i) {
ProjectItem *child = static_cast <ProjectItem *>(folder->child(i));
......@@ -1155,7 +1154,7 @@ void ProjectList::slotRemoveClip()
} else {
ProjectItem *item = static_cast <ProjectItem *>(selected.at(i));
ids << item->clipId();
if (item->numReferences() > 0 && KMessageBox::questionYesNo(kapp->activeWindow(), i18np("Delete clip <b>%2</b>?<br />This will also remove the clip in timeline", "Delete clip <b>%2</b>?<br />This will also remove its %1 clips in timeline", item->numReferences(), item->text(1)), i18n("Delete Clip"), KStandardGuiItem::yes(), KStandardGuiItem::no(), "DeleteAll") == KMessageBox::No) {
if (item->numReferences() > 0 && KMessageBox::questionYesNo(QApplication::activeWindow(), i18np("Delete clip <b>%2</b>?<br />This will also remove the clip in timeline", "Delete clip <b>%2</b>?<br />This will also remove its %1 clips in timeline", item->numReferences(), item->text(1)), i18n("Delete Clip"), KStandardGuiItem::yes(), KStandardGuiItem::no(), "DeleteAll") == KMessageBox::No) {
KMessageBox::enableMessage("DeleteAll");
return;
}
......@@ -1719,7 +1718,7 @@ void ProjectList::slotAddClip(const QList <QUrl> &givenList, const QString &grou
f->setLayout(l);
QPointer<QFileDialog> d = new QFileDialog(kapp->activeWindow(), i18n("Open Clips"), m_doc->getDocumentProperty("QFileDialogClipFolder"), dialogFilter);
QPointer<QFileDialog> d = new QFileDialog(QApplication::activeWindow(), i18n("Open Clips"), m_doc->getDocumentProperty("QFileDialogClipFolder"), dialogFilter);
//TODO: KF5, how to add a custom widget to file dialog
/*QGridLayout *layout = (QGridLayout*)d->layout();
layout->addWidget(f, 0, 0);*/
......@@ -1843,9 +1842,9 @@ void ProjectList::slotRemoveInvalidClip(const QString &id, bool replace)
}
else {
if (replace)
m_invalidClipDialog = new InvalidDialog(i18n("Invalid clip"), i18n("Clip is invalid, will be removed from project."), replace, kapp->activeWindow());
m_invalidClipDialog = new InvalidDialog(i18n("Invalid clip"), i18n("Clip is invalid, will be removed from project."), replace, QApplication::activeWindow());
else {
m_invalidClipDialog = new InvalidDialog(i18n("Invalid clip"), i18n("Clip is missing or invalid. Remove it from project?"), replace, kapp->activeWindow());
m_invalidClipDialog = new InvalidDialog(i18n("Invalid clip"), i18n("Clip is missing or invalid. Remove it from project?"), replace, QApplication::activeWindow());
}
m_invalidClipDialog->addClip(id, path);
int result = m_invalidClipDialog->exec();
......@@ -2389,7 +2388,7 @@ bool ProjectList::adjustProjectProfileToItem(ProjectItem *item)
item = static_cast <ProjectItem*>(m_listView->currentItem());
}
if (item == NULL || item->referencedClip() == NULL) {
KMessageBox::information(kapp->activeWindow(), i18n("Cannot find profile from current clip"));
KMessageBox::information(QApplication::activeWindow(), i18n("Cannot find profile from current clip"));
return false;
}
bool profileUpdated = false;
......@@ -2436,7 +2435,7 @@ bool ProjectList::adjustProjectProfileToItem(ProjectItem *item)
delete list;
delete label;
} else if (fps > 0) {
KMessageBox::information(kapp->activeWindow(), i18n("Your clip does not match current project's profile.\nNo existing profile found to match the clip's properties.\nClip size: %1\nFps: %2\n", size, fps));
KMessageBox::information(QApplication::activeWindow(), i18n("Your clip does not match current project's profile.\nNo existing profile found to match the clip's properties.\nClip size: %1\nFps: %2\n", size, fps));
}
}
}
......
......@@ -22,13 +22,13 @@
#include <QDebug>
#include <QTemporaryFile>
#include <KApplication>
#include <KLocalizedString>
#include <KMessageBox>
#include <KStandardDirs>
#include <KIO/FileCopyJob>
#include <QApplication>
#include <QGraphicsScene>
#include <QDomElement>
#include <QGraphicsItem>
......@@ -326,7 +326,7 @@ int TitleDocument::loadFromXml(const QDomDocument& doc, QGraphicsRectItem* start
int doc_width = doc.documentElement().attribute("width").toInt();
int doc_height = doc.documentElement().attribute("height").toInt();
if (doc_width != m_width || doc_height != m_height) {
KMessageBox::information(kapp->activeWindow(), i18n("This title clip was created with a different frame size."), i18n("Title Profile"));
KMessageBox::information(QApplication::activeWindow(), i18n("This title clip was created with a different frame size."), i18n("Title Profile"));
//TODO: convert using QTransform
m_width = doc_width;
m_height = doc_height;
......@@ -375,7 +375,7 @@ int TitleDocument::loadFromXml(const QDomDocument& doc, QGraphicsRectItem* start
font.setUnderline(txtProperties.namedItem("font-underline").nodeValue().toInt());
// Older Kdenlive version did not store pixel size but point size
if (txtProperties.namedItem("font-pixel-size").isNull()) {
KMessageBox::information(kapp->activeWindow(), i18n("Some of your text clips were saved with size in points, which means different sizes on different displays. They will be converted to pixel size, making them portable, but you could have to adjust their size."), i18n("Text Clips Updated"));
KMessageBox::information(QApplication::activeWindow(), i18n("Some of your text clips were saved with size in points, which means different sizes on different displays. They will be converted to pixel size, making them portable, but you could have to adjust their size."), i18n("Text Clips Updated"));
QFont f2;
f2.setPointSize(txtProperties.namedItem("font-size").nodeValue().toInt());
font.setPixelSize(QFontInfo(f2).pixelSize());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment