00001
#include <klocale.h>
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
#include "newcontactdlg.h"
00012
00013
#include <qvariant.h>
00014
#include <qpushbutton.h>
00015
#include <qgroupbox.h>
00016
#include <qlabel.h>
00017
#include <qlineedit.h>
00018
#include <qcombobox.h>
00019
#include <qlayout.h>
00020
#include <qtooltip.h>
00021
#include <qwhatsthis.h>
00022
00023
00024
00025
00026
00027
00028
00029
00030 FormNewContactDlg::FormNewContactDlg( QWidget* parent,
const char* name,
bool modal, WFlags fl )
00031 : QDialog( parent, name, modal, fl )
00032 {
00033
if ( !name )
00034 setName(
"FormNewContactDlg" );
00035 FormNewContactDlgLayout =
new QVBoxLayout(
this, 11, 6,
"FormNewContactDlgLayout");
00036
00037 layout3 =
new QVBoxLayout( 0, 0, 6,
"layout3");
00038
00039 groupBoxNewContact =
new QGroupBox(
this,
"groupBoxNewContact" );
00040 groupBoxNewContact->setColumnLayout(0, Qt::Vertical );
00041 groupBoxNewContact->layout()->setSpacing( 6 );
00042 groupBoxNewContact->layout()->setMargin( 11 );
00043 groupBoxNewContactLayout =
new QVBoxLayout( groupBoxNewContact->layout() );
00044 groupBoxNewContactLayout->setAlignment( Qt::AlignTop );
00045
00046 layout1 =
new QGridLayout( 0, 1, 1, 0, 6,
"layout1");
00047
00048 textLabelNewContactNumber =
new QLabel( groupBoxNewContact,
"textLabelNewContactNumber" );
00049
00050 layout1->addWidget( textLabelNewContactNumber, 1, 0 );
00051
00052 lineEditNewContactNumber =
new QLineEdit( groupBoxNewContact,
"lineEditNewContactNumber" );
00053
00054 layout1->addWidget( lineEditNewContactNumber, 1, 1 );
00055
00056 textLabelNewContactName =
new QLabel( groupBoxNewContact,
"textLabelNewContactName" );
00057
00058 layout1->addWidget( textLabelNewContactName, 0, 0 );
00059
00060 comboBoxNewContactType =
new QComboBox( FALSE, groupBoxNewContact,
"comboBoxNewContactType" );
00061
00062 layout1->addWidget( comboBoxNewContactType, 2, 1 );
00063
00064 textLabelNewContactType =
new QLabel( groupBoxNewContact,
"textLabelNewContactType" );
00065
00066 layout1->addWidget( textLabelNewContactType, 2, 0 );
00067
00068 lineEditNewContactName =
new QLineEdit( groupBoxNewContact,
"lineEditNewContactName" );
00069
00070 layout1->addWidget( lineEditNewContactName, 0, 1 );
00071 groupBoxNewContactLayout->addLayout( layout1 );
00072 layout3->addWidget( groupBoxNewContact );
00073
00074 layout2 =
new QHBoxLayout( 0, 0, 6,
"layout2");
00075 QSpacerItem* spacer =
new QSpacerItem( 60, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00076 layout2->addItem( spacer );
00077
00078 pushButtonNewContactCancel =
new QPushButton(
this,
"pushButtonNewContactCancel" );
00079 layout2->addWidget( pushButtonNewContactCancel );
00080
00081 pushButtonNewContactOk =
new QPushButton(
this,
"pushButtonNewContactOk" );
00082 layout2->addWidget( pushButtonNewContactOk );
00083 layout3->addLayout( layout2 );
00084 FormNewContactDlgLayout->addLayout( layout3 );
00085 languageChange();
00086 resize( QSize(282, 198).expandedTo(minimumSizeHint()) );
00087 clearWState( WState_Polished );
00088
00089
00090 connect( pushButtonNewContactCancel, SIGNAL( clicked() ),
this, SLOT(
closeDialog() ) );
00091 connect( pushButtonNewContactOk, SIGNAL( clicked() ),
this, SLOT(
readContact() ) );
00092
00093
00094 setTabOrder( lineEditNewContactName, lineEditNewContactNumber );
00095 setTabOrder( lineEditNewContactNumber, comboBoxNewContactType );
00096 setTabOrder( comboBoxNewContactType, pushButtonNewContactOk );
00097 setTabOrder( pushButtonNewContactOk, pushButtonNewContactCancel );
00098
00099
00100 textLabelNewContactNumber->setBuddy( lineEditNewContactNumber );
00101 textLabelNewContactName->setBuddy( lineEditNewContactName );
00102 textLabelNewContactType->setBuddy( comboBoxNewContactType );
00103 }
00104
00105
00106
00107
00108 FormNewContactDlg::~FormNewContactDlg()
00109 {
00110
00111 }
00112
00113
00114
00115
00116
00117
void FormNewContactDlg::languageChange()
00118 {
00119 setCaption( tr2i18n(
"FormNewContactDlg" ) );
00120 groupBoxNewContact->setTitle( tr2i18n(
"Contact Properties" ) );
00121 textLabelNewContactNumber->setText( tr2i18n(
"Number" ) );
00122 lineEditNewContactNumber->setInputMask( tr2i18n(
"#00000000000000000000; " ) );
00123 QToolTip::add( lineEditNewContactNumber, tr2i18n(
"Only digits are allowed, a leading + is also valid" ) );
00124 textLabelNewContactName->setText( tr2i18n(
"Name" ) );
00125 comboBoxNewContactType->clear();
00126 comboBoxNewContactType->insertItem( tr2i18n(
"Home" ) );
00127 comboBoxNewContactType->insertItem( tr2i18n(
"Work" ) );
00128 comboBoxNewContactType->insertItem( tr2i18n(
"Mobile" ) );
00129 comboBoxNewContactType->insertItem( tr2i18n(
"Fax" ) );
00130 comboBoxNewContactType->insertItem( tr2i18n(
"Other" ) );
00131 textLabelNewContactType->setText( tr2i18n(
"Type" ) );
00132 pushButtonNewContactCancel->setText( tr2i18n(
"Cancel" ) );
00133 pushButtonNewContactOk->setText( tr2i18n(
"Ok" ) );
00134 }
00135
00136
void FormNewContactDlg::readContact()
00137 {
00138 qWarning(
"FormNewContactDlg::readContact(): Not implemented yet" );
00139 }
00140
00141
void FormNewContactDlg::closeDialog()
00142 {
00143 qWarning(
"FormNewContactDlg::closeDialog(): Not implemented yet" );
00144 }
00145
00146
#include "newcontactdlg.moc"