From: Jean-Baptiste Mardelle Date: Sun, 30 Dec 2007 00:09:45 +0000 (+0000) Subject: Start of the config dialog X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4935314b6335a07eec4c2bcf88cdc31e802a9220;p=kdenlive Start of the config dialog svn path=/branches/KDE4/; revision=1779 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a9afc59b..3088830b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,6 +20,7 @@ kde4_add_ui_files(kdenlive_UI widgets/timeline_ui.ui widgets/monitor_ui.ui widgets/colorclip_ui.ui + widgets/configmisc_ui.ui ) set(kdenlive_SRCS @@ -37,8 +38,10 @@ set(kdenlive_SRCS timecode.cpp ) +kde4_add_kcfg_files(kdenlive_SRCS GENERATE_MOC kdenlivesettings.kcfgc ) + kde4_add_executable(kdenlive ${kdenlive_SRCS} ${kdenlive_UI}) - + target_link_libraries(kdenlive ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} @@ -47,5 +50,5 @@ target_link_libraries(kdenlive ) install(TARGETS kdenlive DESTINATION ${BIN_INSTALL_DIR}) -install( FILES kdenliveui.rc - DESTINATION ${DATA_INSTALL_DIR}/kdenlive ) \ No newline at end of file +install( FILES kdenliveui.rc DESTINATION ${DATA_INSTALL_DIR}/kdenlive ) +install (FILES kdenlive.kcfg DESTINATION share/config.kcfg) \ No newline at end of file diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg new file mode 100644 index 00000000..ecac2374 --- /dev/null +++ b/src/kdenlivesettings.kcfg @@ -0,0 +1,16 @@ + + + + + + + + 00:00:05:00 + + + + 00:00:05:00 + + + \ No newline at end of file diff --git a/src/kdenlivesettings.kcfgc b/src/kdenlivesettings.kcfgc new file mode 100644 index 00000000..7e3d9368 --- /dev/null +++ b/src/kdenlivesettings.kcfgc @@ -0,0 +1,4 @@ +File=kdenlivesettings.kcfg +ClassName=KdenliveSettings +Singleton=true +Mutators=true \ No newline at end of file diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 822d82c8..79f8449e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1,4 +1,6 @@ + +#include #include #include @@ -11,12 +13,15 @@ #include #include #include -#include +#include + #include #include "mainwindow.h" #include "trackview.h" +#include "kdenlivesettings.h" +#include "ui_configmisc_ui.h" MainWindow::MainWindow(QWidget *parent) : KXmlGuiWindow(parent), @@ -107,6 +112,12 @@ void MainWindow::setupActions() KStandardAction::openNew(this, SLOT(newFile()), actionCollection()); + + KStandardAction::openNew(this, SLOT(newFile()), + actionCollection()); + + KStandardAction::preferences(this, SLOT(slotPreferences()), + actionCollection()); setupGUI(); } @@ -176,4 +187,31 @@ void MainWindow::connectDocument(KdenliveDoc *doc) //changed //connect(doc, SIGNAL(addClip(QDomElement &)), m_projectList, SLOT(slotAddClip(QDomElement &))); } + +void MainWindow::slotPreferences() +{ + //An instance of your dialog could be already created and could be + // cached, in which case you want to display the cached dialog + // instead of creating another one + if ( KConfigDialog::showDialog( "settings" ) ) + return; + + // KConfigDialog didn't find an instance of this dialog, so lets + // create it : + KConfigDialog* dialog = new KConfigDialog(this, "settings", + KdenliveSettings::self()); + + QWidget *page1 = new QWidget; + Ui::ConfigMisc_UI* confWdg = new Ui::ConfigMisc_UI( ); + confWdg->setupUi(page1); + + dialog->addPage( page1, i18n("Misc"), "misc" ); + + //User edited the configuration - update your local copies of the + //configuration data + connect( dialog, SIGNAL(settingsChanged()), this, SLOT(updateConfiguration()) ); + + dialog->show(); +} + #include "mainwindow.moc" diff --git a/src/mainwindow.h b/src/mainwindow.h index 18e1cf20..af93385b 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -51,6 +51,7 @@ class MainWindow : public KXmlGuiWindow void saveFile(); void saveFileAs(); void saveFileAs(const QString &outputFileName); + void slotPreferences(); }; #endif diff --git a/src/projectlist.cpp b/src/projectlist.cpp index 6635bb4c..e0e29237 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -270,7 +270,7 @@ void ProjectList::addProducer(QDomElement producer) pix.fill(QColor(colour.left(7))); QStringList itemEntry; itemEntry.append(QString::null); - itemEntry.append(producer.attribute("name");); + itemEntry.append(producer.attribute("name")); ProjectItem *item = new ProjectItem(listView, itemEntry, producer); item->setIcon(0, QIcon(pix)); item->setData(1, ClipTypeRole, (int) type); diff --git a/src/widgets/configmisc_ui.ui b/src/widgets/configmisc_ui.ui new file mode 100644 index 00000000..b4eab508 --- /dev/null +++ b/src/widgets/configmisc_ui.ui @@ -0,0 +1,80 @@ + + ConfigMisc_UI + + + + 0 + 0 + 316 + 117 + + + + Form + + + + + + Default durations + + + + + + Color clips + + + + + + + 99:99:99:99; + + + ::: + + + + + + + Image clips + + + + + + + 99:99:99:99; + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + KRestrictedLine + KLineEdit +
krestrictedline.h
+
+
+ + +