summaryrefslogtreecommitdiffstats
path: root/kbabel/kbabeldict/modules/dbsearchengine2/preferenceswidget.cpp
blob: 7634a799d941e3c32946b5652d6c7d16460e217d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include <qradiobutton.h>
#include <qslider.h>
#include <qspinbox.h>  
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <klocale.h>
#include <kfiledialog.h>
#include <kurlrequester.h>
#include <qtoolbutton.h>
#include <klineedit.h>
#include <kstandarddirs.h>
#include <knuminput.h>

#include "dbse2.h"
#include "preferenceswidget.h"

KDB2PreferencesWidget::KDB2PreferencesWidget(QWidget *parent, const char* name)
		: PrefWidget(parent,name) 
{
	QVBoxLayout *layout = new QVBoxLayout(this);
//	QLabel *label = new QLabel(i18n("Settings for KDE Database Search Engine"),this);
//	layout->addWidget(label);

	dbpw = new DBSearchEnginePrefWidget(this);
	dbpw->dbDirectory->setMode(KFile::Directory | KFile::LocalOnly);
	dbpw->show();	
	layout->addWidget(dbpw);
	setMinimumSize(300,300);

	standard();

//    connect(dbpw->browseTB_3,SIGNAL(clicked()),SLOT(browse1()));

    emit restoreNow();   //Fill with actual params.			

}

KDB2PreferencesWidget::~KDB2PreferencesWidget()
{
}

void KDB2PreferencesWidget::apply()
{
emit applyNow();
}

void KDB2PreferencesWidget::cancel()
{
emit restoreNow();
}

void KDB2PreferencesWidget::standard()
{
QString defaultDir;
 KStandardDirs * dirs = KGlobal::dirs();
 if(dirs)
 {
     defaultDir = dirs->saveLocation("data");
     if(defaultDir.right(1)!="/")
         defaultDir+="/";
     defaultDir += "kbabeldict/dbsearchengine2";
 }
dbpw->dbDirectory->setURL(defaultDir);

dbpw->autoUpdate->setChecked(true);

dbpw->useSentence->setChecked(true);
dbpw->useGlossary->setChecked(true);
dbpw->useExact->setChecked(true);
dbpw->useDivide->setChecked(true);
dbpw->useAlpha->setChecked(true);
dbpw->useWordByWord->setChecked(true);
dbpw->useDynamic->setChecked(true);
dbpw->scoreDivide->setValue(90);
dbpw->scoreExact->setValue(100);
dbpw->scoreSentence->setValue(90);
dbpw->scoreWordByWord->setValue(70);
dbpw->scoreGlossary->setValue(98);
dbpw->scoreAlpha->setValue(98);
dbpw->scoreDynamic->setValue(80);

dbpw->numberOfResult->setValue(5);
dbpw->minScore->setValue(60);

dbpw->firstCapital->setChecked(true);
dbpw->allCapital->setChecked(false);
dbpw->accelerator->setChecked(true);
dbpw->sameLetter->setChecked(true);
dbpw->checkLang->setChecked(true);
dbpw->useFilters->setChecked(false);
dbpw->dateToday->setChecked(false);
/*
 */
 //dbpw->dirInput->setURL(defaultDir); 
}

#include "preferenceswidget.moc"