00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "importdlgbase.h"
00013
00014 #include <qvariant.h>
00015 #include <kdialog.h>
00016 #include <qlabel.h>
00017 #include <qcombobox.h>
00018 #include <qpushbutton.h>
00019 #include <qlineedit.h>
00020 #include <qframe.h>
00021 #include <kurlrequester.h>
00022 #include <qcheckbox.h>
00023 #include <qlayout.h>
00024 #include <qtooltip.h>
00025 #include <qwhatsthis.h>
00026
00027
00028
00029
00030
00031
00032
00033
00034 ImportDialogBase::ImportDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl )
00035 : QDialog( parent, name, modal, fl )
00036 {
00037 if ( !name )
00038 setName( "import_dialog" );
00039 import_dialogLayout = new QGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "import_dialogLayout");
00040
00041 dir_label = new QLabel( this, "dir_label" );
00042
00043 import_dialogLayout->addWidget( dir_label, 0, 0 );
00044
00045 vcsCombo = new QComboBox( FALSE, this, "vcsCombo" );
00046 vcsCombo->setEnabled( FALSE );
00047 vcsCombo->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 0, 0, vcsCombo->sizePolicy().hasHeightForWidth() ) );
00048
00049 import_dialogLayout->addWidget( vcsCombo, 1, 1 );
00050
00051 fetchModuleButton = new QPushButton( this, "fetchModuleButton" );
00052 fetchModuleButton->setEnabled( FALSE );
00053 fetchModuleButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, fetchModuleButton->sizePolicy().hasHeightForWidth() ) );
00054 fetchModuleButton->setAutoDefault( FALSE );
00055
00056 import_dialogLayout->addWidget( fetchModuleButton, 1, 2 );
00057
00058 textLabel1 = new QLabel( this, "textLabel1" );
00059 textLabel1->setEnabled( FALSE );
00060
00061 import_dialogLayout->addWidget( textLabel1, 1, 0 );
00062
00063 name_label = new QLabel( this, "name_label" );
00064
00065 import_dialogLayout->addWidget( name_label, 2, 0 );
00066
00067 name_edit = new QLineEdit( this, "name_edit" );
00068 name_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 1, 0, name_edit->sizePolicy().hasHeightForWidth() ) );
00069
00070 import_dialogLayout->addMultiCellWidget( name_edit, 2, 2, 1, 2 );
00071
00072 Layout1 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "Layout1");
00073 Spacer3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00074 Layout1->addItem( Spacer3 );
00075
00076 ok_button = new QPushButton( this, "ok_button" );
00077 ok_button->setDefault( TRUE );
00078 Layout1->addWidget( ok_button );
00079
00080 cancel_button = new QPushButton( this, "cancel_button" );
00081 Layout1->addWidget( cancel_button );
00082
00083 import_dialogLayout->addMultiCellLayout( Layout1, 10, 10, 0, 2 );
00084
00085 project_combo = new QComboBox( FALSE, this, "project_combo" );
00086 project_combo->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 1, 0, project_combo->sizePolicy().hasHeightForWidth() ) );
00087
00088 import_dialogLayout->addMultiCellWidget( project_combo, 3, 3, 1, 2 );
00089
00090 project_label = new QLabel( this, "project_label" );
00091
00092 import_dialogLayout->addWidget( project_label, 3, 0 );
00093
00094 line1 = new QFrame( this, "line1" );
00095 line1->setFrameShape( QFrame::HLine );
00096 line1->setFrameShadow( QFrame::Sunken );
00097 line1->setFrameShape( QFrame::HLine );
00098
00099 import_dialogLayout->addMultiCellWidget( line1, 9, 9, 0, 2 );
00100
00101 urlinput_edit = new KURLRequester( this, "urlinput_edit" );
00102
00103 import_dialogLayout->addMultiCellWidget( urlinput_edit, 0, 0, 1, 2 );
00104 Spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00105 import_dialogLayout->addItem( Spacer2, 8, 2 );
00106
00107 TextLabel5 = new QLabel( this, "TextLabel5" );
00108
00109 import_dialogLayout->addWidget( TextLabel5, 7, 0 );
00110
00111 email_edit = new QLineEdit( this, "email_edit" );
00112 email_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 1, 0, email_edit->sizePolicy().hasHeightForWidth() ) );
00113
00114 import_dialogLayout->addMultiCellWidget( email_edit, 7, 7, 1, 2 );
00115
00116 author_edit = new QLineEdit( this, "author_edit" );
00117 author_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)0, 1, 0, author_edit->sizePolicy().hasHeightForWidth() ) );
00118
00119 import_dialogLayout->addMultiCellWidget( author_edit, 6, 6, 1, 2 );
00120 Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum );
00121 import_dialogLayout->addItem( Spacer1, 5, 2 );
00122
00123 author_label = new QLabel( this, "author_label" );
00124
00125 import_dialogLayout->addWidget( author_label, 6, 0 );
00126
00127 infrastructureBox = new QCheckBox( this, "infrastructureBox" );
00128 infrastructureBox->setEnabled( TRUE );
00129
00130 import_dialogLayout->addMultiCellWidget( infrastructureBox, 4, 4, 1, 2 );
00131 languageChange();
00132 resize( QSize(437, 293).expandedTo(minimumSizeHint()) );
00133 clearWState( WState_Polished );
00134
00135
00136 connect( ok_button, SIGNAL( clicked() ), this, SLOT( accept() ) );
00137 connect( cancel_button, SIGNAL( clicked() ), this, SLOT( reject() ) );
00138 connect( project_combo, SIGNAL( activated(const QString&) ), this, SLOT( projectTypeChanged(const QString&) ) );
00139 connect( project_combo, SIGNAL( activated(int) ), this, SLOT( projectTypeChanged(int) ) );
00140
00141
00142 setTabOrder( urlinput_edit, vcsCombo );
00143 setTabOrder( vcsCombo, fetchModuleButton );
00144 setTabOrder( fetchModuleButton, name_edit );
00145 setTabOrder( name_edit, project_combo );
00146 setTabOrder( project_combo, author_edit );
00147 setTabOrder( author_edit, email_edit );
00148 setTabOrder( email_edit, ok_button );
00149 setTabOrder( ok_button, cancel_button );
00150
00151
00152 dir_label->setBuddy( urlinput_edit );
00153 textLabel1->setBuddy( vcsCombo );
00154 name_label->setBuddy( name_edit );
00155 project_label->setBuddy( project_combo );
00156 TextLabel5->setBuddy( email_edit );
00157 author_label->setBuddy( author_edit );
00158 }
00159
00160
00161
00162
00163 ImportDialogBase::~ImportDialogBase()
00164 {
00165
00166 }
00167
00168
00169
00170
00171
00172 void ImportDialogBase::languageChange()
00173 {
00174 setCaption( tr2i18n( "Import Existing Project" ) );
00175 dir_label->setText( tr2i18n( "&Directory:" ) );
00176 fetchModuleButton->setText( tr2i18n( "Fetch &Module" ) );
00177 textLabel1->setText( tr2i18n( "&Fetch from:" ) );
00178 name_label->setText( tr2i18n( "Project &name:" ) );
00179 ok_button->setText( tr2i18n( "&OK" ) );
00180 cancel_button->setText( tr2i18n( "&Cancel" ) );
00181 project_label->setText( tr2i18n( "&Project type:" ) );
00182 TextLabel5->setText( tr2i18n( "&Email:" ) );
00183 author_label->setText( tr2i18n( "&Author:" ) );
00184 infrastructureBox->setText( tr2i18n( "Generate build system infrastructure" ) );
00185 }
00186
00187 void ImportDialogBase::dirButtonClicked()
00188 {
00189 qWarning( "ImportDialogBase::dirButtonClicked(): Not implemented yet" );
00190 }
00191
00192 void ImportDialogBase::dirChanged()
00193 {
00194 qWarning( "ImportDialogBase::dirChanged(): Not implemented yet" );
00195 }
00196
00197 void ImportDialogBase::projectTypeChanged(const QString&)
00198 {
00199 qWarning( "ImportDialogBase::projectTypeChanged(const QString&): Not implemented yet" );
00200 }
00201
00202 void ImportDialogBase::projectTypeChanged(int)
00203 {
00204 qWarning( "ImportDialogBase::projectTypeChanged(int): Not implemented yet" );
00205 }
00206
00207 #include "importdlgbase.moc"