summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/contacteditor.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp62
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 @@
#include <qlabel.h>
-#include <qtabwidget.h>
#include <qlayout.h>
#include <qlineedit.h>
@@ -59,5 +58,5 @@ ContactEditor::ContactEditor( const Opie::OPimContact &entry,
const char *name,
WFlags )
- : QDialog( parent, name, TRUE, WStyle_ContextHelp ),
+ : QDialog( parent, name, true, WStyle_ContextHelp ),
defaultEmailChooserPosition( -1 ),
m_personalView ( false ),
@@ -120,12 +119,12 @@ void ContactEditor::init() {
QVBoxLayout *vb = new QVBoxLayout( this );
- tabMain = new QTabWidget( this );
+ tabMain = new Opie::Ui::OTabWidget( this );
vb->addWidget( tabMain );
- QWidget *tabViewport = new QWidget ( tabMain );
+ m_generalWidget = new QWidget ( tabMain );
- vb = new QVBoxLayout( tabViewport );
+ vb = new QVBoxLayout( m_generalWidget );
- svGeneral = new QScrollView( tabViewport );
+ svGeneral = new QScrollView( m_generalWidget );
vb->addWidget( svGeneral, 0, 0 );
svGeneral->setResizePolicy( QScrollView::AutoOneFit );
@@ -137,6 +136,5 @@ void ContactEditor::init() {
svGeneral->addChild( container );
- QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 );
- gl->setResizeMode( QLayout::FreeResize );
+ QGridLayout *gl = new QGridLayout( container, 10, 2, 2, 4 );
btnFullName = new QPushButton( tr( "Full Name..." ), container );
@@ -169,5 +167,5 @@ void ContactEditor::init() {
// Chooser 1
- cmbChooserField1 = new QComboBox( FALSE, container );
+ cmbChooserField1 = new QComboBox( false, container );
QWhatsThis::add( cmbChooserField1, tr( "Press to select attribute to change" ) );
cmbChooserField1->setMaximumWidth( 90 );
@@ -182,5 +180,5 @@ void ContactEditor::init() {
// Chooser 2
- cmbChooserField2 = new QComboBox( FALSE, container );
+ cmbChooserField2 = new QComboBox( false, container );
QWhatsThis::add( cmbChooserField2, tr( "Press to select attribute to change" ) );
cmbChooserField2->setMaximumWidth( 90 );
@@ -195,5 +193,5 @@ void ContactEditor::init() {
// Chooser 3
- cmbChooserField3 = new QComboBox( FALSE, container );
+ cmbChooserField3 = new QComboBox( false, container );
QWhatsThis::add( cmbChooserField3, tr( "Press to select attribute to change" ) );
cmbChooserField3->setMaximumWidth( 90 );
@@ -210,5 +208,5 @@ void ContactEditor::init() {
QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) );
gl->addWidget( l, 7, 0 );
- cmbFileAs = new QComboBox( TRUE, container );
+ cmbFileAs = new QComboBox( true, container );
gl->addWidget( cmbFileAs, 7, 1 );
@@ -220,10 +218,10 @@ void ContactEditor::init() {
cmbCat->show();
- btnNote = new QPushButton( tr( "Notes..." ), container );
+ btnNote = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Notes..." ), container );
gl->addWidget( btnNote, 9, 1 );
- tabMain->insertTab( tabViewport, tr( "General" ) );
+ tabMain->addTab( m_generalWidget, "addressbook/AddressBookSmall", tr( "General" ) );
- tabViewport = new QWidget ( tabMain );
+ QWidget *tabViewport = new QWidget ( tabMain );
vb = new QVBoxLayout( tabViewport );
@@ -239,5 +237,5 @@ void ContactEditor::init() {
gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem
- cmbAddress = new QComboBox( FALSE, container );
+ cmbAddress = new QComboBox( false, container );
cmbAddress->insertItem( tr( "Business" ) );
cmbAddress->insertItem( tr( "Home" ) );
@@ -266,5 +264,5 @@ void ContactEditor::init() {
l = new QLabel( tr( "Country" ), container );
gl->addWidget( l, 5, 0 );
- cmbCountry = new QComboBox( TRUE, container );
+ cmbCountry = new QComboBox( true, container );
cmbCountry->insertItem( "" );
cmbCountry->insertItem( tr ( "United States" ) );
@@ -486,5 +484,5 @@ void ContactEditor::init() {
// Chooser 4
- cmbChooserField4 = new QComboBox( FALSE, container );
+ cmbChooserField4 = new QComboBox( false, container );
cmbChooserField4->setMaximumWidth( 90 );
gl->addWidget( cmbChooserField4, 6, 0 );
@@ -502,5 +500,5 @@ void ContactEditor::init() {
gl->addItem( space, 7, 0 );
- tabMain->insertTab( tabViewport, tr( "Address" ) );
+ tabMain->addTab( tabViewport, "home", tr( "Address" ) );
tabViewport = new QWidget ( tabMain );
@@ -526,5 +524,5 @@ void ContactEditor::init() {
QPopupMenu* m1 = new QPopupMenu( container );
- birthdayPicker = new DateBookMonth( m1, 0, TRUE );
+ birthdayPicker = new DateBookMonth( m1, 0, true );
m1->insertItem( birthdayPicker );
@@ -551,5 +549,5 @@ void ContactEditor::init() {
m1 = new QPopupMenu( container );
- anniversaryPicker = new DateBookMonth( m1, 0, TRUE );
+ anniversaryPicker = new DateBookMonth( m1, 0, true );
m1->insertItem( anniversaryPicker );
@@ -600,7 +598,7 @@ void ContactEditor::init() {
- tabMain->insertTab( tabViewport, tr( "Details" ) );
+ tabMain->addTab( tabViewport, "UtilsIcon", tr( "Details" ) );
- dlgNote = new QDialog( this, "Note Dialog", TRUE );
+ dlgNote = new QDialog( this, "Note Dialog", true );
dlgNote->setCaption( tr("Enter Note") );
QVBoxLayout *vbNote = new QVBoxLayout( dlgNote );
@@ -609,5 +607,5 @@ void ContactEditor::init() {
connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) );
- dlgName = new QDialog( this, "Name Dialog", TRUE );
+ dlgName = new QDialog( this, "Name Dialog", true );
dlgName->setCaption( tr("Edit Name") );
gl = new QGridLayout( dlgName, 5, 2, 2, 3 );
@@ -1094,5 +1092,5 @@ void ContactEditor::slotName() {
if ( QPEApplication::execDialog( dlgName ) ) {
- if ( txtLastName->text().contains( ' ', TRUE ) )
+ if ( txtLastName->text().contains( ' ', true ) )
tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text();
else
@@ -1139,5 +1137,5 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
odebug << "Fullname: " << simplifiedName << oendl;
- commapos = simplifiedName.find( ',', 0, TRUE);
+ commapos = simplifiedName.find( ',', 0, true);
if ( commapos >= 0 ) {
odebug << " Commapos: " << commapos << oendl;
@@ -1263,5 +1261,5 @@ void ContactEditor::setEntry( const Opie::OPimContact &entry ) {
// Cleanup and activate the general Page ..
cleanupFields();
- tabMain->setCurrentPage( 0 );
+ tabMain->setCurrentTab( m_generalWidget );
ent = entry;
@@ -1284,5 +1282,5 @@ void ContactEditor::setEntry( const Opie::OPimContact &entry ) {
if ( !ent.isEmpty() ){
// Lastnames with multiple words need to be protected by a comma !
- if ( ent.lastName().contains( ' ', TRUE ) )
+ if ( ent.lastName().contains( ' ', true ) )
txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() );
else
@@ -1688,6 +1686,6 @@ static inline bool containsAlphaNum( const QString &str )
for ( i = 0; i < count; i++ )
if ( !str[i].isSpace() )
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
@@ -1698,6 +1696,6 @@ static inline bool constainsWhiteSpace( const QString &str )
for (i = 0; i < count; i++ )
if ( str[i].isSpace() )
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}