diff options
-rw-r--r-- | Swift/QtUI/QtAboutWidget.cpp | 8 | ||||
-rw-r--r-- | Swift/QtUI/QtAboutWidget.h | 7 | ||||
-rw-r--r-- | Swift/QtUI/QtLoginWindow.cpp | 8 | ||||
-rw-r--r-- | Swift/QtUI/QtLoginWindow.h | 3 |
4 files changed, 12 insertions, 14 deletions
diff --git a/Swift/QtUI/QtAboutWidget.cpp b/Swift/QtUI/QtAboutWidget.cpp index 7e5cda1..d4f8386 100644 --- a/Swift/QtUI/QtAboutWidget.cpp +++ b/Swift/QtUI/QtAboutWidget.cpp @@ -10,12 +10,6 @@ #include "Swiften/Application/Application.h" namespace Swift { -QtAboutWidget* QtAboutWidget::instance() { - if (!instance_) { - instance_ = new QtAboutWidget(); - } - return instance_; -} QtAboutWidget::QtAboutWidget() : QWidget() { resize(180, 240); @@ -38,8 +32,6 @@ QtAboutWidget::QtAboutWidget() : QWidget() { buildString += "</centre></font>"; QLabel* buildLabel = new QLabel(buildString, this); mainLayout->addWidget(buildLabel); - } -QtAboutWidget* QtAboutWidget::instance_ = NULL; } diff --git a/Swift/QtUI/QtAboutWidget.h b/Swift/QtUI/QtAboutWidget.h index 0a1fc3f..4d99bbb 100644 --- a/Swift/QtUI/QtAboutWidget.h +++ b/Swift/QtUI/QtAboutWidget.h @@ -4,12 +4,9 @@ namespace Swift { class QtAboutWidget : public QWidget { - Q_OBJECT - public: - static QtAboutWidget* instance(); + Q_OBJECT - private: + public: QtAboutWidget(); - static QtAboutWidget* instance_; }; } diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index 9694364..fb31e3c 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -136,7 +136,13 @@ void QtLoginWindow::handleCertficateChecked(bool checked) { } void QtLoginWindow::handleAbout() { - QtAboutWidget::instance()->show(); + if (!aboutDialog_) { + aboutDialog_ = new QtAboutWidget(); + aboutDialog_->show(); + } + else { + aboutDialog_->raise(); + } } void QtLoginWindow::handleQuit() { diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h index 144f212..153f757 100644 --- a/Swift/QtUI/QtLoginWindow.h +++ b/Swift/QtUI/QtLoginWindow.h @@ -2,6 +2,7 @@ #define SWIFT_QtLoginWindow_H #include <QMainWindow> +#include <QPointer> #include <QLineEdit> #include <QPushButton> #include <QCheckBox> @@ -10,6 +11,7 @@ #include "Swift/Controllers/LoginWindow.h" #include "Swift/Controllers/MainWindow.h" +#include "QtAboutWidget.h" class QLabel; class QToolButton; @@ -43,6 +45,7 @@ namespace Swift { QToolButton* certificateButton_; QMenuBar* menuBar_; QMenu* swiftMenu_; + QPointer<QtAboutWidget> aboutDialog_; }; } |