]> git.sesse.net Git - kdenlive/commitdiff
Fix profiles dialog button:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 9 Nov 2008 15:48:05 +0000 (15:48 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 9 Nov 2008 15:48:05 +0000 (15:48 +0000)
http://www.kdenlive.org:80/mantis/view.php?id=324

svn path=/branches/KDE4/; revision=2642

src/kdenlivesettingsdialog.cpp
src/kdenlivesettingsdialog.h
src/mainwindow.cpp
src/profilesdialog.cpp
src/profilesdialog.h

index 39b5aa39ccb7043256a439f641c73c2be2f28ce6..9b87ac1cfd6a3cf975dbab188e5574fdef404be6 100644 (file)
@@ -115,6 +115,18 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(
         m_configMisc.kcfg_profiles_list->addItem(i.key(), i.value());
     }
 
+    checkProfile();
+
+    slotUpdateDisplay();
+    m_audioDevice = KdenliveSettings::audio_device();
+    initDevices();
+    connect(m_configMisc.kcfg_profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
+}
+
+KdenliveSettingsDialog::~KdenliveSettingsDialog() {}
+
+
+void KdenliveSettingsDialog::checkProfile() {
     if (!KdenliveSettings::default_profile().isEmpty()) {
         for (int i = 0; i < m_configMisc.kcfg_profiles_list->count(); i++) {
             if (m_configMisc.kcfg_profiles_list->itemData(i).toString() == KdenliveSettings::default_profile()) {
@@ -124,15 +136,8 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(
             }
         }
     }
-
-    slotUpdateDisplay();
-    m_audioDevice = KdenliveSettings::audio_device();
-    initDevices();
-    connect(m_configMisc.kcfg_profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
 }
 
-KdenliveSettingsDialog::~KdenliveSettingsDialog() {}
-
 void KdenliveSettingsDialog::initDevices() {
     // Fill audio drivers
     m_configSdl.kcfg_audio_driver->addItem(i18n("Automatic"), QString());
index fa513b7229e6c8bb0477ef7c85a1f2c705a69870..48352967cd724f3f349ace764a7db13909c7eb67 100644 (file)
@@ -40,7 +40,7 @@ public:
     KdenliveSettingsDialog(QWidget * parent = 0);
     ~KdenliveSettingsDialog();
     void showPage(int page, int option);
-
+    void checkProfile();
     bool hasChanged();
     bool isDefault();
     void updateSettings();
index 4b8ef43536fa6f64792c495c007851a34c87645f..4ce338028462ce39425ee063f3b8752dc92d3a98 100644 (file)
@@ -1353,7 +1353,9 @@ void MainWindow::slotPreferences(int page, int option) {
     // cached, in which case you want to display the cached dialog
     // instead of creating another one
     if (KConfigDialog::showDialog("settings")) {
-        if (page != -1) static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"))->showPage(page, option);
+        KdenliveSettingsDialog* d = static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"));
+        if (page != -1) d->showPage(page, option);
+        d->checkProfile();
         return;
     }
 
index 8315ca16e070c053661a3a388b5a6e76b6b9bc50..3cbd5af26452309f3030d3cb184d1be045b135e7 100644 (file)
@@ -46,6 +46,7 @@ ProfilesDialog::ProfilesDialog(QWidget * parent): QDialog(parent), m_isCustomPro
     connect(m_view.button_create, SIGNAL(clicked()), this, SLOT(slotCreateProfile()));
     connect(m_view.button_save, SIGNAL(clicked()), this, SLOT(slotSaveProfile()));
     connect(m_view.button_delete, SIGNAL(clicked()), this, SLOT(slotDeleteProfile()));
+    connect(m_view.button_default, SIGNAL(clicked()), this, SLOT(slotSetDefaultProfile()));
 }
 
 void ProfilesDialog::fillList(const QString selectedProfile) {
@@ -77,6 +78,12 @@ void ProfilesDialog::slotCreateProfile() {
     m_view.properties->setEnabled(true);
 }
 
+void ProfilesDialog::slotSetDefaultProfile() {
+    int ix = m_view.profiles_list->currentIndex();
+    QString path = m_view.profiles_list->itemData(ix).toString();
+    if (!path.isEmpty()) KdenliveSettings::setDefault_profile(path);
+}
+
 void ProfilesDialog::slotSaveProfile() {
     const QString profileDesc = m_view.description->text();
     int ix = m_view.profiles_list->findText(profileDesc);
index d7f8ea055083886d991cb82d1fa2f8c5b23ee07a..26bfa362df89b276129219dd99e10f11ea6e7caa 100644 (file)
@@ -45,6 +45,7 @@ private slots:
     void slotCreateProfile();
     void slotSaveProfile();
     void slotDeleteProfile();
+    void slotSetDefaultProfile();
 
 private:
     Ui::ProfilesDialog_UI m_view;