00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "codegenerationwizardbase.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qwidget.h>
00017 #include <qlabel.h>
00018 #include <qframe.h>
00019 #include <qheader.h>
00020 #include <qlistview.h>
00021 #include <qgroupbox.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025 #include <qimage.h>
00026 #include <qpixmap.h>
00027
00028 static const char* const img0_codegenerationwizardbase[] = {
00029 "16 15 38 1",
00030 ". c None",
00031 "b c #004062",
00032 "# c #00406a",
00033 "e c #00446a",
00034 "a c #08446a",
00035 "J c #185d8b",
00036 "I c #206194",
00037 "H c #296994",
00038 "F c #29699c",
00039 "G c #296d9c",
00040 "D c #31719c",
00041 "E c #3175a4",
00042 "C c #3979a4",
00043 "B c #397da4",
00044 "A c #4181ac",
00045 "y c #4185ac",
00046 "z c #4a89ac",
00047 "x c #528db4",
00048 "v c #5291b4",
00049 "w c #5291bd",
00050 "t c #5a99bd",
00051 "u c #5a9dbd",
00052 "s c #62a5c5",
00053 "r c #6aa5c5",
00054 "o c #6aaec5",
00055 "p c #73aecd",
00056 "q c #7bb6cd",
00057 "l c #7bbacd",
00058 "k c #7bbad5",
00059 "m c #83bad5",
00060 "h c #83c2d5",
00061 "i c #8bc2de",
00062 "f c #94cee6",
00063 "n c #9ccade",
00064 "j c #a4d2e6",
00065 "g c #acdaee",
00066 "d c #acdeee",
00067 "c c #b4deee",
00068 ".....#a.........",
00069 "....bcde........",
00070 "....acfca.......",
00071 "....bghide......",
00072 "....ajklmca.....",
00073 "....bnopopde....",
00074 "....aqrsrsrca...",
00075 "....brtututub...",
00076 "....atvvwvvva...",
00077 "....bxyzyzye....",
00078 "....aAABABa.....",
00079 "....bCDEDe......",
00080 "....aFGHa.......",
00081 "....bIJe........",
00082 ".....#a........."};
00083
00084 static const char* const img1_codegenerationwizardbase[] = {
00085 "16 15 38 1",
00086 ". c None",
00087 "e c #004062",
00088 "a c #00406a",
00089 "b c #00446a",
00090 "# c #08446a",
00091 "I c #185d8b",
00092 "J c #206194",
00093 "F c #296994",
00094 "H c #29699c",
00095 "G c #296d9c",
00096 "C c #31719c",
00097 "D c #3175a4",
00098 "E c #3979a4",
00099 "A c #397da4",
00100 "B c #4181ac",
00101 "x c #4185ac",
00102 "y c #4a89ac",
00103 "z c #528db4",
00104 "v c #5291b4",
00105 "w c #5291bd",
00106 "u c #5a99bd",
00107 "t c #5a9dbd",
00108 "r c #62a5c5",
00109 "q c #6aa5c5",
00110 "o c #6aaec5",
00111 "n c #73aecd",
00112 "s c #7bb6cd",
00113 "k c #7bbacd",
00114 "j c #7bbad5",
00115 "l c #83bad5",
00116 "h c #83c2d5",
00117 "g c #8bc2de",
00118 "f c #94cee6",
00119 "p c #9ccade",
00120 "m c #a4d2e6",
00121 "i c #acdaee",
00122 "c c #acdeee",
00123 "d c #b4deee",
00124 "........#a......",
00125 ".......bcde.....",
00126 "......#dfd#.....",
00127 ".....bcghie.....",
00128 "....#djklm#.....",
00129 "...bcnonnpe.....",
00130 "..#dqrqrqs#.....",
00131 "..etututuqe.....",
00132 "..#vwvvvwu#.....",
00133 "...bxyxyxze.....",
00134 "....#ABABB#.....",
00135 ".....bCDCEe.....",
00136 "......#FGH#.....",
00137 ".......bIJe.....",
00138 "........#a......"};
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148 CodeGenerationWizardBase::CodeGenerationWizardBase( QWidget* parent, const char* name, bool modal, WFlags fl )
00149 : QWizard( parent, name, modal, fl ),
00150 image0( (const char **) img0_codegenerationwizardbase ),
00151 image1( (const char **) img1_codegenerationwizardbase )
00152 {
00153 if ( !name )
00154 setName( "CodeGenerationWizardBase" );
00155
00156 select = new QWidget( this, "select" );
00157 selectLayout = new QVBoxLayout( select, 0, 10, "selectLayout");
00158
00159 TextLabel1 = new QLabel( select, "TextLabel1" );
00160 selectLayout->addWidget( TextLabel1 );
00161
00162 Frame4 = new QFrame( select, "Frame4" );
00163 Frame4->setFrameShape( QFrame::Box );
00164 Frame4->setFrameShadow( QFrame::Plain );
00165 Frame4->setMargin( 10 );
00166 Frame4Layout = new QGridLayout( Frame4, 1, 1, 20, 10, "Frame4Layout");
00167
00168 m_addButton = new QPushButton( Frame4, "m_addButton" );
00169 m_addButton->setPixmap( image0 );
00170
00171 Frame4Layout->addWidget( m_addButton, 1, 1 );
00172 Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00173 Frame4Layout->addItem( Spacer1, 0, 1 );
00174
00175 m_selectedList = new QListView( Frame4, "m_selectedList" );
00176 m_selectedList->addColumn( tr2i18n( "Classes Selected" ) );
00177 m_selectedList->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 1, 0, m_selectedList->sizePolicy().hasHeightForWidth() ) );
00178 m_selectedList->setSelectionMode( QListView::Extended );
00179
00180 Frame4Layout->addMultiCellWidget( m_selectedList, 0, 4, 2, 2 );
00181
00182 m_removeButton = new QPushButton( Frame4, "m_removeButton" );
00183 m_removeButton->setPixmap( image1 );
00184
00185 Frame4Layout->addWidget( m_removeButton, 3, 1 );
00186 Spacer3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed );
00187 Frame4Layout->addItem( Spacer3, 2, 1 );
00188
00189 m_availableList = new QListView( Frame4, "m_availableList" );
00190 m_availableList->addColumn( tr2i18n( "Classes Available" ) );
00191 m_availableList->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 1, 0, m_availableList->sizePolicy().hasHeightForWidth() ) );
00192 m_availableList->setSelectionMode( QListView::Extended );
00193
00194 Frame4Layout->addMultiCellWidget( m_availableList, 0, 4, 0, 0 );
00195 Spacer1_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00196 Frame4Layout->addItem( Spacer1_2, 4, 1 );
00197 selectLayout->addWidget( Frame4 );
00198 addPage( select, QString("") );
00199
00200 status = new QWidget( this, "status" );
00201 statusLayout = new QVBoxLayout( status, 0, 10, "statusLayout");
00202
00203 m_label = new QLabel( status, "m_label" );
00204 statusLayout->addWidget( m_label );
00205
00206 GroupBox2 = new QGroupBox( status, "GroupBox2" );
00207 GroupBox2->setColumnLayout(0, Qt::Vertical );
00208 GroupBox2->layout()->setSpacing( 10 );
00209 GroupBox2->layout()->setMargin( 20 );
00210 GroupBox2Layout = new QVBoxLayout( GroupBox2->layout() );
00211 GroupBox2Layout->setAlignment( Qt::AlignTop );
00212
00213 m_statusList = new QListView( GroupBox2, "m_statusList" );
00214 m_statusList->addColumn( tr2i18n( "Class" ) );
00215 m_statusList->addColumn( tr2i18n( "Generation Status" ) );
00216 GroupBox2Layout->addWidget( m_statusList );
00217 statusLayout->addWidget( GroupBox2 );
00218 addPage( status, QString("") );
00219 languageChange();
00220 resize( QSize(396, 386).expandedTo(minimumSizeHint()) );
00221 clearWState( WState_Polished );
00222
00223
00224 connect( m_addButton, SIGNAL( clicked() ), this, SLOT( selectClass() ) );
00225 connect( m_removeButton, SIGNAL( clicked() ), this, SLOT( deselectClass() ) );
00226 }
00227
00228
00229
00230
00231 CodeGenerationWizardBase::~CodeGenerationWizardBase()
00232 {
00233
00234 }
00235
00236
00237
00238
00239
00240 void CodeGenerationWizardBase::languageChange()
00241 {
00242 setCaption( tr2i18n( "Code Generation Wizard" ) );
00243 TextLabel1->setText( tr2i18n( "Place all the classes you want to generate code\n"
00244 "for in the right hand side list" ) );
00245 m_addButton->setText( QString::null );
00246 QToolTip::add( m_addButton, tr2i18n( "Add class for code generation" ) );
00247 m_selectedList->header()->setLabel( 0, tr2i18n( "Classes Selected" ) );
00248 m_removeButton->setText( QString::null );
00249 QToolTip::add( m_removeButton, tr2i18n( "Remove class from Code Generation" ) );
00250 m_availableList->header()->setLabel( 0, tr2i18n( "Classes Available" ) );
00251 setTitle( select, tr2i18n( "Select Classes" ) );
00252 m_label->setText( tr2i18n( "Press the Generation button to start the code generation" ) );
00253 GroupBox2->setTitle( tr2i18n( "Generation Status" ) );
00254 m_statusList->header()->setLabel( 0, tr2i18n( "Class" ) );
00255 m_statusList->header()->setLabel( 1, tr2i18n( "Generation Status" ) );
00256 setTitle( status, tr2i18n( "Code Generation Status" ) );
00257 }
00258
00259 void CodeGenerationWizardBase::selectClass()
00260 {
00261 qWarning( "CodeGenerationWizardBase::selectClass(): Not implemented yet" );
00262 }
00263
00264 void CodeGenerationWizardBase::deselectClass()
00265 {
00266 qWarning( "CodeGenerationWizardBase::deselectClass(): Not implemented yet" );
00267 }
00268
00269 void CodeGenerationWizardBase::classGenerated(UMLClassifier*)
00270 {
00271 qWarning( "CodeGenerationWizardBase::classGenerated(UMLClassifier*): Not implemented yet" );
00272 }
00273
00274 #include "codegenerationwizardbase.moc"