KDevelop API Documentation

appwizarddlgbase.cpp

Go to the documentation of this file.
00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './appwizarddlgbase.ui'
00005 **
00006 ** Created: Tue Feb 22 08:53:11 2005
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.4   edited Nov 24 2003 $)
00008 **
00009 ** WARNING! All changes made in this file will be lost!
00010 ****************************************************************************/
00011 
00012 #include "appwizarddlgbase.h"
00013 
00014 #include <qvariant.h>
00015 #include <kdialog.h>
00016 #include <qpushbutton.h>
00017 #include <qwidget.h>
00018 #include <qtabwidget.h>
00019 #include <qheader.h>
00020 #include <klistview.h>
00021 #include <kiconview.h>
00022 #include <qlabel.h>
00023 #include <qgroupbox.h>
00024 #include <qlineedit.h>
00025 #include <kurlrequester.h>
00026 #include <qmultilineedit.h>
00027 #include <qcombobox.h>
00028 #include <qframe.h>
00029 #include <qlayout.h>
00030 #include <qtooltip.h>
00031 #include <qwhatsthis.h>
00032 
00033 /*
00034  *  Constructs a AppWizardDialogBase as a child of 'parent', with the
00035  *  name 'name' and widget flags set to 'f'.
00036  *
00037  *  The wizard will by default be modeless, unless you set 'modal' to
00038  *  TRUE to construct a modal wizard.
00039  */
00040 AppWizardDialogBase::AppWizardDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl )
00041     : QWizard( parent, name, modal, fl )
00042 {
00043     if ( !name )
00044     setName( "AppWizardDialogBase" );
00045 
00046     generalPage = new QWidget( this, "generalPage" );
00047     generalPageLayout = new QGridLayout( generalPage, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "generalPageLayout"); 
00048 
00049     templates_tabwidget = new QTabWidget( generalPage, "templates_tabwidget" );
00050 
00051     m_allProjectsPage = new QWidget( templates_tabwidget, "m_allProjectsPage" );
00052     m_allProjectsPageLayout = new QGridLayout( m_allProjectsPage, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "m_allProjectsPageLayout"); 
00053 
00054     templates_listview = new KListView( m_allProjectsPage, "templates_listview" );
00055     templates_listview->addColumn( QString::null );
00056     templates_listview->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 1, 1, templates_listview->sizePolicy().hasHeightForWidth() ) );
00057     templates_listview->setHScrollBarMode( KListView::Auto );
00058     templates_listview->setProperty( "selectionMode", "Single" );
00059     templates_listview->setRootIsDecorated( TRUE );
00060     templates_listview->setResizeMode( KListView::AllColumns );
00061     templates_listview->setFullWidth( FALSE );
00062     templates_listview->setItemsMovable( FALSE );
00063 
00064     m_allProjectsPageLayout->addWidget( templates_listview, 0, 0 );
00065     templates_tabwidget->insertTab( m_allProjectsPage, QString::fromLatin1("") );
00066 
00067     m_favouritesPage = new QWidget( templates_tabwidget, "m_favouritesPage" );
00068     m_favouritesPageLayout = new QGridLayout( m_favouritesPage, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "m_favouritesPageLayout"); 
00069 
00070     favourites_iconview = new KIconView( m_favouritesPage, "favourites_iconview" );
00071     favourites_iconview->setArrangement( KIconView::LeftToRight );
00072     favourites_iconview->setItemsMovable( FALSE );
00073     favourites_iconview->setMode( KIconView::Select );
00074 
00075     m_favouritesPageLayout->addWidget( favourites_iconview, 0, 0 );
00076     templates_tabwidget->insertTab( m_favouritesPage, QString::fromLatin1("") );
00077 
00078     generalPageLayout->addMultiCellWidget( templates_tabwidget, 0, 1, 0, 0 );
00079 
00080     icon_label = new QLabel( generalPage, "icon_label" );
00081     icon_label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)5, 0, 0, icon_label->sizePolicy().hasHeightForWidth() ) );
00082     icon_label->setMinimumSize( QSize( 250, 180 ) );
00083     icon_label->setMaximumSize( QSize( 250, 180 ) );
00084     icon_label->setFrameShape( QLabel::LineEditPanel );
00085     icon_label->setFrameShadow( QLabel::Sunken );
00086     icon_label->setScaledContents( TRUE );
00087     icon_label->setAlignment( int( QLabel::AlignCenter ) );
00088 
00089     generalPageLayout->addWidget( icon_label, 0, 1 );
00090 
00091     GroupBox1 = new QGroupBox( generalPage, "GroupBox1" );
00092     GroupBox1->setColumnLayout(0, Qt::Vertical );
00093     GroupBox1->layout()->setSpacing( KDialog::spacingHint() );
00094     GroupBox1->layout()->setMargin( KDialog::marginHint() );
00095     GroupBox1Layout = new QHBoxLayout( GroupBox1->layout() );
00096     GroupBox1Layout->setAlignment( Qt::AlignTop );
00097 
00098     layout2 = new QVBoxLayout( 0, 0, KDialog::spacingHint(), "layout2"); 
00099 
00100     appname_label = new QLabel( GroupBox1, "appname_label" );
00101     layout2->addWidget( appname_label );
00102 
00103     location_label = new QLabel( GroupBox1, "location_label" );
00104     layout2->addWidget( location_label );
00105 
00106     TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
00107     layout2->addWidget( TextLabel3 );
00108     GroupBox1Layout->addLayout( layout2 );
00109 
00110     layout1 = new QVBoxLayout( 0, 0, KDialog::spacingHint(), "layout1"); 
00111 
00112     appname_edit = new QLineEdit( GroupBox1, "appname_edit" );
00113     appname_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 1, 0, appname_edit->sizePolicy().hasHeightForWidth() ) );
00114     layout1->addWidget( appname_edit );
00115 
00116     dest_edit = new KURLRequester( GroupBox1, "dest_edit" );
00117     dest_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 1, 0, dest_edit->sizePolicy().hasHeightForWidth() ) );
00118     layout1->addWidget( dest_edit );
00119 
00120     finalLoc_label = new QLabel( GroupBox1, "finalLoc_label" );
00121     finalLoc_label->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 1, 0, finalLoc_label->sizePolicy().hasHeightForWidth() ) );
00122     layout1->addWidget( finalLoc_label );
00123     GroupBox1Layout->addLayout( layout1 );
00124 
00125     generalPageLayout->addMultiCellWidget( GroupBox1, 2, 2, 0, 1 );
00126 
00127     desc_textview = new QMultiLineEdit( generalPage, "desc_textview" );
00128     desc_textview->setEnabled( TRUE );
00129     desc_textview->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)7, 0, 0, desc_textview->sizePolicy().hasHeightForWidth() ) );
00130     desc_textview->setMinimumSize( QSize( 250, 0 ) );
00131     desc_textview->setMaximumSize( QSize( 250, 32767 ) );
00132     desc_textview->setFocusPolicy( QMultiLineEdit::NoFocus );
00133     desc_textview->setWordWrap( QMultiLineEdit::WidgetWidth );
00134     desc_textview->setReadOnly( TRUE );
00135 
00136     generalPageLayout->addWidget( desc_textview, 1, 1 );
00137     addPage( generalPage, QString("") );
00138 
00139     WizardPage = new QWidget( this, "WizardPage" );
00140     WizardPageLayout = new QVBoxLayout( WizardPage, KDialog::marginHint(), KDialog::spacingHint(), "WizardPageLayout"); 
00141 
00142     projectOptions = new QGroupBox( WizardPage, "projectOptions" );
00143     projectOptions->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 1, 0, projectOptions->sizePolicy().hasHeightForWidth() ) );
00144     projectOptions->setColumnLayout(0, Qt::Vertical );
00145     projectOptions->layout()->setSpacing( KDialog::spacingHint() );
00146     projectOptions->layout()->setMargin( KDialog::marginHint() );
00147     projectOptionsLayout = new QHBoxLayout( projectOptions->layout() );
00148     projectOptionsLayout->setAlignment( Qt::AlignTop );
00149 
00150     layout6 = new QVBoxLayout( 0, 0, KDialog::spacingHint(), "layout6"); 
00151 
00152     author_label = new QLabel( projectOptions, "author_label" );
00153     layout6->addWidget( author_label );
00154 
00155     email_label = new QLabel( projectOptions, "email_label" );
00156     layout6->addWidget( email_label );
00157 
00158     version_label = new QLabel( projectOptions, "version_label" );
00159     layout6->addWidget( version_label );
00160     projectOptionsLayout->addLayout( layout6 );
00161 
00162     layout8 = new QVBoxLayout( 0, 0, KDialog::spacingHint(), "layout8"); 
00163 
00164     author_edit = new QLineEdit( projectOptions, "author_edit" );
00165     author_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 1, 0, author_edit->sizePolicy().hasHeightForWidth() ) );
00166     layout8->addWidget( author_edit );
00167 
00168     email_edit = new QLineEdit( projectOptions, "email_edit" );
00169     email_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 1, 0, email_edit->sizePolicy().hasHeightForWidth() ) );
00170     layout8->addWidget( email_edit );
00171 
00172     layout7 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout7"); 
00173 
00174     version_edit = new QLineEdit( projectOptions, "version_edit" );
00175     version_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, version_edit->sizePolicy().hasHeightForWidth() ) );
00176     layout7->addWidget( version_edit );
00177 
00178     license_label = new QLabel( projectOptions, "license_label" );
00179     layout7->addWidget( license_label );
00180 
00181     license_combo = new QComboBox( FALSE, projectOptions, "license_combo" );
00182     license_combo->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 1, 0, license_combo->sizePolicy().hasHeightForWidth() ) );
00183     layout7->addWidget( license_combo );
00184     layout8->addLayout( layout7 );
00185     projectOptionsLayout->addLayout( layout8 );
00186     WizardPageLayout->addWidget( projectOptions );
00187 
00188     optionsGroup = new QGroupBox( WizardPage, "optionsGroup" );
00189     optionsGroup->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 1, 1, optionsGroup->sizePolicy().hasHeightForWidth() ) );
00190     optionsGroup->setMinimumSize( QSize( 550, 270 ) );
00191     optionsGroup->setColumnLayout(0, Qt::Vertical );
00192     optionsGroup->layout()->setSpacing( 0 );
00193     optionsGroup->layout()->setMargin( 0 );
00194     optionsGroupLayout = new QGridLayout( optionsGroup->layout() );
00195     optionsGroupLayout->setAlignment( Qt::AlignTop );
00196 
00197     custom_options = new QFrame( optionsGroup, "custom_options" );
00198     custom_options->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 1, 1, custom_options->sizePolicy().hasHeightForWidth() ) );
00199     custom_options->setFrameShape( QFrame::NoFrame );
00200     custom_options->setFrameShadow( QFrame::Plain );
00201     custom_options->setLineWidth( 0 );
00202 
00203     optionsGroupLayout->addWidget( custom_options, 0, 0 );
00204     WizardPageLayout->addWidget( optionsGroup );
00205     addPage( WizardPage, QString("") );
00206     languageChange();
00207     resize( QSize(616, 615).expandedTo(minimumSizeHint()) );
00208     clearWState( WState_Polished );
00209 
00210     // signals and slots connections
00211     connect( templates_listview, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( templatesTreeViewClicked(QListViewItem*) ) );
00212     connect( author_edit, SIGNAL( textChanged(const QString&) ), this, SLOT( textChanged() ) );
00213     connect( version_edit, SIGNAL( textChanged(const QString&) ), this, SLOT( textChanged() ) );
00214     connect( appname_edit, SIGNAL( textChanged(const QString&) ), this, SLOT( textChanged() ) );
00215     connect( appname_edit, SIGNAL( textChanged(const QString&) ), this, SLOT( projectLocationChanged() ) );
00216     connect( dest_edit, SIGNAL( urlSelected(const QString&) ), this, SLOT( destButtonClicked(const QString&) ) );
00217     connect( dest_edit, SIGNAL( textChanged(const QString&) ), this, SLOT( textChanged() ) );
00218     connect( dest_edit, SIGNAL( textChanged(const QString&) ), this, SLOT( projectLocationChanged() ) );
00219     connect( favourites_iconview, SIGNAL( selectionChanged(QIconViewItem*) ), this, SLOT( favouritesIconViewClicked(QIconViewItem*) ) );
00220     connect( templates_listview, SIGNAL( contextMenuRequested(QListViewItem*,const QPoint&,int) ), this, SLOT( templatesContextMenu(QListViewItem*,const QPoint&,int) ) );
00221     connect( favourites_iconview, SIGNAL( contextMenuRequested(QIconViewItem*,const QPoint&) ), this, SLOT( favouritesContextMenu(QIconViewItem*,const QPoint&) ) );
00222     connect( favourites_iconview, SIGNAL( contextMenuRequested(QIconViewItem*,const QPoint&) ), this, SLOT( favouritesContextMenu(QIconViewItem*,const QPoint&) ) );
00223 
00224     // tab order
00225     setTabOrder( author_edit, email_edit );
00226     setTabOrder( email_edit, version_edit );
00227     setTabOrder( version_edit, license_combo );
00228     setTabOrder( license_combo, appname_edit );
00229     setTabOrder( appname_edit, dest_edit );
00230     setTabOrder( dest_edit, templates_tabwidget );
00231     setTabOrder( templates_tabwidget, templates_listview );
00232     setTabOrder( templates_listview, favourites_iconview );
00233 
00234     // buddies
00235     appname_label->setBuddy( appname_edit );
00236     location_label->setBuddy( dest_edit );
00237     author_label->setBuddy( author_edit );
00238     email_label->setBuddy( email_edit );
00239     version_label->setBuddy( version_edit );
00240     license_label->setBuddy( license_combo );
00241 }
00242 
00243 /*
00244  *  Destroys the object and frees any allocated resources
00245  */
00246 AppWizardDialogBase::~AppWizardDialogBase()
00247 {
00248     // no need to delete child widgets, Qt does it all for us
00249 }
00250 
00251 /*
00252  *  Sets the strings of the subwidgets using the current
00253  *  language.
00254  */
00255 void AppWizardDialogBase::languageChange()
00256 {
00257     setCaption( tr2i18n( "Create New Project" ) );
00258     templates_listview->header()->setLabel( 0, QString::null );
00259     QWhatsThis::add( templates_listview, QString::null );
00260     templates_tabwidget->changeTab( m_allProjectsPage, tr2i18n( "&All Projects" ) );
00261     templates_tabwidget->changeTab( m_favouritesPage, tr2i18n( "&Favorites" ) );
00262     GroupBox1->setTitle( tr2i18n( "Properties" ) );
00263     appname_label->setText( tr2i18n( "Application &name:" ) );
00264     location_label->setText( tr2i18n( "&Location:" ) );
00265     TextLabel3->setText( tr2i18n( "Final location:" ) );
00266     finalLoc_label->setText( tr2i18n( "TextLabel4" ) );
00267     desc_textview->setText( QString::null );
00268     setTitle( generalPage, tr2i18n( "General" ) );
00269     projectOptions->setTitle( tr2i18n( "General Options" ) );
00270     author_label->setText( tr2i18n( "Author:" ) );
00271     email_label->setText( tr2i18n( "Email:" ) );
00272     version_label->setText( tr2i18n( "Version:" ) );
00273     version_edit->setText( tr2i18n( "0.1" ) );
00274     license_label->setText( tr2i18n( "License:" ) );
00275     license_combo->clear();
00276     license_combo->insertItem( tr2i18n( "Custom" ) );
00277     optionsGroup->setTitle( tr2i18n( "Custom Options" ) );
00278     setTitle( WizardPage, tr2i18n( "Project Options" ) );
00279 }
00280 
00281 void AppWizardDialogBase::licenseChanged()
00282 {
00283     qWarning( "AppWizardDialogBase::licenseChanged(): Not implemented yet" );
00284 }
00285 
00286 void AppWizardDialogBase::destButtonClicked(const QString&)
00287 {
00288     qWarning( "AppWizardDialogBase::destButtonClicked(const QString&): Not implemented yet" );
00289 }
00290 
00291 void AppWizardDialogBase::projectLocationChanged()
00292 {
00293     qWarning( "AppWizardDialogBase::projectLocationChanged(): Not implemented yet" );
00294 }
00295 
00296 void AppWizardDialogBase::projectNameChanged()
00297 {
00298     qWarning( "AppWizardDialogBase::projectNameChanged(): Not implemented yet" );
00299 }
00300 
00301 void AppWizardDialogBase::textChanged()
00302 {
00303     qWarning( "AppWizardDialogBase::textChanged(): Not implemented yet" );
00304 }
00305 
00306 void AppWizardDialogBase::templatesTreeViewClicked(QListViewItem*)
00307 {
00308     qWarning( "AppWizardDialogBase::templatesTreeViewClicked(QListViewItem*): Not implemented yet" );
00309 }
00310 
00311 void AppWizardDialogBase::favouritesIconViewClicked(QIconViewItem*)
00312 {
00313     qWarning( "AppWizardDialogBase::favouritesIconViewClicked(QIconViewItem*): Not implemented yet" );
00314 }
00315 
00316 void AppWizardDialogBase::templatesContextMenu(QListViewItem*,const QPoint&,int)
00317 {
00318     qWarning( "AppWizardDialogBase::templatesContextMenu(QListViewItem*,const QPoint&,int): Not implemented yet" );
00319 }
00320 
00321 void AppWizardDialogBase::favouritesContextMenu(QIconViewItem*,const QPoint&)
00322 {
00323     qWarning( "AppWizardDialogBase::favouritesContextMenu(QIconViewItem*,const QPoint&): Not implemented yet" );
00324 }
00325 
00326 #include "appwizarddlgbase.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:37 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003