This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
#include "QtHelpButton.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "ResourcePaths.h"
|
||||
|
||||
QtHelpButton::QtHelpButton(const QString& helpTitle, const QString& helpText, QWidget* parent)
|
||||
QtHelpButton::QtHelpButton(const QtHelpButtonInfo& info, QWidget* parent)
|
||||
: QtIconButton(
|
||||
ResourcePaths::getGuiPath().concatenate(L"window/help.png"),
|
||||
ResourcePaths::getGuiPath().concatenate(L"window/help_hover.png"),
|
||||
parent)
|
||||
, m_helpTitle(helpTitle)
|
||||
, m_helpText(helpText)
|
||||
, m_info(info)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
|
||||
@@ -27,12 +24,5 @@ QtHelpButton::QtHelpButton(const QString& helpTitle, const QString& helpText, QW
|
||||
|
||||
void QtHelpButton::handleHelpPress()
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setWindowTitle(QStringLiteral("Sourcetrail"));
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
msgBox.setText("<b>" + m_helpTitle + "</b>");
|
||||
msgBox.setInformativeText(m_helpText);
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
msgBox.setDefaultButton(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
m_info.displayMessage();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef QT_HELP_BUTTON_H
|
||||
#define QT_HELP_BUTTON_H
|
||||
|
||||
#include "QtHelpButtonInfo.h"
|
||||
#include "QtIconButton.h"
|
||||
|
||||
class QtHelpButton: public QtIconButton
|
||||
@@ -8,14 +9,13 @@ class QtHelpButton: public QtIconButton
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtHelpButton(const QString& helpTitle, const QString& helpText, QWidget* parent = nullptr);
|
||||
QtHelpButton(const QtHelpButtonInfo& info, QWidget* parent = nullptr);
|
||||
|
||||
private slots:
|
||||
void handleHelpPress();
|
||||
|
||||
private:
|
||||
QString m_helpTitle;
|
||||
QString m_helpText;
|
||||
QtHelpButtonInfo m_info;
|
||||
};
|
||||
|
||||
#endif // QT_HELP_BUTTON_H
|
||||
|
||||
Reference in New Issue
Block a user