From c601b5a27f74b16158adafe429faefbe573e64a2 Mon Sep 17 00:00:00 2001 From: Szymon Tomasz Stefanek Date: Sat, 1 Jan 2011 20:19:56 +0000 Subject: The big rename for modules. Still some details remaining. git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5284 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/about/AboutDialog.cpp | 246 ++++++++++++++++++++++++++++++++++++++ src/modules/about/AboutDialog.h | 41 +++++++ src/modules/about/CMakeLists.txt | 4 +- src/modules/about/aboutdialog.cpp | 246 -------------------------------------- src/modules/about/aboutdialog.h | 41 ------- src/modules/about/libkviabout.cpp | 6 +- 6 files changed, 292 insertions(+), 292 deletions(-) create mode 100644 src/modules/about/AboutDialog.cpp create mode 100644 src/modules/about/AboutDialog.h delete mode 100644 src/modules/about/aboutdialog.cpp delete mode 100644 src/modules/about/aboutdialog.h (limited to 'src/modules/about') diff --git a/src/modules/about/AboutDialog.cpp b/src/modules/about/AboutDialog.cpp new file mode 100644 index 000000000..081ebecca --- /dev/null +++ b/src/modules/about/AboutDialog.cpp @@ -0,0 +1,246 @@ +//============================================================================= +// +// 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) 2002 Szymon Stefanek (pragma at kvirc dot net) +// Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org) +// +// 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 "KviLocale.h" +#include "KviApplication.h" +#include "KviFileUtils.h" +#include "kvi_sourcesdate.h" +#include "KviBuildInfo.h" +#include "KviOsInfo.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +extern AboutDialog * g_pAboutDialog; +/* +"KVIrc public releases :
\n" \ +"
\n" \ +"0.9.0
\n" \ +"Release date: 25.01.1999
\n" \ +"
\n" \ +"1.0.0 'Millennium'
\n" \ +"\"The net in your hands\"
\n" \ +"Release date: 21.12.1999
\n" \ +"
\n" \ +"2.0.0 'Phoenix'
\n" \ +"\"The client that can't make coffee\"
\n" \ +"Release date: 30.05.2000
\n" \ +"
\n" \ +"2.1.0 'Dark Star'
\n" \ +"\"The client that can't make coffee\"
\n" \ +"Release date: 30.01.2001
\n" \ +"
\n" \ +"2.1.1 'Monolith'
\n" \ +"\"A breath of fresh net\"
\n" \ +"Release date: 01.05.2001
\n" \ +"
3.0.0-xmas build: 24-12-2001\n" \ +"3.0.0-beta1: 24-06-2002\n " +"3.0.0 'Avatar'
\n" \ +"\"No slogan yet\"
\n" \ +"Release date: Still unknown
\n" \ +*/ + +#include "abouttext.inc" + +AboutDialog::AboutDialog() +: KviTalTabDialog(0) +{ + setWindowTitle(__tr2qs_ctx("About KVIrc...","about")); + setOkButton(__tr2qs_ctx("Close","about")); + + // About tab + QString buffer; + g_pApp->findImage(buffer,"kvi_splash.png"); + + QPixmap pix(buffer); + + QWidget * w = new QWidget(this); + QGridLayout * g = new QGridLayout(w); + + QLabel * l = new QLabel(w); + l->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + QPalette p = l->palette(); + p.setColor(backgroundRole(), Qt::black); + l->setPalette(p); + l->setAlignment(Qt::AlignCenter); + l->setPixmap(pix); + + g->addWidget(l,0,0); + + QString aboutString= "KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'
"; + aboutString += __tr2qs_ctx("Forged by the KVIrc Development Team","about"); + + l = new QLabel(aboutString,w); + l->setAlignment(Qt::AlignCenter); + g->addWidget(l,1,0); + + addTab(w,__tr2qs_ctx("About","about")); + + + // Info tab + w = new QWidget(this); + g = new QGridLayout(w); + + QTextEdit * v = new QTextEdit(w); + v->setReadOnly(true); + g->addWidget(v,0,0); + + // Get info + QString infoString = "KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'

"; + infoString += ""; + infoString += __tr2qs_ctx("Runtime Info","about"); + infoString += ":
"; + infoString += __tr2qs_ctx("System Name","about"); + infoString += ": "; + infoString += KviOsInfo::name(); +#ifndef COMPILE_ON_MAC + infoString += " "; + infoString += KviOsInfo::release(); +#endif + infoString += "
"; + infoString += __tr2qs_ctx("System Version","about"); + infoString += ": "; + infoString += KviOsInfo::version(); + infoString += "
"; + infoString += __tr2qs_ctx("Architecture","about"); + infoString += ": "; + infoString += KviOsInfo::machine(); + infoString += "

