| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_ACTIONSETTINGTAB_H |
| 21 |
#define KSNIP_ACTIONSETTINGTAB_H |
| 22 |
|
| 23 |
#include <QWidget> |
| 24 |
#include <QGridLayout> |
| 25 |
#include <QCheckBox> |
| 26 |
#include <QComboBox> |
| 27 |
#include <QLabel> |
| 28 |
#include <QLineEdit> |
| 29 |
#include <QPushButton> |
| 30 |
|
| 31 |
#include "src/common/helper/EnumTranslator.h" |
| 32 |
#include "src/widgets/CustomSpinBox.h" |
| 33 |
#include "src/widgets/CustomLineEdit.h" |
| 34 |
#include "src/widgets/KeySequenceLineEdit.h" |
| 35 |
#include "src/gui/actions/Action.h" |
| 36 |
#include "src/gui/globalHotKeys/HotKeyMap.h" |
| 37 |
|
| 38 |
class ActionSettingTab : public QWidget |
| 39 |
{ |
| 40 |
Q_OBJECT |
| 41 |
public: |
| 42 |
explicit ActionSettingTab(const QString &name, const QList<CaptureModes> &captureModes, const QSharedPointer<IPlatformChecker> &platformChecker); |
| 43 |
explicit ActionSettingTab(const Action &action, const QList<CaptureModes> &captureModes, const QSharedPointer<IPlatformChecker> &platformChecker); |
| 44 |
~ActionSettingTab() override; |
| 45 |
Action action() const; |
| 46 |
|
| 47 |
signals: |
| 48 |
void nameChanged(const QString &name); |
| 49 |
|
| 50 |
protected: |
| 51 |
explicit ActionSettingTab(const QList<CaptureModes> &captureModes, const QSharedPointer<IPlatformChecker> &platformChecker); |
| 52 |
void setAction(const Action &action) const; |
| 53 |
|
| 54 |
private: |
| 55 |
QComboBox *mCaptureModeComboBox; |
| 56 |
QCheckBox *mCaptureEnabledCheckBox; |
| 57 |
QCheckBox *mIncludeCursorCheckBox; |
| 58 |
QCheckBox *mShowPinWindowCheckBox; |
| 59 |
QCheckBox *mUploadCheckBox; |
| 60 |
QCheckBox *mSaveCheckBox; |
| 61 |
QCheckBox *mCopyToClipboardCheckBox; |
| 62 |
QCheckBox *mOpenDirectoryCheckBox; |
| 63 |
QCheckBox *mHideMainWindowCheckBox; |
| 64 |
QCheckBox *mIsGlobalShortcutCheckBox; |
| 65 |
QLabel *mCaptureModeLabel; |
| 66 |
QLabel *mDelayLabel; |
| 67 |
QLabel *mNameLabel; |
| 68 |
QLabel *mShortcutLabel; |
| 69 |
CustomSpinBox *mDelaySpinBox; |
| 70 |
CustomLineEdit *mNameLineEdit; |
| 71 |
KeySequenceLineEdit *mShortcutLineEdit; |
| 72 |
QPushButton *mShortcutClearButton; |
| 73 |
QGridLayout *mLayout; |
| 74 |
|
| 75 |
void initGui(const QList<CaptureModes> &captureModes); |
| 76 |
void populateCaptureModeCombobox(const QList<CaptureModes> &captureModes); |
| 77 |
int indexOfSelectedCaptureMode(CaptureModes modes) const; |
| 78 |
static QString getTextWithEscapedAmpersand(const QString &text); |
| 79 |
static QString getTextWithoutEscapedAmpersand(const QString &text); |
| 80 |
|
| 81 |
private slots: |
| 82 |
void captureEnabledChanged(); |
| 83 |
void nameEditingFinished(); |
| 84 |
}; |
| 85 |
|
| 86 |
#endif |