*** empty log message ***

This commit is contained in:
dockes 2007-10-07 20:22:55 +00:00
parent 516d76ac93
commit 24cf3efbfa
2 changed files with 53 additions and 73 deletions

View File

@ -1,5 +1,5 @@
#ifndef lint #ifndef lint
static char rcsid[] = "@(#$Id: confgui.cpp,v 1.5 2007-10-01 06:35:31 dockes Exp $ (C) 2005 J.F.Dockes"; static char rcsid[] = "@(#$Id: confgui.cpp,v 1.6 2007-10-07 20:22:55 dockes Exp $ (C) 2005 J.F.Dockes";
#endif #endif
#include <stdio.h> #include <stdio.h>
@ -85,11 +85,6 @@ void ConfParamW::setValue(bool value)
m_cflink->set(string(buf)); m_cflink->set(string(buf));
} }
void ConfParamW::loadValue()
{
}
bool ConfParamW::createCommon(const QString& lbltxt, const QString& tltptxt) bool ConfParamW::createCommon(const QString& lbltxt, const QString& tltptxt)
{ {
m_hl = new QHBOXLAYOUT(this); m_hl = new QHBOXLAYOUT(this);
@ -121,15 +116,13 @@ ConfParamIntW::ConfParamIntW(QWidget *parent, ConfLink cflink,
return; return;
m_sb = new QSpinBox(this); m_sb = new QSpinBox(this);
// sb->setMinimum(minvalue);
m_sb->setMinValue(minvalue); m_sb->setMinValue(minvalue);
// sb->setMaximum(maxvalue);
m_sb->setMaxValue(maxvalue); m_sb->setMaxValue(maxvalue);
m_sb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, m_sb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
QSizePolicy::Fixed, QSizePolicy::Fixed,
0, // Horizontal stretch 0, // Horizontal stretch
0, // Vertical stretch 0, // Vertical stretch
m_sb->sizePolicy().hasHeightForWidth() ) ); m_sb->sizePolicy().hasHeightForWidth()));
m_hl->addWidget(m_sb); m_hl->addWidget(m_sb);
QFRAME *fr = new QFRAME(this); QFRAME *fr = new QFRAME(this);
@ -140,7 +133,6 @@ ConfParamIntW::ConfParamIntW(QWidget *parent, ConfLink cflink,
fr->sizePolicy().hasHeightForWidth() ) ); fr->sizePolicy().hasHeightForWidth() ) );
m_hl->addWidget(fr); m_hl->addWidget(fr);
loadValue(); loadValue();
QObject::connect(m_sb, SIGNAL(valueChanged(int)), QObject::connect(m_sb, SIGNAL(valueChanged(int)),
@ -162,15 +154,14 @@ ConfParamStrW::ConfParamStrW(QWidget *parent, ConfLink cflink,
if (!createCommon(lbltxt, tltptxt)) if (!createCommon(lbltxt, tltptxt))
return; return;
m_le = new QLineEdit(this); m_le = new QLineEdit(this);
// m_le->setMinimumSize( QSize( 200, 0 ) );
loadValue(); loadValue();
m_le->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, m_le->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
QSizePolicy::Fixed, QSizePolicy::Fixed,
1, // Horizontal stretch 1, // Horizontal stretch
0, // Vertical stretch 0, // Vertical stretch
m_le->sizePolicy().hasHeightForWidth() ) ); m_le->sizePolicy().hasHeightForWidth()));
m_hl->addWidget(m_le); m_hl->addWidget(m_le);
@ -197,17 +188,14 @@ ConfParamCStrW::ConfParamCStrW(QWidget *parent, ConfLink cflink,
m_cmb = new QComboBox(this); m_cmb = new QComboBox(this);
m_cmb->insertStringList(sl); m_cmb->insertStringList(sl);
m_cmb->setEditable(false); m_cmb->setEditable(false);
loadValue();
m_cmb->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, m_cmb->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
QSizePolicy::Fixed, QSizePolicy::Fixed,
1, // Horizontal stretch 1, // Horizontal stretch
0, // Vertical stretch 0, // Vertical stretch
m_cmb->sizePolicy().hasHeightForWidth() ) ); m_cmb->sizePolicy().hasHeightForWidth()));
m_hl->addWidget(m_cmb); m_hl->addWidget(m_cmb);
loadValue();
QObject::connect(m_cmb, SIGNAL(activated(const QString&)), QObject::connect(m_cmb, SIGNAL(activated(const QString&)),
this, SLOT(setValue(const QString&))); this, SLOT(setValue(const QString&)));
} }
@ -226,8 +214,8 @@ void ConfParamCStrW::loadValue()
} }
ConfParamBoolW::ConfParamBoolW(QWidget *parent, ConfLink cflink, ConfParamBoolW::ConfParamBoolW(QWidget *parent, ConfLink cflink,
const QString& lbltxt, const QString& lbltxt,
const QString& tltptxt) const QString& tltptxt)
: ConfParamW(parent, cflink) : ConfParamW(parent, cflink)
{ {
// No createCommon because the checkbox has a label // No createCommon because the checkbox has a label
@ -235,12 +223,11 @@ ConfParamBoolW::ConfParamBoolW(QWidget *parent, ConfLink cflink,
m_hl->setSpacing(spacing); m_hl->setSpacing(spacing);
m_cb = new QCheckBox(lbltxt, this); m_cb = new QCheckBox(lbltxt, this);
m_cb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, m_cb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
QSizePolicy::Fixed, QSizePolicy::Fixed,
0, // Horizontal stretch 0, // Horizontal stretch
0, // Vertical stretch 0, // Vertical stretch
m_cb->sizePolicy().hasHeightForWidth() ) ); m_cb->sizePolicy().hasHeightForWidth()));
QToolTip::add(m_cb, tltptxt); QToolTip::add(m_cb, tltptxt);
m_hl->addWidget(m_cb); m_hl->addWidget(m_cb);
@ -249,7 +236,7 @@ ConfParamBoolW::ConfParamBoolW(QWidget *parent, ConfLink cflink,
QSizePolicy::Fixed, QSizePolicy::Fixed,
1, // Horizontal stretch 1, // Horizontal stretch
0, // Vertical stretch 0, // Vertical stretch
fr->sizePolicy().hasHeightForWidth() ) ); fr->sizePolicy().hasHeightForWidth()));
m_hl->addWidget(fr); m_hl->addWidget(fr);
QObject::connect(m_cb, SIGNAL(toggled(bool)), QObject::connect(m_cb, SIGNAL(toggled(bool)),
@ -276,10 +263,10 @@ ConfParamFNW::ConfParamFNW(QWidget *parent, ConfLink cflink,
m_le = new QLineEdit(this); m_le = new QLineEdit(this);
m_le->setMinimumSize(QSize(150, 0 )); m_le->setMinimumSize(QSize(150, 0 ));
m_le->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, m_le->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
QSizePolicy::Fixed, QSizePolicy::Fixed,
1, // Horizontal stretch 1, // Horizontal stretch
0, // Vertical stretch 0, // Vertical stretch
m_le->sizePolicy().hasHeightForWidth() ) ); m_le->sizePolicy().hasHeightForWidth()));
m_hl->addWidget(m_le); m_hl->addWidget(m_le);
QPushButton *pb = new QPushButton(this); QPushButton *pb = new QPushButton(this);
@ -288,7 +275,7 @@ ConfParamFNW::ConfParamFNW(QWidget *parent, ConfLink cflink,
QSizePolicy::Fixed, QSizePolicy::Fixed,
0, // Horizontal stretch 0, // Horizontal stretch
0, // Vertical stretch 0, // Vertical stretch
pb->sizePolicy().hasHeightForWidth() ) ); pb->sizePolicy().hasHeightForWidth()));
m_hl->addWidget(pb); m_hl->addWidget(pb);
@ -313,8 +300,8 @@ void ConfParamFNW::showBrowserDialog()
} }
ConfParamSLW::ConfParamSLW(QWidget *parent, ConfLink cflink, ConfParamSLW::ConfParamSLW(QWidget *parent, ConfLink cflink,
const QString& lbltxt, const QString& lbltxt,
const QString& tltptxt) const QString& tltptxt)
: ConfParamW(parent, cflink) : ConfParamW(parent, cflink)
{ {
// Can't use createCommon here cause we want the buttons below the label // Can't use createCommon here cause we want the buttons below the label
@ -329,10 +316,9 @@ ConfParamSLW::ConfParamSLW(QWidget *parent, ConfLink cflink,
QSizePolicy::Fixed, QSizePolicy::Fixed,
0, // Horizontal stretch 0, // Horizontal stretch
0, // Vertical stretch 0, // Vertical stretch
tl->sizePolicy().hasHeightForWidth() ) ); tl->sizePolicy().hasHeightForWidth()));
tl->setText(lbltxt); tl->setText(lbltxt);
QToolTip::add(tl, tltptxt); QToolTip::add(tl, tltptxt);
/* qt4 tl->setProperty("toolTip", tltptxt);*/
vl1->addWidget(tl); vl1->addWidget(tl);
QPushButton *pbA = new QPushButton(this); QPushButton *pbA = new QPushButton(this);
@ -341,7 +327,7 @@ ConfParamSLW::ConfParamSLW(QWidget *parent, ConfLink cflink,
QSizePolicy::Fixed, QSizePolicy::Fixed,
0, // Horizontal stretch 0, // Horizontal stretch
0, // Vertical stretch 0, // Vertical stretch
pbA->sizePolicy().hasHeightForWidth() ) ); pbA->sizePolicy().hasHeightForWidth()));
hl1->addWidget(pbA); hl1->addWidget(pbA);
QPushButton *pbD = new QPushButton(this); QPushButton *pbD = new QPushButton(this);
pbD->setText(tr("-")); pbD->setText(tr("-"));
@ -349,33 +335,28 @@ ConfParamSLW::ConfParamSLW(QWidget *parent, ConfLink cflink,
QSizePolicy::Fixed, QSizePolicy::Fixed,
0, // Horizontal stretch 0, // Horizontal stretch
0, // Vertical stretch 0, // Vertical stretch
pbD->sizePolicy().hasHeightForWidth() ) ); pbD->sizePolicy().hasHeightForWidth()));
hl1->addWidget(pbD); hl1->addWidget(pbD);
vl1->addLayout(hl1); vl1->addLayout(hl1);
m_hl->addLayout(vl1); m_hl->addLayout(vl1);
m_lb = new QLISTBOX(this); m_lb = new QLISTBOX(this);
loadValue();
m_lb->setSelectionMode(QLISTBOX::Extended); m_lb->setSelectionMode(QLISTBOX::Extended);
m_lb->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, m_lb->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
QSizePolicy::Preferred, QSizePolicy::Preferred,
1, // Horizontal stretch 1, // Horizontal stretch
1, // Vertical stretch 1, // Vertical stretch
m_lb->sizePolicy().hasHeightForWidth() ) ); m_lb->sizePolicy().hasHeightForWidth()));
m_hl->addWidget(m_lb); m_hl->addWidget(m_lb);
this->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, this->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
QSizePolicy::Preferred, QSizePolicy::Preferred,
1, // Horizontal stretch 1, // Horizontal stretch
1, // Vertical stretch 1, // Vertical stretch
this->sizePolicy().hasHeightForWidth() ) ); this->sizePolicy().hasHeightForWidth()));
loadValue();
QObject::connect(pbA, SIGNAL(clicked()), this, SLOT(showInputDialog())); QObject::connect(pbA, SIGNAL(clicked()), this, SLOT(showInputDialog()));
QObject::connect(pbD, SIGNAL(clicked()), this, SLOT(deleteSelected())); QObject::connect(pbD, SIGNAL(clicked()), this, SLOT(deleteSelected()));
} }
@ -476,4 +457,3 @@ void ConfParamCSLW::showInputDialog()
} }
} // Namespace confgui } // Namespace confgui

