mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-30 21:25:32 -05:00
45 lines
962 B
C++
45 lines
962 B
C++
#pragma once
|
|
#include "macro-ref.hpp"
|
|
|
|
#include <QListWidget>
|
|
#include <QPushButton>
|
|
#include <QHBoxLayout>
|
|
|
|
class MacroList : public QWidget {
|
|
Q_OBJECT
|
|
public:
|
|
MacroList(QWidget *parent, bool allowDuplicates, bool reorder);
|
|
void SetContent(const std::vector<MacroRef> &);
|
|
void AddControl(QWidget *);
|
|
int CurrentRow();
|
|
|
|
private slots:
|
|
void MacroRename(const QString &oldName, const QString &newName);
|
|
void MacroRemove(const QString &name);
|
|
void Add();
|
|
void Remove();
|
|
void Up();
|
|
void Down();
|
|
void MacroItemClicked(QListWidgetItem *);
|
|
|
|
signals:
|
|
void Added(const std::string &);
|
|
void Removed(int);
|
|
void MovedUp(int);
|
|
void MovedDown(int);
|
|
void Replaced(int, const std::string &);
|
|
|
|
private:
|
|
int FindEntry(const std::string ¯o);
|
|
void SetMacroListSize();
|
|
|
|
QListWidget *_list;
|
|
QPushButton *_add;
|
|
QPushButton *_remove;
|
|
QPushButton *_up;
|
|
QPushButton *_down;
|
|
QHBoxLayout *_controlsLayout;
|
|
const bool _allowDuplicates;
|
|
const bool _reorder;
|
|
};
|