Diffstat (limited to 'kaddressbook/kaddressbookmain.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kaddressbookmain.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index 519dc92..8fe3ee0 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp | |||
@@ -22,130 +22,132 @@ | |||
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 <qtoolbar.h> |
29 | #include <qapplication.h> | 29 | #include <qapplication.h> |
30 | #else //KAB_EMBEDDED | 30 | #else //KAB_EMBEDDED |
31 | #include <kedittoolbar.h> | 31 | #include <kedittoolbar.h> |
32 | #include <kkeydialog.h> | 32 | #include <kkeydialog.h> |
33 | #include <kmessagebox.h> | 33 | #include <kmessagebox.h> |
34 | #include <kstatusbar.h> | 34 | #include <kstatusbar.h> |
35 | #endif //KAB_EMBEDDED | 35 | #endif //KAB_EMBEDDED |
36 | #include <klocale.h> | 36 | #include <klocale.h> |
37 | 37 | ||
38 | #include "kabcore.h" | 38 | #include "kabcore.h" |
39 | #include "kaddressbookmain.h" | 39 | #include "kaddressbookmain.h" |
40 | #include "kactioncollection.h" | 40 | #include "kactioncollection.h" |
41 | 41 | ||
42 | #ifdef KAB_EMBEDDED | 42 | #ifdef KAB_EMBEDDED |
43 | KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "adrressbook" ) | 43 | KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "adrressbook" ) |
44 | #else //KAB_EMBEDDED | 44 | #else //KAB_EMBEDDED |
45 | //MOC_SKIP_BEGIN | 45 | //MOC_SKIP_BEGIN |
46 | KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) | 46 | KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) |
47 | //MOC_SKIP_END | 47 | //MOC_SKIP_END |
48 | #endif //KAB_EMBEDDED | 48 | #endif //KAB_EMBEDDED |
49 | { | 49 | { |
50 | setIcon(SmallIcon( "ka24" ) ); | 50 | setIcon(SmallIcon( "ka24" ) ); |
51 | #if 0 | 51 | #if 0 |
52 | //US for embedded systems, create the toolbar before we initiate KABCore. | 52 | //US for embedded systems, create the toolbar before we initiate KABCore. |
53 | // KABCore will fill the toolbar with menues and icons | 53 | // KABCore will fill the toolbar with menues and icons |
54 | QMainWindow::ToolBarDock tbd; | 54 | QMainWindow::ToolBarDock tbd; |
55 | tbd = Top; | 55 | tbd = Top; |
56 | iconToolBar = new QToolBar( this ); | 56 | iconToolBar = new QToolBar( this ); |
57 | addToolBar (iconToolBar , tbd ); | 57 | addToolBar (iconToolBar , tbd ); |
58 | iconToolBar->setHorizontalStretchable(true); | 58 | iconToolBar->setHorizontalStretchable(true); |
59 | //US iconToolBar->setWidth(300); | 59 | //US iconToolBar->setWidth(300); |
60 | #endif // 0 | 60 | #endif // 0 |
61 | 61 | ||
62 | mCore = new KABCore( this, true, this ); | 62 | mCore = new KABCore( this, true, this ); |
63 | 63 | ||
64 | #ifdef KAB_EMBEDDED | 64 | #ifdef KAB_EMBEDDED |
65 | setCaption( i18n( "KAddressbook/Pi" ) ); | 65 | setCaption( i18n( "KAddressbook/Pi" ) ); |
66 | #else //KAB_EMBEDDED | 66 | #else //KAB_EMBEDDED |
67 | setCaption( i18n( "Address Book Browser" ) ); | 67 | setCaption( i18n( "Address Book Browser" ) ); |
68 | #endif //KAB_EMBEDDED | 68 | #endif //KAB_EMBEDDED |
69 | 69 | ||
70 | //mCore->restoreSettings(); | 70 | //mCore->restoreSettings(); |
71 | 71 | ||
72 | initActions(); | 72 | initActions(); |
73 | 73 | ||
74 | setCentralWidget( mCore ); | 74 | setCentralWidget( mCore ); |
75 | 75 | ||
76 | //US statusBar()->show(); | 76 | //US statusBar()->show(); |
77 | 77 | ||
78 | #ifndef KAB_EMBEDDED | 78 | #ifndef KAB_EMBEDDED |
79 | setStandardToolBarMenuEnabled(true); | 79 | setStandardToolBarMenuEnabled(true); |
80 | 80 | ||
81 | createGUI( "kaddressbookui.rc", false ); | 81 | createGUI( "kaddressbookui.rc", false ); |
82 | 82 | ||
83 | 83 | ||
84 | #endif //KAB_EMBEDDED | 84 | #endif //KAB_EMBEDDED |
85 | setAutoSaveSettings(); | 85 | setAutoSaveSettings(); |
86 | qApp->processEvents(); | ||
87 | mCore->restoreSettings(); | 86 | mCore->restoreSettings(); |
87 | #ifndef DESKTOP_VERSION | ||
88 | QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & ))); | ||
89 | #endif | ||
88 | } | 90 | } |
89 | 91 | ||
90 | KAddressBookMain::~KAddressBookMain() | 92 | KAddressBookMain::~KAddressBookMain() |
91 | { | 93 | { |
92 | // mCore->saveSettings(); | 94 | // mCore->saveSettings(); |
93 | } | 95 | } |
94 | 96 | ||
95 | void KAddressBookMain::showMinimized () | 97 | void KAddressBookMain::showMinimized () |
96 | { | 98 | { |
97 | QWidget::showMinimized () ; | 99 | QWidget::showMinimized () ; |
98 | } | 100 | } |
99 | void KAddressBookMain::addEmail( QString addr ) | 101 | void KAddressBookMain::addEmail( QString addr ) |
100 | { | 102 | { |
101 | mCore->addEmail( addr ); | 103 | mCore->addEmail( addr ); |
102 | } | 104 | } |
103 | 105 | ||
104 | #ifndef KAB_EMBEDDED | 106 | #ifndef KAB_EMBEDDED |
105 | ASYNC KAddressBookMain::showContactEditor( QString uid ) | 107 | ASYNC KAddressBookMain::showContactEditor( QString uid ) |
106 | { | 108 | { |
107 | mCore->editContact( uid ); | 109 | mCore->editContact( uid ); |
108 | } | 110 | } |
109 | #endif //KAB_EMBEDDED | 111 | #endif //KAB_EMBEDDED |
110 | void KAddressBookMain::newContact() | 112 | void KAddressBookMain::newContact() |
111 | { | 113 | { |
112 | mCore->newContact(); | 114 | mCore->newContact(); |
113 | } | 115 | } |
114 | 116 | ||
115 | QString KAddressBookMain::getNameByPhone( QString phone ) | 117 | QString KAddressBookMain::getNameByPhone( QString phone ) |
116 | { | 118 | { |
117 | return mCore->getNameByPhone( phone ); | 119 | return mCore->getNameByPhone( phone ); |
118 | } | 120 | } |
119 | 121 | ||
120 | void KAddressBookMain::save() | 122 | void KAddressBookMain::save() |
121 | { | 123 | { |
122 | mCore->save(); | 124 | mCore->save(); |
123 | } | 125 | } |
124 | 126 | ||
125 | void KAddressBookMain::exit() | 127 | void KAddressBookMain::exit() |
126 | { | 128 | { |
127 | close( ); | 129 | close( ); |
128 | } | 130 | } |
129 | 131 | ||
130 | void KAddressBookMain::saveProperties( KConfig* ) | 132 | void KAddressBookMain::saveProperties( KConfig* ) |
131 | { | 133 | { |
132 | } | 134 | } |
133 | 135 | ||
134 | void KAddressBookMain::readProperties( KConfig* ) | 136 | void KAddressBookMain::readProperties( KConfig* ) |
135 | { | 137 | { |
136 | } | 138 | } |
137 | 139 | ||
138 | void KAddressBookMain::initActions() | 140 | void KAddressBookMain::initActions() |
139 | { | 141 | { |
140 | #ifndef KAB_EMBEDDED | 142 | #ifndef KAB_EMBEDDED |
141 | KStdAction::quit( this, SLOT( close() ), actionCollection() ); | 143 | KStdAction::quit( this, SLOT( close() ), actionCollection() ); |
142 | KStdAction::configureToolbars( this, SLOT( configureToolbars() ), actionCollection() ); | 144 | KStdAction::configureToolbars( this, SLOT( configureToolbars() ), actionCollection() ); |
143 | #else //KAB_EMBEDDED | 145 | #else //KAB_EMBEDDED |
144 | //US: transfered the setup of the actions into KABCore | 146 | //US: transfered the setup of the actions into KABCore |
145 | #endif //KAB_EMBEDDED | 147 | #endif //KAB_EMBEDDED |
146 | 148 | ||
147 | 149 | ||
148 | } | 150 | } |
149 | 151 | ||
150 | //US new method to setup menues and toolbars on embedded systems | 152 | //US new method to setup menues and toolbars on embedded systems |
151 | #ifdef KAB_EMBEDDED | 153 | #ifdef KAB_EMBEDDED |