GUI config: propose default name for log file
This commit is contained in:
@@ -236,9 +236,12 @@ void ConfParamBoolW::loadValue()
|
||||
ConfParamFNW::ConfParamFNW(QWidget *parent, ConfLink cflink,
|
||||
const QString& lbltxt,
|
||||
const QString& tltptxt,
|
||||
bool isdir
|
||||
bool isdir,
|
||||
QString dirloc,
|
||||
QString dfltnm
|
||||
)
|
||||
: ConfParamW(parent, cflink), m_isdir(isdir)
|
||||
: ConfParamW(parent, cflink), m_isdir(isdir), m_dirloc(dirloc),
|
||||
m_dfltnm(dfltnm)
|
||||
{
|
||||
if (!createCommon(lbltxt, tltptxt))
|
||||
return;
|
||||
@@ -274,7 +277,7 @@ void ConfParamFNW::loadValue()
|
||||
|
||||
void ConfParamFNW::showBrowserDialog()
|
||||
{
|
||||
QString s = myGetFileName(m_isdir);
|
||||
QString s = myGetFileName(m_isdir, "", false, m_dirloc, m_dfltnm);
|
||||
if (!s.isEmpty())
|
||||
m_le->setText(s);
|
||||
}
|
||||
|
||||
@@ -166,7 +166,11 @@ namespace confgui {
|
||||
const QString& tltptxt);
|
||||
virtual void loadValue();
|
||||
public slots:
|
||||
virtual void setEnabled(bool i) {if(m_cb) ((QWidget*)m_cb)->setEnabled(i);}
|
||||
virtual void setEnabled(bool i) {
|
||||
if(m_cb) {
|
||||
((QWidget*)m_cb)->setEnabled(i);
|
||||
}
|
||||
}
|
||||
public:
|
||||
QCheckBox *m_cb;
|
||||
};
|
||||
@@ -176,14 +180,16 @@ namespace confgui {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConfParamFNW(QWidget *parent, ConfLink cflink,
|
||||
const QString& lbltxt,
|
||||
const QString& tltptxt, bool isdir = false);
|
||||
const QString& lbltxt,
|
||||
const QString& tltptxt, bool isdir = false,
|
||||
QString dirloc = QString(),
|
||||
QString dfltnm = QString()
|
||||
);
|
||||
virtual void loadValue();
|
||||
protected slots:
|
||||
void showBrowserDialog();
|
||||
public slots:
|
||||
virtual void setEnabled(bool i)
|
||||
{
|
||||
virtual void setEnabled(bool i) {
|
||||
if(m_le) ((QWidget*)m_le)->setEnabled(i);
|
||||
if(m_pb) ((QWidget*)m_pb)->setEnabled(i);
|
||||
}
|
||||
@@ -191,6 +197,8 @@ namespace confgui {
|
||||
QLineEdit *m_le;
|
||||
QPushButton *m_pb;
|
||||
bool m_isdir;
|
||||
QString m_dirloc;
|
||||
QString m_dfltnm;
|
||||
};
|
||||
|
||||
// String list
|
||||
|
||||
@@ -394,7 +394,9 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, ConfNull *config)
|
||||
ConfLink(new ConfLinkRclRep(config, "logfilename")),
|
||||
tr("Log file name"),
|
||||
tr("The file where the messages will be written.<br>"
|
||||
"Use 'stderr' for terminal output"), false);
|
||||
"Use 'stderr' for terminal output"), false,
|
||||
u8s2qs(tmplocation()),
|
||||
"log-recoll.txt");
|
||||
gl1->addWidget(w, gridrow++, 1);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user