summaryrefslogtreecommitdiffstats
path: root/src/welcome.cpp
blob: 9b453678a6ec86de16492bc026f3c612d3019f18 (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
/*
 * Copyright (C) 2004 Robert Hogan <robert at roberthogan dot net>
 */

#include "welcome.h"
#include "version.h"

#include <tdelocale.h>

#include <kstandarddirs.h>

#include <tqlayout.h>
#include <tdehtml_part.h>
#include <tqfile.h>

Aboutklamav::Aboutklamav(TQWidget *parent, const char *name)
    : TQWidget(parent, name)
{
	TQVBoxLayout *vbox = new TQVBoxLayout(this, KDialog::marginHint(),
			KDialog::spacingHint(), "vbox");

	TQWidget* privateLayoutWidget = new TQWidget( this, "dblayout" );
	vbox->addWidget(privateLayoutWidget);

	TQGridLayout* dblayout = new TQGridLayout( privateLayoutWidget, 1, 1, 2, 2, "dblayout"); 
	dblayout->setColStretch(1, 1);

	htmlpart = new TDEHTMLPart(privateLayoutWidget);
	dblayout->addMultiCellWidget( htmlpart->widget(), 0, 1, 1, 1 );

	TQString location = locate("data", "klamav/about/aboutklamav.html");
	TQString res = loadFile(location);

	/* Stylesheets */
	res = res.arg( locate( "data", "klamav/about/klamav.css" ) );
	res = res.arg( locate( "data", "tdeui/about/kde_infopage.css" ) );
	if ( kapp->reverseLayout() )
		res = res.arg( "@import \"%1\";" ).arg( locate( "data", "tdeui/about/kde_infopage_rtl.css" ) );
	else
		res = res.arg( "" );


	res = res.arg("KlamAV")
		.arg("KlamAV")
		.arg( i18n("Version ")+TQString(KLAMAV_VERSION) )
		.arg( i18n("An anti-virus manager for the Trinity Desktop Environment") )
		.arg( i18n("KlamAV is a convenient way to manage ClamAV. KlamAV provides:") )
		.arg( i18n("Scheduled scanning") )
		.arg( i18n("Automatic virus database updates") )
		.arg( i18n("E-Mail scanning") )
		.arg( i18n("Virus information browser") )
		.arg( i18n("Quarantine management") )
		.arg( i18n("This program is a front-end for") );
	
	htmlpart->begin();
	htmlpart->write(res);
	htmlpart->end();
}


Aboutklamav::~Aboutklamav()
{
}

/* borrowed from Konqueror */
TQString Aboutklamav::loadFile( const TQString& file ) {
	TQString res;
	if( file.isEmpty() )
		return res;

	TQFile f(file);

	if( !f.open(IO_ReadOnly) )
    		return res;

	TQTextStream t(&f);
	res = t.read();

	return res;
}

#include "welcome.moc"