#include "kdenlivesettings.h"
#include "kdenlivesettingsdialog.h"
-KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(parent, "settings", KdenliveSettings::self())
-{
-
- QWidget *page1 = new QWidget;
- m_configMisc = new Ui::ConfigMisc_UI( );
- m_configMisc->setupUi(page1);
- addPage( page1, i18n("Misc"), "misc" );
-
- QWidget *page2 = new QWidget;
- m_configEnv = new Ui::ConfigEnv_UI( );
- m_configEnv->setupUi(page2);
- m_configEnv->kcfg_mltpath->setMode(KFile::Directory);
-
- //WARNING: the 2 lines below should not be necessary, but does not work without it...
- m_configEnv->kcfg_mltpath->setPath(KdenliveSettings::mltpath());
- m_configEnv->kcfg_rendererpath->setPath(KdenliveSettings::rendererpath());
- addPage( page2, i18n("Environnement"), "env" );
+KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(parent, "settings", KdenliveSettings::self()) {
+
+ QWidget *p1 = new QWidget;
+ m_configMisc.setupUi(p1);
+ page1 = addPage(p1, i18n("Misc"), "misc");
+
+ QWidget *p3 = new QWidget;
+ m_configDisplay.setupUi(p3);
+ page3 = addPage(p3, i18n("Display"), "display");
+
+ QWidget *p2 = new QWidget;
+ m_configEnv.setupUi(p2);
+ m_configEnv.mltpathurl->setMode(KFile::Directory);
+ m_configEnv.mltpathurl->lineEdit()->setObjectName("kcfg_mltpath");
+ m_configEnv.rendererpathurl->lineEdit()->setObjectName("kcfg_rendererpath");
+ m_configEnv.tmppathurl->setMode(KFile::Directory);
+ m_configEnv.tmppathurl->lineEdit()->setObjectName("kcfg_currenttmpfolder");
+ page2 = addPage(p2, i18n("Environnement"), "env");
+
+ QStringList profilesNames = ProfilesDialog::getProfileNames();
+ m_configMisc.profiles_list->addItems(profilesNames);
+ m_defaulfProfile = ProfilesDialog::getSettingsFromFile(KdenliveSettings::default_profile()).value("description");
+ if (profilesNames.contains(m_defaulfProfile)) m_configMisc.profiles_list->setCurrentItem(m_defaulfProfile);
+
+ slotUpdateDisplay();
+ connect(m_configMisc.profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay()));
+}
- QStringList profilesNames = ProfilesDialog::getProfileNames();
- m_configMisc->profiles_list->addItems(profilesNames);
+KdenliveSettingsDialog::~KdenliveSettingsDialog() {}
- //User edited the configuration - update your local copies of the
- //configuration data
- slotUpdateDisplay();
- connect(m_configMisc->profiles_list, SIGNAL(currentIndexChanged( int )), this, SLOT(slotUpdateDisplay()));
+bool KdenliveSettingsDialog::hasChanged() {
+ kDebug() << "// // // KCONFIG hasChanged called";
+ if (m_configMisc.profiles_list->currentText() != m_defaulfProfile) return true;
+ return KConfigDialog::hasChanged();
}
-
-void KdenliveSettingsDialog::slotUpdateDisplay()
-{
- QString currentProfile = m_configMisc->profiles_list->currentText();
- QMap< QString, QString > values = ProfilesDialog::getSettingsForProfile(currentProfile);
- m_configMisc->p_size->setText(values.value("width") + "x" + values.value("height"));
- m_configMisc->p_fps->setText(values.value("frame_rate_num") + "/" + values.value("frame_rate_den"));
- m_configMisc->p_aspect->setText(values.value("sample_aspect_num") + "/" + values.value("sample_aspect_den"));
- m_configMisc->p_display->setText(values.value("display_aspect_num") + "/" + values.value("display_aspect_den"));
- if (values.value("progressive").toInt() == 0) m_configMisc->p_progressive->setText(i18n("Interlaced"));
- else m_configMisc->p_progressive->setText(i18n("Progressive"));
+void KdenliveSettingsDialog::slotUpdateDisplay() {
+ QString currentProfile = m_configMisc.profiles_list->currentText();
+ QMap< QString, QString > values = ProfilesDialog::getSettingsForProfile(currentProfile);
+ m_configMisc.p_size->setText(values.value("width") + "x" + values.value("height"));
+ m_configMisc.p_fps->setText(values.value("frame_rate_num") + "/" + values.value("frame_rate_den"));
+ m_configMisc.p_aspect->setText(values.value("sample_aspect_num") + "/" + values.value("sample_aspect_den"));
+ m_configMisc.p_display->setText(values.value("display_aspect_num") + "/" + values.value("display_aspect_den"));
+ if (values.value("progressive").toInt() == 0) m_configMisc.p_progressive->setText(i18n("Interlaced"));
+ else m_configMisc.p_progressive->setText(i18n("Progressive"));
}