Fix update checker not working on macOS (#1642)
* Prevent update dialog from going off screen Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -8,5 +8,6 @@
|
|||||||
- Minor: Removed "Online Logs" functionality as services are shut down (#1640)
|
- Minor: Removed "Online Logs" functionality as services are shut down (#1640)
|
||||||
- Bugfix: Fix preview on hover not working when Animated emotes options was disabled (#1546)
|
- Bugfix: Fix preview on hover not working when Animated emotes options was disabled (#1546)
|
||||||
- Bugfix: FFZ custom mod badges no longer scale with the emote scale options (#1602)
|
- Bugfix: FFZ custom mod badges no longer scale with the emote scale options (#1602)
|
||||||
|
- Bugfix: MacOS updater looked for non-existing fields, causing it to always fail the update check (#1642)
|
||||||
- Settings open faster
|
- Settings open faster
|
||||||
- Dev: Fully remove Twitch Chatroom support
|
- Dev: Fully remove Twitch Chatroom support
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ void Updates::checkForUpdates()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined Q_OS_WIN || defined Q_OS_MACOS
|
#if defined Q_OS_WIN || defined Q_OS_MACOS
|
||||||
/// Windows downloads an installer for the new version
|
/// Downloads an installer for the new version
|
||||||
QJsonValue updateExe_val = object.value("updateexe");
|
QJsonValue updateExe_val = object.value("updateexe");
|
||||||
if (!updateExe_val.isString())
|
if (!updateExe_val.isString())
|
||||||
{
|
{
|
||||||
@@ -268,7 +268,8 @@ void Updates::checkForUpdates()
|
|||||||
return Failure;
|
return Failure;
|
||||||
}
|
}
|
||||||
this->updateExe_ = updateExe_val.toString();
|
this->updateExe_ = updateExe_val.toString();
|
||||||
|
#endif
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
/// Windows portable
|
/// Windows portable
|
||||||
QJsonValue portable_val = object.value("portable_download");
|
QJsonValue portable_val = object.value("portable_download");
|
||||||
if (!portable_val.isString())
|
if (!portable_val.isString())
|
||||||
@@ -278,14 +279,15 @@ void Updates::checkForUpdates()
|
|||||||
return Failure;
|
return Failure;
|
||||||
}
|
}
|
||||||
this->updatePortable_ = portable_val.toString();
|
this->updatePortable_ = portable_val.toString();
|
||||||
|
#endif
|
||||||
#elif defined Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
QJsonValue updateGuide_val = object.value("updateguide");
|
QJsonValue updateGuide_val = object.value("updateguide");
|
||||||
if (updateGuide_val.isString())
|
if (updateGuide_val.isString())
|
||||||
{
|
{
|
||||||
this->updateGuideLink_ = updateGuide_val.toString();
|
this->updateGuideLink_ = updateGuide_val.toString();
|
||||||
}
|
}
|
||||||
#else
|
#endif
|
||||||
|
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) && !defined(Q_OS_LINUX)
|
||||||
return Failure;
|
return Failure;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,17 @@ void initUpdateButton(Button &button,
|
|||||||
QObject::connect(&button, &Button::leftClicked, [&button] {
|
QObject::connect(&button, &Button::leftClicked, [&button] {
|
||||||
auto dialog = new UpdateDialog();
|
auto dialog = new UpdateDialog();
|
||||||
dialog->setActionOnFocusLoss(BaseWindow::Delete);
|
dialog->setActionOnFocusLoss(BaseWindow::Delete);
|
||||||
dialog->move(button.mapToGlobal(
|
|
||||||
QPoint(int(-100 * button.scale()), button.height())));
|
auto globalPoint = button.mapToGlobal(
|
||||||
|
QPoint(int(-100 * button.scale()), button.height()));
|
||||||
|
|
||||||
|
// Make sure that update dialog will not go off left edge of screen
|
||||||
|
if (globalPoint.x() < 0)
|
||||||
|
{
|
||||||
|
globalPoint.setX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog->move(globalPoint);
|
||||||
dialog->show();
|
dialog->show();
|
||||||
dialog->raise();
|
dialog->raise();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user