Commit c119b2a6 authored by Laurent Montel's avatar Laurent Montel 😁

Readd Lineedit to search folder

parent 232bd189
......@@ -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());
}
......
......@@ -128,6 +128,7 @@ private: // data
QGroupBox *mFolderToolTipsGroupBox;
QButtonGroup *mFavoriteFoldersViewGroup;
QGroupBox *mFavoriteFoldersViewGroupBox;
QCheckBox *mFolderQuickSearchCB;
};
class AppearancePageHeadersTab : public ConfigModuleTab
......
......@@ -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
......
......@@ -612,6 +612,7 @@ private:
bool mReaderWindowActive;
bool mReaderWindowBelow;
bool mEnableFavoriteFolderView;
bool mEnableFolderQuickSearch;
QPointer<KMail::SearchWindow> mSearchWin;
......
......@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment