Add summary charts help button
This commit is contained in:
parent
2ec9012c07
commit
76e5fd4834
5 changed files with 33 additions and 4 deletions
|
@ -58,6 +58,17 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="button_Help">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/images.qrc">
|
||||
<normaloff>:/icons/help.ico</normaloff>:/icons/help.ico</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -66,7 +77,7 @@
|
|||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabSpecies" native="true">
|
||||
<widget class="QWidget" name="tabSpecies">
|
||||
<attribute name="title">
|
||||
<string>Species Distribution</string>
|
||||
</attribute>
|
||||
|
@ -89,7 +100,7 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabLevels" native="true">
|
||||
<widget class="QWidget" name="tabLevels">
|
||||
<attribute name="title">
|
||||
<string>Level Distribution</string>
|
||||
</attribute>
|
||||
|
@ -227,6 +238,8 @@
|
|||
<header>QtCharts</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../resources/images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
@ -64,6 +64,8 @@ private:
|
|||
QChart::ChartTheme currentTheme() const;
|
||||
void updateTheme();
|
||||
void stopChartAnimation();
|
||||
|
||||
void showHelpDialog();
|
||||
};
|
||||
|
||||
#endif // WILDMONCHART_H
|
||||
|
|
BIN
resources/icons/help.ico
Executable file
BIN
resources/icons/help.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
|
@ -16,6 +16,7 @@
|
|||
<file>icons/folder_map_opened.ico</file>
|
||||
<file>icons/folder_map.ico</file>
|
||||
<file>icons/folder.ico</file>
|
||||
<file>icons/help.ico</file>
|
||||
<file>icons/map_edited.ico</file>
|
||||
<file>icons/map_opened.ico</file>
|
||||
<file>icons/map.ico</file>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "log.h"
|
||||
|
||||
// TODO: Draw species icons below legend icons?
|
||||
// TODO: Help button that explains the charts
|
||||
|
||||
static const QString baseWindowTitle = QString("Wild Pokémon Summary Charts");
|
||||
|
||||
|
@ -28,6 +27,8 @@ WildMonChart::WildMonChart(QWidget *parent, const EncounterTableModel *table) :
|
|||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
setWindowFlags(Qt::Window);
|
||||
|
||||
connect(ui->button_Help, &QAbstractButton::clicked, this, &WildMonChart::showHelpDialog);
|
||||
|
||||
// Changing these settings changes which level distribution chart is shown
|
||||
connect(ui->groupBox_Species, &QGroupBox::clicked, this, &WildMonChart::createLevelDistributionChart);
|
||||
connect(ui->comboBox_Species, &QComboBox::currentTextChanged, this, &WildMonChart::createLevelDistributionChart);
|
||||
|
@ -408,6 +409,18 @@ void WildMonChart::stopChartAnimation() {
|
|||
ui->chartView_SpeciesDistribution->chart()->setAnimationOptions(QChart::NoAnimation);
|
||||
}
|
||||
|
||||
void WildMonChart::showHelpDialog() {
|
||||
static const QString text = "This window provides some visualizations of the data in your current Wild Pokémon tab";
|
||||
static const QString informative = "The <b>Species Distribution</b> tab shows the cumulative encounter chance for each species "
|
||||
"in the table. In other words, it answers the question \"For a given encounter of this type, "
|
||||
"what is the likelihood that the pokémon encountered will be of that species?\"<br><br>"
|
||||
"The <b>Level Distribution</b> tab..."; // TODO
|
||||
QMessageBox msgBox(QMessageBox::Information, "porymap", text, QMessageBox::Close, this);
|
||||
msgBox.setTextFormat(Qt::RichText);
|
||||
msgBox.setInformativeText(informative);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
void WildMonChart::closeEvent(QCloseEvent *event) {
|
||||
porymapConfig.wildMonChartGeometry = saveGeometry();
|
||||
QWidget::closeEvent(event);
|
||||
|
|
Loading…
Reference in a new issue