KDialog > QDialog

parent a534288b
......@@ -1366,7 +1366,8 @@ void MainWindow::slotUpdateProjectProfile(const QString &profile)
bool updateFps = project->setProfilePath(profile);
KdenliveSettings::setCurrent_profile(profile);
KdenliveSettings::setProject_fps(project->fps());
setCaption(project->description(), project->isModified());
setWindowTitle(project->description());
setWindowModified(project->isModified());
project->clipManager()->clearUnusedProducers();
pCore->monitorManager()->resetProfiles(project->timecode());
m_transitionConfig->updateProjectFormat();
......@@ -1471,7 +1472,8 @@ void MainWindow::slotUpdateProjectDuration(int pos)
void MainWindow::slotUpdateDocumentState(bool modified)
{
setCaption(pCore->projectManager()->current()->description(), modified);
setWindowTitle(pCore->projectManager()->current()->description());
setWindowModified(modified);
m_saveAction->setEnabled(modified);
}
......@@ -1569,7 +1571,8 @@ void MainWindow::connectDocument()
m_commandStack->setActiveStack(project->commandStack());
KdenliveSettings::setProject_display_ratio(project->dar());
setCaption(project->description(), project->isModified());
setWindowTitle(project->description());
setWindowModified(project->isModified());
m_saveAction->setEnabled(project->isModified());
m_normalEditTool->setChecked(true);
connect(m_projectMonitor, SIGNAL(durationChanged(int)), this, SLOT(slotUpdateProjectDuration(int)));
......
......@@ -49,14 +49,13 @@
#include <KLocalizedString>
#include <KMessageBox>
#include <KFileItem>
#include <KDialog>
#include <QDialog>
#include <KColorScheme>
#include <KActionCollection>
#include <KVBox>
#include <KHBox>
#include <KPassivePopup>
#include <KGlobalSettings>
#include <KStandardDirs>
#ifdef USE_NEPOMUK
......@@ -79,6 +78,9 @@
#include <QVBoxLayout>
#include <QtConcurrent>
#include <QFileDialog>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
MyMessageWidget::MyMessageWidget(QWidget *parent) : KMessageWidget(parent) {}
MyMessageWidget::MyMessageWidget(const QString &text, QWidget *parent) : KMessageWidget(text, parent) {}
......@@ -141,7 +143,8 @@ void SmallInfoLabel::slotSetJobCount(int jobCount)
setText(i18np("%1 job", "%1 jobs", jobCount));
setToolTip(i18np("%1 pending job", "%1 pending jobs", jobCount));
if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) {
//if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) {
if (style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) {
setFixedWidth(sizeHint().width());
show();
return;
......@@ -163,7 +166,8 @@ void SmallInfoLabel::slotSetJobCount(int jobCount)
}
}
else {
if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) {
//if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) {
if (style()->styleHint(QStyle::SH_Widget_Animate, 0, this)) {
setFixedWidth(0);
hide();
return;
......@@ -1848,7 +1852,7 @@ void ProjectList::slotRemoveInvalidClip(const QString &id, bool replace)
}
m_invalidClipDialog->addClip(id, path);
int result = m_invalidClipDialog->exec();
if (result == KDialog::Yes) replace = true;
if (result == QDialog::Accepted) replace = true;
}
}
if (m_invalidClipDialog) {
......@@ -2404,11 +2408,10 @@ bool ProjectList::adjustProjectProfileToItem(ProjectItem *item)
// get a list of compatible profiles
QMap <QString, QString> suggestedProfiles = ProfilesDialog::getProfilesFromProperties(width, height, fps, par, item->clipType() == Image);
if (!suggestedProfiles.isEmpty()) {
QPointer<KDialog> dialog = new KDialog(this);
dialog->setCaption(i18n("Change project profile"));
dialog->setButtons(KDialog::Ok | KDialog::Cancel);
QWidget container;
QPointer<QDialog> dialog = new QDialog(this);
dialog->setWindowTitle(i18n("Change project profile"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *l = new QVBoxLayout;
QLabel *label = new QLabel(i18n("Your clip does not match current project's profile.\nDo you want to change the project profile?\n\nThe following profiles match the clip (size: %1, fps: %2)", size, fps));
l->addWidget(label);
......@@ -2423,9 +2426,18 @@ bool ProjectList::adjustProjectProfileToItem(ProjectItem *item)
}
list->setCurrentRow(0);
l->addWidget(list);
container.setLayout(l);
dialog->setButtonText(KDialog::Ok, i18n("Update profile"));
dialog->setMainWidget(&container);
mainWidget->setLayout(l);
QVBoxLayout *mainLayout = new QVBoxLayout;
dialog->setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setText(i18n("Update profile"));
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
dialog->connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
dialog->connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
mainLayout->addWidget(buttonBox);
if (dialog->exec() == QDialog::Accepted) {
//Change project profile
profileUpdated = true;
......@@ -3478,15 +3490,23 @@ void ProjectList::slotUpdateJobStatus(ProjectItem *item, int type, int status, c
void ProjectList::slotShowJobLog()
{
KDialog d(this);
d.setButtons(KDialog::Close);
QDialog d(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *l = new QVBoxLayout;
QTextEdit t(&d);
for (int i = 0; i < m_errorLog.count(); ++i) {
if (i > 0) t.insertHtml("<br><hr /><br>");
t.insertPlainText(m_errorLog.at(i));
}
t.setReadOnly(true);
d.setMainWidget(&t);
l->addWidget(&t);
mainWidget->setLayout(l);
QVBoxLayout *mainLayout = new QVBoxLayout;
d.setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
mainLayout->addWidget(buttonBox);
d.connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
d.exec();
}
......
......@@ -33,6 +33,7 @@ the Free Software Foundation, either version 3 of the License, or
#include <QDebug>
#include <QMimeDatabase>
#include <QMimeType>
#include <KConfigGroup>
ProjectManager::ProjectManager(QObject* parent) :
QObject(parent),
......@@ -209,7 +210,7 @@ bool ProjectManager::saveFileAs(const QString &outputFileName)
m_project->m_autosave->setManagedFile(QUrl(hash));
}
pCore->window()->setCaption(m_project->description());
pCore->window()->setWindowTitle(m_project->description());
m_project->setModified(false);
m_recentFilesAction->addUrl(QUrl(outputFileName));
m_fileRevert->setEnabled(true);
......@@ -487,7 +488,7 @@ void ProjectManager::slotOpenBackup(const QUrl& url)
doOpenFile(QUrl(requestedBackup), NULL);
m_project->setUrl(projectFile);
m_project->setModified(true);
pCore->window()->setCaption(m_project->description());
pCore->window()->setWindowTitle(m_project->description());
}
delete dia;
}
......
......@@ -24,8 +24,8 @@
#include <QDebug>
#include <KLocalizedString>
#include <KGlobalSettings>
#include <QApplication>
#include <QPainter>
#include <QGraphicsSceneMouseEvent>
#include <QParallelAnimationGroup>
......@@ -61,7 +61,7 @@ void AbstractClipItem::closeAnimation()
if (!isEnabled()) return;
setEnabled(false);
setFlag(QGraphicsItem::ItemIsSelectable, false);
if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) {
if (QApplication::activeWindow()->style()->styleHint(QStyle::SH_Widget_Animate, 0, QApplication::activeWindow())) {
// animation disabled
deleteLater();
return;
......
......@@ -70,15 +70,6 @@ bool sortGuidesList(const Guide *g1 , const Guide *g2)
return (*g1).position() < (*g2).position();
}
//TODO:
// disable animation if user asked it in KDE's global settings
// http://lists.kde.org/?l=kde-commits&m=120398724717624&w=2
// needs something like below (taken from dolphin)
// #include <kglobalsettings.h>
// const bool animate = KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects;
// const int duration = animate ? 1500 : 1;
CustomTrackView::CustomTrackView(KdenliveDoc *doc, CustomTrackScene* projectscene, QWidget *parent) :
QGraphicsView(projectscene, parent)
, m_tracksHeight(KdenliveSettings::trackheight())
......
......@@ -24,7 +24,6 @@
#include <QDebug>
#include <klocale.h>
#include <KGlobalSettings>
#include <QBrush>
#include <QDomElement>
......@@ -45,7 +44,7 @@ Transition::Transition(const ItemInfo &info, int transitiontrack, double fps, co
setPos(info.startPos.frames(fps), (int)(info.track * KdenliveSettings::trackheight() + itemOffset() + 1));
#if QT_VERSION >= 0x040600
if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) {
if (QApplication::activeWindow()->style()->styleHint(QStyle::SH_Widget_Animate, 0, QApplication::activeWindow())) {
// animation disabled
setRect(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal) itemHeight());
}
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>347</width>
<height>87</height>
<height>90</height>
</rect>
</property>
<property name="windowTitle">
......@@ -21,28 +21,21 @@
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="KRestrictedLine" name="kfr_position">
<property name="inputMask">
<string>99:99:99:99; </string>
</property>
</widget>
</item>
<item row="0" column="3">
<item row="0" column="4">
<widget class="QLabel" name="clip_filesize_3">
<property name="text">
<string>Value</string>
</property>
</widget>
</item>
<item row="0" column="4">
<item row="0" column="5">
<widget class="QDoubleSpinBox" name="kfr_value">
<property name="maximum">
<double>1000.0</double>
<double>1000.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="1" rowspan="2" colspan="2">
<item row="1" column="2" rowspan="2" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -55,7 +48,7 @@
</property>
</spacer>
</item>
<item row="2" column="2" colspan="3">
<item row="2" column="3" colspan="3">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -65,20 +58,11 @@
</property>
</widget>
</item>
<item row="0" column="1" colspan="3">
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
<class>KRestrictedLine</class>
<extends>QLineEdit</extends>
<header>krestrictedline.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
......@@ -87,11 +71,11 @@
<receiver>KeyFrameDialog_UI</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
......@@ -103,11 +87,11 @@
<receiver>KeyFrameDialog_UI</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
......
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