Ref T165, use "?" for context help in update dialog

This commit is contained in:
Klaus Basan
2017-09-27 19:36:00 +02:00
parent a5a32a1722
commit 9d28aa1d1b
2 changed files with 19 additions and 2 deletions

View File

@@ -9,6 +9,7 @@
#include "downloadandinstalldialog.h" #include "downloadandinstalldialog.h"
#include "ui_downloadandinstalldialog.h" #include "ui_downloadandinstalldialog.h"
#include "blackgui/guiapplication.h"
#include <QPushButton> #include <QPushButton>
#include <QDesktopServices> #include <QDesktopServices>
@@ -16,8 +17,6 @@ using namespace BlackMisc::Db;
namespace BlackGui namespace BlackGui
{ {
class COverlayMessagesFrame;
namespace Components namespace Components
{ {
CDownloadAndInstallDialog::CDownloadAndInstallDialog(QWidget *parent) : CDownloadAndInstallDialog::CDownloadAndInstallDialog(QWidget *parent) :
@@ -55,6 +54,13 @@ namespace BlackGui
return QDialog::Rejected; 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) void CDownloadAndInstallDialog::onDontShowAgain(bool dontShowAgain)
{ {
m_setting.setAndSave(!dontShowAgain); m_setting.setAndSave(!dontShowAgain);
@@ -65,5 +71,10 @@ namespace BlackGui
const bool nv = ui->comp_DistributionInfo->isNewVersionAvailable(); const bool nv = ui->comp_DistributionInfo->isNewVersionAvailable();
ui->bb_DownloadInstallDialog->button(QDialogButtonBox::Ok)->setEnabled(nv); ui->bb_DownloadInstallDialog->button(QDialogButtonBox::Ok)->setEnabled(nv);
} }
void CDownloadAndInstallDialog::requestHelp()
{
if (sGui) { sGui->showHelp(this); }
}
} // ns } // ns
} // ns } // ns

View File

@@ -41,6 +41,9 @@ namespace BlackGui
//! \copydoc QDialog::exec //! \copydoc QDialog::exec
virtual int exec() override; virtual int exec() override;
//! \copydoc QObject::event
virtual bool event(QEvent *event) override;
private: private:
QScopedPointer<Ui::CDownloadAndInstallDialog> ui; QScopedPointer<Ui::CDownloadAndInstallDialog> ui;
BlackMisc::CSetting<BlackGui::Settings::TUpdateNotificationSettings> m_setting { this }; //!< show again? BlackMisc::CSetting<BlackGui::Settings::TUpdateNotificationSettings> m_setting { this }; //!< show again?
@@ -50,6 +53,9 @@ namespace BlackGui
//! Selection in distribution component changed //! Selection in distribution component changed
void selectionChanged(); void selectionChanged();
//! Request context help
void requestHelp();
}; };
} // ns } // ns
} // ns } // ns