add feature to save asearch ignored file types as startup default
This commit is contained in:
parent
2f319431f9
commit
d76382ce2e
@ -39,6 +39,12 @@
|
||||
<property name="name">
|
||||
<cstring>textLabel2</cstring>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>Plain</enum>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>7</number>
|
||||
</property>
|
||||
@ -180,13 +186,42 @@
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>restrictFtCB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restrict file types</string>
|
||||
<cstring>layout25</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>restrictFtCB</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Restrict file types</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>saveFileTypesPB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save as default</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
@ -356,7 +391,7 @@
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QComboBox" row="1" column="0">
|
||||
<widget class="QComboBox" row="1" column="0">
|
||||
<property name="name">
|
||||
<cstring>subtreeCMB</cstring>
|
||||
</property>
|
||||
@ -387,7 +422,7 @@
|
||||
<enum>NoInsertion</enum>
|
||||
</property>
|
||||
<property name="duplicatesEnabled">
|
||||
<bool>false</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>Enter top directory for search</string>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.3 2006-09-12 10:11:36 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: advsearch_w.cpp,v 1.4 2006-09-13 08:13:36 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -72,12 +72,18 @@ void AdvSearch::init()
|
||||
this, SLOT(delAFiltypPB_clicked()));
|
||||
connect(addAFiltypPB, SIGNAL(clicked()),
|
||||
this, SLOT(addAFiltypPB_clicked()));
|
||||
connect(saveFileTypesPB, SIGNAL(clicked()),
|
||||
this, SLOT(saveFileTypes()));
|
||||
|
||||
// Initialize lists of accepted and ignored mime types from config
|
||||
// and settings
|
||||
list<string> types = rclconfig->getAllMimeTypes();
|
||||
noFiltypsLB->insertStringList(prefs.asearchIgnFilTyps);
|
||||
|
||||
QStringList ql;
|
||||
for (list<string>::iterator it = types.begin(); it != types.end(); it++) {
|
||||
ql.append(it->c_str());
|
||||
if (prefs.asearchIgnFilTyps.findIndex(it->c_str())<0)
|
||||
ql.append(it->c_str());
|
||||
}
|
||||
yesFiltypsLB->insertStringList(ql);
|
||||
|
||||
@ -115,6 +121,17 @@ void AdvSearch::delAFiltypPB_clicked()
|
||||
delFiltypPB_clicked();
|
||||
}
|
||||
|
||||
// Save current list of ignored file types to prefs
|
||||
void AdvSearch::saveFileTypes()
|
||||
{
|
||||
prefs.asearchIgnFilTyps.clear();
|
||||
for (unsigned int i = 0; i < noFiltypsLB->count();i++) {
|
||||
QListBoxItem *item = noFiltypsLB->item(i);
|
||||
prefs.asearchIgnFilTyps.append(item->text());
|
||||
}
|
||||
rwSettings(true);
|
||||
}
|
||||
|
||||
// Move selected file types from the ignored to the searched box
|
||||
void AdvSearch::addFiltypPB_clicked()
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#ifndef _ADVSEARCH_W_H_INCLUDED_
|
||||
#define _ADVSEARCH_W_H_INCLUDED_
|
||||
/* @(#$Id: advsearch_w.h,v 1.1 2006-09-04 15:13:01 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||
/* @(#$Id: advsearch_w.h,v 1.2 2006-09-13 08:13:36 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -40,6 +40,7 @@ public slots:
|
||||
virtual void restrictFtCB_toggled( bool on );
|
||||
virtual void searchPB_clicked();
|
||||
virtual void browsePB_clicked();
|
||||
virtual void saveFileTypes();
|
||||
|
||||
signals:
|
||||
void startSearch(Rcl::AdvSearchData);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.15 2006-09-11 12:05:38 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
||||
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.16 2006-09-13 08:13:36 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -131,6 +131,11 @@ void rwSettings(bool writing)
|
||||
SETTING_RW(prefs.mainheight, "/Recoll/geometry/height", Num, 400);
|
||||
SETTING_RW(prefs.ssearchTyp, "/Recoll/prefs/simpleSearchTyp", Num, 0);
|
||||
SETTING_RW(prefs.htmlBrowser, "/Recoll/prefs/htmlBrowser", , "");
|
||||
SETTING_RW(prefs.startWithAdvSearchOpen,
|
||||
"/Recoll/prefs/startWithAdvSearchOpen", Bool, false);
|
||||
SETTING_RW(prefs.startWithSortToolOpen,
|
||||
"/Recoll/prefs/startWithSortToolOpen", Bool, false);
|
||||
|
||||
SETTING_RW(prefs.showicons, "/Recoll/prefs/reslist/showicons", Bool, true);
|
||||
SETTING_RW(prefs.autoSearchOnWS, "/Recoll/prefs/reslist/autoSearchOnWS",
|
||||
Bool, false);
|
||||
@ -139,9 +144,9 @@ void rwSettings(bool writing)
|
||||
"");
|
||||
SETTING_RW(prefs.reslistfontsize, "/Recoll/prefs/reslist/fontSize", Num,
|
||||
0);
|
||||
|
||||
SETTING_RW(prefs.queryStemLang, "/Recoll/prefs/query/stemLang", ,
|
||||
"english");
|
||||
|
||||
SETTING_RW(prefs.queryBuildAbstract,
|
||||
"/Recoll/prefs/query/buildAbstract", Bool, true);
|
||||
SETTING_RW(prefs.queryReplaceAbstract,
|
||||
@ -156,6 +161,15 @@ void rwSettings(bool writing)
|
||||
settings.readListEntry("/Recoll/prefs/query/ssearchHistory");
|
||||
}
|
||||
|
||||
// Ssearch combobox history list
|
||||
if (writing) {
|
||||
settings.writeEntry("/Recoll/prefs/query/asearchIgnFilTyps",
|
||||
prefs.asearchIgnFilTyps);
|
||||
} else {
|
||||
prefs.asearchIgnFilTyps =
|
||||
settings.readListEntry("/Recoll/prefs/query/asearchIgnFilTyps");
|
||||
}
|
||||
|
||||
// The extra databases settings. These are stored as a list of
|
||||
// xapian directory names, encoded in base64 to avoid any
|
||||
// binary/charset conversion issues. There are 2 lists for all
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
#ifndef _GUIUTILS_H_INCLUDED_
|
||||
#define _GUIUTILS_H_INCLUDED_
|
||||
/*
|
||||
* @(#$Id: guiutils.h,v 1.7 2006-09-11 12:05:38 dockes Exp $ (C) 2005 Jean-Francois Dockes
|
||||
* @(#$Id: guiutils.h,v 1.8 2006-09-13 08:13:36 dockes Exp $ (C) 2005 Jean-Francois Dockes
|
||||
* jean-francois.dockes@wanadoo.fr
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -64,6 +64,8 @@ class PrefsPack {
|
||||
QString htmlBrowser;
|
||||
bool queryBuildAbstract;
|
||||
bool queryReplaceAbstract;
|
||||
bool startWithAdvSearchOpen;
|
||||
bool startWithSortToolOpen;
|
||||
// Extra query databases. This are encoded to base64 before storing
|
||||
// to the qt settings file to avoid any bin string/ charset conv issues
|
||||
list<string> allExtraDbs;
|
||||
@ -73,6 +75,8 @@ class PrefsPack {
|
||||
QStringList asearchSubdirHist;
|
||||
// Textual history of simple searches (this is just the combobox list)
|
||||
QStringList ssearchHistory;
|
||||
// Ignored file types in adv search (startup default)
|
||||
QStringList asearchIgnFilTyps;
|
||||
|
||||
PrefsPack() :
|
||||
showicons(true),
|
||||
@ -80,7 +84,9 @@ class PrefsPack {
|
||||
reslistfontsize(10),
|
||||
ssearchTyp(0),
|
||||
queryBuildAbstract(true),
|
||||
queryReplaceAbstract(false)
|
||||
queryReplaceAbstract(false),
|
||||
startWithAdvSearchOpen(false),
|
||||
startWithSortToolOpen(false)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.47 2006-09-11 09:08:44 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.48 2006-09-13 08:13:36 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -288,6 +288,11 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
mainWindow->show();
|
||||
if (prefs.startWithAdvSearchOpen)
|
||||
mainWindow->showAdvSearchDialog();
|
||||
if (prefs.startWithSortToolOpen)
|
||||
mainWindow->showSortDialog();
|
||||
|
||||
start_idxthread(*rclconfig);
|
||||
|
||||
// Let's go
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.30 2006-09-12 10:11:36 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: rclmain.cpp,v 1.31 2006-09-13 08:13:36 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -131,6 +131,12 @@ void RclMain::init()
|
||||
|
||||
nextPageAction->setIconSet(createIconSet("nextpage.png"));
|
||||
prevPageAction->setIconSet(createIconSet("prevpage.png"));
|
||||
|
||||
|
||||
if (prefs.startWithAdvSearchOpen)
|
||||
showAdvSearchDialog();
|
||||
if (prefs.startWithSortToolOpen)
|
||||
showSortDialog();
|
||||
}
|
||||
|
||||
// We also want to get rid of the advanced search form and previews
|
||||
|
||||
@ -164,7 +164,7 @@
|
||||
<cstring>useIconsCB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show document type icons in result list</string>
|
||||
<string>Show document type icons in result list.</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
@ -175,12 +175,38 @@
|
||||
<cstring>autoSearchCB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Auto-start simple search on whitespace entry</string>
|
||||
<string>Auto-start simple search on whitespace entry.</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>initStartAdvCB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start with advanced search dialog open.</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>initStartSortCB</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start with sort dialog open.</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
|
||||
|
||||
</vbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.2 2006-09-06 09:50:59 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.3 2006-09-13 08:13:36 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -54,6 +54,10 @@ void UIPrefsDialog::init()
|
||||
// Show icons checkbox
|
||||
useIconsCB->setChecked(prefs.showicons);
|
||||
autoSearchCB->setChecked(prefs.autoSearchOnWS);
|
||||
|
||||
initStartAdvCB->setChecked(prefs.startWithAdvSearchOpen);
|
||||
initStartSortCB->setChecked(prefs.startWithSortToolOpen);
|
||||
|
||||
// Result list font family and size
|
||||
reslistFontFamily = prefs.reslistfontfamily;
|
||||
reslistFontSize = prefs.reslistfontsize;
|
||||
@ -149,6 +153,9 @@ void UIPrefsDialog::accept()
|
||||
prefs.queryReplaceAbstract = buildAbsCB->isChecked() &&
|
||||
replAbsCB->isChecked();
|
||||
|
||||
prefs.startWithAdvSearchOpen = initStartAdvCB->isChecked();
|
||||
prefs.startWithSortToolOpen = initStartSortCB->isChecked();
|
||||
|
||||
prefs.activeExtraDbs.clear();
|
||||
for (unsigned int i = 0; i < actDbsLB->count(); i++) {
|
||||
QListBoxItem *item = actDbsLB->item(i);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user