KDevelop API Documentation

parts/appwizard/filepropspage.cpp

Go to the documentation of this file.
00001 #include "filepropspage.h" 00002 #include <qlistbox.h> 00003 #include <qlineedit.h> 00004 #include <qtextview.h> 00005 #include <iostream.h> 00006 #include <klocale.h> 00007 #include <qlabel.h> 00008 #include <qmultilineedit.h> 00009 00010 /* 00011 * Constructs a FilePropsPage which is a child of 'parent', with the 00012 * name 'name' and widget flags set to 'f' 00013 */ 00014 FilePropsPage::FilePropsPage( QWidget* parent, const char* name, WFlags fl ) 00015 : FilePropsPageBase( parent, name, fl ){ 00016 m_props = new QPtrList<ClassFileProp>; 00017 m_current_class = 9999; // no current 00018 } 00019 00020 /* 00021 * Destroys the object and frees any allocated resources 00022 */ 00023 FilePropsPage::~FilePropsPage() 00024 { 00025 // no need to delete child widgets, Qt does it all for us 00026 } 00027 00028 /* 00029 * public slot 00030 */ 00031 void FilePropsPage::slotSelectionChanged() 00032 { 00033 int item = classes_listbox->currentItem(); 00034 ClassFileProp* prop; 00035 // save the old values 00036 if (m_current_class != 9999){ // != no selected 00037 prop = m_props->at(m_current_class); 00038 prop->m_classname = classname_edit->text(); 00039 prop->m_headerfile = headerfile_edit->text(); 00040 if(m_different_header_impl){ 00041 prop->m_implfile = implfile_edit->text(); 00042 } 00043 if(prop->m_change_baseclass){ 00044 prop->m_baseclass = baseclass_edit->text(); 00045 } 00046 } 00047 prop = m_props->at(item); 00048 classname_edit->setText(prop->m_classname); 00049 desc_textview->setText(prop->m_description); 00050 headerfile_edit->setText(prop->m_headerfile); 00051 if(m_different_header_impl){ 00052 implfile_edit->setText(prop->m_implfile); 00053 } 00054 baseclass_edit->setText(prop->m_baseclass); 00055 if(prop->m_change_baseclass){ 00056 baseclass_edit->setEnabled(true); 00057 } 00058 else { 00059 baseclass_edit->setEnabled(false); 00060 } 00061 m_current_class = item; 00062 } 00063 00064 void FilePropsPage::setClassFileProps(QPtrList<ClassFileProp> props,bool different_header_impl){ 00065 *m_props = props; 00066 m_different_header_impl = different_header_impl; 00067 if (!m_different_header_impl){ 00068 implfile_edit->hide(); 00069 implfile_label->hide(); 00070 headerfile_label->setText(i18n("Header/Implementation file:")); 00071 00072 } 00073 // fill the listbox 00074 ClassFileProp* prop; 00075 for ( prop=m_props->first(); prop != 0; prop=m_props->next() ){ 00076 classes_listbox->insertItem(prop->m_classname); 00077 } 00078 classes_listbox->setSelected(0,true); 00079 slotSelectionChanged(); 00080 } 00081 00082 QPtrList<ClassFileProp> FilePropsPage::getClassFileProps(){ 00083 return *m_props; 00084 } 00085 void FilePropsPage::slotClassnameChanged(const QString& text){ 00086 classes_listbox->changeItem(text, classes_listbox->currentItem()); 00087 } 00088 00089 #include "filepropspage.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:09 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003