mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-19 11:54:22 -04:00
added settings to search for store the splitter position
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4043 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5a36473a4d
commit
24b2b8ce29
2 changed files with 47 additions and 1 deletions
|
@ -95,6 +95,8 @@ SearchDialog::SearchDialog(QWidget *parent)
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
|
m_bProcessSettings = false;
|
||||||
|
|
||||||
_queueIsAlreadyTakenCareOf = false ;
|
_queueIsAlreadyTakenCareOf = false ;
|
||||||
ui.lineEdit->setFocus();
|
ui.lineEdit->setFocus();
|
||||||
ui.lineEdit->setToolTip(tr("Enter a keyword here (at least 3 char long)"));
|
ui.lineEdit->setToolTip(tr("Enter a keyword here (at least 3 char long)"));
|
||||||
|
@ -181,6 +183,9 @@ SearchDialog::SearchDialog(QWidget *parent)
|
||||||
ui.resetButton->hide();
|
ui.resetButton->hide();
|
||||||
ui.clearButton->hide();
|
ui.clearButton->hide();
|
||||||
|
|
||||||
|
// load settings
|
||||||
|
processSettings(true);
|
||||||
|
|
||||||
ui._ownFiles_CB->setMinimumWidth(20);
|
ui._ownFiles_CB->setMinimumWidth(20);
|
||||||
ui._friendListsearch_SB->setMinimumWidth(20);
|
ui._friendListsearch_SB->setMinimumWidth(20);
|
||||||
ui._anonF2Fsearch_CB->setMinimumWidth(20);
|
ui._anonF2Fsearch_CB->setMinimumWidth(20);
|
||||||
|
@ -192,6 +197,43 @@ SearchDialog::SearchDialog(QWidget *parent)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SearchDialog::~SearchDialog()
|
||||||
|
{
|
||||||
|
// save settings
|
||||||
|
processSettings(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchDialog::processSettings(bool bLoad)
|
||||||
|
{
|
||||||
|
m_bProcessSettings = true;
|
||||||
|
|
||||||
|
QHeaderView *pHeader = ui.searchSummaryWidget->header () ;
|
||||||
|
|
||||||
|
Settings->beginGroup(QString("SearchDialog"));
|
||||||
|
|
||||||
|
if (bLoad) {
|
||||||
|
// load settings
|
||||||
|
|
||||||
|
// state of SearchSummary tree
|
||||||
|
pHeader->restoreState(Settings->value("SearchSummaryTree").toByteArray());
|
||||||
|
|
||||||
|
// state of splitter
|
||||||
|
ui.splitter->restoreState(Settings->value("Splitter").toByteArray());
|
||||||
|
} else {
|
||||||
|
// save settings
|
||||||
|
|
||||||
|
// state of SearchSummary tree
|
||||||
|
Settings->setValue("SearchSummaryTree", pHeader->saveState());
|
||||||
|
|
||||||
|
// state of splitter
|
||||||
|
Settings->setValue("Splitter", ui.splitter->saveState());
|
||||||
|
}
|
||||||
|
|
||||||
|
Settings->endGroup();
|
||||||
|
m_bProcessSettings = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SearchDialog::checkText(const QString& txt)
|
void SearchDialog::checkText(const QString& txt)
|
||||||
{
|
{
|
||||||
if(txt.length() < 3)
|
if(txt.length() < 3)
|
||||||
|
|
|
@ -39,7 +39,7 @@ class SearchDialog : public MainPage
|
||||||
/** Default Constructor */
|
/** Default Constructor */
|
||||||
SearchDialog(QWidget *parent = 0);
|
SearchDialog(QWidget *parent = 0);
|
||||||
/** Default Destructor */
|
/** Default Destructor */
|
||||||
|
~SearchDialog();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateFiles(qulonglong request_id,FileDetail file) ;
|
void updateFiles(qulonglong request_id,FileDetail file) ;
|
||||||
|
@ -126,9 +126,13 @@ private:
|
||||||
static bool initialised;
|
static bool initialised;
|
||||||
void initialiseFileTypeMappings();
|
void initialiseFileTypeMappings();
|
||||||
|
|
||||||
|
void processSettings(bool bLoad);
|
||||||
|
|
||||||
void FilterItems();
|
void FilterItems();
|
||||||
bool FilterItem(QTreeWidgetItem *pItem, QString &sPattern, int nFilterColumn);
|
bool FilterItem(QTreeWidgetItem *pItem, QString &sPattern, int nFilterColumn);
|
||||||
|
|
||||||
|
bool m_bProcessSettings;
|
||||||
|
|
||||||
int nextSearchId;
|
int nextSearchId;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue