ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kbwidget.h
Go to the documentation of this file.
1 #ifndef KBWIDGET_H
2 #define KBWIDGET_H
3 
4 #include <QFile>
5 #include <QListWidgetItem>
6 #include <QWidget>
7 #include "kb.h"
8 
9 // Central widget for displaying/controlling a device
10 
11 namespace Ui {
12 class KbWidget;
13 }
14 
15 class KbWidget : public QWidget
16 {
17  Q_OBJECT
18 
19 public:
20  explicit KbWidget(QWidget *parent, Kb* _device);
21  ~KbWidget();
22 
23  // Device handle
25  inline QString name() const { return device->usbModel; }
26 
27  // Has the "there is a firmware upgrade for this device..." screen already been shown?
29  // Update the "Check for updates" label with the current status
30  void updateFwButton();
31 
32 public slots:
33  // Show a tab
34  void showFirstTab();
35  void showLastTab();
36 
37  // Display firmware update dialog
38  inline void showFwUpdate() { on_fwUpdButton_clicked(); }
39 
40 private:
42  quint64 lastAutoSave;
43 
45 
46  const static int GUID = Qt::UserRole;
47  const static int NEW_FLAG = Qt::UserRole + 1;
48 
49 private slots:
50  void updateProfileList();
51  void profileChanged();
52  void on_profileBox_activated(int index);
53 
54  QIcon modeIcon(int i);
55  void addNewModeItem();
56 
57  void modeChanged(bool spontaneous = true);
58  void on_modesList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
59  void modesList_reordered();
60  void on_modesList_itemChanged(QListWidgetItem *item);
61  void on_modesList_itemClicked(QListWidgetItem *item);
62  void on_modesList_customContextMenuRequested(const QPoint &pos);
63 
64  void devUpdate();
65  void modeUpdate();
67  void on_tabWidget_currentChanged(int index);
69 };
70 
71 #endif // KBWIDGET_H
rgb * current
Definition: main.c:46
void modeUpdate()
Definition: kbwidget.cpp:307
static const int GUID
Definition: kbwidget.h:46
void updateFwButton()
Definition: kbwidget.cpp:326
quint64 lastAutoSave
Definition: kbwidget.h:42
KbMode * currentMode
Definition: kbwidget.h:44
void on_modesList_itemClicked(QListWidgetItem *item)
Definition: kbwidget.cpp:207
void on_tabWidget_currentChanged(int index)
Definition: kbwidget.cpp:317
void on_hwSaveButton_clicked()
Definition: kbwidget.cpp:310
KbWidget(QWidget *parent, Kb *_device)
Definition: kbwidget.cpp:15
QString name() const
Definition: kbwidget.h:25
void modeChanged(bool spontaneous=true)
Definition: kbwidget.cpp:148
bool hasShownNewFW
Definition: kbwidget.h:28
Definition: kbmode.h:36
void showFwUpdate()
Definition: kbwidget.h:38
void showLastTab()
Definition: kbwidget.cpp:68
Definition: kb.h:11
void on_profileBox_activated(int index)
Definition: kbwidget.cpp:113
static const int NEW_FLAG
Definition: kbwidget.h:47
QString usbModel
Definition: kb.h:16
void showFirstTab()
Definition: kbwidget.cpp:64
void modesList_reordered()
Definition: kbwidget.cpp:177
Ui::KbWidget * ui
Definition: kbwidget.h:41
~KbWidget()
Definition: kbwidget.cpp:60
void devUpdate()
Definition: kbwidget.cpp:300
Kb * device
Definition: kbwidget.h:24
void profileChanged()
Definition: kbwidget.cpp:91
void on_fwUpdButton_clicked()
Definition: kbwidget.cpp:339
void on_modesList_itemChanged(QListWidgetItem *item)
Definition: kbwidget.cpp:199
void addNewModeItem()
Definition: kbwidget.cpp:136
void on_modesList_customContextMenuRequested(const QPoint &pos)
KbWidget::on_modesList_customContextMenuRequested.
Definition: kbwidget.cpp:236
QIcon modeIcon(int i)
Definition: kbwidget.cpp:127
void on_modesList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
Definition: kbwidget.cpp:168
void updateProfileList()
Definition: kbwidget.cpp:73