summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 9c40142..a4f3579 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -540,44 +540,78 @@ void KABCore::restoreSettings()
splitterSize.append( wid / 2 );
}
mMiniSplitter->setSizes( splitterSize );
if ( mExtensionBarSplitter ) {
//splitterSize = KABPrefs::instance()->mExtensionsSplitter;
if ( true /*splitterSize.count() == 0*/ ) {
splitterSize.append( wid / 2 );
splitterSize.append( wid / 2 );
}
mExtensionBarSplitter->setSizes( splitterSize );
}
+#ifdef DESKTOP_VERSION
+ KConfig *config = KABPrefs::instance()->getConfig();
+ config->setGroup("WidgetLayout");
+ QStringList list;
+ list = config->readListEntry("MainLayout");
+ int x,y,w,h;
+ if ( ! list.isEmpty() ) {
+ x = list[0].toInt();
+ y = list[1].toInt();
+ w = list[2].toInt();
+ h = list[3].toInt();
+ KApplication::testCoords( &x,&y,&w,&h );
+ topLevelWidget()->setGeometry(x,y,w,h);
-
+ } else {
+ topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
+ }
+#endif
}
void KABCore::saveSettings()
{
KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked();
if ( mExtensionBarSplitter )
KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked();
KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes();
#ifndef KAB_EMBEDDED
KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes();
#endif //KAB_EMBEDDED
mExtensionManager->saveSettings();
mViewManager->saveSettings();
KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem();
+#ifdef DESKTOP_VERSION
+ KConfig *config = KABPrefs::instance()->getConfig();
+ config->setGroup("WidgetLayout");
+ QStringList list ;//= config->readListEntry("MainLayout");
+ int x,y,w,h;
+ QWidget* wid;
+ wid = topLevelWidget();
+ x = wid->geometry().x();
+ y = wid->geometry().y();
+ w = wid->width();
+ h = wid->height();
+ list.clear();
+ list << QString::number( x );
+ list << QString::number( y );
+ list << QString::number( w );
+ list << QString::number( h );
+ config->writeEntry("MainLayout",list );
+#endif
KABPrefs::instance()->writeConfig();
qDebug("KA: KABCore::saveSettings() ");
}
KABC::AddressBook *KABCore::addressBook() const
{
return mAddressBook;
}
KConfig *KABCore::config()
{
#ifndef KAB_EMBEDDED