summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index beb953a..8229212 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -187,15 +187,15 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
187 "neccessary startup files.\n" 187 "neccessary startup files.\n"
188 "\nFree up some space before\nentering data!") 188 "\nFree up some space before\nentering data!")
189 ); 189 );
190 } 190 }
191 191
192 listContainer = new QWidget( this ); 192 listContainer = new QWidget( this );
193 193
194 QVBoxLayout *vb = new QVBoxLayout( listContainer ); 194 QVBoxLayout *vb = new QVBoxLayout( listContainer );
195 195
196 abList = new AbTable( &orderedFields, listContainer, "table" ); 196 abList = new AbTable( &orderedFields, listContainer, "table" );
197 vb->addWidget(abList); 197 vb->addWidget(abList);
198 abList->setHScrollBarMode( QScrollView::AlwaysOff ); 198 abList->setHScrollBarMode( QScrollView::AlwaysOff );
199 connect( abList, SIGNAL( empty( bool ) ), 199 connect( abList, SIGNAL( empty( bool ) ),
200 this, SLOT( listIsEmpty( bool ) ) ); 200 this, SLOT( listIsEmpty( bool ) ) );
201 connect( abList, SIGNAL( details() ), 201 connect( abList, SIGNAL( details() ),
@@ -230,13 +230,13 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
230 fontMenu->insertItem(tr( "Normal" ), 1); 230 fontMenu->insertItem(tr( "Normal" ), 1);
231 fontMenu->insertItem(tr( "Large" ), 2); 231 fontMenu->insertItem(tr( "Large" ), 2);
232 232
233 defaultFont = new QFont( abList->font() ); 233 defaultFont = new QFont( abList->font() );
234 234
235 slotSetFont(startFontSize); 235 slotSetFont(startFontSize);
236 236
237 mbList->insertItem( tr("Font"), fontMenu); 237 mbList->insertItem( tr("Font"), fontMenu);
238 setCentralWidget(listContainer); 238 setCentralWidget(listContainer);
239 239
240 // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); 240 // qDebug("adressbook contrsuction: t=%d", t.elapsed() );
241} 241}
242void AddressbookWindow::slotSetFont( int size ) { 242void AddressbookWindow::slotSetFont( int size ) {
@@ -244,13 +244,13 @@ void AddressbookWindow::slotSetFont( int size ) {
244 if (size > 2 || size < 0) 244 if (size > 2 || size < 0)
245 size = 1; 245 size = 1;
246 246
247 startFontSize = size; 247 startFontSize = size;
248 248
249 QFont *currentFont; 249 QFont *currentFont;
250 250
251 switch (size) { 251 switch (size) {
252 case 0: 252 case 0:
253 fontMenu->setItemChecked(0, true); 253 fontMenu->setItemChecked(0, true);
254 fontMenu->setItemChecked(1, false); 254 fontMenu->setItemChecked(1, false);
255 fontMenu->setItemChecked(2, false); 255 fontMenu->setItemChecked(2, false);
256 abList->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) ); 256 abList->setFont( QFont( defaultFont->family(), defaultFont->pointSize() - 2 ) );
@@ -468,13 +468,13 @@ static void parseName( const QString& name, QString *first, QString *middle,
468 if ( space <= 0 ) { 468 if ( space <= 0 ) {
469 *first = rest; 469 *first = rest;
470 } else { 470 } else {
471 *first = rest.left( space ); 471 *first = rest.left( space );
472 *middle = rest.mid( space+1 ); 472 *middle = rest.mid( space+1 );
473 } 473 }
474 474
475} 475}
476 476
477 477
478void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data) 478void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
479{ 479{
480 if (msg == "editPersonal()") { 480 if (msg == "editPersonal()") {
@@ -500,13 +500,13 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
500 500
501 if ( bAbEditFirstTime ) { 501 if ( bAbEditFirstTime ) {
502 abEditor = new ContactEditor( cnt, &orderedFields, &slOrderedFields, 502 abEditor = new ContactEditor( cnt, &orderedFields, &slOrderedFields,
503 this, "editor" ); 503 this, "editor" );
504 bAbEditFirstTime = FALSE; 504 bAbEditFirstTime = FALSE;
505 } else { 505 } else {
506 abEditor->setEntry( cnt ); 506 abEditor->setEntry( cnt );
507 } 507 }
508 abView()->init( cnt ); 508 abView()->init( cnt );
509 editEntry( NewEntry ); 509 editEntry( NewEntry );
510 510
511 511
512 512
@@ -791,13 +791,13 @@ void AddressbookWindow::initFields()
791 } 791 }
792 slOrderedFields.append( zn ); 792 slOrderedFields.append( zn );
793 zn = cfg.readEntry( "Category" + QString::number(++i), QString::null ); 793 zn = cfg.readEntry( "Category" + QString::number(++i), QString::null );
794 } 794 }
795 cfg.setGroup( "Font" ); 795 cfg.setGroup( "Font" );
796 startFontSize = cfg.readNumEntry( "fontSize", 1 ); 796 startFontSize = cfg.readNumEntry( "fontSize", 1 );
797 797
798 798
799 } else { 799 } else {
800 QString str; 800 QString str;
801 str = getenv("HOME"); 801 str = getenv("HOME");
802 str += "/Settings/AddressBook.conf"; 802 str += "/Settings/AddressBook.conf";
803 QFile::remove( str ); 803 QFile::remove( str );
@@ -856,20 +856,20 @@ AbLabel *AddressbookWindow::abView()
856 856
857void AddressbookWindow::slotFind() 857void AddressbookWindow::slotFind()
858{ 858{
859#ifndef MAKE_FOR_SHARP_ROM 859#ifndef MAKE_FOR_SHARP_ROM
860 if ( centralWidget() == abView() ) 860 if ( centralWidget() == abView() )
861 showList(); 861 showList();
862 862
863 FindDialog frmFind( "Contacts", this ); 863 FindDialog frmFind( "Contacts", this );
864 QObject::connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), abList, SLOT(slotDoFind( const QString&,bool,bool,int))); 864 QObject::connect( &frmFind, SIGNAL(signalFindClicked(const QString &, bool, bool, int)), abList, SLOT(slotDoFind( const QString&,bool,bool,int)));
865 QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) ); 865 QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) );
866 QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) ); 866 QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) );
867 867
868 frmFind.exec(); 868 frmFind.exec();
869 869
870 if ( abList->numSelections() ) 870 if ( abList->numSelections() )
871 abList->clearSelection(); 871 abList->clearSelection();
872 872
873 abList->clearFindRow(); 873 abList->clearFindRow();
874#endif 874#endif
875} 875}
@@ -903,12 +903,13 @@ void AddressbookWindow::populateCategories()
903{ 903{
904 catMenu->clear(); 904 catMenu->clear();
905 905
906 int id, 906 int id,
907 rememberId; 907 rememberId;
908 id = 1; 908 id = 1;
909 rememberId = 0;
909 catMenu->insertItem( tr( "All" ), id++ ); 910 catMenu->insertItem( tr( "All" ), id++ );
910 QStringList categories = abList->categories(); 911 QStringList categories = abList->categories();
911 categories.append( tr( "Unfiled" ) ); 912 categories.append( tr( "Unfiled" ) );
912 for ( QStringList::Iterator it = categories.begin(); 913 for ( QStringList::Iterator it = categories.begin();
913 it != categories.end(); ++it ) { 914 it != categories.end(); ++it ) {
914 catMenu->insertItem( *it, id ); 915 catMenu->insertItem( *it, id );