Commit 257e0683 authored by Olivier SOLDANO's avatar Olivier SOLDANO

ui: winsparkle autoupdate mandatory

suppression of the compiler instructions allowing hiding autoupdate
in configuration widget (options) and mainwindow (connection to the winsparkle-ring.xml).

plus corrected styling and .pro file according to this change

Change-Id: Ib3d2b3d4ceae9101b6aeb2af4c10398dd0c24a3d
parent 56c39508
......@@ -259,13 +259,10 @@ win32 {
INSTALLS += RINGTONES PACKAGING LICENSE RUNTIME LRC_TRANSLATION QTRUNTIME QTDEPSRUNTIME \
QTPLUGINIMAGE QTPLATFORMS LIBSTD
ENABLE_AUTOUPDATE=$${ENABLE_AUTOUPDATE}
equals (ENABLE_AUTOUPDATE, True) {
DEFINES += ENABLE_AUTOUPDATE
LIBS += -L$${RING}/lib -lWinSparkle
WINSPARKLE.files = $${RING}/bin/WinSparkle.dll $${RING}/bin/libringclient.dll
WINSPARKLE.path = $$OUT_PWD/release
INSTALLS += WINSPARKLE
message("AUTO UPDATES enabled")
}
DEFINES += ENABLE_AUTOUPDATE
LIBS += -L$${RING}/lib -lWinSparkle
WINSPARKLE.files = $${RING}/bin/WinSparkle.dll $${RING}/bin/libringclient.dll
WINSPARKLE.path = $$OUT_PWD/release
INSTALLS += WINSPARKLE
message("AUTO UPDATES enabled")
}
......@@ -56,9 +56,7 @@
#include "profile.h"
#include "person.h"
#ifdef ENABLE_AUTOUPDATE
#include "winsparkle.h"
#endif
ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
NavWidget(parent),
......@@ -178,14 +176,6 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
connect(ui->outputComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(outputIndexChanged(int)));
connect(ui->inputComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(inputIndexChanged(int)));
#ifndef ENABLE_AUTOUPDATE
ui->checkUpdateButton->hide();
ui->intervalUpdateCheckSpinBox->hide();
ui->updateDayLabel->hide();
ui->autoUpdateCheckBox->hide();
#endif
auto profile = ProfileModel::instance().selectedProfile();
ui->avatarButton->setIcon(QPixmap::fromImage(Utils::getCirclePhoto(profile->person()->photo().value<QImage>(), ui->avatarButton->width())));
ui->profileNameEdit->setText(profile->person()->formattedName());
......@@ -193,6 +183,8 @@ ConfigurationWidget::ConfigurationWidget(QWidget *parent) :
//temporary fix hiding imports buttons
ui->exportButton->hide();
ui->importButton->hide();
ui->intervalUpdateCheckSpinBox->setEnabled(true);
}
void ConfigurationWidget::showPreview()
......@@ -211,12 +203,10 @@ void ConfigurationWidget::showPreview()
void
ConfigurationWidget::showEvent(QShowEvent *event)
{
#ifdef ENABLE_AUTOUPDATE
if (win_sparkle_get_automatic_check_for_updates()) {
ui->autoUpdateCheckBox->setChecked(true);
}
ui->intervalUpdateCheckSpinBox->setValue(win_sparkle_get_update_check_interval() / 86400);
#endif
QWidget::showEvent(event);
showPreview();
}
......@@ -357,25 +347,19 @@ ConfigurationWidget::on_closeOrMinCheckBox_toggled(bool checked)
void
ConfigurationWidget::on_checkUpdateButton_clicked()
{
#ifdef ENABLE_AUTOUPDATE
win_sparkle_check_update_with_ui();
#endif
}
void
ConfigurationWidget::on_autoUpdateCheckBox_toggled(bool checked)
{
#ifdef ENABLE_AUTOUPDATE
win_sparkle_set_automatic_check_for_updates(checked);
#endif
}
void
ConfigurationWidget::on_intervalUpdateCheckSpinBox_valueChanged(int arg1)
{
#ifdef ENABLE_AUTOUPDATE
win_sparkle_set_update_check_interval(arg1 * 86400);
#endif
}
void
......
......@@ -689,12 +689,18 @@
<pointsize>11</pointsize>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(77, 77, 77);</string>
</property>
<property name="text">
<string>Check for update automatically every</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -708,6 +714,12 @@
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="value">
<number>3</number>
</property>
</widget>
</item>
<item>
......@@ -747,8 +759,20 @@
</property>
<item>
<widget class="QPushButton" name="checkUpdateButton">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>Check for updates</string>
<string>Check for updates now</string>
</property>
</widget>
</item>
......
......@@ -32,11 +32,7 @@
#include "aboutdialog.h"
#include "settingskey.h"
#ifdef ENABLE_AUTOUPDATE
#include "winsparkle.h"
#endif
#include "callmodel.h"
MainWindow::MainWindow(QWidget* parent) :
......@@ -98,8 +94,7 @@ MainWindow::MainWindow(QWidget* parent) :
} else
resize(1054, 600);
#ifdef ENABLE_AUTOUPDATE
win_sparkle_set_appcast_url("http://gpl.savoirfairelinux.net/ring-download/windows/winsparkle-ring.xml");
win_sparkle_set_appcast_url("http://dl.ring.cx/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();});
......@@ -112,7 +107,6 @@ MainWindow::MainWindow(QWidget* parent) :
QObject::connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, [=]() {
win_sparkle_cleanup();
});
#endif
setContextMenuPolicy(Qt::NoContextMenu);
......
......@@ -297,7 +297,7 @@ QPushButton#errorPushButton, QPushButton#registerButton{
}
QPushButton#wizardButton:hover, QPushButton#playButton:hover, QPushButton#clearHistoryButton:hover,
QPushButton#doTransferButton:hover, QPushButton#photoButton:hover,
QPushButton#checkUpdateButton:hover, QPushButton#doTransferButton:hover, QPushButton#photoButton:hover,
QPushButton#takePhotoButton:hover, QPushButton#importButton:hover,
QPushButton#existingPushButton:hover, QPushButton#newAccountButton:hover, QPushButton#previousButton:hover,
QPushButton#exportButton:hover, QPushButton#cancelAddButton:hover, QPushButton#exportOnRingButton:hover,
......@@ -307,7 +307,7 @@ QPushButton#registerButton:hover{
}
QPushButton#wizardButton:pressed, QPushButton#playButton:pressed, QPushButton#clearHistoryButton:pressed,
QPushButton#doTransferButton:pressed, QPushButton#photoButton:pressed,
QPushButton#checkUpdateButton:pressed, QPushButton#doTransferButton:pressed, QPushButton#photoButton:pressed,
QPushButton#takePhotoButton:pressed, QPushButton#importButton:pressed,
QPushButton#existingPushButton:pressed, QPushButton#newAccountButton:pressed, QPushButton#previousButton:pressed,
QPushButton#exportButton:pressed, QPushButton#cancelAddButton:pressed, QPushButton#exportOnRingButton:pressed,
......
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