Diffstat (limited to 'kaddressbook/kaddressbookmain.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kaddressbookmain.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index 92c32ca..8ebb93a 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp | |||
@@ -31,146 +31,129 @@ | |||
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 | 50 | ||
51 | setIcon(SmallIcon( "ka24" ) ); | 51 | setIcon(SmallIcon( "ka24" ) ); |
52 | #if 0 | 52 | #if 0 |
53 | //US for embedded systems, create the toolbar before we initiate KABCore. | 53 | //US for embedded systems, create the toolbar before we initiate KABCore. |
54 | // KABCore will fill the toolbar with menues and icons | 54 | // KABCore will fill the toolbar with menues and icons |
55 | QMainWindow::ToolBarDock tbd; | 55 | QMainWindow::ToolBarDock tbd; |
56 | tbd = Top; | 56 | tbd = Top; |
57 | iconToolBar = new QToolBar( this ); | 57 | iconToolBar = new QToolBar( this ); |
58 | addToolBar (iconToolBar , tbd ); | 58 | addToolBar (iconToolBar , tbd ); |
59 | iconToolBar->setHorizontalStretchable(true); | 59 | iconToolBar->setHorizontalStretchable(true); |
60 | //US iconToolBar->setWidth(300); | 60 | //US iconToolBar->setWidth(300); |
61 | #endif // 0 | 61 | #endif // 0 |
62 | 62 | ||
63 | mCore = new KABCore( this, true, this ); | 63 | mCore = new KABCore( this, true, this ); |
64 | 64 | ||
65 | #ifdef KAB_EMBEDDED | 65 | #ifdef KAB_EMBEDDED |
66 | setCaption( i18n( "KAddressbook/Pi" ) ); | 66 | setCaption( i18n( "KAddressbook/Pi" ) ); |
67 | #else //KAB_EMBEDDED | 67 | #else //KAB_EMBEDDED |
68 | setCaption( i18n( "Address Book Browser" ) ); | 68 | setCaption( i18n( "Address Book Browser" ) ); |
69 | #endif //KAB_EMBEDDED | 69 | #endif //KAB_EMBEDDED |
70 | 70 | ||
71 | //mCore->restoreSettings(); | 71 | //mCore->restoreSettings(); |
72 | 72 | ||
73 | initActions(); | 73 | initActions(); |
74 | 74 | ||
75 | setCentralWidget( mCore ); | 75 | setCentralWidget( mCore ); |
76 | 76 | ||
77 | //US statusBar()->show(); | 77 | //US statusBar()->show(); |
78 | 78 | ||
79 | #ifndef KAB_EMBEDDED | 79 | #ifndef KAB_EMBEDDED |
80 | setStandardToolBarMenuEnabled(true); | 80 | setStandardToolBarMenuEnabled(true); |
81 | 81 | ||
82 | createGUI( "kaddressbookui.rc", false ); | 82 | createGUI( "kaddressbookui.rc", false ); |
83 | 83 | ||
84 | 84 | ||
85 | #endif //KAB_EMBEDDED | 85 | #endif //KAB_EMBEDDED |
86 | setAutoSaveSettings(); | 86 | setAutoSaveSettings(); |
87 | qApp->processEvents(); | 87 | qApp->processEvents(); |
88 | mCore->restoreSettings(); | 88 | mCore->restoreSettings(); |
89 | } | 89 | } |
90 | 90 | ||
91 | KAddressBookMain::~KAddressBookMain() | 91 | KAddressBookMain::~KAddressBookMain() |
92 | { | 92 | { |
93 | // mCore->saveSettings(); | 93 | // mCore->saveSettings(); |
94 | } | 94 | } |
95 | #ifndef DESKTOP_VERSION | 95 | |
96 | void KAddressBookMain::show () | ||
97 | { | ||
98 | static bool block = false; | ||
99 | if( block ) { | ||
100 | QWidget::show(); | ||
101 | return; | ||
102 | } else { | ||
103 | block = true ; | ||
104 | QWidget::showFullScreen(); | ||
105 | } | ||
106 | int min = 20; | ||
107 | if ( QApplication::desktop()->width() > 320 ) | ||
108 | min += 20; | ||
109 | setGeometry( 0,0,QApplication::desktop()->width(), QApplication::desktop()->height() - min ); | ||
110 | block = false; | ||
111 | } | ||
112 | #endif | ||
113 | void KAddressBookMain::showMinimized () | 96 | void KAddressBookMain::showMinimized () |
114 | { | 97 | { |
115 | QWidget::showMinimized () ; | 98 | QWidget::showMinimized () ; |
116 | } | 99 | } |
117 | void KAddressBookMain::addEmail( QString addr ) | 100 | void KAddressBookMain::addEmail( QString addr ) |
118 | { | 101 | { |
119 | mCore->addEmail( addr ); | 102 | mCore->addEmail( addr ); |
120 | } | 103 | } |
121 | 104 | ||
122 | #ifndef KAB_EMBEDDED | 105 | #ifndef KAB_EMBEDDED |
123 | ASYNC KAddressBookMain::showContactEditor( QString uid ) | 106 | ASYNC KAddressBookMain::showContactEditor( QString uid ) |
124 | { | 107 | { |
125 | mCore->editContact( uid ); | 108 | mCore->editContact( uid ); |
126 | } | 109 | } |
127 | #endif //KAB_EMBEDDED | 110 | #endif //KAB_EMBEDDED |
128 | void KAddressBookMain::newContact() | 111 | void KAddressBookMain::newContact() |
129 | { | 112 | { |
130 | mCore->newContact(); | 113 | mCore->newContact(); |
131 | } | 114 | } |
132 | 115 | ||
133 | QString KAddressBookMain::getNameByPhone( QString phone ) | 116 | QString KAddressBookMain::getNameByPhone( QString phone ) |
134 | { | 117 | { |
135 | return mCore->getNameByPhone( phone ); | 118 | return mCore->getNameByPhone( phone ); |
136 | } | 119 | } |
137 | 120 | ||
138 | void KAddressBookMain::save() | 121 | void KAddressBookMain::save() |
139 | { | 122 | { |
140 | mCore->save(); | 123 | mCore->save(); |
141 | } | 124 | } |
142 | 125 | ||
143 | void KAddressBookMain::exit() | 126 | void KAddressBookMain::exit() |
144 | { | 127 | { |
145 | close( ); | 128 | close( ); |
146 | } | 129 | } |
147 | 130 | ||
148 | void KAddressBookMain::saveProperties( KConfig* ) | 131 | void KAddressBookMain::saveProperties( KConfig* ) |
149 | { | 132 | { |
150 | } | 133 | } |
151 | 134 | ||
152 | void KAddressBookMain::readProperties( KConfig* ) | 135 | void KAddressBookMain::readProperties( KConfig* ) |
153 | { | 136 | { |
154 | } | 137 | } |
155 | 138 | ||
156 | void KAddressBookMain::initActions() | 139 | void KAddressBookMain::initActions() |
157 | { | 140 | { |
158 | #ifndef KAB_EMBEDDED | 141 | #ifndef KAB_EMBEDDED |
159 | KStdAction::quit( this, SLOT( close() ), actionCollection() ); | 142 | KStdAction::quit( this, SLOT( close() ), actionCollection() ); |
160 | KStdAction::configureToolbars( this, SLOT( configureToolbars() ), actionCollection() ); | 143 | KStdAction::configureToolbars( this, SLOT( configureToolbars() ), actionCollection() ); |
161 | #else //KAB_EMBEDDED | 144 | #else //KAB_EMBEDDED |
162 | //US: transfered the setup of the actions into KABCore | 145 | //US: transfered the setup of the actions into KABCore |
163 | #endif //KAB_EMBEDDED | 146 | #endif //KAB_EMBEDDED |
164 | 147 | ||
165 | 148 | ||
166 | } | 149 | } |
167 | 150 | ||
168 | //US new method to setup menues and toolbars on embedded systems | 151 | //US new method to setup menues and toolbars on embedded systems |
169 | #ifdef KAB_EMBEDDED | 152 | #ifdef KAB_EMBEDDED |
170 | /* | 153 | /* |
171 | QToolBar * KAddressBookMain::getIconToolBar() | 154 | QToolBar * KAddressBookMain::getIconToolBar() |
172 | { | 155 | { |
173 | return iconToolBar; | 156 | return iconToolBar; |
174 | } | 157 | } |
175 | */ | 158 | */ |
176 | 159 | ||