mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
Ref T165, use "?" for context help in update dialog
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "downloadandinstalldialog.h"
|
||||
#include "ui_downloadandinstalldialog.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include <QPushButton>
|
||||
#include <QDesktopServices>
|
||||
|
||||
@@ -16,8 +17,6 @@ using namespace BlackMisc::Db;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
class COverlayMessagesFrame;
|
||||
|
||||
namespace Components
|
||||
{
|
||||
CDownloadAndInstallDialog::CDownloadAndInstallDialog(QWidget *parent) :
|
||||
@@ -55,6 +54,13 @@ namespace BlackGui
|
||||
return QDialog::Rejected;
|
||||
}
|
||||
|
||||
bool CDownloadAndInstallDialog::event(QEvent *event)
|
||||
{
|
||||
if (event->type() != QEvent::EnterWhatsThisMode) { return QDialog::event(event); }
|
||||
QTimer::singleShot(0, this, &CDownloadAndInstallDialog::requestHelp);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CDownloadAndInstallDialog::onDontShowAgain(bool dontShowAgain)
|
||||
{
|
||||
m_setting.setAndSave(!dontShowAgain);
|
||||
@@ -65,5 +71,10 @@ namespace BlackGui
|
||||
const bool nv = ui->comp_DistributionInfo->isNewVersionAvailable();
|
||||
ui->bb_DownloadInstallDialog->button(QDialogButtonBox::Ok)->setEnabled(nv);
|
||||
}
|
||||
|
||||
void CDownloadAndInstallDialog::requestHelp()
|
||||
{
|
||||
if (sGui) { sGui->showHelp(this); }
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -41,6 +41,9 @@ namespace BlackGui
|
||||
//! \copydoc QDialog::exec
|
||||
virtual int exec() override;
|
||||
|
||||
//! \copydoc QObject::event
|
||||
virtual bool event(QEvent *event) override;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CDownloadAndInstallDialog> ui;
|
||||
BlackMisc::CSetting<BlackGui::Settings::TUpdateNotificationSettings> m_setting { this }; //!< show again?
|
||||
@@ -50,6 +53,9 @@ namespace BlackGui
|
||||
|
||||
//! Selection in distribution component changed
|
||||
void selectionChanged();
|
||||
|
||||
//! Request context help
|
||||
void requestHelp();
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user