summaryrefslogtreecommitdiff
path: root/core/pim/todo/templateeditor.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/templateeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/templateeditor.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/core/pim/todo/templateeditor.cpp b/core/pim/todo/templateeditor.cpp
new file mode 100644
index 0000000..1b52d4f
--- a/dev/null
+++ b/core/pim/todo/templateeditor.cpp
@@ -0,0 +1,39 @@
+#include <qaction.h>
+#include <qpopupmenu.h>
+
+#include "mainwindow.h"
+#include "todotemplatemanager.h"
+
+#include "templatedialogimpl.h"
+#include "templateeditor.h"
+
+using namespace Todo;
+
+TemplateEditor::TemplateEditor( MainWindow* main,
+ TemplateManager* manager )
+ : QObject( main ), m_main( main ), m_man( manager )
+{
+ init();
+
+}
+TemplateEditor::~TemplateEditor() {
+
+}
+/* ok we add us to the Menubar */
+void TemplateEditor::init() {
+ QAction* a = new QAction( QString::null, tr("Configure Templates"),
+ 0, this, 0, FALSE );
+ connect(a, SIGNAL(activated() ),
+ this, SLOT(setUp() ) );
+
+ a->addTo( m_main->options() );
+}
+void TemplateEditor::setUp() {
+ qWarning("set up");
+ TemplateDialogImpl dlg(m_main, m_man );
+ int ret= dlg.exec();
+ if (QDialog::Accepted != ret ) {
+ m_man->load();
+ }else
+ m_main->populateTemplates();
+}