lolautoaccept/include/stagesettings.h

64 lines
1.2 KiB
C
Raw Normal View History

2022-04-21 00:47:57 +02:00
#ifndef STAGESETTINGS_H
#define STAGESETTINGS_H
#include <QWidget>
2022-07-04 17:50:18 +02:00
#include "config.h"
2022-04-23 00:39:45 +02:00
#include "datadragon.h"
2022-04-21 00:47:57 +02:00
namespace Ui {
class StageSettings;
}
class StageSettings : public QWidget {
Q_OBJECT
Q_PROPERTY(QString name READ getName WRITE setName)
Q_PROPERTY(bool state READ getState WRITE setState NOTIFY toggled)
public:
explicit StageSettings(QWidget *parent = nullptr);
~StageSettings();
QString getName() const;
void setName(const QString& n);
bool getState() const;
void setState(bool);
struct SelectedChamp {
2023-05-31 22:22:23 +02:00
SelectedChamp(QString name, uint32_t id);
QString name;
uint32_t id;
};
2022-04-23 00:39:45 +02:00
std::vector<SelectedChamp> getChampions() const;
2023-05-31 22:22:23 +02:00
void setChampions(const std::vector<QString>& champs);
2022-04-23 00:39:45 +02:00
void setDataDragon(DataDragon* dd);
2022-08-28 01:43:14 +02:00
void addChamp(const DataDragon::ChampData& cd, QPixmap icon);
2022-04-23 00:39:45 +02:00
2022-07-04 17:50:18 +02:00
void loadConfig(Config::StageConfig& c);
2022-04-21 00:47:57 +02:00
private slots:
void toggledinternal(int state);
void addChamp();
void removeChamp();
2022-07-03 00:31:13 +02:00
void moved();
2022-04-21 00:47:57 +02:00
signals:
void toggled(bool);
2022-07-03 00:31:13 +02:00
void championsChanged();
2022-04-21 00:47:57 +02:00
private:
// delete all items
2023-05-31 22:22:23 +02:00
void resolveAndAddChamp(const QString& name, bool emitchange = false);
void clear();
void updateEnabled();
2022-04-23 00:39:45 +02:00
2022-04-21 00:47:57 +02:00
Ui::StageSettings *ui;
2022-04-23 00:39:45 +02:00
DataDragon* dd = nullptr;
2022-04-21 00:47:57 +02:00
};
#endif // STAGESETTINGS_H