00001
#include <kdialog.h>
00002
#include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
#include "addapplicationdlgbase.h"
00013
00014
#include <qvariant.h>
00015
#include <kdialog.h>
00016
#include <qpushbutton.h>
00017
#include <qgroupbox.h>
00018
#include <qcheckbox.h>
00019
#include <qlineedit.h>
00020
#include <qcombobox.h>
00021
#include <qlabel.h>
00022
#include <qheader.h>
00023
#include <qlistview.h>
00024
#include <qlayout.h>
00025
#include <qtooltip.h>
00026
#include <qwhatsthis.h>
00027
00028
00029
00030
00031
00032
00033
00034
00035 AddApplicationDialogBase::AddApplicationDialogBase(
QWidget* parent,
const char* name,
bool modal, WFlags fl )
00036 :
QDialog( parent, name, modal, fl )
00037 {
00038
if ( !name )
00039 setName(
"add_application_dialog" );
00040 setSizeGripEnabled( FALSE );
00041
add_application_dialogLayout =
new QVBoxLayout(
this, KDialog::marginHint(), KDialog::spacingHint(),
"add_application_dialogLayout");
00042
00043
GroupBox7 =
new QGroupBox(
this,
"GroupBox7" );
00044
GroupBox7->setColumnLayout(0, Qt::Vertical );
00045
GroupBox7->layout()->setSpacing( KDialog::spacingHint() );
00046
GroupBox7->layout()->setMargin( KDialog::marginHint() );
00047
GroupBox7Layout =
new QGridLayout(
GroupBox7->layout() );
00048
GroupBox7Layout->setAlignment( Qt::AlignTop );
00049
00050
terminal_box =
new QCheckBox(
GroupBox7,
"terminal_box" );
00051
00052
GroupBox7Layout->addWidget(
terminal_box, 2, 1 );
00053
00054
comment_edit =
new QLineEdit(
GroupBox7,
"comment_edit" );
00055
00056
GroupBox7Layout->addMultiCellWidget(
comment_edit, 3, 3, 1, 3 );
00057
00058
filename_edit =
new QLineEdit(
GroupBox7,
"filename_edit" );
00059
00060
GroupBox7Layout->addWidget(
filename_edit, 0, 1 );
00061
00062
Layout2 =
new QHBoxLayout( 0, 0, KDialog::spacingHint(),
"Layout2");
00063
00064
icon_button =
new QPushButton(
GroupBox7,
"icon_button" );
00065
icon_button->setMaximumSize(
QSize( 24, 24 ) );
00066
icon_button->setAutoDefault( FALSE );
00067
Layout2->addWidget(
icon_button );
00068
Spacer1 =
new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00069
Layout2->addItem(
Spacer1 );
00070
00071
GroupBox7Layout->addLayout(
Layout2, 1, 3 );
00072
00073
executable_combo =
new QComboBox( FALSE,
GroupBox7,
"executable_combo" );
00074
executable_combo->setEditable( TRUE );
00075
00076
GroupBox7Layout->addWidget(
executable_combo, 0, 3 );
00077
00078
name_edit =
new QLineEdit(
GroupBox7,
"name_edit" );
00079
00080
GroupBox7Layout->addWidget(
name_edit, 1, 1 );
00081
00082
section_combo =
new QComboBox( FALSE,
GroupBox7,
"section_combo" );
00083
00084
GroupBox7Layout->addWidget(
section_combo, 2, 3 );
00085
00086
name_label_2 =
new QLabel(
GroupBox7,
"name_label_2" );
00087
QFont name_label_2_font(
name_label_2->font() );
00088
name_label_2->setFont( name_label_2_font );
00089
name_label_2->setAlignment(
int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00090
00091
GroupBox7Layout->addWidget(
name_label_2, 0, 2 );
00092
00093
icon_label =
new QLabel(
GroupBox7,
"icon_label" );
00094
QFont icon_label_font(
icon_label->font() );
00095
icon_label->setFont( icon_label_font );
00096
icon_label->setAlignment(
int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00097
00098
GroupBox7Layout->addWidget(
icon_label, 1, 2 );
00099
00100
section_label =
new QLabel(
GroupBox7,
"section_label" );
00101
QFont section_label_font(
section_label->font() );
00102
section_label->setFont( section_label_font );
00103
section_label->setAlignment(
int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00104
00105
GroupBox7Layout->addWidget(
section_label, 2, 2 );
00106
00107
filename_label =
new QLabel(
GroupBox7,
"filename_label" );
00108
QFont filename_label_font(
filename_label->font() );
00109
filename_label->setFont( filename_label_font );
00110
filename_label->setAlignment(
int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00111
00112
GroupBox7Layout->addWidget(
filename_label, 0, 0 );
00113
00114
name_label =
new QLabel(
GroupBox7,
"name_label" );
00115
QFont name_label_font(
name_label->font() );
00116
name_label->setFont( name_label_font );
00117
name_label->setAlignment(
int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00118
00119
GroupBox7Layout->addWidget(
name_label, 1, 0 );
00120
00121
comment_label =
new QLabel(
GroupBox7,
"comment_label" );
00122
QFont comment_label_font(
comment_label->font() );
00123
comment_label->setFont( comment_label_font );
00124
comment_label->setAlignment(
int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00125
00126
GroupBox7Layout->addWidget(
comment_label, 3, 0 );
00127
add_application_dialogLayout->addWidget(
GroupBox7 );
00128
Spacer11 =
new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Preferred );
00129
add_application_dialogLayout->addItem(
Spacer11 );
00130
00131
GroupBox6 =
new QGroupBox(
this,
"GroupBox6" );
00132
GroupBox6->setColumnLayout(0, Qt::Vertical );
00133
GroupBox6->layout()->setSpacing( KDialog::spacingHint() );
00134
GroupBox6->layout()->setMargin( KDialog::marginHint() );
00135
GroupBox6Layout =
new QHBoxLayout(
GroupBox6->layout() );
00136
GroupBox6Layout->setAlignment( Qt::AlignTop );
00137
00138
Layout5 =
new QHBoxLayout( 0, 0, KDialog::spacingHint(),
"Layout5");
00139
00140
chosentypes_listview =
new QListView(
GroupBox6,
"chosentypes_listview" );
00141
chosentypes_listview->addColumn( QString::null );
00142
chosentypes_listview->setResizeMode( QListView::LastColumn );
00143
Layout5->addWidget(
chosentypes_listview );
00144
00145
Layout3 =
new QVBoxLayout( 0, 0, KDialog::spacingHint(),
"Layout3");
00146
Spacer4 =
new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00147
Layout3->addItem(
Spacer4 );
00148
00149
add_button =
new QPushButton(
GroupBox6,
"add_button" );
00150
Layout3->addWidget(
add_button );
00151
00152
remove_button =
new QPushButton(
GroupBox6,
"remove_button" );
00153
Layout3->addWidget(
remove_button );
00154
Spacer5 =
new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00155
Layout3->addItem(
Spacer5 );
00156
Layout5->addLayout(
Layout3 );
00157
00158
availtypes_listview =
new QListView(
GroupBox6,
"availtypes_listview" );
00159
availtypes_listview->addColumn( QString::null );
00160
availtypes_listview->setResizeMode( QListView::LastColumn );
00161
Layout5->addWidget(
availtypes_listview );
00162
GroupBox6Layout->addLayout(
Layout5 );
00163
add_application_dialogLayout->addWidget(
GroupBox6 );
00164
00165
Layout1 =
new QHBoxLayout( 0, 0, KDialog::spacingHint(),
"Layout1");
00166
Horizontal_Spacing2 =
new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00167
Layout1->addItem(
Horizontal_Spacing2 );
00168
00169
okbutton =
new QPushButton(
this,
"okbutton" );
00170
okbutton->setAutoDefault( TRUE );
00171
okbutton->setDefault( TRUE );
00172
Layout1->addWidget(
okbutton );
00173
00174
cancelbutton =
new QPushButton(
this,
"cancelbutton" );
00175
cancelbutton->setAutoDefault( TRUE );
00176
Layout1->addWidget(
cancelbutton );
00177
add_application_dialogLayout->addLayout(
Layout1 );
00178
languageChange();
00179 resize(
QSize(586, 425).expandedTo(minimumSizeHint()) );
00180 clearWState( WState_Polished );
00181
00182
00183 connect(
cancelbutton, SIGNAL( clicked() ),
this, SLOT( reject() ) );
00184 connect(
okbutton, SIGNAL( clicked() ),
this, SLOT( accept() ) );
00185 connect(
icon_button, SIGNAL( clicked() ),
this, SLOT(
iconClicked() ) );
00186 connect(
add_button, SIGNAL( clicked() ),
this, SLOT(
addTypeClicked() ) );
00187 connect(
remove_button, SIGNAL( clicked() ),
this, SLOT(
removeTypeClicked() ) );
00188
00189
00190 setTabOrder(
filename_edit,
executable_combo );
00191 setTabOrder(
executable_combo,
name_edit );
00192 setTabOrder(
name_edit,
icon_button );
00193 setTabOrder(
icon_button,
terminal_box );
00194 setTabOrder(
terminal_box,
section_combo );
00195 setTabOrder(
section_combo,
comment_edit );
00196 setTabOrder(
comment_edit,
chosentypes_listview );
00197 setTabOrder(
chosentypes_listview,
add_button );
00198 setTabOrder(
add_button,
remove_button );
00199 setTabOrder(
remove_button,
availtypes_listview );
00200 setTabOrder(
availtypes_listview,
okbutton );
00201 setTabOrder(
okbutton,
cancelbutton );
00202
00203
00204
name_label_2->setBuddy(
executable_combo );
00205
icon_label->setBuddy(
icon_button );
00206
section_label->setBuddy(
section_combo );
00207
filename_label->setBuddy(
filename_edit );
00208
name_label->setBuddy(
name_edit );
00209
comment_label->setBuddy(
comment_edit );
00210 }
00211
00212
00213
00214
00215 AddApplicationDialogBase::~AddApplicationDialogBase()
00216 {
00217
00218 }
00219
00220
00221
00222
00223
00224 void AddApplicationDialogBase::languageChange()
00225 {
00226 setCaption( tr2i18n(
"Add New Application .desktop File" ) );
00227
GroupBox7->setTitle( tr2i18n(
"&Application File" ) );
00228
terminal_box->setText( tr2i18n(
"Start in t&erminal" ) );
00229
icon_button->setText( QString::null );
00230
section_combo->clear();
00231
section_combo->insertItem( tr2i18n(
"Application" ) );
00232
section_combo->insertItem( tr2i18n(
"Games" ) );
00233
section_combo->insertItem( tr2i18n(
"Development" ) );
00234
section_combo->insertItem( tr2i18n(
"Editors" ) );
00235
section_combo->insertItem( tr2i18n(
"Graphics" ) );
00236
section_combo->insertItem( tr2i18n(
"Internet" ) );
00237
section_combo->insertItem( tr2i18n(
"Multimedia" ) );
00238
section_combo->insertItem( tr2i18n(
"Office" ) );
00239
section_combo->insertItem( tr2i18n(
"Settings" ) );
00240
section_combo->insertItem( tr2i18n(
"System" ) );
00241
section_combo->insertItem( tr2i18n(
"Toys" ) );
00242
section_combo->insertItem( tr2i18n(
"Utilities" ) );
00243
section_combo->insertItem( tr2i18n(
"WordProcessing" ) );
00244
name_label_2->setText( tr2i18n(
"E&xecutable:" ) );
00245
icon_label->setText( tr2i18n(
"&Icon:" ) );
00246
section_label->setText( tr2i18n(
"&Section:" ) );
00247
filename_label->setText( tr2i18n(
"&File name:" ) );
00248
name_label->setText( tr2i18n(
"&Name:" ) );
00249
comment_label->setText( tr2i18n(
"Co&mment:" ) );
00250
GroupBox6->setTitle( tr2i18n(
"Mime &Types" ) );
00251
chosentypes_listview->header()->setLabel( 0, QString::null );
00252
add_button->setText( tr2i18n(
"<-" ) );
00253
remove_button->setText( tr2i18n(
"->" ) );
00254
availtypes_listview->header()->setLabel( 0, QString::null );
00255
okbutton->setText( tr2i18n(
"&OK" ) );
00256
cancelbutton->setText( tr2i18n(
"&Cancel" ) );
00257 }
00258
00259 void AddApplicationDialogBase::addTypeClicked()
00260 {
00261 qWarning(
"AddApplicationDialogBase::addTypeClicked(): Not implemented yet" );
00262 }
00263
00264 void AddApplicationDialogBase::iconClicked()
00265 {
00266 qWarning(
"AddApplicationDialogBase::iconClicked(): Not implemented yet" );
00267 }
00268
00269 void AddApplicationDialogBase::removeTypeClicked()
00270 {
00271 qWarning(
"AddApplicationDialogBase::removeTypeClicked(): Not implemented yet" );
00272 }
00273
00274
#include "addapplicationdlgbase.moc"