diff --git a/src/gui/HelpDialog.cxx b/src/gui/HelpDialog.cxx index 8153e3e83..efc03f4d7 100644 --- a/src/gui/HelpDialog.cxx +++ b/src/gui/HelpDialog.cxx @@ -33,7 +33,8 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent, fontHeight = Dialog::fontHeight(), fontWidth = Dialog::fontWidth(), buttonHeight = Dialog::buttonHeight(), - buttonWidth = Dialog::buttonWidth("Previous"), + buttonWidth = Dialog::buttonWidth(" << "), + closeButtonWidth = Dialog::buttonWidth("Close"), VBORDER = Dialog::vBorder(), HBORDER = Dialog::hBorder(), VGAP = Dialog::vGap(); @@ -48,19 +49,27 @@ HelpDialog::HelpDialog(OSystem& osystem, DialogContainer& parent, xpos = HBORDER; ypos = _h - buttonHeight - VBORDER; myPrevButton = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight, - "Previous", GuiObject::kPrevCmd); + "<<", GuiObject::kPrevCmd); myPrevButton->clearFlags(Widget::FLAG_ENABLED); wid.push_back(myPrevButton); xpos += buttonWidth + fontWidth; myNextButton = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight, - "Next", GuiObject::kNextCmd); + ">>", GuiObject::kNextCmd); wid.push_back(myNextButton); - xpos = _w - buttonWidth - HBORDER; + xpos += buttonWidth + fontWidth; + + int updButtonWidth = Dialog::buttonWidth("Check for Update" + ELLIPSIS); + myUpdateButton = + new ButtonWidget(this, font, xpos, ypos, updButtonWidth, buttonHeight, + "Check for Update" + ELLIPSIS, kUpdateCmd); + wid.push_back(myUpdateButton); + + xpos = _w - closeButtonWidth - HBORDER; ButtonWidget* b = - new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight, + new ButtonWidget(this, font, xpos, ypos, closeButtonWidth, buttonHeight, "Close", GuiObject::kCloseCmd); wid.push_back(b); addCancelWidget(b); @@ -229,6 +238,11 @@ void HelpDialog::handleCommand(CommandSender* sender, int cmd, displayInfo(); break; + case kUpdateCmd: + MediaFactory::openURL("https://stella-emu.github.io/downloads.html?version=" + + instance().settings().getString("stella.version")); + break; + case StaticTextWidget::kOpenUrlCmd: { const string url = myDesc[id]->getUrl(); diff --git a/src/gui/HelpDialog.hxx b/src/gui/HelpDialog.hxx index 18f80a4a2..a13152d16 100644 --- a/src/gui/HelpDialog.hxx +++ b/src/gui/HelpDialog.hxx @@ -43,6 +43,7 @@ class HelpDialog : public Dialog static constexpr uInt32 LINES_PER_PAGE = 10; ButtonWidget* myNextButton{nullptr}; ButtonWidget* myPrevButton{nullptr}; + ButtonWidget* myUpdateButton{nullptr}; StaticTextWidget* myTitle; std::array myKey{nullptr}; @@ -53,6 +54,11 @@ class HelpDialog : public Dialog uInt8 myPage{1}; uInt8 myNumPages{5}; + enum { + kUpdateCmd = 'upCm' + }; + + private: // Following constructors and assignment operators not supported HelpDialog() = delete;