"; + infoString += ""; + infoString += __tr2qs_ctx("Build Info","about"); + infoString += ":
"; + infoString += __tr2qs_ctx("Build Date","about"); + infoString += ": "; + infoString += KviBuildInfo::buildDate(); + infoString += "
"; + infoString += __tr2qs_ctx("Sources Date","about"); + infoString += ": "; + infoString += KviBuildInfo::buildSourcesDate(); + infoString += "
"; + infoString += __tr2qs_ctx("Revision Number","about"); + infoString += ": "; + infoString += KviBuildInfo::buildRevision(); + infoString += "
"; + infoString += __tr2qs_ctx("System Name","about"); + infoString += ": "; + infoString += KviBuildInfo::buildSystem(); + infoString += "
"; + infoString += __tr2qs_ctx("CPU Name","about"); + infoString += ": "; + infoString += KviBuildInfo::buildCPU(); + infoString += "
"; + infoString += __tr2qs_ctx("Build Command","about"); + infoString += ": "; + infoString += KviBuildInfo::buildCommand(); + infoString += "
"; + infoString += __tr2qs_ctx("Build Flags","about"); + infoString += ":
   "; + QString flags = KviBuildInfo::buildFlags(); + infoString += flags.replace(QRegExp(";"),"
   "); + infoString += "
