author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/kaddressbookmain.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/kaddressbookmain.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kaddressbookmain.cpp | 22 |
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 | |||
@@ -12,93 +12,96 @@ | |||
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 |
43 | KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" ) | 46 | KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" ) |
44 | #else //KAB_EMBEDDED | 47 | #else //KAB_EMBEDDED |
45 | //MOC_SKIP_BEGIN | 48 | #ifndef Q_MOC_RUN |
46 | KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) | 49 | KAddressBookMain::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 | ||
92 | KAddressBookMain::~KAddressBookMain() | 95 | KAddressBookMain::~KAddressBookMain() |
93 | { | 96 | { |
94 | // mCore->saveSettings(); | 97 | // mCore->saveSettings(); |
95 | } | 98 | } |
96 | 99 | ||
97 | void KAddressBookMain::showMinimized () | 100 | void KAddressBookMain::showMinimized () |
98 | { | 101 | { |
99 | QWidget::showMinimized () ; | 102 | QWidget::showMinimized () ; |
100 | } | 103 | } |
101 | void KAddressBookMain::addEmail( QString addr ) | 104 | void KAddressBookMain::addEmail( QString addr ) |
102 | { | 105 | { |
103 | mCore->addEmail( addr ); | 106 | mCore->addEmail( addr ); |
104 | } | 107 | } |
@@ -222,20 +225,19 @@ void KAddressBookMain::closeEvent( QCloseEvent* ce ) | |||
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 | |||