summaryrefslogtreecommitdiffstats
path: root/src/modules/about/aboutdialog.cpp
blob: d1c5f51bac19a5c63ffe853741b7c0bdc44cd25b (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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
//=============================================================================
//
//   File : aboutdialog.cpp
//   Creation date : Sun Jun 23 17:59:12 2002 GMT by Szymon Stefanek
//
//   This file is part of the KVirc irc client distribution
//   Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)
//
//   This program is FREE software. You can redistribute it and/or
//   modify it under the terms of the GNU General Public License
//   as published by the Free Software Foundation; either version 2
//   of the License, or (at your opinion) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//=============================================================================

#include "aboutdialog.h"

#include "kvi_defaults.h"

#include "kvi_locale.h"
#include "kvi_app.h"
#include "kvi_fileutils.h"
#include "kvi_sourcesdate.h"

#include <tqwidget.h>
#include <layout.h>
#include <kvi_tal_textedit.h>
#include <tqlabel.h>
#include <tqpixmap.h>
#include <tqevent.h>

extern KviAboutDialog * g_pAboutDialog;
/*
"<font color=\"#FFFF00\"><b>KVIrc public releases :</b></font><br>\n" \
"<br>\n" \
"<font color=\"#FF0000\">0.9.0</font><br>\n" \
"<font size=\"2\" color=\"#808080\">Release date: 25.01.1999</font><br>\n" \
"<br>\n" \
"<font color=\"#FF0000\">1.0.0 'Millennium'</font><br>\n" \
"<font size=\"2\">\"The net in your hands\"</font><br>\n" \
"<font size=\"2\" color=\"#808080\">Release date: 21.12.1999</font><br>\n" \
"<br>\n" \
"<font color=\"#FF0000\">2.0.0 'Phoenix'</font><br>\n" \
"<font size=\"2\">\"The client that can't make coffee\"</font><br>\n" \
"<font size=\"2\" color=\"#808080\">Release date: 30.05.2000</font><br>\n" \
"<br>\n" \
"<font color=\"#FF0000\">2.1.0 'Dark Star'</font><br>\n" \
"<font size=\"2\">\"The client that can't make coffee\"</font><br>\n" \
"<font size=\"2\" color=\"#808080\">Release date: 30.01.2001</font><br>\n" \
"<br>\n" \
"<font color=\"#FF0000\">2.1.1 'Monolith'</font><br>\n" \
"<font size=\"2\">\"A breath of fresh net\"</font><br>\n" \
"<font size=\"2\" color=\"#808080\">Release date: 01.05.2001</font><br>\n" \
"<br> 3.0.0-xmas build: 24-12-2001\n" \
"3.0.0-beta1: 24-06-2002\n "
"<font color=\"#FF0000\">3.0.0 'Avatar'</font><br>\n" \
"<font size=\"2\">\"No slogan yet\"</font><br>\n" \
"<font size=\"2\" color=\"#808080\">Release date: Still unknown</font><br>\n" \
*/

#include "abouttext.inc"

KviAboutDialog::KviAboutDialog()
: KviTalTabDialog(0)
{
	setCaption(__tr2qs_ctx("About KVIrc...","about"));
	setOkButton(__tr2qs_ctx("Close","about"));

	KviStr buffer;
	g_pApp->findImage(buffer,"kvi_splash.png");

	TQPixmap pix(TQString(buffer.ptr()));

	TQWidget * w = new TQWidget(this);
	TQGridLayout * g = new TQGridLayout(w,2,1,4,8);

	TQLabel * l = new TQLabel(w);
	l->setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken);
	l->setBackgroundColor(TQt::black);
	l->setAlignment(TQt::AlignCenter);
	l->setPixmap(pix);

	g->addWidget(l,0,0);

	TQString aboutString= "KVIrc <b>" KVI_VERSION " '" KVI_RELEASE_NAME "'</b><br>";
	aboutString += __tr2qs_ctx("Forged by the <b>KVIrc Development Team</b>","about");
	aboutString += "<br>";
	aboutString += __tr2qs_ctx("Sources date","about");
	aboutString += ": ";
	aboutString += KVI_SOURCES_DATE;

	l = new TQLabel(aboutString,w);
	l->setAlignment(TQt::AlignCenter);
	g->addWidget(l,1,0);

	addTab(w,__tr2qs_ctx("About","about"));
	


	w = new TQWidget(this);
	g = new TQGridLayout(w,1,1,4,8);

	KviTalTextEdit * v = new KviTalTextEdit(w);
	v->setReadOnly(true);
	g->addWidget(v,0,0);

	v->setText(g_szAboutText);

	addTab(w,__tr2qs_ctx("Honor && Glory","about"));



	w = new TQWidget(this);
	g = new TQGridLayout(w,1,1,4,8);

	v = new KviTalTextEdit(w);
	v->setReadOnly(true);
	v->setWordWrap(KviTalTextEdit::NoWrap);
	g->addWidget(v,0,0);

	TQString szLicense;

	TQString szLicensePath;
	g_pApp->getGlobalKvircDirectory(szLicensePath,KviApp::License,"EULA");
	
	if(!KviFileUtils::loadFile(szLicensePath,szLicense))
	{
		szLicense = __tr2qs_ctx("Oops... Can't find the license file...\n" \
						"It MUST be included in the distribution...\n" \
						"Please report to <pragma at kvirc dot net>","about");
	}

	v->setText(szLicense);

	addTab(w,__tr2qs_ctx("License","about"));


	connect(this,TQT_SIGNAL(applyButtonPressed()),this,TQT_SLOT(closeButtonPressed()));
}

KviAboutDialog::~KviAboutDialog()
{
	g_pAboutDialog = 0;
}

void KviAboutDialog::closeEvent(TQCloseEvent *e)
{
	e->ignore();
	delete this;
}

void KviAboutDialog::closeButtonPressed()
{
	delete this;
}

#include "aboutdialog.moc"