aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-04-23 22:37:11 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-04-23 22:37:11 +0000
commit1db778e4481eeab3e65d157240fbe963a8113f49 (patch)
tree9e5a839c1206ba4fa4398e8f14d407ad6aae3830
parentset keysize also for DSA key in key generation (before DSA key always was 102... (diff)
downloadgpg4usb-1db778e4481eeab3e65d157240fbe963a8113f49.tar.gz
gpg4usb-1db778e4481eeab3e65d157240fbe963a8113f49.zip
tabbed about dialog with translator file seperated, but of the encoding of the TRANSLATOR file still has to be taken care of
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@902 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rwxr-xr-xaboutdialog.cpp91
-rwxr-xr-xaboutdialog.h61
-rw-r--r--gpg4usb.pro2
-rw-r--r--mainwindow.cpp39
-rw-r--r--mainwindow.h1
-rw-r--r--release/TRANSLATORS11
-rwxr-xr-xsettingsdialog.h1
7 files changed, 167 insertions, 39 deletions
diff --git a/aboutdialog.cpp b/aboutdialog.cpp
new file mode 100755
index 0000000..68d79b7
--- /dev/null
+++ b/aboutdialog.cpp
@@ -0,0 +1,91 @@
+/*
+ * aboutdialog.cpp
+ *
+ * Copyright 2008 gpg4usb-team <[email protected]>
+ *
+ * This file is part of gpg4usb.
+ *
+ * Gpg4usb 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Gpg4usb 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 gpg4usb. If not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "aboutdialog.h"
+
+AboutDialog::AboutDialog(QWidget *parent)
+ : QDialog(parent)
+{
+ this->setWindowTitle(tr("About ")+ qApp->applicationName());
+
+ QTabWidget *tabWidget = new QTabWidget;
+ InfoTab *infoTab = new InfoTab;
+ TranslatorsTab *translatorsTab = new TranslatorsTab;
+
+ tabWidget->addTab(infoTab, tr("General"));
+ tabWidget->addTab(translatorsTab, tr("Translators"));
+
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
+ connect(buttonBox, SIGNAL(accepted()), this, SLOT(close()));
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(tabWidget);
+ mainLayout->addWidget(buttonBox);
+ setLayout(mainLayout);
+
+ this->exec();
+}
+
+InfoTab::InfoTab(QWidget *parent)
+ : QWidget(parent)
+{
+ QPixmap *pixmap = new QPixmap(":gpg4usb-logo.png");
+ QString *text = new QString("<center><h2>" + qApp->applicationName() + " "
+ + qApp->applicationVersion() + "</h2></center>"
+ + tr("<center>This application allows simple encryption <br>"
+ "and decryption of text messages or files.<br>"
+ "It's licensed under the GPL v3<br><br>"
+ "<b>Developer:</b><br>"
+ "Bene, Heimer, Juergen, Nils, Ubbo<br><br>"
+ "If you have any questions or suggestions have a look<br/>"
+ "at our <a href=\"http://gpg4usb.cpunk.de/contact.php\">"
+ "contact page</a> or send a mail to our<br/> mailing list at"
+ " <a href=\"mailto:[email protected]\">[email protected]</a>.") + tr("<br><br> Built with Qt ") + qVersion()
+ + tr(" and GPGME ") + GpgME::GpgContext::getGpgmeVersion() +"</center>");
+
+ QGridLayout *layout = new QGridLayout();
+ QLabel *pixmapLabel = new QLabel();
+ pixmapLabel->setPixmap(*pixmap);
+ layout->addWidget(pixmapLabel, 0, 0, 1, -1, Qt::AlignCenter);
+ QLabel *aboutLabel = new QLabel();
+ aboutLabel->setText(*text);
+ aboutLabel->setOpenExternalLinks(true);
+ layout->addWidget(aboutLabel, 1, 0, 1, -1);
+ layout->addItem(new QSpacerItem(20, 10, QSizePolicy::Minimum,
+ QSizePolicy::Fixed), 2, 1, 1, 1);
+
+ setLayout(layout);
+}
+
+TranslatorsTab::TranslatorsTab(QWidget *parent)
+ : QWidget(parent)
+{
+ QFile translatorsFile;
+ translatorsFile.setFileName(qApp->applicationDirPath()+"/TRANSLATORS");
+ translatorsFile.open(QIODevice::ReadOnly);
+ QByteArray inBuffer = translatorsFile.readAll();
+
+ QLabel *label = new QLabel(inBuffer);
+ QVBoxLayout *mainLayout = new QVBoxLayout(this);
+ mainLayout->addWidget(label);
+
+ setLayout(mainLayout);
+}
diff --git a/aboutdialog.h b/aboutdialog.h
new file mode 100755
index 0000000..daa37d6
--- /dev/null
+++ b/aboutdialog.h
@@ -0,0 +1,61 @@
+/*
+ * aboutdialog.h
+ *
+ * Copyright 2008 gpg4usb-team <[email protected]>
+ *
+ * This file is part of gpg4usb.
+ *
+ * Gpg4usb 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Gpg4usb 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 gpg4usb. If not, see <http://www.gnu.org/licenses/>
+ */
+
+#ifndef __ABOUTDIALOG_H__
+#define __ABOUTDIALOG_H__
+
+#include <QHash>
+#include <QWidget>
+#include <QtGui>
+
+#include "gpgcontext.h"
+
+QT_BEGIN_NAMESPACE
+class QVBoxLayout;
+class QLabel;
+class QTabWidget;
+QT_END_NAMESPACE
+
+class InfoTab : public QWidget
+ {
+ Q_OBJECT
+
+ public:
+ InfoTab(QWidget *parent = 0);
+ };
+
+ class TranslatorsTab : public QWidget
+ {
+ Q_OBJECT
+
+ public:
+ TranslatorsTab(QWidget *parent = 0);
+ };
+
+class AboutDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ AboutDialog(QWidget *parent = 0);
+};
+
+#endif // __ABOUTDIALOG_H__
diff --git a/gpg4usb.pro b/gpg4usb.pro
index a29a818..3b7a682 100644
--- a/gpg4usb.pro
+++ b/gpg4usb.pro
@@ -33,6 +33,7 @@ HEADERS += attachments.h \
textedit.h \
editorpage.h \
quitdialog.h \
+ aboutdialog.h \
keyserverimportdialog.h \
verifynotification.h \
verifydetailsdialog.h \
@@ -58,6 +59,7 @@ SOURCES += attachments.cpp \
textedit.cpp \
editorpage.cpp \
quitdialog.cpp \
+ aboutdialog.cpp \
keyserverimportdialog.cpp \
verifynotification.cpp \
verifydetailsdialog.cpp \
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 9f78a08..41db36f 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -626,44 +626,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
void MainWindow::about()
{
- QPixmap *pixmap = new QPixmap(":gpg4usb-logo.png");
- QString *title = new QString(tr("About ") + qApp->applicationName());
- QString *text = new QString("<center><h2>" + qApp->applicationName() + " "
- + qApp->applicationVersion() + "</h2></center>"
- + tr("<center>This application allows simple encryption <br>"
- "and decryption of text messages or files.<br>"
- "It's licensed under the GPL v3<br><br>"
- "<b>Developer:</b><br>"
- "Bene, Heimer, Juergen, Nils, Ubbo<br><br>"
- "<b>Translation:</b><br>"
- "%1<br><br>"
- "If you have any questions or suggestions have a look<br/>"
- "at our <a href=\"http://gpg4usb.cpunk.de/contact.php\">"
- "contact page</a> or send a mail to our<br/> mailing list at"
- " <a href=\"mailto:[email protected]\">[email protected]</a>.").arg("Viriato/Phol (es), <br>Serse (it), Russell (my),<br>Alessandro (pt_br), Kirill (ru), Tom (vi)")
- + tr("<br><br> Built with Qt ") + qVersion()
- + tr(" and GPGME ") + GpgME::GpgContext::getGpgmeVersion() +"</center>");
-
- QDialog *dialog = new QDialog(this);
- dialog->setWindowTitle(*title);
- QPushButton *closeButton = new QPushButton(tr("&Close"));
- connect(closeButton, SIGNAL(clicked()), dialog, SLOT(close()));
-
- QGridLayout *layout = new QGridLayout(dialog);
- QLabel *pixmapLabel = new QLabel();
- pixmapLabel->setPixmap(*pixmap);
- layout->addWidget(pixmapLabel, 0, 0, 1, -1, Qt::AlignCenter);
- QLabel *aboutLabel = new QLabel();
- aboutLabel->setText(*text);
- aboutLabel->setOpenExternalLinks(true);
- layout->addWidget(aboutLabel, 1, 0, 1, -1);
- layout->addItem(new QSpacerItem(20, 10, QSizePolicy::Minimum,
- QSizePolicy::Fixed), 2, 1, 1, 1);
- layout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding), 3, 0, 1, 1);
- layout->addWidget(closeButton, 3, 1, 1, 1);
- layout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding), 3, 2, 1, 1);
-
- dialog->exec();
+ new AboutDialog(this);
}
void MainWindow::openTranslate()
diff --git a/mainwindow.h b/mainwindow.h
index 45c6fe3..4873c0f 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -28,6 +28,7 @@
#include "textedit.h"
#include "fileencryptiondialog.h"
#include "settingsdialog.h"
+#include "aboutdialog.h"
#include "verifynotification.h"
#include "wizard.h"
diff --git a/release/TRANSLATORS b/release/TRANSLATORS
new file mode 100644
index 0000000..ec4a869
--- /dev/null
+++ b/release/TRANSLATORS
@@ -0,0 +1,11 @@
+Viriato/Phol (es)
+Russell (my)
+Alessandro (pt_br)
+Kirill (ru)
+Tom (vi)
+Jedi (zh_tw)
+Åke (sv)
+Bogaczm (pl)
+Ahmad (ar)
+Elad (he)
+Chen (zh)
diff --git a/settingsdialog.h b/settingsdialog.h
index e4ca8e6..4fb668e 100755
--- a/settingsdialog.h
+++ b/settingsdialog.h
@@ -34,7 +34,6 @@ class QHBoxLayout;
class QVBoxLayout;
class QComboBox;
class QCheckBox;
-class QSettings;
class QDebug;
class QSettings;
class QApplication;