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.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp
index 00cd2a6..1c7ddd4 100644
--- a/core/pim/addressbook/addressbook.cpp
+++ b/core/pim/addressbook/addressbook.cpp
@@ -261,50 +261,49 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
261 populateCategories(); 261 populateCategories();
262 262
263 // Fontsize 263 // Fontsize
264 defaultFont = new QFont( m_abView->font() ); 264 defaultFont = new QFont( m_abView->font() );
265 slotSetFont(m_config.fontSize()); 265 slotSetFont(m_config.fontSize());
266 m_curFontSize = m_config.fontSize(); 266 m_curFontSize = m_config.fontSize();
267 267
268 setCentralWidget(listContainer); 268 setCentralWidget(listContainer);
269 269
270 // qDebug("adressbook contrsuction: t=%d", t.elapsed() ); 270 // qDebug("adressbook contrsuction: t=%d", t.elapsed() );
271 connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) ); 271 connect( qApp, SIGNAL( flush() ), this, SLOT( flush() ) );
272 connect( qApp, SIGNAL( reload() ), this, SLOT( reload() ) ); 272 connect( qApp, SIGNAL( reload() ), this, SLOT( reload() ) );
273 connect( qApp, SIGNAL( appMessage(const QCString &, const QByteArray &) ), 273 connect( qApp, SIGNAL( appMessage(const QCString &, const QByteArray &) ),
274 this, SLOT( appMessage(const QCString &, const QByteArray &) ) ); 274 this, SLOT( appMessage(const QCString &, const QByteArray &) ) );
275 275
276 276
277 isLoading = false; 277 isLoading = false;
278} 278}
279 279
280 280
281void AddressbookWindow::slotConfig() 281void AddressbookWindow::slotConfig()
282{ 282{
283 ConfigDlg* dlg = new ConfigDlg( this, "Config" ); 283 ConfigDlg* dlg = new ConfigDlg( this, "Config" );
284 dlg -> setConfig( m_config ); 284 dlg -> setConfig( m_config );
285 dlg -> showMaximized(); 285 if ( QPEApplication::execDialog( dlg ) ) {
286 if ( dlg -> exec() ) {
287 qWarning ("Config Dialog accepted!"); 286 qWarning ("Config Dialog accepted!");
288 m_config = dlg -> getConfig(); 287 m_config = dlg -> getConfig();
289 if ( m_curFontSize != m_config.fontSize() ){ 288 if ( m_curFontSize != m_config.fontSize() ){
290 qWarning("Font was changed!"); 289 qWarning("Font was changed!");
291 m_curFontSize = m_config.fontSize(); 290 m_curFontSize = m_config.fontSize();
292 emit slotSetFont( m_curFontSize ); 291 emit slotSetFont( m_curFontSize );
293 } 292 }
294 m_abView -> setListOrder( m_config.orderList() ); 293 m_abView -> setListOrder( m_config.orderList() );
295 } 294 }
296 295
297 delete dlg; 296 delete dlg;
298} 297}
299 298
300 299
301void AddressbookWindow::slotSetFont( int size ) 300void AddressbookWindow::slotSetFont( int size )
302{ 301{
303 qWarning("void AddressbookWindow::slotSetFont( %d )", size); 302 qWarning("void AddressbookWindow::slotSetFont( %d )", size);
304 303
305 if (size > 2 || size < 0) 304 if (size > 2 || size < 0)
306 size = 1; 305 size = 1;
307 306
308 m_config.setFontSize( size ); 307 m_config.setFontSize( size );
309 308
310 QFont *currentFont; 309 QFont *currentFont;
@@ -729,54 +728,51 @@ void AddressbookWindow::appMessage(const QCString &msg, const QByteArray &data)
729 // Reset category and edit.. 728 // Reset category and edit..
730 m_abView -> setShowByCategory( QString::null ); 729 m_abView -> setShowByCategory( QString::null );
731 m_abView -> setCurrentUid( uid ); 730 m_abView -> setCurrentUid( uid );
732 slotViewEdit(); 731 slotViewEdit();
733 } 732 }
734 733
735 if (needShow) 734 if (needShow)
736 QPEApplication::setKeepRunning(); 735 QPEApplication::setKeepRunning();
737 736
738} 737}
739 738
740void AddressbookWindow::editEntry( EntryMode entryMode ) 739void AddressbookWindow::editEntry( EntryMode entryMode )
741{ 740{
742 OContact entry; 741 OContact entry;
743 if ( !abEditor ) { 742 if ( !abEditor ) {
744 abEditor = new ContactEditor( entry, this, "editor" ); 743 abEditor = new ContactEditor( entry, this, "editor" );
745 } 744 }
746 if ( entryMode == EditEntry ) 745 if ( entryMode == EditEntry )
747 abEditor->setEntry( m_abView -> currentEntry() ); 746 abEditor->setEntry( m_abView -> currentEntry() );
748 else if ( entryMode == NewEntry ) 747 else if ( entryMode == NewEntry )
749 abEditor->setEntry( entry ); 748 abEditor->setEntry( entry );
750 // other things may change the caption. 749 // other things may change the caption.
751 abEditor->setCaption( tr("Edit Address") ); 750 abEditor->setCaption( tr("Edit Address") );
752 751
753#if defined(Q_WS_QWS) || defined(_WS_QWS_)
754 abEditor->showMaximized();
755#endif
756 // fix the foxus... 752 // fix the foxus...
757 abEditor->setNameFocus(); 753 abEditor->setNameFocus();
758 if ( abEditor->exec() ) { 754 if ( QPEApplication::execDialog( abEditor ) ) {
759 setFocus(); 755 setFocus();
760 if ( entryMode == NewEntry ) { 756 if ( entryMode == NewEntry ) {
761 OContact insertEntry = abEditor->entry(); 757 OContact insertEntry = abEditor->entry();
762 insertEntry.assignUid(); 758 insertEntry.assignUid();
763 m_abView -> addEntry( insertEntry ); 759 m_abView -> addEntry( insertEntry );
764 m_abView -> setCurrentUid( insertEntry.uid() ); 760 m_abView -> setCurrentUid( insertEntry.uid() );
765 } else { 761 } else {
766 OContact replEntry = abEditor->entry(); 762 OContact replEntry = abEditor->entry();
767 763
768 if ( !replEntry.isValidUid() ) 764 if ( !replEntry.isValidUid() )
769 replEntry.assignUid(); 765 replEntry.assignUid();
770 766
771 m_abView -> replaceEntry( replEntry ); 767 m_abView -> replaceEntry( replEntry );
772 } 768 }
773 } 769 }
774 // populateCategories(); 770 // populateCategories();
775 771
776} 772}
777 773
778void AddressbookWindow::editPersonal() 774void AddressbookWindow::editPersonal()
779{ 775{
780 OContact entry; 776 OContact entry;
781 777
782 // Switch to personal view if not selected 778 // Switch to personal view if not selected