summaryrefslogtreecommitdiffstats
path: root/buildtools/qmake/newwidgetdlg.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /buildtools/qmake/newwidgetdlg.cpp
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'buildtools/qmake/newwidgetdlg.cpp')
-rw-r--r--buildtools/qmake/newwidgetdlg.cpp80
1 files changed, 80 insertions, 0 deletions
diff --git a/buildtools/qmake/newwidgetdlg.cpp b/buildtools/qmake/newwidgetdlg.cpp
new file mode 100644
index 00000000..7be62acd
--- /dev/null
+++ b/buildtools/qmake/newwidgetdlg.cpp
@@ -0,0 +1,80 @@
+/***************************************************************************
+ * Copyright (C) 2002 by Jakob Simon-Gaarde *
+ * jsgaarde@tdcspace.dk *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "newwidgetdlg.h"
+#include <qradiobutton.h>
+#include <qstringlist.h>
+#include <qcheckbox.h>
+#include <qmessagebox.h>
+#include <kfiledialog.h>
+#include <klineedit.h>
+#include <kpushbutton.h>
+#include <domutil.h>
+#include <qdom.h>
+#include <kstdguiitem.h>
+
+#define WIDGET_CAPTION_NAME "widget/property|name=caption/string"
+#define WIDGET_CLASS_NAME "class"
+#define WIDGET_SLOTS "slots"
+
+NewWidgetDlg::NewWidgetDlg(QStringList &newFileNames,QWidget* parent, const char* name, bool modal, WFlags fl)
+: NewWidgetDlgBase(parent,name,modal,fl),
+m_newFileNames(newFileNames)
+//=================================================
+{
+// Remove in kde 3.4 support
+ okayButton->setGuiItem(KStdGuiItem::ok());
+ cancelButton->setGuiItem(KStdGuiItem::cancel());
+}
+
+
+NewWidgetDlg::~NewWidgetDlg()
+//==============================================
+{
+}
+
+
+void NewWidgetDlg::subclassingPressed()
+//=====================================
+{
+ QMessageBox::information(0,"subclassing","");
+}
+
+
+void NewWidgetDlg::templateSelChanged()
+//=====================================
+{
+ QMessageBox::information(0,"template","");
+}
+
+void NewWidgetDlg::accept()
+//=========================
+{
+ QDomDocument doc;
+ DomUtil::openDOMFile(doc,"/home/jsgaarde/programming/kdevelop/domapp/clean_dialog.ui");
+ DomUtil::replaceText(doc,WIDGET_CLASS_NAME,"TestClass");
+ DomUtil::replaceText(doc,WIDGET_CAPTION_NAME,"Test Dialog");
+ QDomElement slotsElem = DomUtil::elementByPathExt(doc,WIDGET_SLOTS);
+ QDomNodeList slotnodes = slotsElem.childNodes();
+ for (unsigned int i=0; i<slotnodes.count();i++)
+ {
+ QString msg;
+ QDomElement slotelem = slotnodes.item(i).toElement();
+ msg.sprintf("Slotname: %s\nReturns: %s\nAccess: %s",
+ slotelem.text().ascii(),
+ slotelem.attributeNode("returnType").value().ascii(),
+ slotelem.attributeNode("access").value().ascii());
+ QMessageBox::information(0,"Slots",msg);
+ }
+ DomUtil::saveDOMFile(doc,"/home/jsgaarde/programming/kdevelop/domapp/clean_dialog2.ui");
+ NewWidgetDlgBase::accept();
+}
+