You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdesdk/kbabel/kbabeldict/modules/dbsearchengine/preferenceswidget.cpp

112 lines
2.4 KiB

#include <tqradiobutton.h>
#include <tqslider.h>
#include <tqspinbox.h>
#include <tqcheckbox.h>
#include <tqlabel.h>
#include <tqlayout.h>
#include <klocale.h>
#include <kfiledialog.h>
#include <kurlrequester.h>
#include <tqtoolbutton.h>
#include <klineedit.h>
#include <kstandarddirs.h>
#include "dbseprefwidget.h"
#include "preferenceswidget.h"
PreferencesWidget::PreferencesWidget(TQWidget *parent, const char* name)
: PrefWidget(parent,name)
{
TQVBoxLayout *tqlayout = new TQVBoxLayout(this);
// TQLabel *label = new TQLabel(i18n("Settings for KDE database search engine"),this);
// tqlayout->addWidget(label);
dbpw = new DBSearchEnginePref(this);
dbpw->dirInput->setMode(KFile::Directory | KFile::LocalOnly);
tqlayout->addWidget(dbpw);
resize(TQSize(200,200).expandedTo(tqminimumSizeHint()));
// connect(dbpw->browseTB_3,TQT_SIGNAL(clicked()),TQT_SLOT(browse1()));
emit restoreNow(); //Fill with actual params.
}
PreferencesWidget::~PreferencesWidget()
{
}
void PreferencesWidget::apply()
{
emit applyNow();
}
void PreferencesWidget::cancel()
{
emit restoreNow();
}
void PreferencesWidget::standard()
{
dbpw->caseSensitiveCB->setChecked(false);
dbpw->normalizeCB->setChecked(true);
dbpw->removeContextCB->setChecked(true);
dbpw->oneWordSubCB->setChecked(true);
dbpw->twoWordSubCB->setChecked(false);
dbpw->RegExpRB->setChecked(false);
dbpw->normalTextRB->setChecked(true);
dbpw->equalCB->setChecked( true );
dbpw->containsCB->setChecked( true);
dbpw->containedCB->setChecked( true );
dbpw->oneWordSubSB->setValue(20);
dbpw->twoWordSubSB->setValue(8);
dbpw->maxSB->setValue(500);
dbpw->thresholdSL->setValue(50);
dbpw->thresholdOrigSL->setValue(50);
dbpw->allRB->setChecked( false);
dbpw->slistRB->setChecked( true);
dbpw->rlistRB->setChecked( false );
dbpw->nothingCB->setChecked(true);
dbpw->freqSB->setValue(300);
dbpw->ignoreLE->setText("&.:");
dbpw->autoAddCB_2->setChecked(true);
TQString defaultDir;
KStandardDirs * dirs = KGlobal::dirs();
if(dirs)
{
defaultDir = dirs->saveLocation("data");
if(defaultDir.right(1)!="/")
defaultDir+="/";
defaultDir += "kbabeldict/dbsearchengine";
}
dbpw->dirInput->setURL(defaultDir);
}
void PreferencesWidget::setName(TQString n)
{
dbpw->filenameLB->setText(i18n("Scanning file: %1").tqarg(n));
}
void PreferencesWidget::setEntries(int i)
{
dbpw->entriesLB->setText(i18n("Entries added: %1").tqarg(i));
}
#include "preferenceswidget.moc"