00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "mobilegui_base.h"
00012
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qgroupbox.h>
00016 #include <qlabel.h>
00017 #include <qtabwidget.h>
00018 #include <qheader.h>
00019 #include <qlistview.h>
00020 #include <qtextedit.h>
00021 #include <qlayout.h>
00022 #include <qtooltip.h>
00023 #include <qwhatsthis.h>
00024
00025
00026
00027
00028
00029 MobileGui_base::MobileGui_base( QWidget* parent, const char* name, WFlags fl )
00030 : QWidget( parent, name, fl )
00031 {
00032 if ( !name )
00033 setName( "MobileGui_base" );
00034 MobileGui_baseLayout = new QGridLayout( this, 1, 1, 11, 6, "MobileGui_baseLayout");
00035
00036 GroupBox2 = new QGroupBox( this, "GroupBox2" );
00037 GroupBox2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, GroupBox2->sizePolicy().hasHeightForWidth() ) );
00038 GroupBox2->setColumnLayout(0, Qt::Vertical );
00039 GroupBox2->layout()->setSpacing( 6 );
00040 GroupBox2->layout()->setMargin( 11 );
00041 GroupBox2Layout = new QGridLayout( GroupBox2->layout() );
00042 GroupBox2Layout->setAlignment( Qt::AlignTop );
00043
00044 TextLabel1 = new QLabel( GroupBox2, "TextLabel1" );
00045
00046 GroupBox2Layout->addWidget( TextLabel1, 1, 0 );
00047
00048 TextLabel3_2 = new QLabel( GroupBox2, "TextLabel3_2" );
00049
00050 GroupBox2Layout->addWidget( TextLabel3_2, 3, 0 );
00051
00052 mManufacturerLabel = new QLabel( GroupBox2, "mManufacturerLabel" );
00053
00054 GroupBox2Layout->addWidget( mManufacturerLabel, 0, 1 );
00055
00056 mGSMVersionLabel = new QLabel( GroupBox2, "mGSMVersionLabel" );
00057
00058 GroupBox2Layout->addWidget( mGSMVersionLabel, 2, 1 );
00059
00060 mSerialNumberLabel = new QLabel( GroupBox2, "mSerialNumberLabel" );
00061
00062 GroupBox2Layout->addWidget( mSerialNumberLabel, 3, 1 );
00063
00064 mModelLabel = new QLabel( GroupBox2, "mModelLabel" );
00065
00066 GroupBox2Layout->addWidget( mModelLabel, 1, 1 );
00067
00068 TextLabel3 = new QLabel( GroupBox2, "TextLabel3" );
00069
00070 GroupBox2Layout->addWidget( TextLabel3, 0, 0 );
00071
00072 TextLabel2 = new QLabel( GroupBox2, "TextLabel2" );
00073
00074 GroupBox2Layout->addWidget( TextLabel2, 2, 0 );
00075 spacer42 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00076 GroupBox2Layout->addItem( spacer42, 0, 2 );
00077
00078 MobileGui_baseLayout->addWidget( GroupBox2, 0, 0 );
00079
00080 mTabWidget = new QTabWidget( this, "mTabWidget" );
00081
00082 mABTab = new QWidget( mTabWidget, "mABTab" );
00083 mABTab->setEnabled( FALSE );
00084 mABTabLayout = new QGridLayout( mABTab, 1, 1, 11, 6, "mABTabLayout");
00085
00086 groupBox3 = new QGroupBox( mABTab, "groupBox3" );
00087 groupBox3->setColumnLayout(0, Qt::Vertical );
00088 groupBox3->layout()->setSpacing( 6 );
00089 groupBox3->layout()->setMargin( 11 );
00090 groupBox3Layout = new QGridLayout( groupBox3->layout() );
00091 groupBox3Layout->setAlignment( Qt::AlignTop );
00092
00093 mKabBook = new QListView( groupBox3, "mKabBook" );
00094 mKabBook->addColumn( tr2i18n( "Name" ) );
00095 mKabBook->addColumn( tr2i18n( "Phone" ) );
00096 mKabBook->setResizeMode( QListView::AllColumns );
00097
00098 groupBox3Layout->addMultiCellWidget( mKabBook, 0, 2, 0, 0 );
00099
00100 mReadKabButton = new QPushButton( groupBox3, "mReadKabButton" );
00101
00102 groupBox3Layout->addWidget( mReadKabButton, 0, 1 );
00103 spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00104 groupBox3Layout->addItem( spacer4, 2, 1 );
00105
00106 PushButton8 = new QPushButton( groupBox3, "PushButton8" );
00107
00108 groupBox3Layout->addWidget( PushButton8, 1, 1 );
00109
00110 mABTabLayout->addWidget( groupBox3, 0, 0 );
00111
00112 groupBox4 = new QGroupBox( mABTab, "groupBox4" );
00113 groupBox4->setColumnLayout(0, Qt::Vertical );
00114 groupBox4->layout()->setSpacing( 6 );
00115 groupBox4->layout()->setMargin( 11 );
00116 groupBox4Layout = new QGridLayout( groupBox4->layout() );
00117 groupBox4Layout->setAlignment( Qt::AlignTop );
00118
00119 PushButton3 = new QPushButton( groupBox4, "PushButton3" );
00120
00121 groupBox4Layout->addWidget( PushButton3, 0, 1 );
00122
00123 PushButton12 = new QPushButton( groupBox4, "PushButton12" );
00124
00125 groupBox4Layout->addWidget( PushButton12, 1, 1 );
00126 spacer5 = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
00127 groupBox4Layout->addItem( spacer5, 3, 1 );
00128
00129 PushButton4_2 = new QPushButton( groupBox4, "PushButton4_2" );
00130
00131 groupBox4Layout->addWidget( PushButton4_2, 2, 1 );
00132
00133 MobDeleteButton = new QPushButton( groupBox4, "MobDeleteButton" );
00134
00135 groupBox4Layout->addWidget( MobDeleteButton, 4, 1 );
00136
00137 mMobileBook = new QListView( groupBox4, "mMobileBook" );
00138 mMobileBook->addColumn( tr2i18n( "Name" ) );
00139 mMobileBook->addColumn( tr2i18n( "Phone" ) );
00140 mMobileBook->setResizeMode( QListView::AllColumns );
00141
00142 groupBox4Layout->addMultiCellWidget( mMobileBook, 0, 4, 0, 0 );
00143
00144 mABTabLayout->addWidget( groupBox4, 0, 1 );
00145
00146 layout21 = new QHBoxLayout( 0, 0, 6, "layout21");
00147
00148 PushButton8_3 = new QPushButton( mABTab, "PushButton8_3" );
00149 layout21->addWidget( PushButton8_3 );
00150 spacer6 = new QSpacerItem( 321, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00151 layout21->addItem( spacer6 );
00152
00153 mABTabLayout->addMultiCellLayout( layout21, 1, 1, 0, 1 );
00154 mTabWidget->insertTab( mABTab, QString::fromLatin1("") );
00155
00156 mTerminalTab = new QWidget( mTabWidget, "mTerminalTab" );
00157 mTerminalTabLayout = new QGridLayout( mTerminalTab, 1, 1, 11, 6, "mTerminalTabLayout");
00158
00159 mTermIO = new QTextEdit( mTerminalTab, "mTermIO" );
00160 mTermIO->setReadOnly( TRUE );
00161
00162 mTerminalTabLayout->addWidget( mTermIO, 0, 0 );
00163 mTabWidget->insertTab( mTerminalTab, QString::fromLatin1("") );
00164
00165 MobileGui_baseLayout->addMultiCellWidget( mTabWidget, 1, 1, 0, 1 );
00166
00167 GroupBox1 = new QGroupBox( this, "GroupBox1" );
00168 GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)3, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) );
00169 GroupBox1->setColumnLayout(0, Qt::Vertical );
00170 GroupBox1->layout()->setSpacing( 6 );
00171 GroupBox1->layout()->setMargin( 11 );
00172 GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
00173 GroupBox1Layout->setAlignment( Qt::AlignTop );
00174
00175 mStatus = new QLabel( GroupBox1, "mStatus" );
00176
00177 GroupBox1Layout->addWidget( mStatus, 0, 0 );
00178
00179 TextLabel5 = new QLabel( GroupBox1, "TextLabel5" );
00180
00181 GroupBox1Layout->addWidget( TextLabel5, 1, 0 );
00182
00183 mSignalQualityLabel = new QLabel( GroupBox1, "mSignalQualityLabel" );
00184
00185 GroupBox1Layout->addWidget( mSignalQualityLabel, 1, 1 );
00186
00187 mBatteryChargeLabel = new QLabel( GroupBox1, "mBatteryChargeLabel" );
00188
00189 GroupBox1Layout->addWidget( mBatteryChargeLabel, 0, 1 );
00190 Spacer1 = new QSpacerItem( 0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00191 GroupBox1Layout->addMultiCell( Spacer1, 2, 2, 0, 4 );
00192
00193 mConnectButton = new QPushButton( GroupBox1, "mConnectButton" );
00194
00195 GroupBox1Layout->addWidget( mConnectButton, 3, 0 );
00196 spacer9 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00197 GroupBox1Layout->addItem( spacer9, 3, 2 );
00198
00199 PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
00200 PushButton1->setEnabled( FALSE );
00201
00202 GroupBox1Layout->addWidget( PushButton1, 3, 3 );
00203
00204 PushButton5_3 = new QPushButton( GroupBox1, "PushButton5_3" );
00205 PushButton5_3->setEnabled( FALSE );
00206
00207 GroupBox1Layout->addWidget( PushButton5_3, 3, 4 );
00208
00209 MobileGui_baseLayout->addWidget( GroupBox1, 0, 1 );
00210 languageChange();
00211 resize( QSize(865, 473).expandedTo(minimumSizeHint()) );
00212 clearWState( WState_Polished );
00213
00214
00215 connect( mReadKabButton, SIGNAL( clicked() ), this, SLOT( readKabc() ) );
00216 connect( PushButton8, SIGNAL( clicked() ), this, SLOT( writeKabc() ) );
00217 connect( PushButton3, SIGNAL( clicked() ), this, SLOT( readPhonebook() ) );
00218 connect( PushButton12, SIGNAL( clicked() ), this, SLOT( writePhonebook() ) );
00219 connect( PushButton4_2, SIGNAL( clicked() ), this, SLOT( savePhonebook() ) );
00220 connect( PushButton5_3, SIGNAL( clicked() ), this, SLOT( setClock() ) );
00221 connect( PushButton8_3, SIGNAL( clicked() ), this, SLOT( syncPhonebooks() ) );
00222 connect( PushButton1, SIGNAL( clicked() ), this, SLOT( refreshStatus() ) );
00223 connect( mConnectButton, SIGNAL( clicked() ), this, SLOT( toggleConnection() ) );
00224 connect( MobDeleteButton, SIGNAL( clicked() ), this, SLOT( deleteMobPhonebook() ) );
00225
00226
00227 setTabOrder( mKabBook, mReadKabButton );
00228 setTabOrder( mReadKabButton, PushButton8 );
00229 setTabOrder( PushButton8, mMobileBook );
00230 setTabOrder( mMobileBook, PushButton3 );
00231 setTabOrder( PushButton3, PushButton12 );
00232 setTabOrder( PushButton12, PushButton4_2 );
00233 setTabOrder( PushButton4_2, MobDeleteButton );
00234 setTabOrder( MobDeleteButton, PushButton5_3 );
00235 setTabOrder( PushButton5_3, PushButton1 );
00236 setTabOrder( PushButton1, PushButton8_3 );
00237 }
00238
00239
00240
00241
00242 MobileGui_base::~MobileGui_base()
00243 {
00244
00245 }
00246
00247
00248
00249
00250
00251 void MobileGui_base::languageChange()
00252 {
00253 setCaption( tr2i18n( "Mobile Device" ) );
00254 GroupBox2->setTitle( tr2i18n( "Model Information" ) );
00255 TextLabel1->setText( tr2i18n( "Model:" ) );
00256 TextLabel3_2->setText( tr2i18n( "Serial number:" ) );
00257 mManufacturerLabel->setText( tr2i18n( "x" ) );
00258 mGSMVersionLabel->setText( tr2i18n( "x" ) );
00259 mSerialNumberLabel->setText( tr2i18n( "x" ) );
00260 mModelLabel->setText( tr2i18n( "x" ) );
00261 TextLabel3->setText( tr2i18n( "Manufacturer:" ) );
00262 TextLabel2->setText( tr2i18n( "GSM version:" ) );
00263 groupBox3->setTitle( tr2i18n( "KDE Address Book" ) );
00264 mKabBook->header()->setLabel( 0, tr2i18n( "Name" ) );
00265 mKabBook->header()->setLabel( 1, tr2i18n( "Phone" ) );
00266 mReadKabButton->setText( tr2i18n( "Read" ) );
00267 PushButton8->setText( tr2i18n( "Write" ) );
00268 groupBox4->setTitle( tr2i18n( "Mobile Phone Book" ) );
00269 PushButton3->setText( tr2i18n( "Read" ) );
00270 PushButton12->setText( tr2i18n( "Write" ) );
00271 PushButton4_2->setText( tr2i18n( "Save to File..." ) );
00272 MobDeleteButton->setText( tr2i18n( "Delete" ) );
00273 mMobileBook->header()->setLabel( 0, tr2i18n( "Name" ) );
00274 mMobileBook->header()->setLabel( 1, tr2i18n( "Phone" ) );
00275 PushButton8_3->setText( tr2i18n( "Sync" ) );
00276 mTabWidget->changeTab( mABTab, tr2i18n( "Address Books" ) );
00277 mTabWidget->changeTab( mTerminalTab, tr2i18n( "Terminal" ) );
00278 GroupBox1->setTitle( tr2i18n( "Status" ) );
00279 mStatus->setText( tr2i18n( "Battery charge:" ) );
00280 TextLabel5->setText( tr2i18n( "Signal quality:" ) );
00281 mSignalQualityLabel->setText( tr2i18n( "x" ) );
00282 mBatteryChargeLabel->setText( tr2i18n( "xx %" ) );
00283 mConnectButton->setText( tr2i18n( "Connect" ) );
00284 PushButton1->setText( tr2i18n( "Refresh" ) );
00285 PushButton5_3->setText( tr2i18n( "Set Clock" ) );
00286 }
00287
00288 void MobileGui_base::readKabc()
00289 {
00290 qWarning( "MobileGui_base::readKabc(): Not implemented yet" );
00291 }
00292
00293 void MobileGui_base::readModelInformation()
00294 {
00295 qWarning( "MobileGui_base::readModelInformation(): Not implemented yet" );
00296 }
00297
00298 void MobileGui_base::readPhonebook()
00299 {
00300 qWarning( "MobileGui_base::readPhonebook(): Not implemented yet" );
00301 }
00302
00303 void MobileGui_base::refreshStatus()
00304 {
00305 qWarning( "MobileGui_base::refreshStatus(): Not implemented yet" );
00306 }
00307
00308 void MobileGui_base::savePhonebook()
00309 {
00310 qWarning( "MobileGui_base::savePhonebook(): Not implemented yet" );
00311 }
00312
00313 void MobileGui_base::setClock()
00314 {
00315 qWarning( "MobileGui_base::setClock(): Not implemented yet" );
00316 }
00317
00318 void MobileGui_base::syncPhonebooks()
00319 {
00320 qWarning( "MobileGui_base::syncPhonebooks(): Not implemented yet" );
00321 }
00322
00323 void MobileGui_base::writeKabc()
00324 {
00325 qWarning( "MobileGui_base::writeKabc(): Not implemented yet" );
00326 }
00327
00328 void MobileGui_base::writePhonebook()
00329 {
00330 qWarning( "MobileGui_base::writePhonebook(): Not implemented yet" );
00331 }
00332
00333 void MobileGui_base::termAddOutput(const char*)
00334 {
00335 qWarning( "MobileGui_base::termAddOutput(const char*): Not implemented yet" );
00336 }
00337
00338 void MobileGui_base::toggleConnection()
00339 {
00340 qWarning( "MobileGui_base::toggleConnection(): Not implemented yet" );
00341 }
00342
00343 void MobileGui_base::deleteMobPhonebook()
00344 {
00345 qWarning( "MobileGui_base::deleteMobPhonebook(): Not implemented yet" );
00346 }
00347
00348 #include "mobilegui_base.moc"