summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtAboutWidget.cpp24
-rw-r--r--Swift/QtUI/QtAboutWidget.h3
-rw-r--r--Swift/QtUI/QtSwift.cpp10
-rw-r--r--Swift/QtUI/Swift.qrc1
4 files changed, 32 insertions, 6 deletions
diff --git a/Swift/QtUI/QtAboutWidget.cpp b/Swift/QtUI/QtAboutWidget.cpp
index 8b072e4..b918c3b 100644
--- a/Swift/QtUI/QtAboutWidget.cpp
+++ b/Swift/QtUI/QtAboutWidget.cpp
@@ -11,7 +11,10 @@
#include <QLabel>
#include <QVBoxLayout>
#include <QtGlobal>
-
+#include <QPushButton>
+#include <QTextEdit>
+#include <QFile>
+#include <QTextStream>
#include "Swiften/Application/Application.h"
@@ -39,7 +42,26 @@ QtAboutWidget::QtAboutWidget() : QDialog() {
QLabel* buildLabel = new QLabel(buildString, this);
mainLayout->addWidget(buildLabel);
+ QPushButton* licenseButton = new QPushButton("View License", this);
+ mainLayout->addWidget(licenseButton);
+ connect(licenseButton, SIGNAL(clicked()), this, SLOT(handleLicenseClicked()));
+
setFixedSize(minimumSizeHint());
}
+void QtAboutWidget::handleLicenseClicked() {
+ QTextEdit* text = new QTextEdit();
+ text->setAttribute(Qt::WA_DeleteOnClose);
+ text->setReadOnly(true);
+ QFile file(":/COPYING");
+ file.open(QIODevice::ReadOnly);
+ QTextStream in(&file);
+ in.setAutoDetectUnicode(true);
+ text->setPlainText(in.readAll());
+ file.close();
+ text->resize(500, 600);
+ text->show();
+ text->activateWindow();
+}
+
}
diff --git a/Swift/QtUI/QtAboutWidget.h b/Swift/QtUI/QtAboutWidget.h
index d154dd3..1800676 100644
--- a/Swift/QtUI/QtAboutWidget.h
+++ b/Swift/QtUI/QtAboutWidget.h
@@ -14,5 +14,8 @@ namespace Swift {
public:
QtAboutWidget();
+
+ private slots:
+ void handleLicenseClicked();
};
}
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index 3b286b4..8ff8447 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -79,11 +79,11 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
}
mainController_ = new MainController(chatWindowFactory_, rosterWindowFactory_, loginWindowFactory_, eventWindowFactory_, settings_, application_, systemTray_, soundPlayer_, xmlConsoleWidgetFactory_, chatListWindowFactory_, mucSearchWindowFactory_, options.count("latency-debug") > 0);
- PlatformAutoUpdaterFactory autoUpdaterFactory;
- if (autoUpdaterFactory.isSupported()) {
- autoUpdater_ = autoUpdaterFactory.createAutoUpdater(SWIFT_APPCAST_URL);
- autoUpdater_->checkForUpdates();
- }
+ // PlatformAutoUpdaterFactory autoUpdaterFactory;
+ // if (autoUpdaterFactory.isSupported()) {
+ // autoUpdater_ = autoUpdaterFactory.createAutoUpdater(SWIFT_APPCAST_URL);
+ // autoUpdater_->checkForUpdates();
+ // }
}
QtSwift::~QtSwift() {
diff --git a/Swift/QtUI/Swift.qrc b/Swift/QtUI/Swift.qrc
index 1c07420..2d58eef 100644
--- a/Swift/QtUI/Swift.qrc
+++ b/Swift/QtUI/Swift.qrc
@@ -12,5 +12,6 @@
<file alias="icons/tray-standard.png">../resources/icons/tray-standard.png</file>
<file alias="icons/new-chat.png">../resources/icons/new-chat.png</file>
<file alias="sounds/message-received.wav">../resources/sounds/message-received.wav</file>
+ <file alias="COPYING">../../COPYING</file>
</qresource>
</RCC>