diff options
| author | Tobias Markmann <tm@ayena.de> | 2017-02-21 13:27:42 (GMT) |
|---|---|---|
| committer | Tobias Markmann <tm@ayena.de> | 2017-02-22 11:15:00 (GMT) |
| commit | 996ca9ecf4f226a033d161419f11e715a3f892c3 (patch) | |
| tree | e332db1edf3e9ea2282814154473e3a5e57d362d /Swift/QtUI/QtLoginWindow.cpp | |
| parent | eea861301be0bf3e3f5db6cfc3cada38d133fef2 (diff) | |
| download | swift-996ca9ecf4f226a033d161419f11e715a3f892c3.zip swift-996ca9ecf4f226a033d161419f11e715a3f892c3.tar.bz2 | |
Improve Swift about window regarding auto update UX
The dialog will automatically initiate a check for updates
when opened.
It will show the current state of the auto updater backend,
e.g. whether it is downloading or already at the latest
version.
This also fixes update channel selection being shown
on Windows and Linux.
Test-Information:
Ran Swift and opening the dialog shows a short progress bar
indicating it checking for updates. Afterwards it shows that
it is already running the latest version, which is sensible
for a dev build.
Change-Id: Ie08cd2a8852e468d6007122604b532fedc24bcfe
Diffstat (limited to 'Swift/QtUI/QtLoginWindow.cpp')
| -rw-r--r-- | Swift/QtUI/QtLoginWindow.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index 865d8b5..654e921 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -1,86 +1,86 @@ /* - * Copyright (c) 2010-2016 Isode Limited. + * Copyright (c) 2010-2017 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swift/QtUI/QtLoginWindow.h> #include <algorithm> #include <cassert> #include <boost/bind.hpp> #include <memory> #include <QApplication> #include <QBoxLayout> #include <QCloseEvent> #include <QComboBox> #include <QCursor> #include <QDebug> #include <QDesktopWidget> #include <QFileDialog> #include <QHBoxLayout> #include <QKeyEvent> #include <QLabel> #include <QMenuBar> #include <QMessageBox> #include <QStatusBar> #include <QToolButton> #include <Swiften/Base/Platform.h> #include <Swiften/Base/Paths.h> #include <Swift/Controllers/SettingConstants.h> #include <Swift/Controllers/Settings/SettingsProvider.h> #include <Swift/Controllers/UIEvents/RequestFileTransferListUIEvent.h> #include <Swift/Controllers/UIEvents/RequestHighlightEditorUIEvent.h> #include <Swift/Controllers/UIEvents/RequestXMLConsoleUIEvent.h> #include <Swift/Controllers/UIEvents/UIEventStream.h> #include <Swift/QtUI/QtAboutWidget.h> #include <Swift/QtUI/QtConnectionSettingsWindow.h> #include <Swift/QtUI/QtMainWindow.h> #include <Swift/QtUI/QtSwiftUtil.h> #include <Swift/QtUI/QtUISettingConstants.h> #include <Swift/QtUI/QtUtilities.h> #ifdef HAVE_SCHANNEL #include "CAPICertificateSelector.h" #include <Swiften/TLS/CAPICertificate.h> #endif #include <Swiften/TLS/PKCS12Certificate.h> namespace Swift{ -QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream, SettingsProvider* settings, TimerFactory* timerFactory) : QMainWindow(), settings_(settings), timerFactory_(timerFactory) { +QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream, SettingsProvider* settings, TimerFactory* timerFactory, AutoUpdater* autoUpdater) : QMainWindow(), settings_(settings), timerFactory_(timerFactory), autoUpdater_(autoUpdater) { uiEventStream_ = uiEventStream; setWindowTitle("Swift"); #ifndef Q_OS_MAC #ifdef Q_OS_WIN32 setWindowIcon(QIcon(":/logo-icon-16-win.png")); #else setWindowIcon(QIcon(":/logo-icon-16.png")); #endif #endif QtUtilities::setX11Resource(this, "Main"); setAccessibleName(tr("Swift Login Window")); //setAccessibleDescription(tr("This window is used for providing credentials to log into your XMPP service")); resize(200, 500); setContentsMargins(0,0,0,0); QWidget *centralWidget = new QWidget(this); setCentralWidget(centralWidget); QBoxLayout *topLayout = new QBoxLayout(QBoxLayout::TopToBottom, centralWidget); stack_ = new QStackedWidget(centralWidget); topLayout->addWidget(stack_); topLayout->setMargin(0); loginWidgetWrapper_ = new QWidget(this); loginWidgetWrapper_->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); QBoxLayout *layout = new QBoxLayout(QBoxLayout::TopToBottom, loginWidgetWrapper_); layout->addStretch(2); QLabel* logo = new QLabel(this); QIcon swiftWithTextLogo = QIcon(":/logo-shaded-text.png"); logo->setPixmap(swiftWithTextLogo.pixmap(QSize(192,192))); @@ -415,61 +415,61 @@ void QtLoginWindow::loginClicked() { } else { onCancelLoginRequest(); } } void QtLoginWindow::setLoginAutomatically(bool loginAutomatically) { loginAutomatically_->setChecked(loginAutomatically); } void QtLoginWindow::handleCertficateChecked(bool checked) { if (checked) { #ifdef HAVE_SCHANNEL certificateFile_ = P2QSTRING(selectCAPICertificate()); if (certificateFile_.isEmpty()) { certificateButton_->setChecked(false); } #else certificateFile_ = QFileDialog::getOpenFileName(this, tr("Select an authentication certificate"), QString(), tr("P12 files (*.cert *.p12 *.pfx);;All files (*.*)")); if (certificateFile_.isEmpty()) { certificateButton_->setChecked(false); } #endif } else { certificateFile_ = ""; } } void QtLoginWindow::handleAbout() { if (!aboutDialog_) { - aboutDialog_ = new QtAboutWidget(settings_); + aboutDialog_ = new QtAboutWidget(settings_, autoUpdater_); aboutDialog_->show(); } else { aboutDialog_->show(); aboutDialog_->raise(); aboutDialog_->activateWindow(); } } void QtLoginWindow::handleShowXMLConsole() { uiEventStream_->send(std::make_shared<RequestXMLConsoleUIEvent>()); } void QtLoginWindow::handleShowFileTransferOverview() { uiEventStream_->send(std::make_shared<RequestFileTransferListUIEvent>()); } void QtLoginWindow::handleShowHighlightEditor() { uiEventStream_->send(std::make_shared<RequestHighlightEditorUIEvent>()); } void QtLoginWindow::handleToggleSounds(bool enabled) { settings_->storeSetting(SettingConstants::PLAY_SOUNDS, enabled); } void QtLoginWindow::handleToggleNotifications(bool enabled) { settings_->storeSetting(SettingConstants::SHOW_NOTIFICATIONS, enabled); } void QtLoginWindow::handleQuit() { |
Swift