summaryrefslogtreecommitdiffstats
path: root/parts/appwizard/filepropspage.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 /parts/appwizard/filepropspage.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 'parts/appwizard/filepropspage.cpp')
-rw-r--r--parts/appwizard/filepropspage.cpp88
1 files changed, 88 insertions, 0 deletions
diff --git a/parts/appwizard/filepropspage.cpp b/parts/appwizard/filepropspage.cpp
new file mode 100644
index 00000000..8b60e369
--- /dev/null
+++ b/parts/appwizard/filepropspage.cpp
@@ -0,0 +1,88 @@
+#include "filepropspage.h"
+#include <qlistbox.h>
+#include <klineedit.h>
+#include <qtextview.h>
+#include <klocale.h>
+#include <qlabel.h>
+#include <qmultilineedit.h>
+
+/*
+ * Constructs a FilePropsPage which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ */
+FilePropsPage::FilePropsPage( QWidget* parent, const char* name, WFlags fl )
+ : FilePropsPageBase( parent, name, fl ){
+ m_props = new QPtrList<ClassFileProp>;
+ m_current_class = 9999; // no current
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+FilePropsPage::~FilePropsPage()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * public slot
+ */
+void FilePropsPage::slotSelectionChanged()
+{
+ int item = classes_listbox->currentItem();
+ ClassFileProp* prop;
+ // save the old values
+ if (m_current_class != 9999){ // != no selected
+ prop = m_props->at(m_current_class);
+ prop->m_classname = classname_edit->text();
+ prop->m_headerfile = headerfile_edit->text();
+ if(m_different_header_impl){
+ prop->m_implfile = implfile_edit->text();
+ }
+ if(prop->m_change_baseclass){
+ prop->m_baseclass = baseclass_edit->text();
+ }
+ }
+ prop = m_props->at(item);
+ classname_edit->setText(prop->m_classname);
+ desc_textview->setText(prop->m_description);
+ headerfile_edit->setText(prop->m_headerfile);
+ if(m_different_header_impl){
+ implfile_edit->setText(prop->m_implfile);
+ }
+ baseclass_edit->setText(prop->m_baseclass);
+ if(prop->m_change_baseclass){
+ baseclass_edit->setEnabled(true);
+ }
+ else {
+ baseclass_edit->setEnabled(false);
+ }
+ m_current_class = item;
+}
+
+void FilePropsPage::setClassFileProps(QPtrList<ClassFileProp> props,bool different_header_impl){
+ *m_props = props;
+ m_different_header_impl = different_header_impl;
+ if (!m_different_header_impl){
+ implfile_edit->hide();
+ implfile_label->hide();
+ headerfile_label->setText(i18n("Header/Implementation file:"));
+
+ }
+ // fill the listbox
+ ClassFileProp* prop;
+ for ( prop=m_props->first(); prop != 0; prop=m_props->next() ){
+ classes_listbox->insertItem(prop->m_classname);
+ }
+ classes_listbox->setSelected(0,true);
+ slotSelectionChanged();
+}
+
+QPtrList<ClassFileProp> FilePropsPage::getClassFileProps(){
+ return *m_props;
+}
+void FilePropsPage::slotClassnameChanged(const QString& text){
+ classes_listbox->changeItem(text, classes_listbox->currentItem());
+}
+
+#include "filepropspage.moc"