"; + infoString += __tr2qs_ctx("Compiler Name","about"); + infoString += ": "; + infoString += KviBuildInfo::buildCompiler(); + infoString += "
"; + infoString += __tr2qs_ctx("Compiler Flags","about"); + infoString += ": "; + infoString += KviBuildInfo::buildCompilerFlags(); + + v->setText(infoString); + + addTab(w,__tr2qs_ctx("Executable Information","about")); + + + // Honor & Glory tab + w = new QWidget(this); + g = new QGridLayout(w); + + v = new QTextEdit(w); + v->setReadOnly(true); + g->addWidget(v,0,0); + + v->setText(g_szAboutText); + + addTab(w,__tr2qs_ctx("Honor && Glory","about")); + + + // License tab + w = new QWidget(this); + g = new QGridLayout(w); + + v = new QTextEdit(w); + v->setReadOnly(true); + v->setWordWrapMode(QTextOption::NoWrap); + g->addWidget(v,0,0); + + QString szLicense; + + QString szLicensePath; + g_pApp->getGlobalKvircDirectory(szLicensePath,KviApplication::License,"COPYING"); + + 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 ","about"); + } + + v->setText(szLicense); + + addTab(w,__tr2qs_ctx("License","about")); + + + connect(this,SIGNAL(applyButtonPressed()),this,SLOT(closeButtonPressed())); +} + +AboutDialog::~AboutDialog() +{ + g_pAboutDialog = 0; +} + +void AboutDialog::closeEvent(QCloseEvent *e) +{ + e->ignore(); + delete this; +} + +void AboutDialog::closeButtonPressed() +{ + delete this; +} + +#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES +#include "AboutDialog.moc" +#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES + diff --git a/src/modules/about/AboutDialog.h b/src/modules/about/AboutDialog.h new file mode 100644 index 000000000..ab0ea628b --- /dev/null +++ b/src/modules/about/AboutDialog.h @@ -0,0 +1,41 @@ +#ifndef _ABOUTDIALOG_H_ +#define _ABOUTDIALOG_H_ +//============================================================================= +// +// File : AboutDialog.h +// Creation date : Sun Jun 23 17:59:13 2002 GMT by Szymon Stefanek +// +// This file is part of the KVIrc irc client distribution +// Copyright (C) 2001-2010 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 "KviTalTabDialog.h" + +class AboutDialog : public KviTalTabDialog +{ + Q_OBJECT +public: + AboutDialog(); + ~AboutDialog(); +protected: + virtual void closeEvent(QCloseEvent *e); +protected slots: + void closeButtonPressed(); +}; + +#endif //_ABOUTDIALOG_H_ diff --git a/src/modules/about/CMakeLists.txt b/src/modules/about/CMakeLists.txt index 700ba497d..752adbf40 100644 --- a/src/modules/about/CMakeLists.txt +++ b/src/modules/about/CMakeLists.txt @@ -1,10 +1,10 @@ # CMakeLists for src/modules/about SET(kviabout_MOC_HDRS - aboutdialog.h + AboutDialog.h ) SET(kviabout_SRCS - aboutdialog.cpp + AboutDialog.cpp libkviabout.cpp ) diff --git a/src/modules/about/aboutdialog.cpp b/src/modules/about/aboutdialog.cpp deleted file mode 100644 index 3e3d7d9a9..000000000 --- a/src/modules/about/aboutdialog.cpp +++ /dev/null @@ -1,246 +0,0 @@ -//============================================================================= -// -// 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) 2002 Szymon Stefanek (pragma at kvirc dot net) -// Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org) -// -// 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 "KviLocale.h" -#include "KviApplication.h" -#include "KviFileUtils.h" -#include "kvi_sourcesdate.h" -#include "KviBuildInfo.h" -#include "KviOsInfo.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -extern KviAboutDialog * g_pAboutDialog; -/* -"KVIrc public releases :
\n" \ -"
\n" \ -"0.9.0
\n" \ -"Release date: 25.01.1999
\n" \ -"
\n" \ -"1.0.0 'Millennium'
\n" \ -"\"The net in your hands\"
\n" \ -"Release date: 21.12.1999
\n" \ -"
\n" \ -"2.0.0 'Phoenix'
\n" \ -"\"The client that can't make coffee\"
\n" \ -"Release date: 30.05.2000
\n" \ -"
\n" \ -"2.1.0 'Dark Star'
\n" \ -"\"The client that can't make coffee\"
\n" \ -"Release date: 30.01.2001
\n" \ -"
\n" \ -"2.1.1 'Monolith'
\n" \ -"\"A breath of fresh net\"
\n" \ -"Release date: 01.05.2001
\n" \ -"
3.0.0-xmas build: 24-12-2001\n" \ -"3.0.0-beta1: 24-06-2002\n " -"3.0.0 'Avatar'
\n" \ -"\"No slogan yet\"
\n" \ -"Release date: Still unknown
\n" \ -*/ - -#include "abouttext.inc" - -KviAboutDialog::KviAboutDialog() -: KviTalTabDialog(0) -{ - setWindowTitle(__tr2qs_ctx("About KVIrc...","about")); - setOkButton(__tr2qs_ctx("Close","about")); - - // About tab - QString buffer; - g_pApp->findImage(buffer,"kvi_splash.png"); - - QPixmap pix(buffer); - - QWidget * w = new QWidget(this); - QGridLayout * g = new QGridLayout(w); - - QLabel * l = new QLabel(w); - l->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); - QPalette p = l->palette(); - p.setColor(backgroundRole(), Qt::black); - l->setPalette(p); - l->setAlignment(Qt::AlignCenter); - l->setPixmap(pix); - - g->addWidget(l,0,0); - - QString aboutString= "KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'
"; - aboutString += __tr2qs_ctx("Forged by the KVIrc Development Team","about"); - - l = new QLabel(aboutString,w); - l->setAlignment(Qt::AlignCenter); - g->addWidget(l,1,0); - - addTab(w,__tr2qs_ctx("About","about")); - - - // Info tab - w = new QWidget(this); - g = new QGridLayout(w); - - QTextEdit * v = new QTextEdit(w); - v->setReadOnly(true); - g->addWidget(v,0,0); - - // Get info - QString infoString = "KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'

"; - infoString += ""; - infoString += __tr2qs_ctx("Runtime Info","about"); - infoString += ":
"; - infoString += __tr2qs_ctx("System Name","about"); - infoString += ": "; - infoString += KviOsInfo::name(); -#ifndef COMPILE_ON_MAC - infoString += " "; - infoString += KviOsInfo::release(); -#endif - infoString += "
"; - infoString += __tr2qs_ctx("System Version","about"); - infoString += ": "; - infoString += KviOsInfo::version(); - infoString += "
"; - infoString += __tr2qs_ctx("Architecture","about"); - infoString += ": "; - infoString += KviOsInfo::machine(); - infoString += "

