author | zautrix <zautrix> | 2005-03-29 13:52:41 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-29 13:52:41 (UTC) |
commit | 7046b36fb5dd14598ece00b575554eba2956ef84 (patch) (unidiff) | |
tree | 934579f9f61f09563dfcbfef207d314d510d57ea | |
parent | 894717798a8d129f4b991a2fe856d2f1e8e9624a (diff) | |
download | kdepimpi-7046b36fb5dd14598ece00b575554eba2956ef84.zip kdepimpi-7046b36fb5dd14598ece00b575554eba2956ef84.tar.gz kdepimpi-7046b36fb5dd14598ece00b575554eba2956ef84.tar.bz2 |
kapi fixes
-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 5 | ||||
-rw-r--r-- | kaddressbook/incsearchwidget.cpp | 24 | ||||
-rw-r--r-- | kaddressbook/incsearchwidget.h | 1 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 37 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabprefs.h | 2 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 15 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.h | 2 | ||||
-rw-r--r-- | kaddressbook/viewmanager.cpp | 4 |
9 files changed, 68 insertions, 24 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index a3d465f..6721d5f 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt | |||
@@ -424,3 +424,3 @@ | |||
424 | { "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, | 424 | { "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, |
425 | { "General","Algemein" }, | 425 | { "General","Allgemein" }, |
426 | { "Extensions (restart)","Extensions (restart)" }, | 426 | { "Extensions (restart)","Extensions (restart)" }, |
@@ -749,3 +749,4 @@ | |||
749 | { "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, | 749 | { "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, |
750 | { "","" }, | 750 | { "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" }, |
751 | { "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" }, | ||
751 | { "","" }, | 752 | { "","" }, |
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp index dd2121a..cd198c4 100644 --- a/kaddressbook/incsearchwidget.cpp +++ b/kaddressbook/incsearchwidget.cpp | |||
@@ -116,3 +116,15 @@ void IncSearchWidget::announceFieldChanged() | |||
116 | } | 116 | } |
117 | 117 | void IncSearchWidget::setSize() | |
118 | { | ||
119 | if ( KABPrefs::instance()->mHideSearchOnSwitch && QApplication::desktop()->width() == 480) { | ||
120 | mFieldCombo->setMaximumWidth( 40 ); | ||
121 | mSearchText->setMaximumWidth( 30 ); | ||
122 | } else { | ||
123 | QFontMetrics fm ( mFieldCombo->font() ); | ||
124 | int wid = fm.width(i18n( "All Fields" ) ); | ||
125 | int max = wid; | ||
126 | mFieldCombo->setMaximumWidth( wid+60 ); | ||
127 | mSearchText->setMaximumWidth( 1024 ); | ||
128 | } | ||
129 | } | ||
118 | void IncSearchWidget::setFields( const KABC::Field::List &list ) | 130 | void IncSearchWidget::setFields( const KABC::Field::List &list ) |
@@ -122,6 +134,3 @@ void IncSearchWidget::setFields( const KABC::Field::List &list ) | |||
122 | mFieldCombo->insertItem( i18n( "All Fields" ) ); | 134 | mFieldCombo->insertItem( i18n( "All Fields" ) ); |
123 | QFontMetrics fm ( mFieldCombo->font() ); | 135 | |
124 | int wid = fm.width(i18n( "All Fields" ) ); | ||
125 | int max = wid; | ||
126 | |||
127 | KABC::Field::List::ConstIterator it; | 136 | KABC::Field::List::ConstIterator it; |
@@ -129,5 +138,2 @@ void IncSearchWidget::setFields( const KABC::Field::List &list ) | |||
129 | mFieldCombo->insertItem( (*it)->label() ); | 138 | mFieldCombo->insertItem( (*it)->label() ); |
130 | // wid = fm.width((*it)->label() ); | ||
131 | //if ( wid > max ) | ||
132 | // max = wid; | ||
133 | } | 139 | } |
@@ -138,3 +144,3 @@ void IncSearchWidget::setFields( const KABC::Field::List &list ) | |||
138 | announceFieldChanged(); | 144 | announceFieldChanged(); |
139 | mFieldCombo->setMaximumWidth( wid+60 ); | 145 | setSize(); |
140 | } | 146 | } |
diff --git a/kaddressbook/incsearchwidget.h b/kaddressbook/incsearchwidget.h index 1546a51..cae55cd 100644 --- a/kaddressbook/incsearchwidget.h +++ b/kaddressbook/incsearchwidget.h | |||
@@ -48,2 +48,3 @@ class IncSearchWidget : public QWidget | |||
48 | int currentItem() const; | 48 | int currentItem() const; |
49 | void setSize(); | ||
49 | 50 | ||
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 59aa5a5..09d8523 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -300,2 +300,3 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
300 | // syncManager->setBlockSave(false); | 300 | // syncManager->setBlockSave(false); |
301 | mIncSearchWidget = 0; | ||
301 | mMiniSplitter = 0; | 302 | mMiniSplitter = 0; |
@@ -821,3 +822,2 @@ void KABCore::updateMainWindow() | |||
821 | { | 822 | { |
822 | |||
823 | mMainWindow->showMaximized(); | 823 | mMainWindow->showMaximized(); |
@@ -835,8 +835,11 @@ void KABCore::resizeEvent(QResizeEvent* e ) | |||
835 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 835 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
836 | if ( QApplication::desktop()->width() <= 640 ) { | ||
837 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | ||
838 | mViewManager->getFilterAction()->setComboWidth( 150 ); | ||
839 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | ||
840 | } | ||
841 | } | 836 | } |
837 | if ( QApplication::desktop()->width() <= 640 ) { | ||
838 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | ||
839 | mViewManager->getFilterAction()->setComboWidth( 150 ); | ||
840 | if ( mIncSearchWidget ) | ||
841 | mIncSearchWidget->setSize(); | ||
842 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | ||
843 | } | ||
844 | |||
842 | } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 | 845 | } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 |
@@ -845,8 +848,14 @@ void KABCore::resizeEvent(QResizeEvent* e ) | |||
845 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 848 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
846 | if ( QApplication::desktop()->width() <= 640 ) { | 849 | } |
847 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | 850 | if ( QApplication::desktop()->width() <= 640 ) { |
848 | mMainWindow->showMinimized(); | 851 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); |
852 | mMainWindow->showMinimized(); | ||
853 | if ( KABPrefs::instance()->mHideSearchOnSwitch ) { | ||
854 | if ( mIncSearchWidget ) { | ||
855 | mIncSearchWidget->setSize(); | ||
856 | } | ||
857 | } else { | ||
849 | mViewManager->getFilterAction()->setComboWidth( 0 ); | 858 | mViewManager->getFilterAction()->setComboWidth( 0 ); |
850 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | ||
851 | } | 859 | } |
860 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | ||
852 | } | 861 | } |
@@ -1155,3 +1164,9 @@ void KABCore::incrementalSearch( const QString& text ) | |||
1155 | { | 1164 | { |
1156 | mViewManager->doSearch( text, mIncSearchWidget->currentField() ); | 1165 | QString stext; |
1166 | if ( KABPrefs::instance()->mAutoSearchWithWildcard ) { | ||
1167 | stext = "*" + text; | ||
1168 | } else { | ||
1169 | stext = text; | ||
1170 | } | ||
1171 | mViewManager->doSearch( stext, mIncSearchWidget->currentField() ); | ||
1157 | } | 1172 | } |
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index b96d28a..ea254b7 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp | |||
@@ -62,2 +62,4 @@ KABPrefs::KABPrefs() | |||
62 | addItemBool("SearchWithReturn",&mSearchWithReturn, false ); | 62 | addItemBool("SearchWithReturn",&mSearchWithReturn, false ); |
63 | addItemBool("AutoSearchWithWildcard",&mAutoSearchWithWildcard, false ); | ||
64 | addItemBool("HideSearchOnSwitch",&mHideSearchOnSwitch, false ); | ||
63 | addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont()); | 65 | addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont()); |
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index 1e3b48f..2bb173d 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h | |||
@@ -72,2 +72,4 @@ class KABPrefs : public KPimPrefs | |||
72 | bool mSearchWithReturn; | 72 | bool mSearchWithReturn; |
73 | bool mAutoSearchWithWildcard; | ||
74 | bool mHideSearchOnSwitch; | ||
73 | QValueList<int> mExtensionsSplitter; | 75 | QValueList<int> mExtensionsSplitter; |
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index 3ad2f74..986c9b8 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp | |||
@@ -125,2 +125,10 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * | |||
125 | boxLayout->addWidget( mSearchReturnBox ); | 125 | boxLayout->addWidget( mSearchReturnBox ); |
126 | mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" ); | ||
127 | boxLayout->addWidget( mAutoSearchWithWildcardBox); | ||
128 | mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" ); | ||
129 | boxLayout->addWidget( mHideSearchOnSwitchBox ); | ||
130 | |||
131 | #ifdef DESKTOP_VERSION | ||
132 | mHideSearchOnSwitchBox->hide(); | ||
133 | #endif | ||
126 | mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" ); | 134 | mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" ); |
@@ -173,2 +181,4 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * | |||
173 | connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 181 | connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
182 | connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | ||
183 | connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | ||
174 | connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 184 | connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
@@ -201,2 +211,4 @@ void KABConfigWidget::usrReadConfig() | |||
201 | mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); | 211 | mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); |
212 | mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard ); | ||
213 | mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch ); | ||
202 | mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); | 214 | mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); |
@@ -219,2 +231,5 @@ void KABConfigWidget::usrWriteConfig() | |||
219 | prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); | 231 | prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); |
232 | prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked(); | ||
233 | prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked(); | ||
234 | |||
220 | prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); | 235 | prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); |
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h index 08d71b4..a172e97 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.h +++ b/kaddressbook/kcmconfigs/kabconfigwidget.h | |||
@@ -66,2 +66,4 @@ class KABConfigWidget : public KPrefsWidget | |||
66 | QCheckBox *mViewsSingleClickBox; | 66 | QCheckBox *mViewsSingleClickBox; |
67 | QCheckBox *mAutoSearchWithWildcardBox; | ||
68 | QCheckBox *mHideSearchOnSwitchBox; | ||
67 | QCheckBox *mMultipleViewsAtOnce; | 69 | QCheckBox *mMultipleViewsAtOnce; |
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index 04759a7..c2b1bb0 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp | |||
@@ -110,3 +110,3 @@ void ViewManager::restoreSettings() | |||
110 | int cw = 150; | 110 | int cw = 150; |
111 | if (QApplication::desktop()->width() == 480 ) | 111 | if (QApplication::desktop()->width() == 480 && !KABPrefs::instance()->mHideSearchOnSwitch) |
112 | cw = 0; | 112 | cw = 0; |
@@ -606,3 +606,3 @@ void ViewManager::configureFilters() | |||
606 | int cw = 150; | 606 | int cw = 150; |
607 | if (QApplication::desktop()->width() == 480 ) | 607 | if (QApplication::desktop()->width() == 480 && !KABPrefs::instance()->mHideSearchOnSwitch) |
608 | cw = 0; | 608 | cw = 0; |