Fix profiles dialog button:

http://www.kdenlive.org:80/mantis/view.php?id=324

svn path=/branches/KDE4/; revision=2642
parent a8f6f91b
......@@ -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());
......
......@@ -40,7 +40,7 @@ public:
KdenliveSettingsDialog(QWidget * parent = 0);
~KdenliveSettingsDialog();
void showPage(int page, int option);
void checkProfile();
bool hasChanged();
bool isDefault();
void updateSettings();
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -45,6 +45,7 @@ private slots:
void slotCreateProfile();
void slotSaveProfile();
void slotDeleteProfile();
void slotSetDefaultProfile();
private:
Ui::ProfilesDialog_UI m_view;
......
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