Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index b078968..dec4c7c 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -32,5 +32,4 @@ | |||
32 | 32 | ||
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qtabwidget.h> | ||
35 | #include <qlayout.h> | 34 | #include <qlayout.h> |
36 | #include <qlineedit.h> | 35 | #include <qlineedit.h> |
@@ -59,5 +58,5 @@ ContactEditor::ContactEditor( const Opie::OPimContact &entry, | |||
59 | const char *name, | 58 | const char *name, |
60 | WFlags ) | 59 | WFlags ) |
61 | : QDialog( parent, name, TRUE, WStyle_ContextHelp ), | 60 | : QDialog( parent, name, true, WStyle_ContextHelp ), |
62 | defaultEmailChooserPosition( -1 ), | 61 | defaultEmailChooserPosition( -1 ), |
63 | m_personalView ( false ), | 62 | m_personalView ( false ), |
@@ -120,12 +119,12 @@ void ContactEditor::init() { | |||
120 | QVBoxLayout *vb = new QVBoxLayout( this ); | 119 | QVBoxLayout *vb = new QVBoxLayout( this ); |
121 | 120 | ||
122 | tabMain = new QTabWidget( this ); | 121 | tabMain = new Opie::Ui::OTabWidget( this ); |
123 | vb->addWidget( tabMain ); | 122 | vb->addWidget( tabMain ); |
124 | 123 | ||
125 | QWidget *tabViewport = new QWidget ( tabMain ); | 124 | m_generalWidget = new QWidget ( tabMain ); |
126 | 125 | ||
127 | vb = new QVBoxLayout( tabViewport ); | 126 | vb = new QVBoxLayout( m_generalWidget ); |
128 | 127 | ||
129 | svGeneral = new QScrollView( tabViewport ); | 128 | svGeneral = new QScrollView( m_generalWidget ); |
130 | vb->addWidget( svGeneral, 0, 0 ); | 129 | vb->addWidget( svGeneral, 0, 0 ); |
131 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); | 130 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); |
@@ -137,6 +136,5 @@ void ContactEditor::init() { | |||
137 | svGeneral->addChild( container ); | 136 | svGeneral->addChild( container ); |
138 | 137 | ||
139 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); | 138 | QGridLayout *gl = new QGridLayout( container, 10, 2, 2, 4 ); |
140 | gl->setResizeMode( QLayout::FreeResize ); | ||
141 | 139 | ||
142 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); | 140 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); |
@@ -169,5 +167,5 @@ void ContactEditor::init() { | |||
169 | 167 | ||
170 | // Chooser 1 | 168 | // Chooser 1 |
171 | cmbChooserField1 = new QComboBox( FALSE, container ); | 169 | cmbChooserField1 = new QComboBox( false, container ); |
172 | QWhatsThis::add( cmbChooserField1, tr( "Press to select attribute to change" ) ); | 170 | QWhatsThis::add( cmbChooserField1, tr( "Press to select attribute to change" ) ); |
173 | cmbChooserField1->setMaximumWidth( 90 ); | 171 | cmbChooserField1->setMaximumWidth( 90 ); |
@@ -182,5 +180,5 @@ void ContactEditor::init() { | |||
182 | 180 | ||
183 | // Chooser 2 | 181 | // Chooser 2 |
184 | cmbChooserField2 = new QComboBox( FALSE, container ); | 182 | cmbChooserField2 = new QComboBox( false, container ); |
185 | QWhatsThis::add( cmbChooserField2, tr( "Press to select attribute to change" ) ); | 183 | QWhatsThis::add( cmbChooserField2, tr( "Press to select attribute to change" ) ); |
186 | cmbChooserField2->setMaximumWidth( 90 ); | 184 | cmbChooserField2->setMaximumWidth( 90 ); |
@@ -195,5 +193,5 @@ void ContactEditor::init() { | |||
195 | 193 | ||
196 | // Chooser 3 | 194 | // Chooser 3 |
197 | cmbChooserField3 = new QComboBox( FALSE, container ); | 195 | cmbChooserField3 = new QComboBox( false, container ); |
198 | QWhatsThis::add( cmbChooserField3, tr( "Press to select attribute to change" ) ); | 196 | QWhatsThis::add( cmbChooserField3, tr( "Press to select attribute to change" ) ); |
199 | cmbChooserField3->setMaximumWidth( 90 ); | 197 | cmbChooserField3->setMaximumWidth( 90 ); |
@@ -210,5 +208,5 @@ void ContactEditor::init() { | |||
210 | QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) ); | 208 | QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) ); |
211 | gl->addWidget( l, 7, 0 ); | 209 | gl->addWidget( l, 7, 0 ); |
212 | cmbFileAs = new QComboBox( TRUE, container ); | 210 | cmbFileAs = new QComboBox( true, container ); |
213 | gl->addWidget( cmbFileAs, 7, 1 ); | 211 | gl->addWidget( cmbFileAs, 7, 1 ); |
214 | 212 | ||
@@ -220,10 +218,10 @@ void ContactEditor::init() { | |||
220 | cmbCat->show(); | 218 | cmbCat->show(); |
221 | 219 | ||
222 | btnNote = new QPushButton( tr( "Notes..." ), container ); | 220 | btnNote = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Notes..." ), container ); |
223 | gl->addWidget( btnNote, 9, 1 ); | 221 | gl->addWidget( btnNote, 9, 1 ); |
224 | 222 | ||
225 | tabMain->insertTab( tabViewport, tr( "General" ) ); | 223 | tabMain->addTab( m_generalWidget, "addressbook/AddressBookSmall", tr( "General" ) ); |
226 | 224 | ||
227 | tabViewport = new QWidget ( tabMain ); | 225 | QWidget *tabViewport = new QWidget ( tabMain ); |
228 | 226 | ||
229 | vb = new QVBoxLayout( tabViewport ); | 227 | vb = new QVBoxLayout( tabViewport ); |
@@ -239,5 +237,5 @@ void ContactEditor::init() { | |||
239 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem | 237 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem |
240 | 238 | ||
241 | cmbAddress = new QComboBox( FALSE, container ); | 239 | cmbAddress = new QComboBox( false, container ); |
242 | cmbAddress->insertItem( tr( "Business" ) ); | 240 | cmbAddress->insertItem( tr( "Business" ) ); |
243 | cmbAddress->insertItem( tr( "Home" ) ); | 241 | cmbAddress->insertItem( tr( "Home" ) ); |
@@ -266,5 +264,5 @@ void ContactEditor::init() { | |||
266 | l = new QLabel( tr( "Country" ), container ); | 264 | l = new QLabel( tr( "Country" ), container ); |
267 | gl->addWidget( l, 5, 0 ); | 265 | gl->addWidget( l, 5, 0 ); |
268 | cmbCountry = new QComboBox( TRUE, container ); | 266 | cmbCountry = new QComboBox( true, container ); |
269 | cmbCountry->insertItem( "" ); | 267 | cmbCountry->insertItem( "" ); |
270 | cmbCountry->insertItem( tr ( "United States" ) ); | 268 | cmbCountry->insertItem( tr ( "United States" ) ); |
@@ -486,5 +484,5 @@ void ContactEditor::init() { | |||
486 | 484 | ||
487 | // Chooser 4 | 485 | // Chooser 4 |
488 | cmbChooserField4 = new QComboBox( FALSE, container ); | 486 | cmbChooserField4 = new QComboBox( false, container ); |
489 | cmbChooserField4->setMaximumWidth( 90 ); | 487 | cmbChooserField4->setMaximumWidth( 90 ); |
490 | gl->addWidget( cmbChooserField4, 6, 0 ); | 488 | gl->addWidget( cmbChooserField4, 6, 0 ); |
@@ -502,5 +500,5 @@ void ContactEditor::init() { | |||
502 | gl->addItem( space, 7, 0 ); | 500 | gl->addItem( space, 7, 0 ); |
503 | 501 | ||
504 | tabMain->insertTab( tabViewport, tr( "Address" ) ); | 502 | tabMain->addTab( tabViewport, "home", tr( "Address" ) ); |
505 | 503 | ||
506 | tabViewport = new QWidget ( tabMain ); | 504 | tabViewport = new QWidget ( tabMain ); |
@@ -526,5 +524,5 @@ void ContactEditor::init() { | |||
526 | 524 | ||
527 | QPopupMenu* m1 = new QPopupMenu( container ); | 525 | QPopupMenu* m1 = new QPopupMenu( container ); |
528 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); | 526 | birthdayPicker = new DateBookMonth( m1, 0, true ); |
529 | m1->insertItem( birthdayPicker ); | 527 | m1->insertItem( birthdayPicker ); |
530 | 528 | ||
@@ -551,5 +549,5 @@ void ContactEditor::init() { | |||
551 | 549 | ||
552 | m1 = new QPopupMenu( container ); | 550 | m1 = new QPopupMenu( container ); |
553 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); | 551 | anniversaryPicker = new DateBookMonth( m1, 0, true ); |
554 | m1->insertItem( anniversaryPicker ); | 552 | m1->insertItem( anniversaryPicker ); |
555 | 553 | ||
@@ -600,7 +598,7 @@ void ContactEditor::init() { | |||
600 | 598 | ||
601 | 599 | ||
602 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 600 | tabMain->addTab( tabViewport, "UtilsIcon", tr( "Details" ) ); |
603 | 601 | ||
604 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 602 | dlgNote = new QDialog( this, "Note Dialog", true ); |
605 | dlgNote->setCaption( tr("Enter Note") ); | 603 | dlgNote->setCaption( tr("Enter Note") ); |
606 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 604 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
@@ -609,5 +607,5 @@ void ContactEditor::init() { | |||
609 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 607 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
610 | 608 | ||
611 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 609 | dlgName = new QDialog( this, "Name Dialog", true ); |
612 | dlgName->setCaption( tr("Edit Name") ); | 610 | dlgName->setCaption( tr("Edit Name") ); |
613 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); | 611 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
@@ -1094,5 +1092,5 @@ void ContactEditor::slotName() { | |||
1094 | 1092 | ||
1095 | if ( QPEApplication::execDialog( dlgName ) ) { | 1093 | if ( QPEApplication::execDialog( dlgName ) ) { |
1096 | if ( txtLastName->text().contains( ' ', TRUE ) ) | 1094 | if ( txtLastName->text().contains( ' ', true ) ) |
1097 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); | 1095 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); |
1098 | else | 1096 | else |
@@ -1139,5 +1137,5 @@ QString ContactEditor::parseName( const QString fullName, int type ) { | |||
1139 | odebug << "Fullname: " << simplifiedName << oendl; | 1137 | odebug << "Fullname: " << simplifiedName << oendl; |
1140 | 1138 | ||
1141 | commapos = simplifiedName.find( ',', 0, TRUE); | 1139 | commapos = simplifiedName.find( ',', 0, true); |
1142 | if ( commapos >= 0 ) { | 1140 | if ( commapos >= 0 ) { |
1143 | odebug << " Commapos: " << commapos << oendl; | 1141 | odebug << " Commapos: " << commapos << oendl; |
@@ -1263,5 +1261,5 @@ void ContactEditor::setEntry( const Opie::OPimContact &entry ) { | |||
1263 | // Cleanup and activate the general Page .. | 1261 | // Cleanup and activate the general Page .. |
1264 | cleanupFields(); | 1262 | cleanupFields(); |
1265 | tabMain->setCurrentPage( 0 ); | 1263 | tabMain->setCurrentTab( m_generalWidget ); |
1266 | 1264 | ||
1267 | ent = entry; | 1265 | ent = entry; |
@@ -1284,5 +1282,5 @@ void ContactEditor::setEntry( const Opie::OPimContact &entry ) { | |||
1284 | if ( !ent.isEmpty() ){ | 1282 | if ( !ent.isEmpty() ){ |
1285 | // Lastnames with multiple words need to be protected by a comma ! | 1283 | // Lastnames with multiple words need to be protected by a comma ! |
1286 | if ( ent.lastName().contains( ' ', TRUE ) ) | 1284 | if ( ent.lastName().contains( ' ', true ) ) |
1287 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); | 1285 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); |
1288 | else | 1286 | else |
@@ -1688,6 +1686,6 @@ static inline bool containsAlphaNum( const QString &str ) | |||
1688 | for ( i = 0; i < count; i++ ) | 1686 | for ( i = 0; i < count; i++ ) |
1689 | if ( !str[i].isSpace() ) | 1687 | if ( !str[i].isSpace() ) |
1690 | return TRUE; | 1688 | return true; |
1691 | return FALSE; | 1689 | return false; |
1692 | } | 1690 | } |
1693 | 1691 | ||
@@ -1698,6 +1696,6 @@ static inline bool constainsWhiteSpace( const QString &str ) | |||
1698 | for (i = 0; i < count; i++ ) | 1696 | for (i = 0; i < count; i++ ) |
1699 | if ( str[i].isSpace() ) | 1697 | if ( str[i].isSpace() ) |
1700 | return TRUE; | 1698 | return true; |
1701 | return FALSE; | 1699 | return false; |
1702 | } | 1700 | } |
1703 | 1701 | ||