Start of the config dialog

svn path=/branches/KDE4/; revision=1779
parent e61af07c
......@@ -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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM
"http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile/>
<group name="misc">
<entry name="color_duration" type="String">
<label>Default color clip duration.</label>
<default>00:00:05:00</default>
</entry>
<entry name="image_duration" type="String">
<label>Default image clip duration.</label>
<default>00:00:05:00</default>
</entry>
</group>
</kcfg>
\ No newline at end of file
File=kdenlivesettings.kcfg
ClassName=KdenliveSettings
Singleton=true
Mutators=true
\ No newline at end of file
#include <QTextStream>
#include <KApplication>
#include <KAction>
......@@ -11,12 +13,15 @@
#include <KIO/NetAccess>
#include <KSaveFile>
#include <KRuler>
#include <QTextStream>
#include <KConfigDialog>
#include <mlt++/Mlt.h>
#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"
......@@ -51,6 +51,7 @@ class MainWindow : public KXmlGuiWindow
void saveFile();
void saveFileAs();
void saveFileAs(const QString &outputFileName);
void slotPreferences();
};
#endif
......@@ -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);
......
<ui version="4.0" >
<class>ConfigMisc_UI</class>
<widget class="QWidget" name="ConfigMisc_UI" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>316</width>
<height>117</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Default durations</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Color clips</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="KRestrictedLine" name="kcfg_color_duration" >
<property name="inputMask" >
<string>99:99:99:99; </string>
</property>
<property name="text" >
<string>:::</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Image clips</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="KRestrictedLine" name="kcfg_image_duration" >
<property name="inputMask" >
<string>99:99:99:99; </string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KRestrictedLine</class>
<extends>KLineEdit</extends>
<header>krestrictedline.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
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