When creating new profile, focus it

svn path=/branches/KDE4/; revision=2047
parent 440f7c18
...@@ -126,7 +126,7 @@ void RenderWidget::slotSaveProfile() { ...@@ -126,7 +126,7 @@ void RenderWidget::slotSaveProfile() {
QTextStream out(&file); QTextStream out(&file);
out << doc.toString(); out << doc.toString();
file.close(); file.close();
parseProfiles(); parseProfiles(newGroupName, newProfileName);
} }
delete d; delete d;
} }
...@@ -173,7 +173,7 @@ void RenderWidget::slotDeleteProfile() { ...@@ -173,7 +173,7 @@ void RenderWidget::slotDeleteProfile() {
QTextStream out(&file); QTextStream out(&file);
out << doc.toString(); out << doc.toString();
file.close(); file.close();
parseProfiles(); parseProfiles(currentGroup);
} }
void RenderWidget::slotExport() { void RenderWidget::slotExport() {
...@@ -236,7 +236,7 @@ void RenderWidget::refreshParams() { ...@@ -236,7 +236,7 @@ void RenderWidget::refreshParams() {
else m_view.buttonDelete->setEnabled(true); else m_view.buttonDelete->setEnabled(true);
} }
void RenderWidget::parseProfiles() { void RenderWidget::parseProfiles(QString group, QString profile) {
m_view.size_list->clear(); m_view.size_list->clear();
m_view.format_list->clear(); m_view.format_list->clear();
QString exportFile = KStandardDirs::locate("data", "kdenlive/export/profiles.xml"); QString exportFile = KStandardDirs::locate("data", "kdenlive/export/profiles.xml");
...@@ -244,6 +244,11 @@ void RenderWidget::parseProfiles() { ...@@ -244,6 +244,11 @@ void RenderWidget::parseProfiles() {
exportFile = KStandardDirs::locateLocal("data", "kdenlive/export/customprofiles.xml"); exportFile = KStandardDirs::locateLocal("data", "kdenlive/export/customprofiles.xml");
parseFile(exportFile, true); parseFile(exportFile, true);
refreshView(); refreshView();
QList<QListWidgetItem *> child;
child = m_view.format_list->findItems(group, Qt::MatchExactly);
if (!child.isEmpty()) m_view.format_list->setCurrentItem(child.at(0));
child = m_view.size_list->findItems(profile, Qt::MatchExactly);
if (!child.isEmpty()) m_view.size_list->setCurrentItem(child.at(0));
} }
void RenderWidget::parseFile(QString exportFile, bool editable) { void RenderWidget::parseFile(QString exportFile, bool editable) {
......
...@@ -44,7 +44,7 @@ private slots: ...@@ -44,7 +44,7 @@ private slots:
private: private:
Ui::RenderWidget_UI m_view; Ui::RenderWidget_UI m_view;
QString m_standard; QString m_standard;
void parseProfiles(); void parseProfiles(QString group = QString(), QString profile = QString());
void parseFile(QString exportFile, bool editable); void parseFile(QString exportFile, bool editable);
signals: signals:
......
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