-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ask user in dialog to restart app after update finished
- Loading branch information
1 parent
994f35b
commit de2533d
Showing
9 changed files
with
193 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (C) by Fabian Müller <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
|
||
#include "updatefinisheddialog.h" | ||
#include "common/asserts.h" | ||
#include "ui_updatefinisheddialog.h" | ||
|
||
#include <QDialogButtonBox> | ||
#include <QPushButton> | ||
|
||
namespace OCC { | ||
|
||
UpdateFinishedDialog::UpdateFinishedDialog(QWidget *parent) | ||
: QDialog(parent) | ||
, _ui(new Ui::UpdateFinishedDialog) | ||
{ | ||
_ui->setupUi(this); | ||
|
||
connect(_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); | ||
connect(_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); | ||
|
||
const auto noButton = _ui->buttonBox->button(QDialogButtonBox::No); | ||
const auto yesButton = _ui->buttonBox->button(QDialogButtonBox::Yes); | ||
|
||
noButton->setText(tr("Restart later")); | ||
|
||
yesButton->setText(tr("Restart now")); | ||
yesButton->setDefault(true); | ||
} | ||
|
||
UpdateFinishedDialog::~UpdateFinishedDialog() | ||
{ | ||
delete _ui; | ||
} | ||
|
||
} // OCC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (C) by Fabian Müller <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <QDialog> | ||
|
||
QT_BEGIN_NAMESPACE | ||
namespace Ui { | ||
class UpdateFinishedDialog; | ||
} | ||
QT_END_NAMESPACE | ||
|
||
namespace OCC { | ||
|
||
class UpdateFinishedDialog : public QDialog | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit UpdateFinishedDialog(QWidget *parent = nullptr); | ||
~UpdateFinishedDialog() override; | ||
|
||
private: | ||
::Ui::UpdateFinishedDialog *_ui; | ||
}; | ||
|
||
} // OCC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>UpdateFinishedDialog</class> | ||
<widget class="QDialog" name="UpdateFinishedDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>368</width> | ||
<height>172</height> | ||
</rect> | ||
</property> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Application restart required</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0"> | ||
<property name="spacing"> | ||
<number>12</number> | ||
</property> | ||
<property name="sizeConstraint"> | ||
<enum>QLayout::SetFixedSize</enum> | ||
</property> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="sizePolicy"> | ||
<sizepolicy hsizetype="Fixed" vsizetype="Maximum"> | ||
<horstretch>0</horstretch> | ||
<verstretch>0</verstretch> | ||
</sizepolicy> | ||
</property> | ||
<property name="minimumSize"> | ||
<size> | ||
<width>350</width> | ||
<height>0</height> | ||
</size> | ||
</property> | ||
<property name="maximumSize"> | ||
<size> | ||
<width>350</width> | ||
<height>16777215</height> | ||
</size> | ||
</property> | ||
<property name="text"> | ||
<string><html><head/><body><p><span style=" font-weight:700;">Update installed successfully</span></p><p>Restart the application to finish installing the update.</p></body></html></string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> | ||
</property> | ||
<property name="wordWrap"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="buttonBox"> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::No|QDialogButtonBox::Yes</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |