New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adopt Update dialogs to the new modal widget experience #11617
base: master
Are you sure you want to change the base?
Conversation
82d0c63
to
66e5494
Compare
Hmm could we use the same icon, the app icon, for both? |
66e5494
to
5fdd4fe
Compare
QString txt = tr("<p>A new version of the %1 Client is available.</p>" | ||
"<p><b>%2</b> is available for download. The installed version is %3.</p>") | ||
.arg(Utility::escape(Theme::instance()->appNameGUI()), | ||
Utility::escape(info.versionString()), Utility::escape(Version::versionWithBuildNumber().toString())); | ||
auto *widget = new NoUrlWidget(ocApp()->gui()->settingsDialog(), txt); | ||
widget->setAttribute(Qt::WA_DeleteOnClose); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not a dialog anymore, we should handle its deletion.
Q_OBJECT | ||
|
||
public: | ||
explicit NoUrlWidget(QWidget *parent, const QString &statusMessage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the meaning of the class name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It comes from the method that previously showed the dialog: WindowsUpdater::showNoUrlDialog
. It's called from WindowsUpdater::versionInfoArrived
, when the info has an empty URL. 🤷♂️
{ | ||
delete _ui; | ||
Q_EMIT accepted(); | ||
close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should rather delete the class in the caller than rely on delete on close.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the delete is because the _ui
is now a QScopedPointer
instead of a raw pointer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, but please take a look on my comments.
Fixes: #11593