mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-18 04:51:33 -07:00
Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212)
--------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: ebbit1q <ebbit1q@gmail.com>
This commit is contained in:
parent
be1403c920
commit
1ef07309d6
605 changed files with 3812 additions and 3408 deletions
50
cockatrice/src/interface/utility/sequence_edit.h
Normal file
50
cockatrice/src/interface/utility/sequence_edit.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/**
|
||||
* @file sequence_edit.h
|
||||
* @ingroup UI
|
||||
* @brief TODO: Document this.
|
||||
*/
|
||||
|
||||
#ifndef SEQUENCEEDIT_H
|
||||
#define SEQUENCEEDIT_H
|
||||
|
||||
#include <QEvent>
|
||||
#include <QKeySequence>
|
||||
#include <QLineEdit>
|
||||
#include <QPushButton>
|
||||
#include <QWidget>
|
||||
|
||||
class SequenceEdit : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SequenceEdit(const QString &_shortcutName, QWidget *parent = nullptr);
|
||||
QString getSequence();
|
||||
void setShortcutName(const QString &_shortcutName);
|
||||
void refreshShortcut();
|
||||
void clear();
|
||||
void retranslateUi();
|
||||
|
||||
private slots:
|
||||
void removeLastShortcut();
|
||||
void restoreDefault();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *, QEvent *event) override;
|
||||
|
||||
private:
|
||||
QString shortcutName;
|
||||
QLineEdit *lineEdit;
|
||||
QPushButton *clearButton;
|
||||
QPushButton *defaultButton;
|
||||
int keys = 0;
|
||||
int currentKey = 0;
|
||||
bool valid = false;
|
||||
|
||||
void processKey(QKeyEvent *e);
|
||||
int translateModifiers(Qt::KeyboardModifiers state, const QString &text);
|
||||
bool validateShortcut(const QKeySequence &sequence);
|
||||
void finishShortcut();
|
||||
void updateSettings();
|
||||
};
|
||||
|
||||
#endif // SEQUENCEEDIT_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue