-
Notifications
You must be signed in to change notification settings - Fork 0
/
component.cpp
executable file
·43 lines (38 loc) · 1.12 KB
/
component.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <QAction>
#include <QSettings>
#include "component.h"
/*!
* \brief Creates and connects an action for muting.
* \param parent The parent widget, used for Qt's parent/child memory
* management.
*/
Component::Component(QWidget *parent) : QWidget(parent), muted(false)
{
muteAction = new QAction("Mute", this);
muteAction->setCheckable(true);
connect(muteAction, SIGNAL(triggered(bool)), this, SLOT(setMute(bool)));
}
Component::~Component() {}
/*!
* \brief Sets if the component should be in the list of components to speak and
* wait for.
* \param mute If the component should be muted.
*/
void Component::setMute(bool mute) { muted = mute; }
/*!
* \brief Gets a list of menu items used for interacting with the component's
* features from the main menu.
* \return The list to be added to the main menu.
*/
QList<QAction *> Component::getMenuContents()
{
QList<QAction *> actions;
actions.append(muteAction);
return actions;
}
/*!
* \brief Indicated if the component should have its message sent in a
* notification/speech
* \return If the component is muted.
*/
bool Component::isMuted() { return muted; }