-rw-r--r-- | kaddressbook/kabcore.cpp | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 3e578bc..70ab6b7 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -125,9 +125,9 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
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 ); |
@@ -222,14 +222,23 @@ void KABCore::restoreSettings() | |||
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 ); |
@@ -256,11 +265,12 @@ void KABCore::restoreSettings() | |||
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(); |
@@ -1142,9 +1152,23 @@ void KABCore::initGUI() | |||
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 ); |
@@ -1160,9 +1184,9 @@ void KABCore::initGUI() | |||
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 | ||
@@ -1485,17 +1509,21 @@ void KABCore::addActionsManually() | |||
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. |