summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-07-12 13:37:11 +0200
committerMontel Laurent <[email protected]>2016-07-12 13:37:11 +0200
commitc119b2a65c2ba1258a42fbd52999f153f82958af (patch)
treeda2ac7380594a73ce5fb1b9d68adb58df48eae08
parent232bd189d217b5b31b8ee228d7f98f093a89b2cb (diff)
Readd Lineedit to search folder
-rw-r--r--kmail/src/configuredialog/configureappearancepage.cpp9
-rw-r--r--kmail/src/configuredialog/configureappearancepage.h1
-rw-r--r--kmail/src/kmmainwidget.cpp12
-rw-r--r--kmail/src/kmmainwidget.h1
-rw-r--r--kmail/src/settings/kmail.kcfg.cmake6
5 files changed, 28 insertions, 1 deletions
diff --git a/kmail/src/configuredialog/configureappearancepage.cpp b/kmail/src/configuredialog/configureappearancepage.cpp
index 3c5c349..0ca76f3 100644
--- a/kmail/src/configuredialog/configureappearancepage.cpp
+++ b/kmail/src/configuredialog/configureappearancepage.cpp
@@ -518,6 +518,13 @@ AppearancePageLayoutTab::AppearancePageLayoutTab(QWidget *parent)
connect(mFolderListGroup, SIGNAL(buttonClicked(int)),
this, SLOT(slotEmitChanged()));
+ QHBoxLayout* folderCBHLayout = new QHBoxLayout;
+ mFolderQuickSearchCB = new QCheckBox( i18n("Show folder quick search field"), this );
+ connect(mFolderQuickSearchCB, &QAbstractButton::toggled, this, &ConfigModuleTab::slotEmitChanged);
+ folderCBHLayout->addWidget( mFolderQuickSearchCB );
+ vlay->addLayout( folderCBHLayout );
+
+
// "favorite folders view mode" radio buttons:
mFavoriteFoldersViewGroupBox = new QGroupBox(this);
mFavoriteFoldersViewGroupBox->setTitle(i18n("Show Favorite Folders View"));
@@ -574,6 +581,7 @@ void AppearancePage::LayoutTab::doLoadOther()
loadWidget(mFolderListGroupBox, mFolderListGroup, KMailSettings::self()->folderListItem());
loadWidget(mReaderWindowModeGroupBox, mReaderWindowModeGroup, KMailSettings::self()->readerWindowModeItem());
loadWidget(mFavoriteFoldersViewGroupBox, mFavoriteFoldersViewGroup, MailCommon::MailCommonSettings::self()->favoriteCollectionViewModeItem());
+ loadWidget(mFolderQuickSearchCB, KMailSettings::self()->enableFolderQuickSearchItem());
const int checkedFolderToolTipsPolicy = KMailSettings::self()->toolTipDisplayPolicy();
if (checkedFolderToolTipsPolicy >= 0) {
mFolderToolTipsGroup->button(checkedFolderToolTipsPolicy)->setChecked(true);
@@ -585,6 +593,7 @@ void AppearancePage::LayoutTab::save()
saveButtonGroup(mFolderListGroup, KMailSettings::self()->folderListItem());
saveButtonGroup(mReaderWindowModeGroup, KMailSettings::self()->readerWindowModeItem());
saveButtonGroup(mFavoriteFoldersViewGroup, MailCommon::MailCommonSettings::self()->favoriteCollectionViewModeItem());
+ saveCheckBox(mFolderQuickSearchCB, KMailSettings::self()->enableFolderQuickSearchItem());
KMailSettings::self()->setToolTipDisplayPolicy(mFolderToolTipsGroup->checkedId());
}
diff --git a/kmail/src/configuredialog/configureappearancepage.h b/kmail/src/configuredialog/configureappearancepage.h
index ed34278..8dbbe37 100644
--- a/kmail/src/configuredialog/configureappearancepage.h
+++ b/kmail/src/configuredialog/configureappearancepage.h
@@ -128,6 +128,7 @@ private: // data
QGroupBox *mFolderToolTipsGroupBox;
QButtonGroup *mFavoriteFoldersViewGroup;
QGroupBox *mFavoriteFoldersViewGroupBox;
+ QCheckBox *mFolderQuickSearchCB;
};
class AppearancePageHeadersTab : public ConfigModuleTab
diff --git a/kmail/src/kmmainwidget.cpp b/kmail/src/kmmainwidget.cpp
index a8a7d31..b8573cf 100644
--- a/kmail/src/kmmainwidget.cpp
+++ b/kmail/src/kmmainwidget.cpp
@@ -559,6 +559,8 @@ void KMMainWidget::readPreConfig()
mHtmlLoadExtGlobalSetting = MessageViewer::MessageViewerSettings::self()->htmlLoadExternal();
mEnableFavoriteFolderView = (MailCommon::MailCommonSettings::self()->favoriteCollectionViewMode() != MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::HiddenMode);
+ mEnableFolderQuickSearch = KMailSettings::self()->enableFolderQuickSearch();
+
readFolderConfig();
updateHtmlMenuEntry();
if (mMsgView) {
@@ -811,6 +813,7 @@ void KMMainWidget::readConfig()
const bool oldReaderWindowActive = mReaderWindowActive;
const bool oldReaderWindowBelow = mReaderWindowBelow;
const bool oldFavoriteFolderView = mEnableFavoriteFolderView;
+ const bool oldFolderQuickSearch = mEnableFolderQuickSearch;
// on startup, the layout is always new and we need to relayout the widgets
bool layoutChanged = !mStartupDone;
@@ -828,6 +831,11 @@ void KMMainWidget::readConfig()
createWidgets();
restoreCollectionFolderViewConfig();
Q_EMIT recreateGui();
+ } else if ( oldFolderQuickSearch != mEnableFolderQuickSearch ) {
+ if ( mEnableFolderQuickSearch )
+ mFolderTreeWidget->filterFolderLineEdit()->show();
+ else
+ mFolderTreeWidget->filterFolderLineEdit()->hide();
}
}
@@ -976,7 +984,6 @@ void KMMainWidget::createWidgets()
opt |= FolderTreeWidget::ShowCollectionStatisticAnimation;
opt |= FolderTreeWidget::DontKeyFilter;
mFolderTreeWidget = new FolderTreeWidget(this, mGUIClient, opt);
- mFolderTreeWidget->filterFolderLineEdit()->hide();
connect(mFolderTreeWidget->folderTreeView(), SIGNAL(currentChanged(Akonadi::Collection)), this, SLOT(slotFolderChanged(Akonadi::Collection)));
@@ -1035,6 +1042,9 @@ void KMMainWidget::createWidgets()
mShowIntroductionAction->setEnabled(false);
}
}
+ if ( !KMailSettings::self()->enableFolderQuickSearch() ) {
+ mFolderTreeWidget->filterFolderLineEdit()->hide();
+ }
//
// Create the favorite folder view
diff --git a/kmail/src/kmmainwidget.h b/kmail/src/kmmainwidget.h
index 39166b2..c29d4c7 100644
--- a/kmail/src/kmmainwidget.h
+++ b/kmail/src/kmmainwidget.h
@@ -612,6 +612,7 @@ private:
bool mReaderWindowActive;
bool mReaderWindowBelow;
bool mEnableFavoriteFolderView;
+ bool mEnableFolderQuickSearch;
QPointer<KMail::SearchWindow> mSearchWin;
diff --git a/kmail/src/settings/kmail.kcfg.cmake b/kmail/src/settings/kmail.kcfg.cmake
index 29a1bf6..7cf2ad9 100644
--- a/kmail/src/settings/kmail.kcfg.cmake
+++ b/kmail/src/settings/kmail.kcfg.cmake
@@ -159,6 +159,12 @@
</entry>
</group>
+ <group name="UserInterface">
+ <entry name="EnableFolderQuickSearch" type="Bool">
+ <label>Show folder quick search line edit</label>
+ <default>false</default>
+ </entry>
+ </group>
<group name="Composer">
<entry name="ForwardingInlineByDefault" type="Bool">