Cancel did not reset uiprefs dialog to stored state
This commit is contained in:
parent
2bf6bd56f5
commit
28034d2b86
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.7 2006-09-22 10:46:26 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.8 2006-11-07 08:57:11 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -48,6 +48,27 @@ static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.7 2006-09-22 10:46:26 dockes Ex
|
|||||||
#include "uiprefs_w.h"
|
#include "uiprefs_w.h"
|
||||||
|
|
||||||
void UIPrefsDialog::init()
|
void UIPrefsDialog::init()
|
||||||
|
{
|
||||||
|
|
||||||
|
connect(reslistFontPB, SIGNAL(clicked()), this, SLOT(showFontDialog()));
|
||||||
|
connect(helpBrowserPB, SIGNAL(clicked()), this, SLOT(showBrowserDialog()));
|
||||||
|
connect(resetFontPB, SIGNAL(clicked()), this, SLOT(resetReslistFont()));
|
||||||
|
connect(extraDbLE,SIGNAL(textChanged(const QString&)), this,
|
||||||
|
SLOT(extraDbTextChanged(const QString&)));
|
||||||
|
connect(addAADbPB, SIGNAL(clicked()), this, SLOT(addAADbPB_clicked()));
|
||||||
|
connect(addADbPB, SIGNAL(clicked()), this, SLOT(addADbPB_clicked()));
|
||||||
|
connect(delADbPB, SIGNAL(clicked()), this, SLOT(delADbPB_clicked()));
|
||||||
|
connect(delAADbPB, SIGNAL(clicked()), this, SLOT(delAADbPB_clicked()));
|
||||||
|
connect(addExtraDbPB, SIGNAL(clicked()), this, SLOT(addExtraDbPB_clicked()));
|
||||||
|
connect(browseDbPB, SIGNAL(clicked()), this, SLOT(browseDbPB_clicked()));
|
||||||
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
|
||||||
|
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
||||||
|
connect(buildAbsCB, SIGNAL(toggled(bool)),
|
||||||
|
replAbsCB, SLOT(setEnabled(bool)));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update dialog state from stored prefs
|
||||||
|
void UIPrefsDialog::setFromPrefs()
|
||||||
{
|
{
|
||||||
// Entries per result page spinbox
|
// Entries per result page spinbox
|
||||||
pageLenSB->setValue(prefs.respagesize);
|
pageLenSB->setValue(prefs.respagesize);
|
||||||
@ -72,7 +93,9 @@ void UIPrefsDialog::init()
|
|||||||
s.setNum(reslistFontSize));
|
s.setNum(reslistFontSize));
|
||||||
}
|
}
|
||||||
helpBrowserLE->setText(prefs.htmlBrowser);
|
helpBrowserLE->setText(prefs.htmlBrowser);
|
||||||
|
|
||||||
// Stemming language combobox
|
// Stemming language combobox
|
||||||
|
stemLangCMB->clear();
|
||||||
stemLangCMB->insertItem(tr("(no stemming)"));
|
stemLangCMB->insertItem(tr("(no stemming)"));
|
||||||
list<string> langs;
|
list<string> langs;
|
||||||
string reason;
|
string reason;
|
||||||
@ -81,7 +104,6 @@ void UIPrefsDialog::init()
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
langs = rcldb->getStemLangs();
|
langs = rcldb->getStemLangs();
|
||||||
|
|
||||||
int i = 0, cur = -1;
|
int i = 0, cur = -1;
|
||||||
for (list<string>::const_iterator it = langs.begin();
|
for (list<string>::const_iterator it = langs.begin();
|
||||||
it != langs.end(); it++) {
|
it != langs.end(); it++) {
|
||||||
@ -100,9 +122,7 @@ void UIPrefsDialog::init()
|
|||||||
autoPhraseCB->setChecked(prefs.ssearchAutoPhrase);
|
autoPhraseCB->setChecked(prefs.ssearchAutoPhrase);
|
||||||
|
|
||||||
buildAbsCB->setChecked(prefs.queryBuildAbstract);
|
buildAbsCB->setChecked(prefs.queryBuildAbstract);
|
||||||
if (!prefs.queryBuildAbstract) {
|
replAbsCB->setEnabled(prefs.queryBuildAbstract);
|
||||||
replAbsCB->setEnabled(false);
|
|
||||||
}
|
|
||||||
replAbsCB->setChecked(prefs.queryReplaceAbstract);
|
replAbsCB->setChecked(prefs.queryReplaceAbstract);
|
||||||
|
|
||||||
// Initialize the extra indexes listboxes
|
// Initialize the extra indexes listboxes
|
||||||
@ -111,30 +131,16 @@ void UIPrefsDialog::init()
|
|||||||
it != prefs.allExtraDbs.end(); it++) {
|
it != prefs.allExtraDbs.end(); it++) {
|
||||||
ql.append(QString::fromLocal8Bit(it->c_str()));
|
ql.append(QString::fromLocal8Bit(it->c_str()));
|
||||||
}
|
}
|
||||||
|
allDbsLB->clear();
|
||||||
allDbsLB->insertStringList(ql);
|
allDbsLB->insertStringList(ql);
|
||||||
ql.clear();
|
ql.clear();
|
||||||
for (list<string>::iterator it = prefs.activeExtraDbs.begin();
|
for (list<string>::iterator it = prefs.activeExtraDbs.begin();
|
||||||
it != prefs.activeExtraDbs.end(); it++) {
|
it != prefs.activeExtraDbs.end(); it++) {
|
||||||
ql.append(QString::fromLocal8Bit(it->c_str()));
|
ql.append(QString::fromLocal8Bit(it->c_str()));
|
||||||
}
|
}
|
||||||
|
actDbsLB->clear();
|
||||||
actDbsLB->insertStringList(ql);
|
actDbsLB->insertStringList(ql);
|
||||||
ql.clear();
|
ql.clear();
|
||||||
|
|
||||||
connect(reslistFontPB, SIGNAL(clicked()), this, SLOT(showFontDialog()));
|
|
||||||
connect(helpBrowserPB, SIGNAL(clicked()), this, SLOT(showBrowserDialog()));
|
|
||||||
connect(resetFontPB, SIGNAL(clicked()), this, SLOT(resetReslistFont()));
|
|
||||||
connect(extraDbLE,SIGNAL(textChanged(const QString&)), this,
|
|
||||||
SLOT(extraDbTextChanged(const QString&)));
|
|
||||||
connect(addAADbPB, SIGNAL(clicked()), this, SLOT(addAADbPB_clicked()));
|
|
||||||
connect(addADbPB, SIGNAL(clicked()), this, SLOT(addADbPB_clicked()));
|
|
||||||
connect(delADbPB, SIGNAL(clicked()), this, SLOT(delADbPB_clicked()));
|
|
||||||
connect(delAADbPB, SIGNAL(clicked()), this, SLOT(delAADbPB_clicked()));
|
|
||||||
connect(addExtraDbPB, SIGNAL(clicked()), this, SLOT(addExtraDbPB_clicked()));
|
|
||||||
connect(browseDbPB, SIGNAL(clicked()), this, SLOT(browseDbPB_clicked()));
|
|
||||||
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
|
|
||||||
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
|
|
||||||
connect(buildAbsCB, SIGNAL(toggled(bool)),
|
|
||||||
replAbsCB, SLOT(setEnabled(bool)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIPrefsDialog::accept()
|
void UIPrefsDialog::accept()
|
||||||
@ -184,6 +190,11 @@ void UIPrefsDialog::accept()
|
|||||||
emit uiprefsDone();
|
emit uiprefsDone();
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
void UIPrefsDialog::reject()
|
||||||
|
{
|
||||||
|
setFromPrefs();
|
||||||
|
QDialog::reject();
|
||||||
|
}
|
||||||
|
|
||||||
void UIPrefsDialog::showFontDialog()
|
void UIPrefsDialog::showFontDialog()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/* @(#$Id: uiprefs_w.h,v 1.1 2006-09-04 15:13:02 dockes Exp $ (C) 2006 J.F.Dockes */
|
/* @(#$Id: uiprefs_w.h,v 1.2 2006-11-07 08:57:11 dockes Exp $ (C) 2006 J.F.Dockes */
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef _UIPREFS_W_H_INCLUDED_
|
#ifndef _UIPREFS_W_H_INCLUDED_
|
||||||
#define _UIPREFS_W_H_INCLUDED_
|
#define _UIPREFS_W_H_INCLUDED_
|
||||||
/* @(#$Id: uiprefs_w.h,v 1.1 2006-09-04 15:13:02 dockes Exp $ (C) 2005 J.F.Dockes */
|
/* @(#$Id: uiprefs_w.h,v 1.2 2006-11-07 08:57:11 dockes Exp $ (C) 2005 J.F.Dockes */
|
||||||
#include <qvariant.h>
|
#include <qvariant.h>
|
||||||
#include <qdialog.h>
|
#include <qdialog.h>
|
||||||
|
|
||||||
@ -53,6 +53,9 @@ signals:
|
|||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void accept();
|
virtual void accept();
|
||||||
|
virtual void reject();
|
||||||
|
private:
|
||||||
|
void setFromPrefs();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user