author | zautrix <zautrix> | 2004-06-29 11:59:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-06-29 11:59:46 (UTC) |
commit | da43dbdc6c82453228f34766fc74585615cba938 (patch) (unidiff) | |
tree | 16576932cea08bf117b2d0320b0d5f66ee8ad093 /kaddressbook | |
parent | 627489ea2669d3997676bc3cee0f5d0d0c16c4d4 (diff) | |
download | kdepimpi-da43dbdc6c82453228f34766fc74585615cba938.zip kdepimpi-da43dbdc6c82453228f34766fc74585615cba938.tar.gz kdepimpi-da43dbdc6c82453228f34766fc74585615cba938.tar.bz2 |
New lib ical.Some minor changes as well.
-rw-r--r-- | kaddressbook/kabcore.cpp | 46 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 2 | ||||
-rw-r--r-- | kaddressbook/kaddressbookmain.cpp | 19 | ||||
-rw-r--r-- | kaddressbook/kaddressbookmain.h | 4 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 8 |
5 files changed, 41 insertions, 38 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 3e578bc..70ab6b7 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -97,65 +97,65 @@ | |||
97 | #include <libkdepim/categoryselectdialog.h> | 97 | #include <libkdepim/categoryselectdialog.h> |
98 | 98 | ||
99 | #include "addresseeutil.h" | 99 | #include "addresseeutil.h" |
100 | #include "undocmds.h" | 100 | #include "undocmds.h" |
101 | #include "addresseeeditordialog.h" | 101 | #include "addresseeeditordialog.h" |
102 | #include "viewmanager.h" | 102 | #include "viewmanager.h" |
103 | #include "details/detailsviewcontainer.h" | 103 | #include "details/detailsviewcontainer.h" |
104 | #include "kabprefs.h" | 104 | #include "kabprefs.h" |
105 | #include "xxportmanager.h" | 105 | #include "xxportmanager.h" |
106 | #include "incsearchwidget.h" | 106 | #include "incsearchwidget.h" |
107 | #include "jumpbuttonbar.h" | 107 | #include "jumpbuttonbar.h" |
108 | #include "extensionmanager.h" | 108 | #include "extensionmanager.h" |
109 | #include "addresseeconfig.h" | 109 | #include "addresseeconfig.h" |
110 | #include <kcmultidialog.h> | 110 | #include <kcmultidialog.h> |
111 | 111 | ||
112 | 112 | ||
113 | #ifdef KAB_EMBEDDED | 113 | #ifdef KAB_EMBEDDED |
114 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) | 114 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) |
115 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), | 115 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), |
116 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ | 116 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ |
117 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) | 117 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) |
118 | #else //KAB_EMBEDDED | 118 | #else //KAB_EMBEDDED |
119 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) | 119 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) |
120 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), | 120 | : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), |
121 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), | 121 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), |
122 | mReadWrite( readWrite ), mModified( false ) | 122 | mReadWrite( readWrite ), mModified( false ) |
123 | #endif //KAB_EMBEDDED | 123 | #endif //KAB_EMBEDDED |
124 | { | 124 | { |
125 | #ifdef KAB_EMBEDDED | 125 | #ifdef KAB_EMBEDDED |
126 | //US we define here our own global actioncollection. | 126 | //US we define here our own global actioncollection. |
127 | //mActionCollection = new KActionCollection(this); | 127 | //mActionCollection = new KActionCollection(this); |
128 | #endif //KAB_EMBEDDED | 128 | #endif //KAB_EMBEDDED |
129 | 129 | mExtensionBarSplitter = 0; | |
130 | mIsPart = !parent->inherits( "KAddressBookMain" ); | 130 | mIsPart = !parent->inherits( "KAddressBookMain" ); |
131 | 131 | ||
132 | mAddressBook = KABC::StdAddressBook::self(); | 132 | mAddressBook = KABC::StdAddressBook::self(); |
133 | KABC::StdAddressBook::setAutomaticSave( true ); | 133 | KABC::StdAddressBook::setAutomaticSave( true ); |
134 | 134 | ||
135 | #ifndef KAB_EMBEDDED | 135 | #ifndef KAB_EMBEDDED |
136 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); | 136 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); |
137 | #endif //KAB_EMBEDDED | 137 | #endif //KAB_EMBEDDED |
138 | 138 | ||
139 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), | 139 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), |
140 | SLOT( addressBookChanged() ) ); | 140 | SLOT( addressBookChanged() ) ); |
141 | 141 | ||
142 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, | 142 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, |
143 | "X-Department", "KADDRESSBOOK" ); | 143 | "X-Department", "KADDRESSBOOK" ); |
144 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, | 144 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, |
145 | "X-Profession", "KADDRESSBOOK" ); | 145 | "X-Profession", "KADDRESSBOOK" ); |
146 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, | 146 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, |
147 | "X-AssistantsName", "KADDRESSBOOK" ); | 147 | "X-AssistantsName", "KADDRESSBOOK" ); |
148 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, | 148 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, |
149 | "X-ManagersName", "KADDRESSBOOK" ); | 149 | "X-ManagersName", "KADDRESSBOOK" ); |
150 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, | 150 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, |
151 | "X-SpousesName", "KADDRESSBOOK" ); | 151 | "X-SpousesName", "KADDRESSBOOK" ); |
152 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, | 152 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, |
153 | "X-Office", "KADDRESSBOOK" ); | 153 | "X-Office", "KADDRESSBOOK" ); |
154 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, | 154 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, |
155 | "X-IMAddress", "KADDRESSBOOK" ); | 155 | "X-IMAddress", "KADDRESSBOOK" ); |
156 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, | 156 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, |
157 | "X-Anniversary", "KADDRESSBOOK" ); | 157 | "X-Anniversary", "KADDRESSBOOK" ); |
158 | 158 | ||
159 | initGUI(); | 159 | initGUI(); |
160 | 160 | ||
161 | mIncSearchWidget->setFocus(); | 161 | mIncSearchWidget->setFocus(); |
@@ -194,101 +194,111 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
194 | #endif //KAB_EMBEDDED | 194 | #endif //KAB_EMBEDDED |
195 | 195 | ||
196 | setModified( false ); | 196 | setModified( false ); |
197 | } | 197 | } |
198 | 198 | ||
199 | KABCore::~KABCore() | 199 | KABCore::~KABCore() |
200 | { | 200 | { |
201 | // save(); | 201 | // save(); |
202 | //saveSettings(); | 202 | //saveSettings(); |
203 | //KABPrefs::instance()->writeConfig(); | 203 | //KABPrefs::instance()->writeConfig(); |
204 | delete AddresseeConfig::instance(); | 204 | delete AddresseeConfig::instance(); |
205 | mAddressBook = 0; | 205 | mAddressBook = 0; |
206 | KABC::StdAddressBook::close(); | 206 | KABC::StdAddressBook::close(); |
207 | 207 | ||
208 | #ifdef KAB_EMBEDDED | 208 | #ifdef KAB_EMBEDDED |
209 | //US we define here our own global actioncollection. | 209 | //US we define here our own global actioncollection. |
210 | // delete mActionCollection; | 210 | // delete mActionCollection; |
211 | #endif //KAB_EMBEDDED | 211 | #endif //KAB_EMBEDDED |
212 | 212 | ||
213 | } | 213 | } |
214 | 214 | ||
215 | void KABCore::restoreSettings() | 215 | void KABCore::restoreSettings() |
216 | { | 216 | { |
217 | bool state = KABPrefs::instance()->mJumpButtonBarVisible; | 217 | bool state = KABPrefs::instance()->mJumpButtonBarVisible; |
218 | 218 | ||
219 | mActionJumpBar->setChecked( state ); | 219 | mActionJumpBar->setChecked( state ); |
220 | setJumpButtonBarVisible( state ); | 220 | setJumpButtonBarVisible( state ); |
221 | 221 | ||
222 | state = KABPrefs::instance()->mDetailsPageVisible; | 222 | state = KABPrefs::instance()->mDetailsPageVisible; |
223 | 223 | ||
224 | mActionDetails->setChecked( state ); | 224 | mActionDetails->setChecked( state ); |
225 | setDetailsVisible( state ); | 225 | setDetailsVisible( state ); |
226 | QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 226 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
227 | if ( splitterSize.count() == 0 ) { | 227 | if ( splitterSize.count() == 0 ) { |
228 | splitterSize.append( width() / 2 ); | 228 | splitterSize.append( width() / 2 ); |
229 | splitterSize.append( width() / 2 ); | 229 | splitterSize.append( width() / 2 ); |
230 | } | 230 | } |
231 | mMiniSplitter->setSizes( splitterSize ); | 231 | mMiniSplitter->setSizes( splitterSize ); |
232 | if ( mExtensionBarSplitter ) { | ||
233 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | ||
234 | if ( splitterSize.count() == 0 ) { | ||
235 | splitterSize.append( width() / 2 ); | ||
236 | splitterSize.append( width() / 2 ); | ||
237 | } | ||
238 | mExtensionBarSplitter->setSizes( splitterSize ); | ||
239 | |||
240 | } | ||
232 | #ifndef KAB_EMBEDDED | 241 | #ifndef KAB_EMBEDDED |
233 | QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 242 | QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
234 | if ( splitterSize.count() == 0 ) { | 243 | if ( splitterSize.count() == 0 ) { |
235 | splitterSize.append( width() / 2 ); | 244 | splitterSize.append( width() / 2 ); |
236 | splitterSize.append( width() / 2 ); | 245 | splitterSize.append( width() / 2 ); |
237 | } | 246 | } |
238 | mExtensionBarSplitter->setSizes( splitterSize ); | 247 | mExtensionBarSplitter->setSizes( splitterSize ); |
239 | 248 | ||
240 | splitterSize = KABPrefs::instance()->mDetailsSplitter; | 249 | splitterSize = KABPrefs::instance()->mDetailsSplitter; |
241 | if ( splitterSize.count() == 0 ) { | 250 | if ( splitterSize.count() == 0 ) { |
242 | splitterSize.append( height() / 2 ); | 251 | splitterSize.append( height() / 2 ); |
243 | splitterSize.append( height() / 2 ); | 252 | splitterSize.append( height() / 2 ); |
244 | } | 253 | } |
245 | mDetailsSplitter->setSizes( splitterSize ); | 254 | mDetailsSplitter->setSizes( splitterSize ); |
246 | 255 | ||
247 | mExtensionManager->restoreSettings(); | 256 | mExtensionManager->restoreSettings(); |
248 | 257 | ||
249 | #endif //KAB_EMBEDDED | 258 | #endif //KAB_EMBEDDED |
250 | 259 | ||
251 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); | 260 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); |
252 | 261 | ||
253 | mViewManager->restoreSettings(); | 262 | mViewManager->restoreSettings(); |
254 | mExtensionManager->restoreSettings(); | 263 | mExtensionManager->restoreSettings(); |
255 | } | 264 | } |
256 | 265 | ||
257 | void KABCore::saveSettings() | 266 | void KABCore::saveSettings() |
258 | { | 267 | { |
259 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); | 268 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); |
260 | KABPrefs::instance()->mExtensionsSplitter = mMiniSplitter->sizes(); | 269 | if ( mExtensionBarSplitter ) |
270 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | ||
261 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); | 271 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); |
262 | 272 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); | |
263 | #ifndef KAB_EMBEDDED | 273 | #ifndef KAB_EMBEDDED |
264 | 274 | ||
265 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 275 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
266 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); | 276 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); |
267 | #endif //KAB_EMBEDDED | 277 | #endif //KAB_EMBEDDED |
268 | mExtensionManager->saveSettings(); | 278 | mExtensionManager->saveSettings(); |
269 | mViewManager->saveSettings(); | 279 | mViewManager->saveSettings(); |
270 | 280 | ||
271 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); | 281 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); |
272 | 282 | ||
273 | } | 283 | } |
274 | 284 | ||
275 | KABC::AddressBook *KABCore::addressBook() const | 285 | KABC::AddressBook *KABCore::addressBook() const |
276 | { | 286 | { |
277 | return mAddressBook; | 287 | return mAddressBook; |
278 | } | 288 | } |
279 | 289 | ||
280 | KConfig *KABCore::config() | 290 | KConfig *KABCore::config() |
281 | { | 291 | { |
282 | #ifndef KAB_EMBEDDED | 292 | #ifndef KAB_EMBEDDED |
283 | return KABPrefs::instance()->config(); | 293 | return KABPrefs::instance()->config(); |
284 | #else //KAB_EMBEDDED | 294 | #else //KAB_EMBEDDED |
285 | return KABPrefs::instance()->getConfig(); | 295 | return KABPrefs::instance()->getConfig(); |
286 | #endif //KAB_EMBEDDED | 296 | #endif //KAB_EMBEDDED |
287 | } | 297 | } |
288 | 298 | ||
289 | KActionCollection *KABCore::actionCollection() const | 299 | KActionCollection *KABCore::actionCollection() const |
290 | { | 300 | { |
291 | return mGUIClient->actionCollection(); | 301 | return mGUIClient->actionCollection(); |
292 | } | 302 | } |
293 | 303 | ||
294 | KABC::Field *KABCore::currentSearchField() const | 304 | KABC::Field *KABCore::currentSearchField() const |
@@ -1114,83 +1124,97 @@ void KABCore::initGUI() | |||
1114 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1124 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1115 | 1125 | ||
1116 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); | 1126 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); |
1117 | 1127 | ||
1118 | topLayout->addWidget( mExtensionBarSplitter ); | 1128 | topLayout->addWidget( mExtensionBarSplitter ); |
1119 | topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); | 1129 | topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); |
1120 | topLayout->addWidget( mJumpButtonBar ); | 1130 | topLayout->addWidget( mJumpButtonBar ); |
1121 | topLayout->setStretchFactor( mJumpButtonBar, 1 ); | 1131 | topLayout->setStretchFactor( mJumpButtonBar, 1 ); |
1122 | 1132 | ||
1123 | mXXPortManager = new XXPortManager( this, this ); | 1133 | mXXPortManager = new XXPortManager( this, this ); |
1124 | 1134 | ||
1125 | #else //KAB_EMBEDDED | 1135 | #else //KAB_EMBEDDED |
1126 | //US initialize viewMenu before settingup viewmanager. | 1136 | //US initialize viewMenu before settingup viewmanager. |
1127 | // Viewmanager needs this menu to plugin submenues. | 1137 | // Viewmanager needs this menu to plugin submenues. |
1128 | viewMenu = new QPopupMenu( this ); | 1138 | viewMenu = new QPopupMenu( this ); |
1129 | settingsMenu = new QPopupMenu( this ); | 1139 | settingsMenu = new QPopupMenu( this ); |
1130 | //filterMenu = new QPopupMenu( this ); | 1140 | //filterMenu = new QPopupMenu( this ); |
1131 | ImportMenu = new QPopupMenu( this ); | 1141 | ImportMenu = new QPopupMenu( this ); |
1132 | ExportMenu = new QPopupMenu( this ); | 1142 | ExportMenu = new QPopupMenu( this ); |
1133 | 1143 | ||
1134 | 1144 | ||
1135 | //US since we have no splitter for the embedded system, setup | 1145 | //US since we have no splitter for the embedded system, setup |
1136 | // a layout with two frames. One left and one right. | 1146 | // a layout with two frames. One left and one right. |
1137 | 1147 | ||
1138 | QBoxLayout *topLayout; | 1148 | QBoxLayout *topLayout; |
1139 | 1149 | ||
1140 | // = new QHBoxLayout( this ); | 1150 | // = new QHBoxLayout( this ); |
1141 | // QBoxLayout *topLayout = (QBoxLayout*)layout(); | 1151 | // QBoxLayout *topLayout = (QBoxLayout*)layout(); |
1142 | 1152 | ||
1143 | // QWidget *mainBox = new QWidget( this ); | 1153 | // QWidget *mainBox = new QWidget( this ); |
1144 | // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); | 1154 | // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); |
1145 | 1155 | ||
1146 | 1156 | #ifdef DESKTOP_VERSION | |
1157 | topLayout = new QHBoxLayout( this ); | ||
1158 | |||
1159 | |||
1160 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | ||
1161 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | ||
1162 | |||
1163 | topLayout->addWidget(mMiniSplitter ); | ||
1164 | |||
1165 | mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); | ||
1166 | mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | ||
1167 | mViewManager = new ViewManager( this, mExtensionBarSplitter ); | ||
1168 | mDetails = new ViewContainer( mMiniSplitter ); | ||
1169 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); | ||
1170 | #else | ||
1147 | if ( QApplication::desktop()->width() > 480 ) { | 1171 | if ( QApplication::desktop()->width() > 480 ) { |
1148 | topLayout = new QHBoxLayout( this ); | 1172 | topLayout = new QHBoxLayout( this ); |
1149 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 1173 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
1150 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 1174 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
1151 | } else { | 1175 | } else { |
1152 | 1176 | ||
1153 | topLayout = new QVBoxLayout( this ); | 1177 | topLayout = new QVBoxLayout( this ); |
1154 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 1178 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
1155 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 1179 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
1156 | } | 1180 | } |
1157 | 1181 | ||
1158 | topLayout->addWidget(mMiniSplitter ); | 1182 | topLayout->addWidget(mMiniSplitter ); |
1159 | mViewManager = new ViewManager( this, mMiniSplitter ); | 1183 | mViewManager = new ViewManager( this, mMiniSplitter ); |
1160 | mDetails = new ViewContainer( mMiniSplitter ); | 1184 | mDetails = new ViewContainer( mMiniSplitter ); |
1161 | 1185 | ||
1162 | 1186 | ||
1163 | mExtensionManager = new ExtensionManager( this, mMiniSplitter ); | 1187 | mExtensionManager = new ExtensionManager( this, mMiniSplitter ); |
1164 | 1188 | #endif | |
1165 | //eh->hide(); | 1189 | //eh->hide(); |
1166 | // topLayout->addWidget(mExtensionManager ); | 1190 | // topLayout->addWidget(mExtensionManager ); |
1167 | 1191 | ||
1168 | 1192 | ||
1169 | /*US | 1193 | /*US |
1170 | #ifndef KAB_NOSPLITTER | 1194 | #ifndef KAB_NOSPLITTER |
1171 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1195 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1172 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); | 1196 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); |
1173 | topLayout->setSpacing( 10 ); | 1197 | topLayout->setSpacing( 10 ); |
1174 | 1198 | ||
1175 | mDetailsSplitter = new QSplitter( this ); | 1199 | mDetailsSplitter = new QSplitter( this ); |
1176 | 1200 | ||
1177 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); | 1201 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); |
1178 | 1202 | ||
1179 | mViewManager = new ViewManager( this, viewSpace ); | 1203 | mViewManager = new ViewManager( this, viewSpace ); |
1180 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1204 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1181 | 1205 | ||
1182 | mDetails = new ViewContainer( mDetailsSplitter ); | 1206 | mDetails = new ViewContainer( mDetailsSplitter ); |
1183 | 1207 | ||
1184 | topLayout->addWidget( mDetailsSplitter ); | 1208 | topLayout->addWidget( mDetailsSplitter ); |
1185 | topLayout->setStretchFactor( mDetailsSplitter, 100 ); | 1209 | topLayout->setStretchFactor( mDetailsSplitter, 100 ); |
1186 | #else //KAB_NOSPLITTER | 1210 | #else //KAB_NOSPLITTER |
1187 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1211 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1188 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); | 1212 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); |
1189 | topLayout->setSpacing( 10 ); | 1213 | topLayout->setSpacing( 10 ); |
1190 | 1214 | ||
1191 | // mDetailsSplitter = new QSplitter( this ); | 1215 | // mDetailsSplitter = new QSplitter( this ); |
1192 | 1216 | ||
1193 | QVBox *viewSpace = new QVBox( this ); | 1217 | QVBox *viewSpace = new QVBox( this ); |
1194 | 1218 | ||
1195 | mViewManager = new ViewManager( this, viewSpace ); | 1219 | mViewManager = new ViewManager( this, viewSpace ); |
1196 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1220 | viewSpace->setStretchFactor( mViewManager, 1 ); |
@@ -1457,73 +1481,77 @@ void KABCore::addActionsManually() | |||
1457 | mActionDelete->plug( editMenu ); | 1481 | mActionDelete->plug( editMenu ); |
1458 | editMenu->insertSeparator(); | 1482 | editMenu->insertSeparator(); |
1459 | mActionSelectAll->plug( editMenu ); | 1483 | mActionSelectAll->plug( editMenu ); |
1460 | 1484 | ||
1461 | 1485 | ||
1462 | // settings menu | 1486 | // settings menu |
1463 | //US special menuentry to configure the addressbook resources. On KDE | 1487 | //US special menuentry to configure the addressbook resources. On KDE |
1464 | // you do that through the control center !!! | 1488 | // you do that through the control center !!! |
1465 | mActionConfigResources->plug( settingsMenu ); | 1489 | mActionConfigResources->plug( settingsMenu ); |
1466 | settingsMenu->insertSeparator(); | 1490 | settingsMenu->insertSeparator(); |
1467 | 1491 | ||
1468 | mActionConfigKAddressbook->plug( settingsMenu ); | 1492 | mActionConfigKAddressbook->plug( settingsMenu ); |
1469 | 1493 | ||
1470 | if ( mIsPart ) { | 1494 | if ( mIsPart ) { |
1471 | mActionConfigShortcuts->plug( settingsMenu ); | 1495 | mActionConfigShortcuts->plug( settingsMenu ); |
1472 | mActionConfigureToolbars->plug( settingsMenu ); | 1496 | mActionConfigureToolbars->plug( settingsMenu ); |
1473 | 1497 | ||
1474 | } else { | 1498 | } else { |
1475 | mActionKeyBindings->plug( settingsMenu ); | 1499 | mActionKeyBindings->plug( settingsMenu ); |
1476 | } | 1500 | } |
1477 | 1501 | ||
1478 | settingsMenu->insertSeparator(); | 1502 | settingsMenu->insertSeparator(); |
1479 | 1503 | ||
1480 | mActionJumpBar->plug( settingsMenu ); | 1504 | mActionJumpBar->plug( settingsMenu ); |
1481 | mActionDetails->plug( settingsMenu ); | 1505 | mActionDetails->plug( settingsMenu ); |
1482 | settingsMenu->insertSeparator(); | 1506 | settingsMenu->insertSeparator(); |
1483 | 1507 | ||
1484 | mActionWhoAmI->plug( settingsMenu ); | 1508 | mActionWhoAmI->plug( settingsMenu ); |
1485 | mActionCategories->plug( settingsMenu ); | 1509 | mActionCategories->plug( settingsMenu ); |
1486 | 1510 | ||
1487 | mActionAboutKAddressbook->plug( helpMenu ); | 1511 | mActionAboutKAddressbook->plug( helpMenu ); |
1488 | 1512 | ||
1513 | |||
1489 | if (QApplication::desktop()->width() > 320 ) { | 1514 | if (QApplication::desktop()->width() > 320 ) { |
1490 | 1515 | ||
1491 | mActionEditAddressee->plug( tb ); | 1516 | mActionEditAddressee->plug( tb ); |
1492 | mActionSave->plug( tb ); | 1517 | mActionSave->plug( tb ); |
1493 | mViewManager->getFilterAction()->plug ( tb); | 1518 | mViewManager->getFilterAction()->plug ( tb); |
1494 | if (QApplication::desktop()->width() > 480 ) | 1519 | if (QApplication::desktop()->width() > 480 ) { |
1495 | mActionDelete->plug( tb ); | 1520 | mActionUndo->plug( tb ); |
1521 | mActionDelete->plug( tb ); | ||
1522 | mActionRedo->plug( tb ); | ||
1523 | } | ||
1496 | } | 1524 | } |
1497 | mActionQuit->plug ( tb ); | 1525 | //mActionQuit->plug ( tb ); |
1498 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); | 1526 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); |
1499 | 1527 | ||
1500 | //US link the searchwidget first to this. | 1528 | //US link the searchwidget first to this. |
1501 | // The real linkage to the toolbar happens later. | 1529 | // The real linkage to the toolbar happens later. |
1502 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); | 1530 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); |
1503 | //US tb->insertItem( mIncSearchWidget ); | 1531 | //US tb->insertItem( mIncSearchWidget ); |
1504 | /*US | 1532 | /*US |
1505 | mIncSearchWidget = new IncSearchWidget( tb ); | 1533 | mIncSearchWidget = new IncSearchWidget( tb ); |
1506 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 1534 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
1507 | SLOT( incrementalSearch( const QString& ) ) ); | 1535 | SLOT( incrementalSearch( const QString& ) ) ); |
1508 | 1536 | ||
1509 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1537 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1510 | 1538 | ||
1511 | //US topLayout->addWidget( mJumpButtonBar ); | 1539 | //US topLayout->addWidget( mJumpButtonBar ); |
1512 | this->layout()->add( mJumpButtonBar ); | 1540 | this->layout()->add( mJumpButtonBar ); |
1513 | */ | 1541 | */ |
1514 | 1542 | ||
1515 | #endif //KAB_EMBEDDED | 1543 | #endif //KAB_EMBEDDED |
1516 | } | 1544 | } |
1517 | 1545 | ||
1518 | 1546 | ||
1519 | 1547 | ||
1520 | void KABCore::clipboardDataChanged() | 1548 | void KABCore::clipboardDataChanged() |
1521 | { | 1549 | { |
1522 | 1550 | ||
1523 | if ( mReadWrite ) | 1551 | if ( mReadWrite ) |
1524 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); | 1552 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); |
1525 | 1553 | ||
1526 | } | 1554 | } |
1527 | 1555 | ||
1528 | void KABCore::updateActionMenu() | 1556 | void KABCore::updateActionMenu() |
1529 | { | 1557 | { |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index edf98c2..b84ec22 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -315,65 +315,65 @@ class KABCore : public QWidget | |||
315 | void contactSelected( const QPixmap &pixmap ); | 315 | void contactSelected( const QPixmap &pixmap ); |
316 | public slots: | 316 | public slots: |
317 | void setDetailsVisible( bool visible ); | 317 | void setDetailsVisible( bool visible ); |
318 | void setDetailsToState(); | 318 | void setDetailsToState(); |
319 | private slots: | 319 | private slots: |
320 | void setJumpButtonBarVisible( bool visible ); | 320 | void setJumpButtonBarVisible( bool visible ); |
321 | 321 | ||
322 | void extensionModified( const KABC::Addressee::List &list ); | 322 | void extensionModified( const KABC::Addressee::List &list ); |
323 | void clipboardDataChanged(); | 323 | void clipboardDataChanged(); |
324 | void updateActionMenu(); | 324 | void updateActionMenu(); |
325 | void configureKeyBindings(); | 325 | void configureKeyBindings(); |
326 | #ifdef KAB_EMBEDDED | 326 | #ifdef KAB_EMBEDDED |
327 | void configureResources(); | 327 | void configureResources(); |
328 | #endif //KAB_EMBEDDED | 328 | #endif //KAB_EMBEDDED |
329 | 329 | ||
330 | void slotEditorDestroyed( const QString &uid ); | 330 | void slotEditorDestroyed( const QString &uid ); |
331 | void configurationChanged(); | 331 | void configurationChanged(); |
332 | void addressBookChanged(); | 332 | void addressBookChanged(); |
333 | 333 | ||
334 | private: | 334 | private: |
335 | void initGUI(); | 335 | void initGUI(); |
336 | void initActions(); | 336 | void initActions(); |
337 | 337 | ||
338 | AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, | 338 | AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, |
339 | const char *name = 0 ); | 339 | const char *name = 0 ); |
340 | 340 | ||
341 | KXMLGUIClient *mGUIClient; | 341 | KXMLGUIClient *mGUIClient; |
342 | 342 | ||
343 | KABC::AddressBook *mAddressBook; | 343 | KABC::AddressBook *mAddressBook; |
344 | 344 | ||
345 | ViewManager *mViewManager; | 345 | ViewManager *mViewManager; |
346 | // QSplitter *mDetailsSplitter; | 346 | // QSplitter *mDetailsSplitter; |
347 | //QSplitter *mExtensionBarSplitter; | 347 | KDGanttMinimizeSplitter *mExtensionBarSplitter; |
348 | ViewContainer *mDetails; | 348 | ViewContainer *mDetails; |
349 | KDGanttMinimizeSplitter* mMiniSplitter; | 349 | KDGanttMinimizeSplitter* mMiniSplitter; |
350 | XXPortManager *mXXPortManager; | 350 | XXPortManager *mXXPortManager; |
351 | JumpButtonBar *mJumpButtonBar; | 351 | JumpButtonBar *mJumpButtonBar; |
352 | IncSearchWidget *mIncSearchWidget; | 352 | IncSearchWidget *mIncSearchWidget; |
353 | ExtensionManager *mExtensionManager; | 353 | ExtensionManager *mExtensionManager; |
354 | 354 | ||
355 | KCMultiDialog *mConfigureDialog; | 355 | KCMultiDialog *mConfigureDialog; |
356 | 356 | ||
357 | #ifndef KAB_EMBEDDED | 357 | #ifndef KAB_EMBEDDED |
358 | 358 | ||
359 | KCMultiDialog *mConfigureDialog; | 359 | KCMultiDialog *mConfigureDialog; |
360 | LDAPSearchDialog *mLdapSearchDialog; | 360 | LDAPSearchDialog *mLdapSearchDialog; |
361 | #endif //KAB_EMBEDDED | 361 | #endif //KAB_EMBEDDED |
362 | QDict<AddresseeEditorDialog> mEditorDict; | 362 | QDict<AddresseeEditorDialog> mEditorDict; |
363 | 363 | ||
364 | bool mReadWrite; | 364 | bool mReadWrite; |
365 | bool mModified; | 365 | bool mModified; |
366 | bool mIsPart; | 366 | bool mIsPart; |
367 | 367 | ||
368 | //US file menu | 368 | //US file menu |
369 | KAction *mActionMail; | 369 | KAction *mActionMail; |
370 | KAction* mActionPrint; | 370 | KAction* mActionPrint; |
371 | KAction* mActionNewContact; | 371 | KAction* mActionNewContact; |
372 | KAction *mActionSave; | 372 | KAction *mActionSave; |
373 | KAction *mActionEditAddressee; | 373 | KAction *mActionEditAddressee; |
374 | KAction *mActionMailVCard; | 374 | KAction *mActionMailVCard; |
375 | KAction *mActionQuit; | 375 | KAction *mActionQuit; |
376 | 376 | ||
377 | //US edit menu | 377 | //US edit menu |
378 | KAction *mActionCopy; | 378 | KAction *mActionCopy; |
379 | KAction *mActionCut; | 379 | KAction *mActionCut; |
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index 92c32ca..8ebb93a 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp | |||
@@ -63,82 +63,65 @@ KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainW | |||
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 | { |
diff --git a/kaddressbook/kaddressbookmain.h b/kaddressbook/kaddressbookmain.h index 81ae09c..cf6f899 100644 --- a/kaddressbook/kaddressbookmain.h +++ b/kaddressbook/kaddressbookmain.h | |||
@@ -41,68 +41,64 @@ class QToolBar; | |||
41 | class KABCore; | 41 | class KABCore; |
42 | class KConfig; | 42 | class KConfig; |
43 | 43 | ||
44 | /** | 44 | /** |
45 | This class serves as the main window for KAddressBook. It handles the | 45 | This class serves as the main window for KAddressBook. It handles the |
46 | menus, toolbars, and status bars. | 46 | menus, toolbars, and status bars. |
47 | 47 | ||
48 | @short Main window class | 48 | @short Main window class |
49 | @author Don Sanders <dsanders@kde.org> | 49 | @author Don Sanders <dsanders@kde.org> |
50 | @version 0.1 | 50 | @version 0.1 |
51 | */ | 51 | */ |
52 | #ifdef KAB_EMBEDDED | 52 | #ifdef KAB_EMBEDDED |
53 | class KAddressBookMain : public KMainWindow | 53 | class KAddressBookMain : public KMainWindow |
54 | #else //KAB_EMBEDDED | 54 | #else //KAB_EMBEDDED |
55 | //MOC_SKIP_BEGIN | 55 | //MOC_SKIP_BEGIN |
56 | class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface | 56 | class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface |
57 | //MOC_SKIP_END | 57 | //MOC_SKIP_END |
58 | #endif //KAB_EMBEDDED | 58 | #endif //KAB_EMBEDDED |
59 | { | 59 | { |
60 | Q_OBJECT | 60 | Q_OBJECT |
61 | 61 | ||
62 | public: | 62 | public: |
63 | KAddressBookMain(); | 63 | KAddressBookMain(); |
64 | virtual ~KAddressBookMain(); | 64 | virtual ~KAddressBookMain(); |
65 | 65 | ||
66 | #ifdef KAB_EMBEDDED | 66 | #ifdef KAB_EMBEDDED |
67 | // QPEToolBar * getIconToolBar(); | 67 | // QPEToolBar * getIconToolBar(); |
68 | // QToolBar * getIconToolBar(); | 68 | // QToolBar * getIconToolBar(); |
69 | #endif //KAB_EMBEDDED | 69 | #endif //KAB_EMBEDDED |
70 | 70 | ||
71 | 71 | ||
72 | public slots: | 72 | public slots: |
73 | #ifndef DESKTOP_VERSION | ||
74 | void show(); | ||
75 | #endif | ||
76 | |||
77 | void showMinimized () ; | 73 | void showMinimized () ; |
78 | virtual void addEmail( QString addr ); | 74 | virtual void addEmail( QString addr ); |
79 | #ifndef KAB_EMBEDDED | 75 | #ifndef KAB_EMBEDDED |
80 | //MOC_SKIP_BEGIN | 76 | //MOC_SKIP_BEGIN |
81 | virtual ASYNC showContactEditor( QString uid ); | 77 | virtual ASYNC showContactEditor( QString uid ); |
82 | //MOC_SKIP_END | 78 | //MOC_SKIP_END |
83 | #endif //KAB_EMBEDDED | 79 | #endif //KAB_EMBEDDED |
84 | virtual void newContact(); | 80 | virtual void newContact(); |
85 | virtual QString getNameByPhone( QString phone ); | 81 | virtual QString getNameByPhone( QString phone ); |
86 | virtual void save(); | 82 | virtual void save(); |
87 | virtual void exit(); | 83 | virtual void exit(); |
88 | 84 | ||
89 | protected: | 85 | protected: |
90 | void initActions(); | 86 | void initActions(); |
91 | #ifdef KAB_EMBEDDED | 87 | #ifdef KAB_EMBEDDED |
92 | //US new method to setup menues and toolbars on embedded systems | 88 | //US new method to setup menues and toolbars on embedded systems |
93 | void createGUI(); | 89 | void createGUI(); |
94 | #endif //KAB_EMBEDDED | 90 | #endif //KAB_EMBEDDED |
95 | 91 | ||
96 | /** | 92 | /** |
97 | This function is called when it is time for the app to save its | 93 | This function is called when it is time for the app to save its |
98 | properties for session management purposes. | 94 | properties for session management purposes. |
99 | */ | 95 | */ |
100 | void saveProperties( KConfig* ); | 96 | void saveProperties( KConfig* ); |
101 | 97 | ||
102 | /** | 98 | /** |
103 | This function is called when this app is restored. The KConfig | 99 | This function is called when this app is restored. The KConfig |
104 | object points to the session management config file that was saved | 100 | object points to the session management config file that was saved |
105 | with @ref saveProperties | 101 | with @ref saveProperties |
106 | */ | 102 | */ |
107 | void readProperties( KConfig* ); | 103 | void readProperties( KConfig* ); |
108 | 104 | ||
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index ffa37a5..3f6f69d 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -39,70 +39,66 @@ int main( int argc, char **argv ) | |||
39 | if ( ! exitHelp ) { | 39 | if ( ! exitHelp ) { |
40 | 40 | ||
41 | KGlobal::setAppName( "kaddressbook" ); | 41 | KGlobal::setAppName( "kaddressbook" ); |
42 | #ifndef DESKTOP_VERSION | 42 | #ifndef DESKTOP_VERSION |
43 | KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) ); | 43 | KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) ); |
44 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); | 44 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); |
45 | #else | 45 | #else |
46 | QString fileName ; | 46 | QString fileName ; |
47 | #ifndef _WIN32_ | 47 | #ifndef _WIN32_ |
48 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/"; | 48 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/"; |
49 | #else | 49 | #else |
50 | fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\"; | 50 | fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\"; |
51 | #endif | 51 | #endif |
52 | KGlobal::iconLoader()->setIconPath(fileName); | 52 | KGlobal::iconLoader()->setIconPath(fileName); |
53 | QString appdir = QDir::homeDirPath(); | 53 | QString appdir = QDir::homeDirPath(); |
54 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) | 54 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) |
55 | appdir += "kaddressbook"; | 55 | appdir += "kaddressbook"; |
56 | else | 56 | else |
57 | appdir += "/kaddressbook"; | 57 | appdir += "/kaddressbook"; |
58 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); | 58 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); |
59 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); | 59 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); |
60 | #endif // desktop | 60 | #endif // desktop |
61 | QDir app_dir; | 61 | QDir app_dir; |
62 | if ( !app_dir.exists(KStandardDirs::appDir()) ) | 62 | if ( !app_dir.exists(KStandardDirs::appDir()) ) |
63 | app_dir.mkdir (KStandardDirs::appDir()); | 63 | app_dir.mkdir (KStandardDirs::appDir()); |
64 | 64 | ||
65 | KAddressBookMain* m = new KAddressBookMain(); | 65 | KAddressBookMain* m = new KAddressBookMain(); |
66 | //US MainWindow m; | 66 | //US MainWindow m; |
67 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 67 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); |
68 | 68 | ||
69 | #ifndef DESKTOP_VERSION | 69 | #ifndef DESKTOP_VERSION |
70 | a.showMainWidget(m ); | 70 | a.showMainWidget(m ); |
71 | m->showFullScreen(); | 71 | m->showMaximized(); |
72 | int min = 20; | 72 | |
73 | if ( QApplication::desktop()->width() > 320 ) | ||
74 | min += 20; | ||
75 | m->setGeometry( 0,0,QApplication::desktop()->width(), QApplication::desktop()->height() - min ); | ||
76 | |||
77 | #else | 73 | #else |
78 | a.setMainWidget(m ); | 74 | a.setMainWidget(m ); |
79 | m->show(); | 75 | m->show(); |
80 | //m->resize( 640, 480 ); | 76 | //m->resize( 640, 480 ); |
81 | #endif | 77 | #endif |
82 | a.exec(); | 78 | a.exec(); |
83 | 79 | ||
84 | } | 80 | } |
85 | qDebug("KA: Bye! "); | 81 | qDebug("KA: Bye! "); |
86 | } | 82 | } |
87 | 83 | ||
88 | /* | 84 | /* |
89 | #include <stdlib.h> | 85 | #include <stdlib.h> |
90 | 86 | ||
91 | #include <qstring.h> | 87 | #include <qstring.h> |
92 | 88 | ||
93 | #include <kabc/stdaddressbook.h> | 89 | #include <kabc/stdaddressbook.h> |
94 | #include <kaboutdata.h> | 90 | #include <kaboutdata.h> |
95 | #include <kcmdlineargs.h> | 91 | #include <kcmdlineargs.h> |
96 | #include <kcrash.h> | 92 | #include <kcrash.h> |
97 | #include <kdebug.h> | 93 | #include <kdebug.h> |
98 | #include <klocale.h> | 94 | #include <klocale.h> |
99 | #include <kstartupinfo.h> | 95 | #include <kstartupinfo.h> |
100 | #include <kuniqueapplication.h> | 96 | #include <kuniqueapplication.h> |
101 | #include <kwin.h> | 97 | #include <kwin.h> |
102 | 98 | ||
103 | #include "kaddressbookmain.h" | 99 | #include "kaddressbookmain.h" |
104 | #include "kabcore.h" | 100 | #include "kabcore.h" |
105 | 101 | ||
106 | extern "C" { | 102 | extern "C" { |
107 | 103 | ||
108 | void crashHandler( int ) | 104 | void crashHandler( int ) |