View File

@ -1,5 +1,5 @@
#ifndef lint #ifndef lint
static char rcsid[] = "@(#$Id: confguiindex.cpp,v 1.3 2007-10-01 06:35:31 dockes Exp $ (C) 2007 J.F.Dockes"; static char rcsid[] = "@(#$Id: confguiindex.cpp,v 1.4 2007-10-07 20:22:55 dockes Exp $ (C) 2007 J.F.Dockes";
#endif #endif
#include <qglobal.h> #include <qglobal.h>
@ -67,7 +67,7 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, RclConfig *config)
ConfParamDNLW *etopdirs = new ConfParamDNLW *etopdirs = new
ConfParamDNLW(this, lnktopdirs, tr("Top directories"), ConfParamDNLW(this, lnktopdirs, tr("Top directories"),
tr("The list of directories where recursive " tr("The list of directories where recursive "
"indexing starts. Default: your home.")); "indexing starts.<br>Default: your home."));
vboxLayout->addWidget(etopdirs); vboxLayout->addWidget(etopdirs);
ConfLink lnkskp(new ConfLinkRclRep(config, "skippedPaths")); ConfLink lnkskp(new ConfLinkRclRep(config, "skippedPaths"));
@ -91,14 +91,14 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, RclConfig *config)
ConfLink lnkidxsl(new ConfLinkRclRep(config, "indexstemminglanguages")); ConfLink lnkidxsl(new ConfLinkRclRep(config, "indexstemminglanguages"));
ConfParamCSLW *eidxsl = new ConfParamCSLW *eidxsl = new
ConfParamCSLW(this, lnkidxsl, tr("Index stemming languages"), ConfParamCSLW(this, lnkidxsl, tr("Index stemming languages"),
tr("The languages for which stemming expansion " tr("The languages for which stemming expansion<br>"
"dictionaries will be built."), stemlangs); "dictionaries will be built."), stemlangs);
vboxLayout->addWidget(eidxsl); vboxLayout->addWidget(eidxsl);
ConfLink lnk4(new ConfLinkRclRep(config, "logfilename")); ConfLink lnk4(new ConfLinkRclRep(config, "logfilename"));
ConfParamFNW *e4 = new ConfParamFNW *e4 = new
ConfParamFNW(this, lnk4, tr("Log file name"), ConfParamFNW(this, lnk4, tr("Log file name"),
tr("The file where the messages will be written. " tr("The file where the messages will be written.<br>"
"Use 'stderr' for terminal output"), false); "Use 'stderr' for terminal output"), false);
vboxLayout->addWidget(e4); vboxLayout->addWidget(e4);
@ -106,7 +106,7 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, RclConfig *config)
ConfParamIntW *e1 = new ConfParamIntW *e1 = new
ConfParamIntW(this, lnk1, tr("Log verbosity level"), ConfParamIntW(this, lnk1, tr("Log verbosity level"),
tr("This value adjusts the amount of " tr("This value adjusts the amount of "
"messages, from only errors to a " "messages,<br>from only errors to a "
"lot of debugging data."), 0, 6); "lot of debugging data."), 0, 6);
vboxLayout->addWidget(e1); vboxLayout->addWidget(e1);
@ -124,7 +124,7 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, RclConfig *config)
ConfParamIntW(this, lnkfsocc, tr("Max disk occupation (%)"), ConfParamIntW(this, lnkfsocc, tr("Max disk occupation (%)"),
tr("This is the percentage of disk occupation where " tr("This is the percentage of disk occupation where "
"indexing will fail and stop (to avoid filling up " "indexing will fail and stop (to avoid filling up "
"your disk). <br>" "your disk).<br>"
"0 means no limit (this is the default)."), 0, 100); "0 means no limit (this is the default)."), 0, 100);
vboxLayout->addWidget(efsocc); vboxLayout->addWidget(efsocc);
@ -161,7 +161,7 @@ ConfTopPanelW::ConfTopPanelW(QWidget *parent, RclConfig *config)
ConfLink lnkusfc(new ConfLinkRclRep(config, "usesystemfilecommand")); ConfLink lnkusfc(new ConfLinkRclRep(config, "usesystemfilecommand"));
ConfParamBoolW *eusfc = new ConfParamBoolW *eusfc = new
ConfParamBoolW(this, lnkusfc, tr("Use system's 'file' command"), ConfParamBoolW(this, lnkusfc, tr("Use system's 'file' command"),
tr("Use the system's 'file' command if internal " tr("Use the system's 'file' command if internal<br>"
"mime type identification fails.")); "mime type identification fails."));
vboxLayout->addWidget(eusfc); vboxLayout->addWidget(eusfc);
} }
@ -176,11 +176,10 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, RclConfig *config)
ConfLink lnksubkeydirs(new ConfLinkNullRep()); ConfLink lnksubkeydirs(new ConfLinkNullRep());
m_subdirs = new m_subdirs = new
ConfParamDNLW(this, lnksubkeydirs, ConfParamDNLW(this, lnksubkeydirs,
QObject::tr("Subdirectories with specific parameters"), QObject::tr("<b>Subdirectories with specific parameters"),
QObject::tr("The list of subdirectories in the indexed " QObject::tr("The list of subdirectories in the indexed "
"hierarchy where some parameters need to be " "hierarchy <br>where some parameters need "
"customised. " "to be customised. Default: empty."));
"Default: empty."));
m_subdirs->getListBox()->setSelectionMode(QLISTBOX::Single); m_subdirs->getListBox()->setSelectionMode(QLISTBOX::Single);
connect(m_subdirs->getListBox(), SIGNAL(selectionChanged()), connect(m_subdirs->getListBox(), SIGNAL(selectionChanged()),
this, SLOT(subDirChanged())); this, SLOT(subDirChanged()));
@ -199,10 +198,11 @@ ConfSubPanelW::ConfSubPanelW(QWidget *parent, RclConfig *config)
QLabel *explain = new QLabel(this); QLabel *explain = new QLabel(this);
explain->setText( explain->setText(
QObject:: QObject::
tr("<i>The following parameters are set either at the " tr("<i>The parameters that follow are set either at the "
"top level (no selection or empty line selected) " "top level, if nothing<br>"
"or for the selected subdirectory. " "or an empty line is selected in the listbox above, "
"You can add / remove directories by clicking " "or for the selected subdirectory.<br>"
"You can add or remove directories by clicking "
"the +/- buttons.")); "the +/- buttons."));
vboxLayout->addWidget(explain); vboxLayout->addWidget(explain);