implement option to display the catg filter as a toolbar combobox
This commit is contained in:
parent
ebd7d51935
commit
67f9c95a9b
@ -103,6 +103,7 @@ void rwSettings(bool writing)
|
|||||||
|
|
||||||
SETTING_RW(prefs.autoSearchOnWS, "/Recoll/prefs/reslist/autoSearchOnWS",
|
SETTING_RW(prefs.autoSearchOnWS, "/Recoll/prefs/reslist/autoSearchOnWS",
|
||||||
Bool, false);
|
Bool, false);
|
||||||
|
SETTING_RW(prefs.catgToolBar, "/Recoll/prefs/catgToolBar", Bool, false);
|
||||||
SETTING_RW(prefs.ssearchAutoPhrase,
|
SETTING_RW(prefs.ssearchAutoPhrase,
|
||||||
"/Recoll/prefs/ssearchAutoPhrase", Bool, false);
|
"/Recoll/prefs/ssearchAutoPhrase", Bool, false);
|
||||||
SETTING_RW(prefs.respagesize, "/Recoll/prefs/reslist/pagelen", Num, 8);
|
SETTING_RW(prefs.respagesize, "/Recoll/prefs/reslist/pagelen", Num, 8);
|
||||||
|
|||||||
@ -60,6 +60,9 @@ extern bool startHelpBrowser(const string& url = "");
|
|||||||
class PrefsPack {
|
class PrefsPack {
|
||||||
public:
|
public:
|
||||||
bool autoSearchOnWS;
|
bool autoSearchOnWS;
|
||||||
|
// Decide if we display the doc category filter control as a
|
||||||
|
// toolbar+combobox or as a button group under simple search
|
||||||
|
bool catgToolBar;
|
||||||
int respagesize;
|
int respagesize;
|
||||||
int maxhltextmbs;
|
int maxhltextmbs;
|
||||||
QString reslistfontfamily;
|
QString reslistfontfamily;
|
||||||
|
|||||||
@ -43,6 +43,8 @@ using std::pair;
|
|||||||
#else
|
#else
|
||||||
#include <q3filedialog.h>
|
#include <q3filedialog.h>
|
||||||
#define QFileDialog Q3FileDialog
|
#define QFileDialog Q3FileDialog
|
||||||
|
#include <q3toolbar.h>
|
||||||
|
#define QToolBar Q3ToolBar
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <qtabwidget.h>
|
#include <qtabwidget.h>
|
||||||
@ -165,6 +167,14 @@ void RclMain::init()
|
|||||||
}
|
}
|
||||||
preferencesMenu->setItemChecked(curid, true);
|
preferencesMenu->setItemChecked(curid, true);
|
||||||
|
|
||||||
|
// Toolbar+combobox version of the category selector
|
||||||
|
QComboBox *catgCMB = 0;
|
||||||
|
if (prefs.catgToolBar) {
|
||||||
|
catgCMB = new QComboBox(FALSE, new QToolBar(this), "catCMB");
|
||||||
|
catgCMB->insertItem(tr("All"));
|
||||||
|
catgCMB->setToolTip(tr("Document category filter"));
|
||||||
|
}
|
||||||
|
|
||||||
// Document categories buttons
|
// Document categories buttons
|
||||||
catgBGRP->setColumnLayout(1, Qt::Vertical);
|
catgBGRP->setColumnLayout(1, Qt::Vertical);
|
||||||
list<string> cats;
|
list<string> cats;
|
||||||
@ -178,9 +188,12 @@ void RclMain::init()
|
|||||||
QString catgnm = QString::fromUtf8(it->c_str(), it->length());
|
QString catgnm = QString::fromUtf8(it->c_str(), it->length());
|
||||||
m_catgbutvec.push_back(*it);
|
m_catgbutvec.push_back(*it);
|
||||||
but->setText(tr(catgnm));
|
but->setText(tr(catgnm));
|
||||||
|
if (prefs.catgToolBar && catgCMB)
|
||||||
|
catgCMB->insertItem(tr(catgnm));
|
||||||
}
|
}
|
||||||
catgBGRP->setButton(0);
|
catgBGRP->setButton(0);
|
||||||
|
if (prefs.catgToolBar)
|
||||||
|
catgBGRP->hide();
|
||||||
// Connections
|
// Connections
|
||||||
connect(sSearch, SIGNAL(startSearch(RefCntr<Rcl::SearchData>)),
|
connect(sSearch, SIGNAL(startSearch(RefCntr<Rcl::SearchData>)),
|
||||||
this, SLOT(startSearch(RefCntr<Rcl::SearchData>)));
|
this, SLOT(startSearch(RefCntr<Rcl::SearchData>)));
|
||||||
@ -243,6 +256,8 @@ void RclMain::init()
|
|||||||
connect(queryPrefsAction, SIGNAL(activated()), this, SLOT(showUIPrefs()));
|
connect(queryPrefsAction, SIGNAL(activated()), this, SLOT(showUIPrefs()));
|
||||||
connect(extIdxAction, SIGNAL(activated()), this, SLOT(showExtIdxDialog()));
|
connect(extIdxAction, SIGNAL(activated()), this, SLOT(showExtIdxDialog()));
|
||||||
connect(catgBGRP, SIGNAL(clicked(int)), this, SLOT(catgFilter(int)));
|
connect(catgBGRP, SIGNAL(clicked(int)), this, SLOT(catgFilter(int)));
|
||||||
|
if (prefs.catgToolBar && catgCMB)
|
||||||
|
connect(catgCMB, SIGNAL(activated(int)), this, SLOT(catgFilter(int)));
|
||||||
|
|
||||||
#if (QT_VERSION < 0x040000)
|
#if (QT_VERSION < 0x040000)
|
||||||
nextPageAction->setIconSet(createIconSet("nextpage.png"));
|
nextPageAction->setIconSet(createIconSet("nextpage.png"));
|
||||||
|
|||||||
@ -284,6 +284,17 @@
|
|||||||
<string>Choose editor applications</string>
|
<string>Choose editor applications</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QCheckBox">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>catgToolBarCB</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Display category filter as toolbar instead of button panel (needs restart).</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<widget class="QCheckBox">
|
<widget class="QCheckBox">
|
||||||
<property name="name">
|
<property name="name">
|
||||||
<cstring>autoSearchCB</cstring>
|
<cstring>autoSearchCB</cstring>
|
||||||
|
|||||||
@ -98,6 +98,7 @@ void UIPrefsDialog::setFromPrefs()
|
|||||||
pageLenSB->setValue(prefs.respagesize);
|
pageLenSB->setValue(prefs.respagesize);
|
||||||
collapseDupsCB->setChecked(prefs.collapseDuplicates);
|
collapseDupsCB->setChecked(prefs.collapseDuplicates);
|
||||||
maxHLTSB->setValue(prefs.maxhltextmbs);
|
maxHLTSB->setValue(prefs.maxhltextmbs);
|
||||||
|
catgToolBarCB->setChecked(prefs.catgToolBar);
|
||||||
autoSearchCB->setChecked(prefs.autoSearchOnWS);
|
autoSearchCB->setChecked(prefs.autoSearchOnWS);
|
||||||
syntlenSB->setValue(prefs.syntAbsLen);
|
syntlenSB->setValue(prefs.syntAbsLen);
|
||||||
syntctxSB->setValue(prefs.syntAbsCtx);
|
syntctxSB->setValue(prefs.syntAbsCtx);
|
||||||
@ -171,6 +172,7 @@ void UIPrefsDialog::setFromPrefs()
|
|||||||
void UIPrefsDialog::accept()
|
void UIPrefsDialog::accept()
|
||||||
{
|
{
|
||||||
prefs.autoSearchOnWS = autoSearchCB->isChecked();
|
prefs.autoSearchOnWS = autoSearchCB->isChecked();
|
||||||
|
prefs.catgToolBar = catgToolBarCB->isChecked();
|
||||||
prefs.respagesize = pageLenSB->value();
|
prefs.respagesize = pageLenSB->value();
|
||||||
prefs.collapseDuplicates = collapseDupsCB->isChecked();
|
prefs.collapseDuplicates = collapseDupsCB->isChecked();
|
||||||
prefs.maxhltextmbs = maxHLTSB->value();
|
prefs.maxhltextmbs = maxHLTSB->value();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user