00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "addattributedialogbase.h"
00013
00014 #include <qvariant.h>
00015 #include <kdialog.h>
00016 #include <qpushbutton.h>
00017 #include <qheader.h>
00018 #include <qlistview.h>
00019 #include <qgroupbox.h>
00020 #include <qlabel.h>
00021 #include <qcombobox.h>
00022 #include <qlineedit.h>
00023 #include <qlayout.h>
00024 #include <qtooltip.h>
00025 #include <qwhatsthis.h>
00026
00027
00028
00029
00030
00031
00032
00033
00034 AddAttributeDialogBase::AddAttributeDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl )
00035 : QDialog( parent, name, modal, fl )
00036 {
00037 if ( !name )
00038 setName( "AddAttributeDialogBase" );
00039 setSizeGripEnabled( TRUE );
00040 AddAttributeDialogBaseLayout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint(), "AddAttributeDialogBaseLayout");
00041
00042 attributes = new QListView( this, "attributes" );
00043 attributes->addColumn( tr2i18n( "Access" ) );
00044 attributes->addColumn( tr2i18n( "Storage" ) );
00045 attributes->addColumn( tr2i18n( "Type" ) );
00046 attributes->addColumn( tr2i18n( "Declarator" ) );
00047 attributes->setAllColumnsShowFocus( TRUE );
00048 attributes->setResizeMode( QListView::LastColumn );
00049 AddAttributeDialogBaseLayout->addWidget( attributes );
00050
00051 layout3 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout3");
00052 spacer3 = new QSpacerItem( 111, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00053 layout3->addItem( spacer3 );
00054
00055 addAttributeButton = new QPushButton( this, "addAttributeButton" );
00056 layout3->addWidget( addAttributeButton );
00057
00058 deleteAttributeButton = new QPushButton( this, "deleteAttributeButton" );
00059 layout3->addWidget( deleteAttributeButton );
00060 AddAttributeDialogBaseLayout->addLayout( layout3 );
00061
00062 groupBox1 = new QGroupBox( this, "groupBox1" );
00063 groupBox1->setColumnLayout(0, Qt::Vertical );
00064 groupBox1->layout()->setSpacing( KDialog::spacingHint() );
00065 groupBox1->layout()->setMargin( KDialog::marginHint() );
00066 groupBox1Layout = new QVBoxLayout( groupBox1->layout() );
00067 groupBox1Layout->setAlignment( Qt::AlignTop );
00068
00069 layout4 = new QGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "layout4");
00070
00071 textLabel1 = new QLabel( groupBox1, "textLabel1" );
00072
00073 layout4->addWidget( textLabel1, 0, 0 );
00074
00075 returnType = new QComboBox( FALSE, groupBox1, "returnType" );
00076 returnType->setEditable( TRUE );
00077
00078 layout4->addWidget( returnType, 1, 0 );
00079
00080 declarator = new QLineEdit( groupBox1, "declarator" );
00081
00082 layout4->addWidget( declarator, 1, 1 );
00083
00084 textLabel2 = new QLabel( groupBox1, "textLabel2" );
00085
00086 layout4->addWidget( textLabel2, 0, 1 );
00087 groupBox1Layout->addLayout( layout4 );
00088
00089 layout5 = new QGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "layout5");
00090
00091 storage = new QComboBox( FALSE, groupBox1, "storage" );
00092
00093 layout5->addWidget( storage, 1, 1 );
00094
00095 textLabel5 = new QLabel( groupBox1, "textLabel5" );
00096
00097 layout5->addWidget( textLabel5, 0, 1 );
00098
00099 textLabel3 = new QLabel( groupBox1, "textLabel3" );
00100
00101 layout5->addWidget( textLabel3, 0, 0 );
00102
00103 access = new QComboBox( FALSE, groupBox1, "access" );
00104
00105 layout5->addWidget( access, 1, 0 );
00106 groupBox1Layout->addLayout( layout5 );
00107 AddAttributeDialogBaseLayout->addWidget( groupBox1 );
00108
00109 Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1");
00110 Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00111 Layout1->addItem( Horizontal_Spacing2 );
00112
00113 buttonOk = new QPushButton( this, "buttonOk" );
00114 buttonOk->setAutoDefault( TRUE );
00115 buttonOk->setDefault( TRUE );
00116 Layout1->addWidget( buttonOk );
00117
00118 buttonCancel = new QPushButton( this, "buttonCancel" );
00119 buttonCancel->setAutoDefault( TRUE );
00120 Layout1->addWidget( buttonCancel );
00121 AddAttributeDialogBaseLayout->addLayout( Layout1 );
00122 languageChange();
00123 resize( QSize(619, 413).expandedTo(minimumSizeHint()) );
00124 clearWState( WState_Polished );
00125
00126
00127 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
00128 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
00129 connect( addAttributeButton, SIGNAL( clicked() ), this, SLOT( addAttribute() ) );
00130 connect( deleteAttributeButton, SIGNAL( clicked() ), this, SLOT( deleteCurrentAttribute() ) );
00131 connect( attributes, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( currentChanged(QListViewItem*) ) );
00132 connect( returnType, SIGNAL( activated(const QString&) ), this, SLOT( updateGUI() ) );
00133 connect( declarator, SIGNAL( textChanged(const QString&) ), this, SLOT( updateGUI() ) );
00134 connect( access, SIGNAL( activated(const QString&) ), this, SLOT( updateGUI() ) );
00135 connect( storage, SIGNAL( activated(const QString&) ), this, SLOT( updateGUI() ) );
00136 connect( returnType, SIGNAL( textChanged(const QString&) ), this, SLOT( updateGUI() ) );
00137
00138
00139 setTabOrder( attributes, addAttributeButton );
00140 setTabOrder( addAttributeButton, deleteAttributeButton );
00141 setTabOrder( deleteAttributeButton, returnType );
00142 setTabOrder( returnType, declarator );
00143 setTabOrder( declarator, access );
00144 setTabOrder( access, storage );
00145 setTabOrder( storage, buttonOk );
00146 setTabOrder( buttonOk, buttonCancel );
00147
00148
00149 textLabel1->setBuddy( returnType );
00150 textLabel2->setBuddy( declarator );
00151 textLabel5->setBuddy( storage );
00152 textLabel3->setBuddy( access );
00153 init();
00154 }
00155
00156
00157
00158
00159 AddAttributeDialogBase::~AddAttributeDialogBase()
00160 {
00161 destroy();
00162
00163 }
00164
00165
00166
00167
00168
00169 void AddAttributeDialogBase::languageChange()
00170 {
00171 setCaption( tr2i18n( "Add Attribute" ) );
00172 attributes->header()->setLabel( 0, tr2i18n( "Access" ) );
00173 attributes->header()->setLabel( 1, tr2i18n( "Storage" ) );
00174 attributes->header()->setLabel( 2, tr2i18n( "Type" ) );
00175 attributes->header()->setLabel( 3, tr2i18n( "Declarator" ) );
00176 addAttributeButton->setText( tr2i18n( "&Add Attribute" ) );
00177 deleteAttributeButton->setText( tr2i18n( "&Delete Attribute" ) );
00178 groupBox1->setTitle( tr2i18n( "Attribute Properties" ) );
00179 textLabel1->setText( tr2i18n( "T&ype:" ) );
00180 textLabel2->setText( tr2i18n( "D&eclarator:" ) );
00181 textLabel5->setText( tr2i18n( "S&torage:" ) );
00182 textLabel3->setText( tr2i18n( "Acce&ss:" ) );
00183 buttonOk->setText( tr2i18n( "&OK" ) );
00184 buttonOk->setAccel( QKeySequence( QString::null ) );
00185 buttonCancel->setText( tr2i18n( "&Cancel" ) );
00186 buttonCancel->setAccel( QKeySequence( QString::null ) );
00187 }
00188
00189 void AddAttributeDialogBase::init()
00190 {
00191 }
00192
00193 void AddAttributeDialogBase::destroy()
00194 {
00195 }
00196
00197 void AddAttributeDialogBase::addAttribute()
00198 {
00199 qWarning( "AddAttributeDialogBase::addAttribute(): Not implemented yet" );
00200 }
00201
00202 void AddAttributeDialogBase::deleteCurrentAttribute()
00203 {
00204 qWarning( "AddAttributeDialogBase::deleteCurrentAttribute(): Not implemented yet" );
00205 }
00206
00207 void AddAttributeDialogBase::currentChanged(QListViewItem*)
00208 {
00209 qWarning( "AddAttributeDialogBase::currentChanged(QListViewItem*): Not implemented yet" );
00210 }
00211
00212 void AddAttributeDialogBase::updateGUI()
00213 {
00214 qWarning( "AddAttributeDialogBase::updateGUI(): Not implemented yet" );
00215 }
00216
00217 #include "addattributedialogbase.moc"