summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp46
-rw-r--r--kaddressbook/kabcore.h2
-rw-r--r--kaddressbook/kaddressbookmain.cpp19
-rw-r--r--kaddressbook/kaddressbookmain.h4
-rw-r--r--kaddressbook/mainembedded.cpp8
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
@@ -125,9 +125,9 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
#ifdef KAB_EMBEDDED
//US we define here our own global actioncollection.
//mActionCollection = new KActionCollection(this);
#endif //KAB_EMBEDDED
-
+ mExtensionBarSplitter = 0;
mIsPart = !parent->inherits( "KAddressBookMain" );
mAddressBook = KABC::StdAddressBook::self();
KABC::StdAddressBook::setAutomaticSave( true );
@@ -222,14 +222,23 @@ void KABCore::restoreSettings()
state = KABPrefs::instance()->mDetailsPageVisible;
mActionDetails->setChecked( state );
setDetailsVisible( state );
- QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter;
+ QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
if ( splitterSize.count() == 0 ) {
splitterSize.append( width() / 2 );
splitterSize.append( width() / 2 );
}
mMiniSplitter->setSizes( splitterSize );
+ if ( mExtensionBarSplitter ) {
+ splitterSize = KABPrefs::instance()->mExtensionsSplitter;
+ if ( splitterSize.count() == 0 ) {
+ splitterSize.append( width() / 2 );
+ splitterSize.append( width() / 2 );
+ }
+ mExtensionBarSplitter->setSizes( splitterSize );
+
+ }
#ifndef KAB_EMBEDDED
QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter;
if ( splitterSize.count() == 0 ) {
splitterSize.append( width() / 2 );
@@ -256,11 +265,12 @@ void KABCore::restoreSettings()
void KABCore::saveSettings()
{
KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked();
- KABPrefs::instance()->mExtensionsSplitter = mMiniSplitter->sizes();
+ 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();
@@ -1142,9 +1152,23 @@ void KABCore::initGUI()
// QWidget *mainBox = new QWidget( this );
// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
-
+#ifdef DESKTOP_VERSION
+ topLayout = new QHBoxLayout( this );
+
+
+ mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
+ mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
+
+ topLayout->addWidget(mMiniSplitter );
+
+ mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter );
+ mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
+ mViewManager = new ViewManager( this, mExtensionBarSplitter );
+ mDetails = new ViewContainer( mMiniSplitter );
+ mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
+#else
if ( QApplication::desktop()->width() > 480 ) {
topLayout = new QHBoxLayout( this );
mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
@@ -1160,9 +1184,9 @@ void KABCore::initGUI()
mDetails = new ViewContainer( mMiniSplitter );
mExtensionManager = new ExtensionManager( this, mMiniSplitter );
-
+#endif
//eh->hide();
// topLayout->addWidget(mExtensionManager );
@@ -1485,17 +1509,21 @@ void KABCore::addActionsManually()
mActionCategories->plug( settingsMenu );
mActionAboutKAddressbook->plug( helpMenu );
+
if (QApplication::desktop()->width() > 320 ) {
mActionEditAddressee->plug( tb );
mActionSave->plug( tb );
mViewManager->getFilterAction()->plug ( tb);
- if (QApplication::desktop()->width() > 480 )
- mActionDelete->plug( tb );
+ if (QApplication::desktop()->width() > 480 ) {
+ mActionUndo->plug( tb );
+ mActionDelete->plug( tb );
+ mActionRedo->plug( tb );
+ }
}
- mActionQuit->plug ( tb );
+ //mActionQuit->plug ( tb );
// tb->insertWidget(-1, 0, mIncSearchWidget, 6);
//US link the searchwidget first to this.
// The real linkage to the toolbar happens later.
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index edf98c2..b84ec22 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -343,9 +343,9 @@ class KABCore : public QWidget
KABC::AddressBook *mAddressBook;
ViewManager *mViewManager;
// QSplitter *mDetailsSplitter;
- //QSplitter *mExtensionBarSplitter;
+ KDGanttMinimizeSplitter *mExtensionBarSplitter;
ViewContainer *mDetails;
KDGanttMinimizeSplitter* mMiniSplitter;
XXPortManager *mXXPortManager;
JumpButtonBar *mJumpButtonBar;
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp
index 92c32ca..8ebb93a 100644
--- a/kaddressbook/kaddressbookmain.cpp
+++ b/kaddressbook/kaddressbookmain.cpp
@@ -91,26 +91,9 @@ KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainW
KAddressBookMain::~KAddressBookMain()
{
// mCore->saveSettings();
}
-#ifndef DESKTOP_VERSION
-void KAddressBookMain::show ()
-{
- static bool block = false;
- if( block ) {
- QWidget::show();
- return;
- } else {
- block = true ;
- QWidget::showFullScreen();
- }
- int min = 20;
- if ( QApplication::desktop()->width() > 320 )
- min += 20;
- setGeometry( 0,0,QApplication::desktop()->width(), QApplication::desktop()->height() - min );
- block = false;
-}
-#endif
+
void KAddressBookMain::showMinimized ()
{
QWidget::showMinimized () ;
}
diff --git a/kaddressbook/kaddressbookmain.h b/kaddressbook/kaddressbookmain.h
index 81ae09c..cf6f899 100644
--- a/kaddressbook/kaddressbookmain.h
+++ b/kaddressbook/kaddressbookmain.h
@@ -69,12 +69,8 @@ class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface
#endif //KAB_EMBEDDED
public slots:
-#ifndef DESKTOP_VERSION
- void show();
-#endif
-
void showMinimized () ;
virtual void addEmail( QString addr );
#ifndef KAB_EMBEDDED
//MOC_SKIP_BEGIN
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index ffa37a5..3f6f69d 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -67,14 +67,10 @@ int main( int argc, char **argv )
//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
#ifndef DESKTOP_VERSION
a.showMainWidget(m );
- m->showFullScreen();
- int min = 20;
- if ( QApplication::desktop()->width() > 320 )
- min += 20;
- m->setGeometry( 0,0,QApplication::desktop()->width(), QApplication::desktop()->height() - min );
-
+ m->showMaximized();
+
#else
a.setMainWidget(m );
m->show();
//m->resize( 640, 480 );