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
AnimAddDialog Class Reference

#include <src/ckb/animadddialog.h>

+ Inheritance diagram for AnimAddDialog:
+ Collaboration diagram for AnimAddDialog:

Public Member Functions

 AnimAddDialog (QWidget *parent, KbLight *light, const QStringList &keys)
 
 ~AnimAddDialog ()
 
const AnimScriptchosenScript ()
 
int chosenPreset ()
 

Private Slots

void on_animBox_activated (int index)
 
void on_presetBox_activated (int index)
 
void on_previewBox_clicked (bool checked)
 

Private Attributes

Ui::AnimAddDialogui
 
QList< const AnimScript * > scripts
 
KbLight_light
 
QStringList _keys
 
bool showPreview
 

Detailed Description

Definition at line 12 of file animadddialog.h.

Constructor & Destructor Documentation

AnimAddDialog::AnimAddDialog ( QWidget parent,
KbLight light,
const QStringList &  keys 
)
explicit

Definition at line 4 of file animadddialog.cpp.

References Ui_AnimAddDialog::animBox, AnimScript::list(), AnimScript::name(), on_animBox_activated(), scripts, Ui_AnimAddDialog::setupUi(), and ui.

4  :
5  QDialog(parent),
6  ui(new Ui::AnimAddDialog), _light(light), _keys(keys), showPreview(true)
7 {
8  ui->setupUi(this);
10  foreach(const AnimScript* script, scripts)
11  ui->animBox->addItem(script->name());
13 }
Ui::AnimAddDialog * ui
Definition: animadddialog.h:29
static QList< const AnimScript * > list()
Definition: animscript.cpp:51
void setupUi(QDialog *AnimAddDialog)
QComboBox * animBox
void on_animBox_activated(int index)
QList< const AnimScript * > scripts
Definition: animadddialog.h:30
const QString & name() const
Definition: animscript.h:60
QStringList _keys
Definition: animadddialog.h:33
KbLight * _light
Definition: animadddialog.h:32

+ Here is the call graph for this function:

AnimAddDialog::~AnimAddDialog ( )

Definition at line 15 of file animadddialog.cpp.

References _light, KbLight::stopPreview(), and ui.

15  {
16  delete ui;
18 }
void stopPreview()
Definition: kblight.cpp:143
Ui::AnimAddDialog * ui
Definition: animadddialog.h:29
KbLight * _light
Definition: animadddialog.h:32

+ Here is the call graph for this function:

Member Function Documentation

int AnimAddDialog::chosenPreset ( )

Definition at line 24 of file animadddialog.cpp.

References Ui_AnimAddDialog::presetBox, and ui.

Referenced by KbLightWidget::on_animButton_clicked().

24  {
25  return ui->presetBox->currentIndex();
26 }
Ui::AnimAddDialog * ui
Definition: animadddialog.h:29
QComboBox * presetBox

+ Here is the caller graph for this function:

const AnimScript * AnimAddDialog::chosenScript ( )

Definition at line 20 of file animadddialog.cpp.

References Ui_AnimAddDialog::animBox, scripts, and ui.

Referenced by on_animBox_activated(), KbLightWidget::on_animButton_clicked(), and on_presetBox_activated().

20  {
21  return scripts[ui->animBox->currentIndex()];
22 }
Ui::AnimAddDialog * ui
Definition: animadddialog.h:29
QComboBox * animBox
QList< const AnimScript * > scripts
Definition: animadddialog.h:30

+ Here is the caller graph for this function:

void AnimAddDialog::on_animBox_activated ( int  index)
privateslot

Definition at line 28 of file animadddialog.cpp.

References chosenScript(), on_presetBox_activated(), Ui_AnimAddDialog::presetBox, and ui.

Referenced by AnimAddDialog().

28  {
29  // Update preset list
30  ui->presetBox->clear();
31  foreach(const QString& preset, chosenScript()->presets())
32  ui->presetBox->addItem(preset);
33  ui->presetBox->setCurrentIndex(0);
35 }
Ui::AnimAddDialog * ui
Definition: animadddialog.h:29
const AnimScript * chosenScript()
void on_presetBox_activated(int index)
QComboBox * presetBox

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimAddDialog::on_presetBox_activated ( int  index)
privateslot

Definition at line 37 of file animadddialog.cpp.

References _keys, _light, chosenScript(), KbLight::previewAnim(), and showPreview.

Referenced by on_animBox_activated(), and on_previewBox_clicked().

37  {
38  // Update preview
39  if(showPreview)
40  _light->previewAnim(chosenScript(), _keys, chosenScript()->preset(index));
41 }
void previewAnim(const AnimScript *base, const QStringList &keys, const QMap< QString, QVariant > &preset)
Definition: kblight.cpp:124
QStringList _keys
Definition: animadddialog.h:33
const AnimScript * chosenScript()
KbLight * _light
Definition: animadddialog.h:32

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimAddDialog::on_previewBox_clicked ( bool  checked)
privateslot

Definition at line 43 of file animadddialog.cpp.

References _light, on_presetBox_activated(), Ui_AnimAddDialog::presetBox, showPreview, KbLight::stopPreview(), and ui.

43  {
44  showPreview = checked;
45  if(showPreview)
46  on_presetBox_activated(ui->presetBox->currentIndex());
47  else
49 }
void stopPreview()
Definition: kblight.cpp:143
Ui::AnimAddDialog * ui
Definition: animadddialog.h:29
KbLight * _light
Definition: animadddialog.h:32
void on_presetBox_activated(int index)
QComboBox * presetBox

+ Here is the call graph for this function:

Field Documentation

QStringList AnimAddDialog::_keys
private

Definition at line 33 of file animadddialog.h.

Referenced by on_presetBox_activated().

KbLight* AnimAddDialog::_light
private

Definition at line 32 of file animadddialog.h.

Referenced by on_presetBox_activated(), on_previewBox_clicked(), and ~AnimAddDialog().

QList<const AnimScript*> AnimAddDialog::scripts
private

Definition at line 30 of file animadddialog.h.

Referenced by AnimAddDialog(), and chosenScript().

bool AnimAddDialog::showPreview
private

Definition at line 34 of file animadddialog.h.

Referenced by on_presetBox_activated(), and on_previewBox_clicked().


The documentation for this class was generated from the following files: