00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "fcconfigwidgetbase.h"
00013
00014 #include <qvariant.h>
00015 #include <kdialog.h>
00016 #include <qpushbutton.h>
00017 #include <qtabwidget.h>
00018 #include <qheader.h>
00019 #include <qlistview.h>
00020 #include <qcheckbox.h>
00021 #include <qlabel.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025 #include "addglobaldlg.h"
00026
00027
00028
00029
00030
00031 FCConfigWidgetBase::FCConfigWidgetBase( QWidget* parent, const char* name, WFlags fl )
00032 : QWidget( parent, name, fl )
00033 {
00034 if ( !name )
00035 setName( "FCConfigWidgetBase" );
00036 FCConfigWidgetBaseLayout = new QGridLayout( this, 1, 1, 0, KDialog::spacingHint(), "FCConfigWidgetBaseLayout");
00037
00038 fc_tabs = new QTabWidget( this, "fc_tabs" );
00039
00040 tab1 = new QWidget( fc_tabs, "tab1" );
00041 tab1Layout = new QGridLayout( tab1, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "tab1Layout");
00042
00043 remove_button = new QPushButton( tab1, "remove_button" );
00044
00045 tab1Layout->addWidget( remove_button, 3, 1 );
00046
00047 edittype_button = new QPushButton( tab1, "edittype_button" );
00048
00049 tab1Layout->addWidget( edittype_button, 2, 1 );
00050
00051 newsubtype_button = new QPushButton( tab1, "newsubtype_button" );
00052
00053 tab1Layout->addWidget( newsubtype_button, 1, 1 );
00054
00055 newtype_button = new QPushButton( tab1, "newtype_button" );
00056
00057 tab1Layout->addWidget( newtype_button, 0, 1 );
00058
00059 fc_view = new QListView( tab1, "fc_view" );
00060 fc_view->addColumn( tr2i18n( "Type Extension" ) );
00061 fc_view->addColumn( tr2i18n( "Type Name" ) );
00062 fc_view->addColumn( tr2i18n( "Icon" ) );
00063 fc_view->addColumn( tr2i18n( "Description" ) );
00064 fc_view->setResizePolicy( QScrollView::Manual );
00065 fc_view->setAllColumnsShowFocus( TRUE );
00066 fc_view->setRootIsDecorated( TRUE );
00067 fc_view->setResizeMode( QListView::AllColumns );
00068
00069 tab1Layout->addMultiCellWidget( fc_view, 0, 10, 0, 0 );
00070
00071 sidetab_checkbox = new QCheckBox( tab1, "sidetab_checkbox" );
00072
00073 tab1Layout->addWidget( sidetab_checkbox, 10, 1 );
00074 spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00075 tab1Layout->addItem( spacer2, 9, 1 );
00076
00077 moveup_button = new QPushButton( tab1, "moveup_button" );
00078
00079 tab1Layout->addWidget( moveup_button, 7, 1 );
00080
00081 movedown_button = new QPushButton( tab1, "movedown_button" );
00082
00083 tab1Layout->addWidget( movedown_button, 8, 1 );
00084 spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed );
00085 tab1Layout->addItem( spacer1, 6, 1 );
00086 spacer1_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed );
00087 tab1Layout->addItem( spacer1_2, 4, 1 );
00088
00089 edit_type_content_button = new QPushButton( tab1, "edit_type_content_button" );
00090
00091 tab1Layout->addWidget( edit_type_content_button, 5, 1 );
00092 fc_tabs->insertTab( tab1, QString::fromLatin1("") );
00093
00094 tab2 = new QWidget( fc_tabs, "tab2" );
00095 tab2Layout = new QGridLayout( tab2, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "tab2Layout");
00096
00097 fcglobal_view = new QListView( tab2, "fcglobal_view" );
00098 fcglobal_view->addColumn( tr2i18n( "Type Extension" ) );
00099 fcglobal_view->addColumn( tr2i18n( "Type Name" ) );
00100 fcglobal_view->addColumn( tr2i18n( "Icon" ) );
00101 fcglobal_view->addColumn( tr2i18n( "Description" ) );
00102 fcglobal_view->setAllColumnsShowFocus( TRUE );
00103 fcglobal_view->setRootIsDecorated( TRUE );
00104 fcglobal_view->setResizeMode( QListView::AllColumns );
00105
00106 tab2Layout->addMultiCellWidget( fcglobal_view, 0, 0, 0, 1 );
00107 spacer4_2 = new QSpacerItem( 330, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00108 tab2Layout->addItem( spacer4_2, 1, 0 );
00109
00110 copyToProject_button = new QPushButton( tab2, "copyToProject_button" );
00111
00112 tab2Layout->addWidget( copyToProject_button, 1, 1 );
00113 fc_tabs->insertTab( tab2, QString::fromLatin1("") );
00114
00115 tab3 = new QWidget( fc_tabs, "tab3" );
00116 tab3Layout = new QGridLayout( tab3, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "tab3Layout");
00117
00118 fctemplates_view = new QListView( tab3, "fctemplates_view" );
00119 fctemplates_view->addColumn( tr2i18n( "Template Name" ) );
00120 fctemplates_view->setAllColumnsShowFocus( TRUE );
00121 fctemplates_view->setRootIsDecorated( TRUE );
00122 fctemplates_view->setResizeMode( QListView::AllColumns );
00123
00124 tab3Layout->addMultiCellWidget( fctemplates_view, 1, 6, 0, 0 );
00125
00126 edittemplate_button = new QPushButton( tab3, "edittemplate_button" );
00127
00128 tab3Layout->addWidget( edittemplate_button, 2, 1 );
00129
00130 newtemplate_button = new QPushButton( tab3, "newtemplate_button" );
00131
00132 tab3Layout->addWidget( newtemplate_button, 1, 1 );
00133
00134 templatesDir_label = new QLabel( tab3, "templatesDir_label" );
00135
00136 tab3Layout->addMultiCellWidget( templatesDir_label, 0, 0, 0, 1 );
00137
00138 removetemplate_button = new QPushButton( tab3, "removetemplate_button" );
00139
00140 tab3Layout->addWidget( removetemplate_button, 3, 1 );
00141 spacer4 = new QSpacerItem( 20, 150, QSizePolicy::Minimum, QSizePolicy::Expanding );
00142 tab3Layout->addItem( spacer4, 6, 1 );
00143
00144 edit_template_content_button = new QPushButton( tab3, "edit_template_content_button" );
00145
00146 tab3Layout->addWidget( edit_template_content_button, 5, 1 );
00147 spacer6 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed );
00148 tab3Layout->addItem( spacer6, 4, 1 );
00149 fc_tabs->insertTab( tab3, QString::fromLatin1("") );
00150
00151 FCConfigWidgetBaseLayout->addWidget( fc_tabs, 0, 0 );
00152 languageChange();
00153 resize( QSize(505, 388).expandedTo(minimumSizeHint()) );
00154 clearWState( WState_Polished );
00155
00156
00157 connect( newtype_button, SIGNAL( clicked() ), this, SLOT( newtype_button_clicked() ) );
00158 connect( newsubtype_button, SIGNAL( clicked() ), this, SLOT( newsubtype_button_clicked() ) );
00159 connect( remove_button, SIGNAL( clicked() ), this, SLOT( remove_button_clicked() ) );
00160 connect( moveup_button, SIGNAL( clicked() ), this, SLOT( moveup_button_clicked() ) );
00161 connect( movedown_button, SIGNAL( clicked() ), this, SLOT( movedown_button_clicked() ) );
00162 connect( edittype_button, SIGNAL( clicked() ), this, SLOT( edittype_button_clicked() ) );
00163 connect( newtemplate_button, SIGNAL( clicked() ), this, SLOT( newtemplate_button_clicked() ) );
00164 connect( edittemplate_button, SIGNAL( clicked() ), this, SLOT( edittemplate_button_clicked() ) );
00165 connect( removetemplate_button, SIGNAL( clicked() ), this, SLOT( removetemplate_button_clicked() ) );
00166 connect( copyToProject_button, SIGNAL( clicked() ), this, SLOT( copyToProject_button_clicked() ) );
00167 connect( edit_template_content_button, SIGNAL( clicked() ), this, SLOT( edit_template_content_button_clicked() ) );
00168 connect( edit_type_content_button, SIGNAL( clicked() ), this, SLOT( edit_type_content_button_clicked() ) );
00169
00170
00171 setTabOrder( fc_view, newtype_button );
00172 setTabOrder( newtype_button, newsubtype_button );
00173 setTabOrder( newsubtype_button, edittype_button );
00174 setTabOrder( edittype_button, remove_button );
00175 setTabOrder( remove_button, edit_type_content_button );
00176 setTabOrder( edit_type_content_button, moveup_button );
00177 setTabOrder( moveup_button, movedown_button );
00178 setTabOrder( movedown_button, sidetab_checkbox );
00179 setTabOrder( sidetab_checkbox, fc_tabs );
00180 setTabOrder( fc_tabs, fcglobal_view );
00181 setTabOrder( fcglobal_view, copyToProject_button );
00182 setTabOrder( copyToProject_button, fctemplates_view );
00183 setTabOrder( fctemplates_view, newtemplate_button );
00184 setTabOrder( newtemplate_button, edittemplate_button );
00185 setTabOrder( edittemplate_button, removetemplate_button );
00186 setTabOrder( removetemplate_button, edit_template_content_button );
00187 }
00188
00189
00190
00191
00192 FCConfigWidgetBase::~FCConfigWidgetBase()
00193 {
00194
00195 }
00196
00197
00198
00199
00200
00201 void FCConfigWidgetBase::languageChange()
00202 {
00203 setCaption( tr2i18n( "New File Wizard Options" ) );
00204 remove_button->setText( tr2i18n( "Re&move Type" ) );
00205 edittype_button->setText( tr2i18n( "&Edit Type..." ) );
00206 newsubtype_button->setText( tr2i18n( "New &Subtype..." ) );
00207 newtype_button->setText( tr2i18n( "&New Type..." ) );
00208 fc_view->header()->setLabel( 0, tr2i18n( "Type Extension" ) );
00209 fc_view->header()->setLabel( 1, tr2i18n( "Type Name" ) );
00210 fc_view->header()->setLabel( 2, tr2i18n( "Icon" ) );
00211 fc_view->header()->setLabel( 3, tr2i18n( "Description" ) );
00212 sidetab_checkbox->setText( tr2i18n( "Use s&ide tab" ) );
00213 moveup_button->setText( tr2i18n( "Move &Up" ) );
00214 movedown_button->setText( tr2i18n( "Move &Down" ) );
00215 edit_type_content_button->setText( tr2i18n( "Edit Temp&late" ) );
00216 fc_tabs->changeTab( tab1, tr2i18n( "&Project Types" ) );
00217 fcglobal_view->header()->setLabel( 0, tr2i18n( "Type Extension" ) );
00218 fcglobal_view->header()->setLabel( 1, tr2i18n( "Type Name" ) );
00219 fcglobal_view->header()->setLabel( 2, tr2i18n( "Icon" ) );
00220 fcglobal_view->header()->setLabel( 3, tr2i18n( "Description" ) );
00221 copyToProject_button->setText( tr2i18n( "Copy to Pro&ject Types" ) );
00222 fc_tabs->changeTab( tab2, tr2i18n( "Used &Global Types" ) );
00223 fctemplates_view->header()->setLabel( 0, tr2i18n( "Template Name" ) );
00224 edittemplate_button->setText( tr2i18n( "C&hange Content..." ) );
00225 newtemplate_button->setText( tr2i18n( "&New Template..." ) );
00226 templatesDir_label->setText( QString::null );
00227 removetemplate_button->setText( tr2i18n( "Re&move Template" ) );
00228 edit_template_content_button->setText( tr2i18n( "&Edit Template" ) );
00229 fc_tabs->changeTab( tab3, tr2i18n( "Project &Templates" ) );
00230 }
00231
00232 void FCConfigWidgetBase::removetemplate_button_clicked()
00233 {
00234 qWarning( "FCConfigWidgetBase::removetemplate_button_clicked(): Not implemented yet" );
00235 }
00236
00237 void FCConfigWidgetBase::copyToProject_button_clicked()
00238 {
00239 qWarning( "FCConfigWidgetBase::copyToProject_button_clicked(): Not implemented yet" );
00240 }
00241
00242 void FCConfigWidgetBase::newtype_button_clicked()
00243 {
00244 qWarning( "FCConfigWidgetBase::newtype_button_clicked(): Not implemented yet" );
00245 }
00246
00247 void FCConfigWidgetBase::newsubtype_button_clicked()
00248 {
00249 qWarning( "FCConfigWidgetBase::newsubtype_button_clicked(): Not implemented yet" );
00250 }
00251
00252 void FCConfigWidgetBase::remove_button_clicked()
00253 {
00254 qWarning( "FCConfigWidgetBase::remove_button_clicked(): Not implemented yet" );
00255 }
00256
00257 void FCConfigWidgetBase::moveup_button_clicked()
00258 {
00259 qWarning( "FCConfigWidgetBase::moveup_button_clicked(): Not implemented yet" );
00260 }
00261
00262 void FCConfigWidgetBase::movedown_button_clicked()
00263 {
00264 qWarning( "FCConfigWidgetBase::movedown_button_clicked(): Not implemented yet" );
00265 }
00266
00267 void FCConfigWidgetBase::edittype_button_clicked()
00268 {
00269 qWarning( "FCConfigWidgetBase::edittype_button_clicked(): Not implemented yet" );
00270 }
00271
00272 void FCConfigWidgetBase::newtemplate_button_clicked()
00273 {
00274 qWarning( "FCConfigWidgetBase::newtemplate_button_clicked(): Not implemented yet" );
00275 }
00276
00277 void FCConfigWidgetBase::edittemplate_button_clicked()
00278 {
00279 qWarning( "FCConfigWidgetBase::edittemplate_button_clicked(): Not implemented yet" );
00280 }
00281
00282 void FCConfigWidgetBase::edit_template_contents_button_clicked()
00283 {
00284 qWarning( "FCConfigWidgetBase::edit_template_contents_button_clicked(): Not implemented yet" );
00285 }
00286
00287 void FCConfigWidgetBase::edit_template_content_button_clicked()
00288 {
00289 qWarning( "FCConfigWidgetBase::edit_template_content_button_clicked(): Not implemented yet" );
00290 }
00291
00292 void FCConfigWidgetBase::edit_type_content_button_clicked()
00293 {
00294 qWarning( "FCConfigWidgetBase::edit_type_content_button_clicked(): Not implemented yet" );
00295 }
00296
00297 #include "fcconfigwidgetbase.moc"