Commit 9c3e7f78 authored by Edric Milaret's avatar Edric Milaret

autoupdate: fix corner case of update window not appearing

If the update window is displayed when Ring is minimized
then it can be seen in the taskbar but there is no way
to deminimize it.

- Bump Winsparkle to use the new did_find_update_callback

Change-Id: I69cbacef43f81fae5aaca5375691788f09b5d48d
Tuleap: #280
parent 8001f6f0
......@@ -136,22 +136,20 @@ main(int argc, char *argv[])
QCoreApplication::setOrganizationDomain("ring.cx");
QCoreApplication::setApplicationName("Ring");
MainWindow w;
if (not uri.isEmpty()) {
startMinimized = false;
w.onRingEvent(uri);
MainWindow::instance().onRingEvent(uri);
}
if (not startMinimized)
w.show();
MainWindow::instance().show();
else
w.showMinimized();
MainWindow::instance().showMinimized();
w.createThumbBar();
MainWindow::instance().createThumbBar();
#ifdef URI_PROTOCOL
QObject::connect(shmClient, SIGNAL(RingEvent(QString)), &w, SLOT(onRingEvent(QString)));
QObject::connect(shmClient, SIGNAL(RingEvent(QString)), &MainWindow::instance(), SLOT(onRingEvent(QString)));
QObject::connect(&a, &QApplication::aboutToQuit, [&a, &shmClient, &shm, &sem]() {
shmClient->terminate();
......
......@@ -100,6 +100,7 @@ MainWindow::MainWindow(QWidget *parent) :
win_sparkle_set_appcast_url("http://gpl.savoirfairelinux.net/ring-download/windows/winsparkle-ring.xml");
win_sparkle_set_app_details(L"Savoir-faire Linux", L"Ring", QString(NIGHTLY_VERSION).toStdWString().c_str());
win_sparkle_set_shutdown_request_callback([]() {QCoreApplication::exit();});
win_sparkle_set_did_find_update_callback([]() {MainWindow::instance().showNormal();});
win_sparkle_init();
if (win_sparkle_get_last_check_time() == -1) {
......
......@@ -39,8 +39,10 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
inline static MainWindow& instance() {
static auto instance = new MainWindow();
return *instance;
}
void createThumbBar();
protected:
......@@ -55,6 +57,8 @@ private slots:
void switchNormalMaximize();
private:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
Ui::MainWindow* ui;
NavStack* navStack_;
WindowBarUpOne* wbOne_;
......
Subproject commit 0e2112bf52ca171062cbb732896be1c9760ff44c
Subproject commit 1110f626f4c659beb9fcb05e7ecac380b96c6d15
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment