blob: f609bf5f1c8e400c4d902441c75707be7095fef5 (
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** TQt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
#include "config.h"
#include "klamav.h"
#include <tdeapplication.h>
#include <tdelocale.h>
#include <tqpushbutton.h>
#include <tqpixmap.h>
#include <stdlib.h>
#include <kstandarddirs.h>
#include <kurl.h>
TQString databasepath;
TQString quarantinepath;
void
FirstRunWizard::init()
{
// remove unwanted buttons
cancelButton()->hide();
helpButton()->hide();
backButton()->hide();
TQString homepath = getenv("HOME");
databasepath = homepath + "/.klamav/database";
DatabaseLocation->setURL(databasepath);
quarantinepath = homepath + "/.klamav/quarantine";
QuarantineLocation->setURL(quarantinepath);
setFinishEnabled ( WizardPage, true );
}
// void
// FirstRunWizard::destroy()
// {
//
//
// TDEConfig* config = klamav->TDEGlobal::config();
// config->setGroup("Freshklam");
//
// //Configure Database Path
// TQStringList lastDownloadPaths;
// if (DatabaseLocation->url() != "")
// lastDownloadPaths.prepend( TQString("%1").arg(DatabaseLocation->url()));
// else
// lastDownloadPaths.prepend( TQString("%1").arg(databasepath));
// config->writeEntry("lastDownloadPaths", lastDownloadPaths);
// config->sync();
//
// //Configure Quarantine Path
// TQStringList lastQuarLocations;
//
// config->setGroup("Kuarantine");
//
// if (QuarantineLocation->url() != "")
// lastQuarLocations.prepend( TQString("%1").arg(QuarantineLocation->url()));
// else
// lastQuarLocations.prepend( TQString("%1").arg(quarantinepath));
// config->writeEntry("KuarantineLocations", lastQuarLocations);
// config->sync();
//
// //Download an updated database?
// if (CheckForDatabaseUpdates->isChecked())
// tdemain->firstDownload = true;
// }
KURL
FirstRunWizard::databasePath( ) //virtual
{
return DatabaseLocation->url();
}
KURL
FirstRunWizard::quarantinePath( ) //virtual
{
return QuarantineLocation->url();
}
TQString
FirstRunWizard::defaultDatabasePath( ) //virtual
{
return databasepath;
}
TQString
FirstRunWizard::defaultQuarantinePath( ) //virtual
{
return quarantinepath;
}
bool
FirstRunWizard::downloadDatabase( ) //virtual
{
if (CheckForDatabaseUpdates->isChecked())
return true;
return false;
}
|