"; - infoString += ""; - infoString += __tr2qs_ctx("Build Info","about"); - infoString += ":
"; - infoString += __tr2qs_ctx("Build Date","about"); - infoString += ": "; - infoString += KviBuildInfo::buildDate(); - infoString += "
"; - infoString += __tr2qs_ctx("Sources Date","about"); - infoString += ": "; - infoString += KviBuildInfo::buildSourcesDate(); - infoString += "
"; - infoString += __tr2qs_ctx("Revision Number","about"); - infoString += ": "; - infoString += KviBuildInfo::buildRevision(); - infoString += "
"; - infoString += __tr2qs_ctx("System Name","about"); - infoString += ": "; - infoString += KviBuildInfo::buildSystem(); - infoString += "
"; - infoString += __tr2qs_ctx("CPU Name","about"); - infoString += ": "; - infoString += KviBuildInfo::buildCPU(); - infoString += "
"; - infoString += __tr2qs_ctx("Build Command","about"); - infoString += ": "; - infoString += KviBuildInfo::buildCommand(); - infoString += "
"; - infoString += __tr2qs_ctx("Build Flags","about"); - infoString += ":
   "; - QString flags = KviBuildInfo::buildFlags(); - infoString += flags.replace(QRegExp(";"),"
   "); - infoString += "
"; - infoString += __tr2qs_ctx("Compiler Name","about"); - infoString += ": "; - infoString += KviBuildInfo::buildCompiler(); - infoString += "
"; - infoString += __tr2qs_ctx("Compiler Flags","about"); - infoString += ": "; - infoString += KviBuildInfo::buildCompilerFlags(); - - v->setText(infoString); - - addTab(w,__tr2qs_ctx("Executable Information","about")); - - - // Honor & Glory tab - w = new QWidget(this); - g = new QGridLayout(w); - - v = new QTextEdit(w); - v->setReadOnly(true); - g->addWidget(v,0,0); - - v->setText(g_szAboutText); - - addTab(w,__tr2qs_ctx("Honor && Glory","about")); - - - // License tab - w = new QWidget(this); - g = new QGridLayout(w); - - v = new QTextEdit(w); - v->setReadOnly(true); - v->setWordWrapMode(QTextOption::NoWrap); - g->addWidget(v,0,0); - - QString szLicense; - - QString szLicensePath; - g_pApp->getGlobalKvircDirectory(szLicensePath,KviApplication::License,"COPYING"); - - 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 ","about"); - } - - v->setText(szLicense); - - addTab(w,__tr2qs_ctx("License","about")); - - - connect(this,SIGNAL(applyButtonPressed()),this,SLOT(closeButtonPressed())); -} - -KviAboutDialog::~KviAboutDialog() -{ - g_pAboutDialog = 0; -} - -void KviAboutDialog::closeEvent(QCloseEvent *e) -{ - e->ignore(); - delete this; -} - -void KviAboutDialog::closeButtonPressed() -{ - delete this; -} - -#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES -#include "aboutdialog.moc" -#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES - diff --git a/src/modules/about/aboutdialog.h b/src/modules/about/aboutdialog.h deleted file mode 100644 index 30cc6e730..000000000 --- a/src/modules/about/aboutdialog.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _ABOUTDIALOG_H_ -#define _ABOUTDIALOG_H_ -//============================================================================= -// -// File : aboutdialog.h -// Creation date : Sun Jun 23 17:59:13 2002 GMT by Szymon Stefanek -// -// This file is part of the KVIrc irc client distribution -// Copyright (C) 2001-2010 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 "KviTalTabDialog.h" - -class KviAboutDialog : public KviTalTabDialog -{ - Q_OBJECT -public: - KviAboutDialog(); - ~KviAboutDialog(); -protected: - virtual void closeEvent(QCloseEvent *e); -protected slots: - void closeButtonPressed(); -}; - -#endif //_ABOUTDIALOG_H_ diff --git a/src/modules/about/libkviabout.cpp b/src/modules/about/libkviabout.cpp index cae11f43a..3239afc1b 100644 --- a/src/modules/about/libkviabout.cpp +++ b/src/modules/about/libkviabout.cpp @@ -25,12 +25,12 @@ // //============================================================================= -#include "aboutdialog.h" +#include "AboutDialog.h" #include "KviModule.h" #include "KviLocale.h" -KviAboutDialog * g_pAboutDialog = 0; +AboutDialog * g_pAboutDialog = 0; /* @doc: about.kvirc @@ -52,7 +52,7 @@ static bool about_kvs_command_kvirc(KviKvsModuleCommandCall *) { if(!g_pAboutDialog) { - g_pAboutDialog = new KviAboutDialog(); + g_pAboutDialog = new AboutDialog(); g_pAboutDialog->show(); } else { g_pAboutDialog->raise(); -- cgit v1.3.1-10-gc9f91