*** empty log message ***
This commit is contained in:
parent
df78cd2d77
commit
d3e20ceeeb
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: confgui.cpp,v 1.1 2007-09-26 12:16:48 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: confgui.cpp,v 1.2 2007-09-27 15:47:25 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -23,35 +23,38 @@ static char rcsid[] = "@(#$Id: confgui.cpp,v 1.1 2007-09-26 12:16:48 dockes Exp
|
|||||||
#include "confgui.h"
|
#include "confgui.h"
|
||||||
#include "smallut.h"
|
#include "smallut.h"
|
||||||
#include "debuglog.h"
|
#include "debuglog.h"
|
||||||
|
#include "rcldb.h"
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
using std::list;
|
using std::list;
|
||||||
|
|
||||||
namespace confgui {
|
namespace confgui {
|
||||||
|
|
||||||
|
const static int spacing = 3;
|
||||||
|
const static int margin = 6;
|
||||||
|
|
||||||
void ConfParamW::setValue(const QString& value)
|
void ConfParamW::setValue(const QString& value)
|
||||||
{
|
{
|
||||||
m_cflink.set(string((const char *)value.utf8()));
|
m_cflink->set(string((const char *)value.utf8()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfParamW::setValue(int value)
|
void ConfParamW::setValue(int value)
|
||||||
{
|
{
|
||||||
char buf[30];
|
char buf[30];
|
||||||
sprintf(buf, "%d", value);
|
sprintf(buf, "%d", value);
|
||||||
m_cflink.set(string(buf));
|
m_cflink->set(string(buf));
|
||||||
}
|
}
|
||||||
void ConfParamW::setValue(bool value)
|
void ConfParamW::setValue(bool value)
|
||||||
{
|
{
|
||||||
char buf[30];
|
char buf[30];
|
||||||
sprintf(buf, "%d", value);
|
sprintf(buf, "%d", value);
|
||||||
m_cflink.set(string(buf));
|
m_cflink->set(string(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
m_hl->setSpacing(6);
|
m_hl->setSpacing(spacing);
|
||||||
|
|
||||||
QLabel *tl = new QLabel(this);
|
QLabel *tl = new QLabel(this);
|
||||||
tl->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
|
tl->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
|
||||||
@ -67,8 +70,8 @@ bool ConfParamW::createCommon(const QString& lbltxt, const QString& tltptxt)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#include <qframe.h>
|
||||||
ConfParamIntW::ConfParamIntW(QWidget *parent, ConfLink &cflink,
|
ConfParamIntW::ConfParamIntW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt,
|
const QString& tltptxt,
|
||||||
int minvalue,
|
int minvalue,
|
||||||
@ -89,19 +92,27 @@ ConfParamIntW::ConfParamIntW(QWidget *parent, ConfLink &cflink,
|
|||||||
0, // Horizontal stretch
|
0, // Horizontal stretch
|
||||||
0, // Vertical stretch
|
0, // Vertical stretch
|
||||||
sb->sizePolicy().hasHeightForWidth() ) );
|
sb->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
m_hl->addWidget(sb);
|
||||||
|
|
||||||
|
QFrame *fr = new QFrame(this);
|
||||||
|
fr->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
|
||||||
|
QSizePolicy::Fixed,
|
||||||
|
1, // Horizontal stretch
|
||||||
|
0, // Vertical stretch
|
||||||
|
fr->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
m_hl->addWidget(fr);
|
||||||
|
|
||||||
|
|
||||||
string s;
|
string s;
|
||||||
m_cflink.get(s);
|
m_cflink->get(s);
|
||||||
sb->setValue(atoi(s.c_str()));
|
sb->setValue(atoi(s.c_str()));
|
||||||
|
|
||||||
m_hl->addWidget(sb);
|
|
||||||
|
|
||||||
QObject::connect(sb, SIGNAL(valueChanged(int)),
|
QObject::connect(sb, SIGNAL(valueChanged(int)),
|
||||||
this, SLOT(setValue(int)));
|
this, SLOT(setValue(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfParamStrW::ConfParamStrW(QWidget *parent, ConfLink& cflink,
|
ConfParamStrW::ConfParamStrW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt)
|
const QString& tltptxt)
|
||||||
: ConfParamW(parent, cflink)
|
: ConfParamW(parent, cflink)
|
||||||
@ -112,7 +123,7 @@ ConfParamStrW::ConfParamStrW(QWidget *parent, ConfLink& cflink,
|
|||||||
// le->setMinimumSize( QSize( 200, 0 ) );
|
// le->setMinimumSize( QSize( 200, 0 ) );
|
||||||
|
|
||||||
string s;
|
string s;
|
||||||
m_cflink.get(s);
|
m_cflink->get(s);
|
||||||
le->setText(QString::fromUtf8(s.c_str()));
|
le->setText(QString::fromUtf8(s.c_str()));
|
||||||
le->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
|
le->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
|
||||||
QSizePolicy::Fixed,
|
QSizePolicy::Fixed,
|
||||||
@ -126,7 +137,7 @@ ConfParamStrW::ConfParamStrW(QWidget *parent, ConfLink& cflink,
|
|||||||
this, SLOT(setValue(const QString&)));
|
this, SLOT(setValue(const QString&)));
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfParamCStrW::ConfParamCStrW(QWidget *parent, ConfLink& cflink,
|
ConfParamCStrW::ConfParamCStrW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt,
|
const QString& tltptxt,
|
||||||
const QStringList &sl
|
const QStringList &sl
|
||||||
@ -139,7 +150,7 @@ ConfParamCStrW::ConfParamCStrW(QWidget *parent, ConfLink& cflink,
|
|||||||
cmb->insertStringList(sl);
|
cmb->insertStringList(sl);
|
||||||
cmb->setEditable(false);
|
cmb->setEditable(false);
|
||||||
string s;
|
string s;
|
||||||
m_cflink.get(s);
|
m_cflink->get(s);
|
||||||
QString cs = QString::fromUtf8(s.c_str());
|
QString cs = QString::fromUtf8(s.c_str());
|
||||||
for (int i = 0; i < cmb->count(); i++) {
|
for (int i = 0; i < cmb->count(); i++) {
|
||||||
if (!cs.compare(cmb->text(i))) {
|
if (!cs.compare(cmb->text(i))) {
|
||||||
@ -160,7 +171,7 @@ ConfParamCStrW::ConfParamCStrW(QWidget *parent, ConfLink& cflink,
|
|||||||
this, SLOT(setValue(const QString&)));
|
this, SLOT(setValue(const QString&)));
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
@ -170,24 +181,33 @@ ConfParamBoolW::ConfParamBoolW(QWidget *parent, ConfLink& cflink,
|
|||||||
QCheckBox *cb = new QCheckBox(this);
|
QCheckBox *cb = new QCheckBox(this);
|
||||||
|
|
||||||
string s;
|
string s;
|
||||||
m_cflink.get(s);
|
m_cflink->get(s);
|
||||||
cb->setChecked(stringToBool(s));
|
cb->setChecked(stringToBool(s));
|
||||||
cb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
|
cb->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
|
||||||
QSizePolicy::Fixed,
|
QSizePolicy::Fixed,
|
||||||
0, // Horizontal stretch
|
0, // Horizontal stretch
|
||||||
0, // Vertical stretch
|
0, // Vertical stretch
|
||||||
cb->sizePolicy().hasHeightForWidth() ) );
|
cb->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
|
||||||
m_hl->addWidget(cb);
|
m_hl->addWidget(cb);
|
||||||
|
|
||||||
|
QFrame *fr = new QFrame(this);
|
||||||
|
fr->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
|
||||||
|
QSizePolicy::Fixed,
|
||||||
|
1, // Horizontal stretch
|
||||||
|
0, // Vertical stretch
|
||||||
|
fr->sizePolicy().hasHeightForWidth() ) );
|
||||||
|
m_hl->addWidget(fr);
|
||||||
|
|
||||||
QObject::connect(cb, SIGNAL(toggled(bool)),
|
QObject::connect(cb, SIGNAL(toggled(bool)),
|
||||||
this, SLOT(setValue(bool)));
|
this, SLOT(setValue(bool)));
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfParamFNW::ConfParamFNW(QWidget *parent, ConfLink& cflink,
|
ConfParamFNW::ConfParamFNW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt)
|
const QString& tltptxt,
|
||||||
: ConfParamW(parent, cflink)
|
bool isdir
|
||||||
|
)
|
||||||
|
: ConfParamW(parent, cflink), m_isdir(isdir)
|
||||||
{
|
{
|
||||||
if (!createCommon(lbltxt, tltptxt))
|
if (!createCommon(lbltxt, tltptxt))
|
||||||
return;
|
return;
|
||||||
@ -213,7 +233,7 @@ ConfParamFNW::ConfParamFNW(QWidget *parent, ConfLink& cflink,
|
|||||||
|
|
||||||
|
|
||||||
string s;
|
string s;
|
||||||
m_cflink.get(s);
|
m_cflink->get(s);
|
||||||
m_le->setText(QString::fromUtf8(s.c_str()));
|
m_le->setText(QString::fromUtf8(s.c_str()));
|
||||||
|
|
||||||
QObject::connect(pb, SIGNAL(clicked()), this, SLOT(showBrowserDialog()));
|
QObject::connect(pb, SIGNAL(clicked()), this, SLOT(showBrowserDialog()));
|
||||||
@ -223,23 +243,20 @@ ConfParamFNW::ConfParamFNW(QWidget *parent, ConfLink& cflink,
|
|||||||
|
|
||||||
void ConfParamFNW::showBrowserDialog()
|
void ConfParamFNW::showBrowserDialog()
|
||||||
{
|
{
|
||||||
QString s = QFileDialog::getOpenFileName("",
|
QString s = m_isdir ?
|
||||||
"",
|
QFileDialog::getExistingDirectory() : QFileDialog::getSaveFileName();
|
||||||
this,
|
|
||||||
"open file dialog",
|
|
||||||
"Choose a file");
|
|
||||||
if (!s.isEmpty())
|
if (!s.isEmpty())
|
||||||
m_le->setText(s);
|
m_le->setText(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
m_hl = new QHBoxLayout(this);
|
m_hl = new QHBoxLayout(this);
|
||||||
m_hl->setSpacing(6);
|
m_hl->setSpacing(spacing);
|
||||||
|
|
||||||
QVBoxLayout *vl1 = new QVBoxLayout();
|
QVBoxLayout *vl1 = new QVBoxLayout();
|
||||||
QHBoxLayout *hl1 = new QHBoxLayout();
|
QHBoxLayout *hl1 = new QHBoxLayout();
|
||||||
@ -256,7 +273,7 @@ ConfParamSLW::ConfParamSLW(QWidget *parent, ConfLink& cflink,
|
|||||||
vl1->addWidget(tl);
|
vl1->addWidget(tl);
|
||||||
|
|
||||||
QPushButton *pbA = new QPushButton(this);
|
QPushButton *pbA = new QPushButton(this);
|
||||||
pbA->setText(tr("Add"));
|
pbA->setText(tr("+"));
|
||||||
pbA->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
|
pbA->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
|
||||||
QSizePolicy::Fixed,
|
QSizePolicy::Fixed,
|
||||||
0, // Horizontal stretch
|
0, // Horizontal stretch
|
||||||
@ -264,7 +281,7 @@ ConfParamSLW::ConfParamSLW(QWidget *parent, ConfLink& cflink,
|
|||||||
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("Delete"));
|
pbD->setText(tr("-"));
|
||||||
pbD->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
|
pbD->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
|
||||||
QSizePolicy::Fixed,
|
QSizePolicy::Fixed,
|
||||||
0, // Horizontal stretch
|
0, // Horizontal stretch
|
||||||
@ -279,7 +296,7 @@ ConfParamSLW::ConfParamSLW(QWidget *parent, ConfLink& cflink,
|
|||||||
m_lb = new QListBox(this);
|
m_lb = new QListBox(this);
|
||||||
|
|
||||||
string s;
|
string s;
|
||||||
m_cflink.get(s);
|
m_cflink->get(s);
|
||||||
list<string> ls;
|
list<string> ls;
|
||||||
stringToStrings(s, ls);
|
stringToStrings(s, ls);
|
||||||
QStringList qls;
|
QStringList qls;
|
||||||
@ -328,14 +345,13 @@ void ConfParamSLW::showInputDialog()
|
|||||||
|
|
||||||
void ConfParamSLW::listToConf()
|
void ConfParamSLW::listToConf()
|
||||||
{
|
{
|
||||||
LOGDEB(("ConfParamSLW::listToConf()\n"));
|
|
||||||
list<string> ls;
|
list<string> ls;
|
||||||
for (unsigned int i = 0; i < m_lb->count(); i++) {
|
for (unsigned int i = 0; i < m_lb->count(); i++) {
|
||||||
ls.push_back((const char *)m_lb->text(i));
|
ls.push_back((const char *)m_lb->text(i));
|
||||||
}
|
}
|
||||||
string s;
|
string s;
|
||||||
stringsToString(ls, s);
|
stringsToString(ls, s);
|
||||||
m_cflink.set(s);
|
m_cflink->set(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfParamSLW::deleteSelected()
|
void ConfParamSLW::deleteSelected()
|
||||||
@ -345,7 +361,6 @@ void ConfParamSLW::deleteSelected()
|
|||||||
didone = false;
|
didone = false;
|
||||||
for (unsigned int i = 0; i < m_lb->count(); i++) {
|
for (unsigned int i = 0; i < m_lb->count(); i++) {
|
||||||
if (m_lb->isSelected(i)) {
|
if (m_lb->isSelected(i)) {
|
||||||
LOGDEB(("%d is selected\n", i));
|
|
||||||
m_lb->removeItem(i);
|
m_lb->removeItem(i);
|
||||||
didone = true;
|
didone = true;
|
||||||
break;
|
break;
|
||||||
@ -356,13 +371,9 @@ void ConfParamSLW::deleteSelected()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// "Add entry" dialog for a file name list
|
// "Add entry" dialog for a file name list
|
||||||
void ConfParamFNLW::showInputDialog()
|
void ConfParamDNLW::showInputDialog()
|
||||||
{
|
{
|
||||||
QString s = QFileDialog::getOpenFileName("",
|
QString s = QFileDialog::getExistingDirectory();
|
||||||
"",
|
|
||||||
this,
|
|
||||||
"open file dialog",
|
|
||||||
"Choose a file");
|
|
||||||
if (!s.isEmpty()) {
|
if (!s.isEmpty()) {
|
||||||
if (m_lb->findItem(s, Qt::ExactMatch) == 0) {
|
if (m_lb->findItem(s, Qt::ExactMatch) == 0) {
|
||||||
m_lb->insertItem(s);
|
m_lb->insertItem(s);
|
||||||
@ -381,8 +392,7 @@ void ConfParamCSLW::showInputDialog()
|
|||||||
m_sl, // List
|
m_sl, // List
|
||||||
0, // current
|
0, // current
|
||||||
false, // editable,
|
false, // editable,
|
||||||
&ok,
|
&ok);
|
||||||
this);
|
|
||||||
if (ok && !s.isEmpty()) {
|
if (ok && !s.isEmpty()) {
|
||||||
if (m_lb->findItem(s, Qt::ExactMatch) == 0) {
|
if (m_lb->findItem(s, Qt::ExactMatch) == 0) {
|
||||||
m_lb->insertItem(s);
|
m_lb->insertItem(s);
|
||||||
@ -392,4 +402,5 @@ void ConfParamCSLW::showInputDialog()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // Namespace confgui
|
||||||
|
|
||||||
|
|||||||
@ -1,37 +1,42 @@
|
|||||||
#ifndef _confgui_h_included_
|
#ifndef _confgui_h_included_
|
||||||
#define _confgui_h_included_
|
#define _confgui_h_included_
|
||||||
/* @(#$Id: confgui.h,v 1.1 2007-09-26 12:16:48 dockes Exp $ (C) 2007 J.F.Dockes */
|
/* @(#$Id: confgui.h,v 1.2 2007-09-27 15:47:25 dockes Exp $ (C) 2007 J.F.Dockes */
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <qstring.h>
|
#include <qstring.h>
|
||||||
#include <qwidget.h>
|
#include <qwidget.h>
|
||||||
|
|
||||||
|
#include "refcntr.h"
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
class QHBoxLayout;
|
class QHBoxLayout;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QListBox;
|
class QListBox;
|
||||||
|
class RclConfig;
|
||||||
|
|
||||||
namespace confgui {
|
namespace confgui {
|
||||||
|
|
||||||
// A class to isolate the gui widget from the config storage mechanism
|
// A class to isolate the gui widget from the config storage mechanism
|
||||||
class ConfLink {
|
class ConfLinkRep {
|
||||||
public:
|
public:
|
||||||
virtual bool set(const string& val) = 0;
|
virtual bool set(const string& val) = 0;
|
||||||
virtual bool get(string& val) = 0;
|
virtual bool get(string& val) = 0;
|
||||||
};
|
};
|
||||||
|
typedef RefCntr<ConfLinkRep> ConfLink;
|
||||||
|
|
||||||
// A widget to let the user change a configuration parameter
|
// A widget to let the user change one configuration
|
||||||
|
// parameter. Subclassed for specific parameter types
|
||||||
class ConfParamW : public QWidget {
|
class ConfParamW : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ConfParamW(QWidget *parent, ConfLink &cflink)
|
ConfParamW(QWidget *parent, ConfLink cflink)
|
||||||
: QWidget(parent), m_cflink(cflink)
|
: QWidget(parent), m_cflink(cflink)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
ConfLink& m_cflink;
|
ConfLink m_cflink;
|
||||||
QHBoxLayout *m_hl;
|
QHBoxLayout *m_hl;
|
||||||
virtual bool createCommon(const QString& lbltxt,
|
virtual bool createCommon(const QString& lbltxt,
|
||||||
const QString& tltptxt);
|
const QString& tltptxt);
|
||||||
@ -44,9 +49,11 @@ namespace confgui {
|
|||||||
|
|
||||||
|
|
||||||
// Widgets for setting the different types of configuration parameters:
|
// Widgets for setting the different types of configuration parameters:
|
||||||
|
|
||||||
|
// Int
|
||||||
class ConfParamIntW : public ConfParamW {
|
class ConfParamIntW : public ConfParamW {
|
||||||
public:
|
public:
|
||||||
ConfParamIntW(QWidget *parent, ConfLink& cflink,
|
ConfParamIntW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt,
|
const QString& tltptxt,
|
||||||
int minvalue = INT_MIN,
|
int minvalue = INT_MIN,
|
||||||
@ -56,7 +63,7 @@ namespace confgui {
|
|||||||
// Arbitrary string
|
// Arbitrary string
|
||||||
class ConfParamStrW : public ConfParamW {
|
class ConfParamStrW : public ConfParamW {
|
||||||
public:
|
public:
|
||||||
ConfParamStrW(QWidget *parent, ConfLink& cflink,
|
ConfParamStrW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt);
|
const QString& tltptxt);
|
||||||
};
|
};
|
||||||
@ -64,35 +71,38 @@ namespace confgui {
|
|||||||
// Constrained string: choose from list
|
// Constrained string: choose from list
|
||||||
class ConfParamCStrW : public ConfParamW {
|
class ConfParamCStrW : public ConfParamW {
|
||||||
public:
|
public:
|
||||||
ConfParamCStrW(QWidget *parent, ConfLink& cflink,
|
ConfParamCStrW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt, const QStringList& sl);
|
const QString& tltptxt, const QStringList& sl);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Boolean
|
||||||
class ConfParamBoolW : public ConfParamW {
|
class ConfParamBoolW : public ConfParamW {
|
||||||
public:
|
public:
|
||||||
ConfParamBoolW(QWidget *parent, ConfLink& cflink,
|
ConfParamBoolW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt);
|
const QString& tltptxt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// File name
|
||||||
class ConfParamFNW : public ConfParamW {
|
class ConfParamFNW : public ConfParamW {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ConfParamFNW(QWidget *parent, ConfLink& cflink,
|
ConfParamFNW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt);
|
const QString& tltptxt, bool isdir = false);
|
||||||
protected slots:
|
protected slots:
|
||||||
void showBrowserDialog();
|
void showBrowserDialog();
|
||||||
private:
|
protected:
|
||||||
QLineEdit *m_le;
|
QLineEdit *m_le;
|
||||||
|
bool m_isdir;
|
||||||
};
|
};
|
||||||
|
|
||||||
// String list
|
// String list
|
||||||
class ConfParamSLW : public ConfParamW {
|
class ConfParamSLW : public ConfParamW {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ConfParamSLW(QWidget *parent, ConfLink& cflink,
|
ConfParamSLW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt);
|
const QString& tltptxt);
|
||||||
protected slots:
|
protected slots:
|
||||||
@ -103,11 +113,11 @@ namespace confgui {
|
|||||||
void listToConf();
|
void listToConf();
|
||||||
};
|
};
|
||||||
|
|
||||||
// File/Dir name list
|
// Dir name list
|
||||||
class ConfParamFNLW : public ConfParamSLW {
|
class ConfParamDNLW : public ConfParamSLW {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ConfParamFNLW(QWidget *parent, ConfLink& cflink,
|
ConfParamDNLW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt)
|
const QString& tltptxt)
|
||||||
: ConfParamSLW(parent, cflink, lbltxt, tltptxt)
|
: ConfParamSLW(parent, cflink, lbltxt, tltptxt)
|
||||||
@ -121,7 +131,7 @@ namespace confgui {
|
|||||||
class ConfParamCSLW : public ConfParamSLW {
|
class ConfParamCSLW : public ConfParamSLW {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ConfParamCSLW(QWidget *parent, ConfLink& cflink,
|
ConfParamCSLW(QWidget *parent, ConfLink cflink,
|
||||||
const QString& lbltxt,
|
const QString& lbltxt,
|
||||||
const QString& tltptxt,
|
const QString& tltptxt,
|
||||||
const QStringList& sl)
|
const QStringList& sl)
|
||||||
@ -130,9 +140,8 @@ namespace confgui {
|
|||||||
}
|
}
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void showInputDialog();
|
virtual void showInputDialog();
|
||||||
const QStringList &m_sl;
|
const QStringList m_sl;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _confgui_h_included_ */
|
#endif /* _confgui_h_included_ */
|
||||||
|
|||||||
195
src/qtgui/confgui/confguiindex.cpp
Normal file
195
src/qtgui/confgui/confguiindex.cpp
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
#ifndef lint
|
||||||
|
static char rcsid[] = "@(#$Id: confguiindex.cpp,v 1.1 2007-09-27 15:47:25 dockes Exp $ (C) 2007 J.F.Dockes";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <qlayout.h>
|
||||||
|
|
||||||
|
#include <list>
|
||||||
|
using std::list;
|
||||||
|
|
||||||
|
#include "confgui.h"
|
||||||
|
#include "confguiindex.h"
|
||||||
|
#include "smallut.h"
|
||||||
|
#include "debuglog.h"
|
||||||
|
#include "rcldb.h"
|
||||||
|
#include "conflinkrcl.h"
|
||||||
|
#include "execmd.h"
|
||||||
|
|
||||||
|
namespace confgui {
|
||||||
|
const static int spacing = 3;
|
||||||
|
const static int margin = 6;
|
||||||
|
|
||||||
|
ConfTopPanelW::ConfTopPanelW(QWidget *parent, RclConfig *config)
|
||||||
|
: QWidget(parent)
|
||||||
|
{
|
||||||
|
QVBoxLayout *vboxLayout = new QVBoxLayout(this);
|
||||||
|
vboxLayout->setSpacing(spacing);
|
||||||
|
vboxLayout->setMargin(margin);
|
||||||
|
|
||||||
|
ConfLink lnktopdirs(new ConfLinkRclRep(config, "topdirs"));
|
||||||
|
ConfParamDNLW *etopdirs = new
|
||||||
|
ConfParamDNLW(this, lnktopdirs, tr("Top directories"),
|
||||||
|
tr("The list of directories where recursive "
|
||||||
|
"indexing starts. Default: your home."));
|
||||||
|
vboxLayout->addWidget(etopdirs);
|
||||||
|
|
||||||
|
ConfLink lnkskp(new ConfLinkRclRep(config, "skippedPaths"));
|
||||||
|
ConfParamSLW *eskp = new
|
||||||
|
ConfParamSLW(this, lnkskp, tr("List of skipped paths"),
|
||||||
|
tr("These are names of directories which indexing "
|
||||||
|
"will not enter.<br> May contain wildcards. "
|
||||||
|
"Must match "
|
||||||
|
"the paths seen by the indexer (ie: if topdirs "
|
||||||
|
"includes '/home/me' and '/home' is actually a link "
|
||||||
|
"to '/usr/home', a correct skippedPath entry "
|
||||||
|
"would be '/home/tmp*', not '/usr/home/tmp*')"));
|
||||||
|
vboxLayout->addWidget(eskp);
|
||||||
|
|
||||||
|
list<string> cstemlangs = Rcl::Db::getStemmerNames();
|
||||||
|
QStringList stemlangs;
|
||||||
|
for (list<string>::const_iterator it = cstemlangs.begin();
|
||||||
|
it != cstemlangs.end(); it++) {
|
||||||
|
stemlangs.push_back(QString::fromUtf8(it->c_str()));
|
||||||
|
}
|
||||||
|
ConfLink lnkidxsl(new ConfLinkRclRep(config, "indexstemminglanguages"));
|
||||||
|
ConfParamCSLW *eidxsl = new
|
||||||
|
ConfParamCSLW(this, lnkidxsl, tr("Index stemming languages"),
|
||||||
|
tr("The languages for which stemming expansion "
|
||||||
|
"dictionaries will be built."), stemlangs);
|
||||||
|
vboxLayout->addWidget(eidxsl);
|
||||||
|
|
||||||
|
ConfLink lnk4(new ConfLinkRclRep(config, "logfilename"));
|
||||||
|
ConfParamFNW *e4 = new
|
||||||
|
ConfParamFNW(this, lnk4, tr("Log file name"),
|
||||||
|
tr("The file where the messages will be written. "
|
||||||
|
"Use 'stderr' for terminal output"), false);
|
||||||
|
vboxLayout->addWidget(e4);
|
||||||
|
|
||||||
|
ConfLink lnk1(new ConfLinkRclRep(config, "loglevel"));
|
||||||
|
ConfParamIntW *e1 = new
|
||||||
|
ConfParamIntW(this, lnk1, tr("Log verbosity level"),
|
||||||
|
tr("This value adjusts the amount of "
|
||||||
|
"messages, from only errors to a "
|
||||||
|
"lot of debugging data."), 0, 6);
|
||||||
|
vboxLayout->addWidget(e1);
|
||||||
|
|
||||||
|
ConfLink lnkidxflsh(new ConfLinkRclRep(config, "idxflushmb"));
|
||||||
|
ConfParamIntW *eidxflsh = new
|
||||||
|
ConfParamIntW(this, lnkidxflsh, tr("Index flush megabytes interval"),
|
||||||
|
tr("This value adjust the amount of "
|
||||||
|
"data which is indexed betweeen flushes to disk.<br>"
|
||||||
|
"This helps control the indexer memory usage. "
|
||||||
|
"Default 10MB "), 0, 1000);
|
||||||
|
vboxLayout->addWidget(eidxflsh);
|
||||||
|
|
||||||
|
ConfLink lnkfsocc(new ConfLinkRclRep(config, "maxfsoccuppc"));
|
||||||
|
ConfParamIntW *efsocc = new
|
||||||
|
ConfParamIntW(this, lnkfsocc, tr("Max disk occupation (%)"),
|
||||||
|
tr("This is the percentage of disk occupation where "
|
||||||
|
"indexing will fail and stop (to avoid filling up "
|
||||||
|
"your disk). <br>"
|
||||||
|
"0 means no limit (this is the default)."), 0, 100);
|
||||||
|
vboxLayout->addWidget(efsocc);
|
||||||
|
|
||||||
|
|
||||||
|
ConfLink lnknaspl(new ConfLinkRclRep(config, "noaspell"));
|
||||||
|
ConfParamBoolW *enaspl = new
|
||||||
|
ConfParamBoolW(this, lnknaspl, tr("No aspell usage"),
|
||||||
|
tr("Disables use of aspell to generate spelling "
|
||||||
|
"approximation in the term explorer tool.<br> "
|
||||||
|
"Useful is aspell is absent or does not work. "));
|
||||||
|
vboxLayout->addWidget(enaspl);
|
||||||
|
|
||||||
|
ConfLink lnk2(new ConfLinkRclRep(config, "aspellLanguage"));
|
||||||
|
ConfParamStrW *e2 = new
|
||||||
|
ConfParamStrW(this, lnk2, tr("Aspell language"),
|
||||||
|
tr("The language for the aspell dictionary. "
|
||||||
|
"This should look like 'en' or 'fr' ...<br>"
|
||||||
|
"If this value is not set, the NLS environment "
|
||||||
|
"will be used to compute it, which usually works."
|
||||||
|
"To get an idea of what is installed on your system, "
|
||||||
|
"type 'aspell config' and look for .dat files inside "
|
||||||
|
"the 'data-dir' directory. "));
|
||||||
|
vboxLayout->addWidget(e2);
|
||||||
|
|
||||||
|
ConfLink lnkdbd(new ConfLinkRclRep(config, "dbdir"));
|
||||||
|
ConfParamFNW *edbd = new
|
||||||
|
ConfParamFNW(this, lnkdbd, tr("Database directory name"),
|
||||||
|
tr("The name for a directory where to store the index<br>"
|
||||||
|
"A non-absolute path is taken relative to the "
|
||||||
|
" configuration directory. The default is 'xapiandb'."
|
||||||
|
), true);
|
||||||
|
vboxLayout->addWidget(edbd);
|
||||||
|
|
||||||
|
ConfLink lnkusfc(new ConfLinkRclRep(config, "usesystemfilecommand"));
|
||||||
|
ConfParamBoolW *eusfc = new
|
||||||
|
ConfParamBoolW(this, lnkusfc, tr("Use system's 'file' command"),
|
||||||
|
tr("Use the system's 'file' command if internal "
|
||||||
|
"mime type identification fails."));
|
||||||
|
vboxLayout->addWidget(eusfc);
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfSubPanelW::ConfSubPanelW(QWidget *parent, RclConfig *config)
|
||||||
|
: QWidget(parent)
|
||||||
|
{
|
||||||
|
QVBoxLayout *vboxLayout = new QVBoxLayout(this);
|
||||||
|
vboxLayout->setSpacing(spacing);
|
||||||
|
vboxLayout->setMargin(margin);
|
||||||
|
|
||||||
|
ConfLink lnkskn(new ConfLinkRclRep(config, "skippedNames"));
|
||||||
|
ConfParamSLW *eskn = new
|
||||||
|
ConfParamSLW(this, lnkskn, tr("List of skipped names"),
|
||||||
|
tr("These are patterns for file or directory names which "
|
||||||
|
"should not be indexed. "));
|
||||||
|
vboxLayout->addWidget(eskn);
|
||||||
|
|
||||||
|
list<string> args;
|
||||||
|
args.push_back("-l");
|
||||||
|
ExecCmd ex;
|
||||||
|
string icout;
|
||||||
|
string cmd = "iconv";
|
||||||
|
int status = ex.doexec(cmd, args, 0, &icout);
|
||||||
|
if (status) {
|
||||||
|
LOGERR(("Can't get list of charsets from 'iconv -l'"));
|
||||||
|
}
|
||||||
|
icout = neutchars(icout, ",");
|
||||||
|
list<string> ccsets;
|
||||||
|
stringToStrings(icout, ccsets);
|
||||||
|
QStringList charsets;
|
||||||
|
charsets.push_back("");
|
||||||
|
for (list<string>::const_iterator it = ccsets.begin();
|
||||||
|
it != ccsets.end(); it++) {
|
||||||
|
charsets.push_back(QString::fromUtf8(it->c_str()));
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfLink lnk21(new ConfLinkRclRep(config, "defaultcharset"));
|
||||||
|
ConfParamCStrW *e21 = new
|
||||||
|
ConfParamCStrW(this, lnk21, tr("Default character set"),
|
||||||
|
tr("This is the character set used for reading files "
|
||||||
|
"which do not identify the character set "
|
||||||
|
"internally, for example pure text files.<br>"
|
||||||
|
"The default value is empty, "
|
||||||
|
"and the value from the NLS environnement is used."
|
||||||
|
), charsets);
|
||||||
|
vboxLayout->addWidget(e21);
|
||||||
|
|
||||||
|
|
||||||
|
ConfLink lnk3(new ConfLinkRclRep(config, "followLinks"));
|
||||||
|
ConfParamBoolW *e3 = new
|
||||||
|
ConfParamBoolW(this, lnk3, tr("Follow symbolic links"),
|
||||||
|
tr("Follow symbolic links while "
|
||||||
|
"indexing. The default is no, "
|
||||||
|
"to avoid duplicate indexing"));
|
||||||
|
vboxLayout->addWidget(e3);
|
||||||
|
|
||||||
|
ConfLink lnkafln(new ConfLinkRclRep(config, "indexallfilenames"));
|
||||||
|
ConfParamBoolW *eafln = new
|
||||||
|
ConfParamBoolW(this, lnkafln, tr("Index all file names"),
|
||||||
|
tr("Index the names of files for which the contents "
|
||||||
|
"cannot be identified or processed (no or "
|
||||||
|
"unsupported mime type). Default true"));
|
||||||
|
vboxLayout->addWidget(eafln);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // Namespace confgui
|
||||||
23
src/qtgui/confgui/confguiindex.h
Normal file
23
src/qtgui/confgui/confguiindex.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef _confguiindex_h_included_
|
||||||
|
#define _confguiindex_h_included_
|
||||||
|
/* @(#$Id: confguiindex.h,v 1.1 2007-09-27 15:47:25 dockes Exp $ (C) 2007 J.F.Dockes */
|
||||||
|
|
||||||
|
#include <qwidget.h>
|
||||||
|
|
||||||
|
class RclConfig;
|
||||||
|
|
||||||
|
namespace confgui {
|
||||||
|
// A panel with the top-level parameters (can't change in subdirs)
|
||||||
|
class ConfTopPanelW : public QWidget {
|
||||||
|
public:
|
||||||
|
ConfTopPanelW(QWidget *parent, RclConfig *config);
|
||||||
|
};
|
||||||
|
|
||||||
|
// A panel for the parameters that can be changed in subdirectories
|
||||||
|
class ConfSubPanelW : public QWidget {
|
||||||
|
public:
|
||||||
|
ConfSubPanelW(QWidget *parent, RclConfig *config);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _confguiindex_h_included_ */
|
||||||
48
src/qtgui/confgui/conflinkrcl.h
Normal file
48
src/qtgui/confgui/conflinkrcl.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#ifndef _CONFLINKRCL_H_INCLUDED_
|
||||||
|
#define _CONFLINKRCL_H_INCLUDED_
|
||||||
|
/* @(#$Id: conflinkrcl.h,v 1.1 2007-09-27 15:47:25 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||||
|
|
||||||
|
#include "confgui.h"
|
||||||
|
#include "rclconfig.h"
|
||||||
|
#include "debuglog.h"
|
||||||
|
|
||||||
|
namespace confgui {
|
||||||
|
|
||||||
|
class ConfLinkRclRep : public ConfLinkRep {
|
||||||
|
public:
|
||||||
|
ConfLinkRclRep(RclConfig *conf, const string& nm,
|
||||||
|
const string& sk = "")
|
||||||
|
: m_conf(conf), m_nm(nm), m_sk(sk)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
virtual ~ConfLinkRclRep() {}
|
||||||
|
|
||||||
|
virtual bool set(const string& val)
|
||||||
|
{
|
||||||
|
if (!m_conf)
|
||||||
|
return false;
|
||||||
|
LOGDEB(("Setting [%s] value to [%s]\n",
|
||||||
|
m_nm.c_str(), val.c_str()));
|
||||||
|
bool ret = m_conf->setConfParam(m_nm, val);
|
||||||
|
if (!ret)
|
||||||
|
LOGERR(("Value set failed\n"));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
virtual bool get(string& val)
|
||||||
|
{
|
||||||
|
if (!m_conf)
|
||||||
|
return false;
|
||||||
|
bool ret = m_conf->getConfParam(m_nm, val);
|
||||||
|
LOGDEB(("Got [%s] for [%s]\n",
|
||||||
|
ret ? val.c_str() : "no value", m_nm.c_str()));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
RclConfig *m_conf;
|
||||||
|
const string m_nm;
|
||||||
|
const string m_sk;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // Namespace confgui
|
||||||
|
|
||||||
|
#endif /* _CONFLINKRCL_H_INCLUDED_ */
|
||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: main.cpp,v 1.1 2007-09-26 12:16:48 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: main.cpp,v 1.2 2007-09-27 15:47:25 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
|
||||||
@ -21,8 +21,9 @@ static char rcsid[] = "@(#$Id: main.cpp,v 1.1 2007-09-26 12:16:48 dockes Exp $ (
|
|||||||
#include "autoconfig.h"
|
#include "autoconfig.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
using std::string;
|
using namespace std;
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
@ -33,10 +34,14 @@ using std::string;
|
|||||||
#include <qthread.h>
|
#include <qthread.h>
|
||||||
#include <qtimer.h>
|
#include <qtimer.h>
|
||||||
#include <qlayout.h>
|
#include <qlayout.h>
|
||||||
|
#include <qframe.h>
|
||||||
|
|
||||||
#include "pathut.h"
|
#include "pathut.h"
|
||||||
#include "confgui.h"
|
#include "confguiindex.h"
|
||||||
#include "debuglog.h"
|
#include "debuglog.h"
|
||||||
|
#include "rclconfig.h"
|
||||||
|
#include "execmd.h"
|
||||||
|
#include "conflinkrcl.h"
|
||||||
|
|
||||||
using namespace confgui;
|
using namespace confgui;
|
||||||
|
|
||||||
@ -62,7 +67,7 @@ Usage(void)
|
|||||||
exit((op_flags & OPT_h)==0);
|
exit((op_flags & OPT_h)==0);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ConfLinkNull : public ConfLink {
|
class ConfLinkNullRep : public ConfLinkRep {
|
||||||
public:
|
public:
|
||||||
virtual bool set(const string& val)
|
virtual bool set(const string& val)
|
||||||
{
|
{
|
||||||
@ -72,12 +77,17 @@ class ConfLinkNull : public ConfLink {
|
|||||||
virtual bool get(string& val) {val = ""; return true;}
|
virtual bool get(string& val) {val = ""; return true;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static RclConfig *config;
|
||||||
|
RclConfig *RclConfig::getMainConfig()
|
||||||
|
{
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
// fprintf(stderr, "Application created\n");
|
// fprintf(stderr, "Application created\n");
|
||||||
string a_config;
|
|
||||||
thisprog = argv[0];
|
thisprog = argv[0];
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
|
|
||||||
@ -96,6 +106,15 @@ int main(int argc, char **argv)
|
|||||||
DebugLog::getdbl()->setloglevel(DEBDEB1);
|
DebugLog::getdbl()->setloglevel(DEBDEB1);
|
||||||
DebugLog::setfilename("stderr");
|
DebugLog::setfilename("stderr");
|
||||||
|
|
||||||
|
string a_config = "tstconfdir";
|
||||||
|
config = new RclConfig(&a_config);
|
||||||
|
if (config == 0 || !config->ok()) {
|
||||||
|
cerr << "Cant read configuration in: " << a_config << endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
cerr << "Working with configuration file in: " << config->getConfDir()
|
||||||
|
<< endl;
|
||||||
|
|
||||||
// Translation file for Qt
|
// Translation file for Qt
|
||||||
QTranslator qt( 0 );
|
QTranslator qt( 0 );
|
||||||
qt.load( QString( "qt_" ) + QTextCodec::locale(), "." );
|
qt.load( QString( "qt_" ) + QTextCodec::locale(), "." );
|
||||||
@ -113,59 +132,19 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
QWidget w;
|
QWidget w;
|
||||||
ConfLinkNull lnk;
|
|
||||||
|
|
||||||
QVBoxLayout *vboxLayout = new QVBoxLayout(&w);
|
QVBoxLayout *vboxLayout = new QVBoxLayout(&w);
|
||||||
vboxLayout->setSpacing(6);
|
vboxLayout->setSpacing(6);
|
||||||
vboxLayout->setMargin(11);
|
vboxLayout->setMargin(11);
|
||||||
|
|
||||||
ConfParamIntW *e1 = new ConfParamIntW(&w, lnk, "The text for the label",
|
vboxLayout->addWidget(new ConfTopPanelW(&w, config));
|
||||||
"The text for the tooltip");
|
|
||||||
vboxLayout->addWidget(e1);
|
|
||||||
|
|
||||||
ConfParamStrW *e2 = new ConfParamStrW(&w, lnk,
|
QFrame *line2 = new QFrame(&w);
|
||||||
"The text for the string label",
|
line2->setFrameShape(QFrame::HLine);
|
||||||
"The text for the string tooltip");
|
line2->setFrameShadow(QFrame::Sunken);
|
||||||
vboxLayout->addWidget(e2);
|
vboxLayout->addWidget(line2);
|
||||||
|
|
||||||
QStringList valuelist;
|
vboxLayout->addWidget(new ConfSubPanelW(&w, config));
|
||||||
valuelist.push_back("aone");
|
|
||||||
valuelist.push_back("btwo");
|
|
||||||
valuelist.push_back("cthree");
|
|
||||||
valuelist.push_back("dfour");
|
|
||||||
|
|
||||||
ConfParamCStrW *e21 = new ConfParamCStrW(&w, lnk,
|
|
||||||
"The text for the string label",
|
|
||||||
"The text for the string tooltip",
|
|
||||||
valuelist);
|
|
||||||
vboxLayout->addWidget(e21);
|
|
||||||
|
|
||||||
|
|
||||||
ConfParamBoolW *e3 = new ConfParamBoolW(&w, lnk,
|
|
||||||
"The text for the Bool label",
|
|
||||||
"The text for the Bool tooltip");
|
|
||||||
vboxLayout->addWidget(e3);
|
|
||||||
|
|
||||||
ConfParamFNW *e4 = new ConfParamFNW(&w, lnk,
|
|
||||||
"The text for the File Name label",
|
|
||||||
"The text for the File Name tooltip");
|
|
||||||
vboxLayout->addWidget(e4);
|
|
||||||
|
|
||||||
ConfParamSLW *e5 = new ConfParamSLW(&w, lnk,
|
|
||||||
"The text for the String List label",
|
|
||||||
"The text for the String List tooltip");
|
|
||||||
vboxLayout->addWidget(e5);
|
|
||||||
|
|
||||||
ConfParamFNLW *e6 = new ConfParamFNLW(&w, lnk,
|
|
||||||
"The text for the File List label",
|
|
||||||
"The text for the File List tooltip");
|
|
||||||
vboxLayout->addWidget(e6);
|
|
||||||
|
|
||||||
ConfParamCSLW *e7 = new ConfParamCSLW(&w, lnk,
|
|
||||||
"The text for the File List label",
|
|
||||||
"The text for the File List tooltip",
|
|
||||||
valuelist);
|
|
||||||
vboxLayout->addWidget(e7);
|
|
||||||
|
|
||||||
QSize size(0, 0);
|
QSize size(0, 0);
|
||||||
size = size.expandedTo(w.minimumSizeHint());
|
size = size.expandedTo(w.minimumSizeHint());
|
||||||
|
|||||||
@ -5,7 +5,7 @@ CONFIG += qt warn_on thread release debug
|
|||||||
|
|
||||||
HEADERS += confgui.h
|
HEADERS += confgui.h
|
||||||
|
|
||||||
SOURCES += main.cpp confgui.cpp
|
SOURCES += main.cpp confgui.cpp confguiindex.cpp
|
||||||
|
|
||||||
#FORMS =
|
#FORMS =
|
||||||
|
|
||||||
@ -15,9 +15,9 @@ unix {
|
|||||||
OBJECTS_DIR = .obj
|
OBJECTS_DIR = .obj
|
||||||
|
|
||||||
DEFINES += RECOLL_DATADIR=\"/usr/local/share/recoll\"
|
DEFINES += RECOLL_DATADIR=\"/usr/local/share/recoll\"
|
||||||
LIBS += ../../lib/librcl.a -lz
|
LIBS += ../../lib/librcl.a -lxapian -liconv -lz
|
||||||
|
|
||||||
INCLUDEPATH += ../../common ../../utils
|
INCLUDEPATH += ../../common ../../utils ../../rcldb
|
||||||
#../index ../internfile ../query ../unac \
|
#../index ../internfile ../query ../unac \
|
||||||
# ../aspell ../rcldb
|
# ../aspell ../rcldb
|
||||||
POST_TARGETDEPS = ../../lib/librcl.a
|
POST_TARGETDEPS = ../../lib/librcl.a
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user