summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kaddressbookmain.cpp
Unidiff
Diffstat (limited to 'kaddressbook/kaddressbookmain.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kaddressbookmain.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp
index c417226..b317974 100644
--- a/kaddressbook/kaddressbookmain.cpp
+++ b/kaddressbook/kaddressbookmain.cpp
@@ -4,109 +4,112 @@
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#ifdef KAB_EMBEDDED 24#ifdef KAB_EMBEDDED
25#include "kabprefs.h" 25#include "kabprefs.h"
26#include <kglobal.h> 26#include <kglobal.h>
27#include <qmessagebox.h> 27#include <qmessagebox.h>
28#include <qtoolbar.h> 28#include <q3toolbar.h>
29#include <qapplication.h> 29#include <qapplication.h>
30//Added by qt3to4:
31#include <Q3CString>
32#include <QCloseEvent>
30#else //KAB_EMBEDDED 33#else //KAB_EMBEDDED
31#include <kedittoolbar.h> 34#include <kedittoolbar.h>
32#include <kkeydialog.h> 35#include <kkeydialog.h>
33#include <kmessagebox.h> 36#include <kmessagebox.h>
34#include <kstatusbar.h> 37#include <kstatusbar.h>
35#endif //KAB_EMBEDDED 38#endif //KAB_EMBEDDED
36#include <klocale.h> 39#include <klocale.h>
37 40
38#include "kabcore.h" 41#include "kabcore.h"
39#include "kaddressbookmain.h" 42#include "kaddressbookmain.h"
40#include "kactioncollection.h" 43#include "kactioncollection.h"
41 44
42#ifdef KAB_EMBEDDED 45#ifdef KAB_EMBEDDED
43KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" ) 46KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" )
44#else //KAB_EMBEDDED 47#else //KAB_EMBEDDED
45//MOC_SKIP_BEGIN 48#ifndef Q_MOC_RUN
46KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) 49KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 )
47//MOC_SKIP_END 50#endif
48#endif //KAB_EMBEDDED 51#endif //KAB_EMBEDDED
49{ 52{
50 setIcon(SmallIcon( "ka24" ) ); 53 setIcon(SmallIcon( "ka24" ) );
51#if 0 54#if 0
52 //US for embedded systems, create the toolbar before we initiate KABCore. 55 //US for embedded systems, create the toolbar before we initiate KABCore.
53 // KABCore will fill the toolbar with menues and icons 56 // KABCore will fill the toolbar with menues and icons
54 QMainWindow::ToolBarDock tbd; 57 Qt::ToolBarDock tbd;
55 tbd = Top; 58 tbd = Qt::DockTop;
56 iconToolBar = new QToolBar( this ); 59 iconToolBar = new Q3ToolBar( this );
57 addToolBar (iconToolBar , tbd ); 60 addToolBar (iconToolBar , tbd );
58 iconToolBar->setHorizontalStretchable(true); 61 iconToolBar->setHorizontalStretchable(true);
59//US iconToolBar->setWidth(300); 62//US iconToolBar->setWidth(300);
60#endif // 0 63#endif // 0
61 64
62 mCore = new KABCore( this, true, this ); 65 mCore = new KABCore( this, true, this );
63 66
64#ifdef KAB_EMBEDDED 67#ifdef KAB_EMBEDDED
65 setCaption( i18n( "KAddressbook/Pi" ) ); 68 setCaption( i18n( "KAddressbook/Pi" ) );
66#else //KAB_EMBEDDED 69#else //KAB_EMBEDDED
67 setCaption( i18n( "Address Book Browser" ) ); 70 setCaption( i18n( "Address Book Browser" ) );
68#endif //KAB_EMBEDDED 71#endif //KAB_EMBEDDED
69 72
70 //mCore->restoreSettings(); 73 //mCore->restoreSettings();
71 74
72 initActions(); 75 initActions();
73 76
74 setCentralWidget( mCore ); 77 setCentralWidget( mCore );
75 78
76//US statusBar()->show(); 79//US statusBar()->show();
77 80
78#ifndef KAB_EMBEDDED 81#ifndef KAB_EMBEDDED
79 setStandardToolBarMenuEnabled(true); 82 setStandardToolBarMenuEnabled(true);
80 83
81 createGUI( "kaddressbookui.rc", false ); 84 createGUI( "kaddressbookui.rc", false );
82 85
83 86
84#endif //KAB_EMBEDDED 87#endif //KAB_EMBEDDED
85 setAutoSaveSettings(); 88 setAutoSaveSettings();
86 mCore->restoreSettings(); 89 mCore->restoreSettings();
87#ifndef DESKTOP_VERSION 90#ifndef DESKTOP_VERSION
88 QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & ))); 91 QObject::connect(qApp, SIGNAL (appMessage ( const Q3CString &, const QByteArray & )), mCore, SLOT (receiveStart ( const Q3CString &, const QByteArray & )));
89#endif 92#endif
90} 93}
91 94
92KAddressBookMain::~KAddressBookMain() 95KAddressBookMain::~KAddressBookMain()
93{ 96{
94 // mCore->saveSettings(); 97 // mCore->saveSettings();
95} 98}
96 99
97void KAddressBookMain::showMinimized () 100void KAddressBookMain::showMinimized ()
98{ 101{
99 QWidget::showMinimized () ; 102 QWidget::showMinimized () ;
100} 103}
101void KAddressBookMain::addEmail( QString addr ) 104void KAddressBookMain::addEmail( QString addr )
102{ 105{
103 mCore->addEmail( addr ); 106 mCore->addEmail( addr );
104} 107}
105 108
106#ifndef KAB_EMBEDDED 109#ifndef KAB_EMBEDDED
107ASYNC KAddressBookMain::showContactEditor( QString uid ) 110ASYNC KAddressBookMain::showContactEditor( QString uid )
108{ 111{
109 mCore->editContact( uid ); 112 mCore->editContact( uid );
110} 113}
111#endif //KAB_EMBEDDED 114#endif //KAB_EMBEDDED
112void KAddressBookMain::newContact() 115void KAddressBookMain::newContact()
@@ -214,28 +217,27 @@ void KAddressBookMain::closeEvent( QCloseEvent* ce )
214 217
215 if (mAskForQuit) 218 if (mAskForQuit)
216 { 219 {
217 220
218 int res = QMessageBox::information( this, "KA/Pi", mess , i18n("Yes!"), i18n("No"), 0, 0 ); 221 int res = QMessageBox::information( this, "KA/Pi", mess , i18n("Yes!"), i18n("No"), 0, 0 );
219 if (res == 0) 222 if (res == 0)
220 mQuit = true; 223 mQuit = true;
221 else 224 else
222 mQuit = false; 225 mQuit = false;
223 } 226 }
224 227
225 if (mQuit == false) 228 if (mQuit == false)
226 return; 229 return;
227 230
228 if (mModified == true) 231 if (mModified == true)
229 { 232 {
230 save(); 233 save();
231 mCore->saveSettings(); 234 mCore->saveSettings();
232 //KABPrefs::instance()->writeConfig(); 235 //KABPrefs::instance()->writeConfig();
233 } 236 }
234 237
235 ce->accept(); 238 ce->accept();
236} 239}
237 240
238#ifndef KAB_EMBEDDED 241#ifndef KAB_EMBEDDED_
239#include "kaddressbookmain.moc" 242#include "moc_kaddressbookmain.cpp"
240#endif //KAB_EMBEDDED 243#endif //KAB_EMBEDDED
241