Add custom hotkeys. (#2340)

Co-authored-by: LosFarmosCTL <80157503+LosFarmosCTL@users.noreply.github.com>
Co-authored-by: Paweł <zneix@zneix.eu>
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Mm2PL
2021-11-21 17:46:21 +00:00
committed by GitHub
parent b94e21a600
commit 703f3717e2
54 changed files with 3613 additions and 617 deletions
+59
View File
@@ -0,0 +1,59 @@
#pragma once
#include "controllers/hotkeys/Hotkey.hpp"
#include <QDialog>
#include <memory>
namespace Ui {
class EditHotkeyDialog;
} // namespace Ui
namespace chatterino {
class EditHotkeyDialog : public QDialog
{
Q_OBJECT
public:
explicit EditHotkeyDialog(const std::shared_ptr<Hotkey> data,
bool isAdd = false, QWidget *parent = nullptr);
~EditHotkeyDialog() final;
std::shared_ptr<Hotkey> data();
protected slots:
/**
* @brief validates the hotkey
*
* fired by the ok button
**/
void afterEdit();
/**
* @brief updates the list of actions based on the category
*
* fired by the category picker changing
**/
void updatePossibleActions();
/**
* @brief updates the arguments description and input visibility
*
* fired by the action picker changing
**/
void updateArgumentsInput();
private:
void showEditError(QString errorText);
Ui::EditHotkeyDialog *ui_;
std::shared_ptr<Hotkey> data_;
bool shownSingleKeyWarning = false;
};
} // namespace chatterino