SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Types | Private Slots | Private Member Functions | Private Attributes | List of all members
CWKeyerGUI Class Reference

#include <cwkeyergui.h>

+ Inheritance diagram for CWKeyerGUI:
+ Collaboration diagram for CWKeyerGUI:

Public Member Functions

 CWKeyerGUI (QWidget *parent=nullptr)
 
 ~CWKeyerGUI ()
 
void setCWKeyer (CWKeyer *cwKeyer)
 
void resetToDefaults ()
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 
void setSettings (const CWKeyerSettings &settings)
 
void displaySettings ()
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Private Types

enum  KeyScope { NoKeyScope, DotKeyScope, DashKeyScope }
 

Private Slots

void on_cwTextClear_clicked (bool checked)
 
void on_cwTextEdit_editingFinished ()
 
void on_cwSpeed_valueChanged (int value)
 
void on_playDots_toggled (bool checked)
 
void on_playDashes_toggled (bool checked)
 
void on_playText_toggled (bool checked)
 
void on_playLoopCW_toggled (bool checked)
 
void on_playStop_toggled (bool checked)
 
void on_keyingStyle_toggled (bool checked)
 
void on_keyDotCapture_toggled (bool checked)
 
void on_keyDashCapture_toggled (bool checked)
 
void on_keyboardKeyer_toggled (bool checked)
 
void commandKeyPressed (Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release)
 
void keyboardKeyPressed (Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release)
 

Private Member Functions

void applySettings (bool force=false)
 
void blockApplySettings (bool block)
 
void setKeyLabel (QLabel *label, Qt::Key key, Qt::KeyboardModifiers keyModifiers)
 

Private Attributes

Ui::CWKeyerGUI * ui
 
CWKeyerm_cwKeyer
 
CWKeyerSettings m_settings
 
bool m_doApplySettings
 
CommandKeyReceiverm_commandKeyReceiver
 
KeyScope m_keyScope
 

Detailed Description

Definition at line 38 of file cwkeyergui.h.

Member Enumeration Documentation

◆ KeyScope

enum CWKeyerGUI::KeyScope
private
Enumerator
NoKeyScope 
DotKeyScope 
DashKeyScope 

Definition at line 55 of file cwkeyergui.h.

Constructor & Destructor Documentation

◆ CWKeyerGUI()

CWKeyerGUI::CWKeyerGUI ( QWidget *  parent = nullptr)
explicit

Definition at line 30 of file cwkeyergui.cpp.

References m_commandKeyReceiver, CommandKeyReceiver::setRelease(), and ui.

30  :
31  QWidget(parent),
32  ui(new Ui::CWKeyerGUI),
33  m_cwKeyer(nullptr),
34  m_doApplySettings(true),
36 {
37  ui->setupUi(this);
40  this->installEventFilter(m_commandKeyReceiver);
41 }
bool m_doApplySettings
Definition: cwkeyergui.h:66
CWKeyer * m_cwKeyer
Definition: cwkeyergui.h:64
CommandKeyReceiver * m_commandKeyReceiver
Definition: cwkeyergui.h:67
void setRelease(bool release)
KeyScope m_keyScope
Definition: cwkeyergui.h:68
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:

◆ ~CWKeyerGUI()

CWKeyerGUI::~CWKeyerGUI ( )

Definition at line 43 of file cwkeyergui.cpp.

References m_commandKeyReceiver, and ui.

44 {
45  this->releaseKeyboard(); // just in case
46  m_commandKeyReceiver->deleteLater();
47  delete ui;
48 }
CommandKeyReceiver * m_commandKeyReceiver
Definition: cwkeyergui.h:67
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62

Member Function Documentation

◆ applySettings()

void CWKeyerGUI::applySettings ( bool  force = false)
private

Definition at line 290 of file cwkeyergui.cpp.

References CWKeyer::MsgConfigureCWKeyer::create(), CWKeyer::getInputMessageQueue(), m_cwKeyer, m_doApplySettings, m_settings, and MessageQueue::push().

Referenced by commandKeyPressed(), deserialize(), on_cwSpeed_valueChanged(), on_cwTextClear_clicked(), on_cwTextEdit_editingFinished(), on_keyboardKeyer_toggled(), on_keyingStyle_toggled(), on_playDashes_toggled(), on_playDots_toggled(), on_playLoopCW_toggled(), on_playText_toggled(), and resetToDefaults().

291 {
293  {
295  m_cwKeyer->getInputMessageQueue()->push(message);
296  }
297 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static MsgConfigureCWKeyer * create(const CWKeyerSettings &settings, bool force)
Definition: cwkeyer.h:63
bool m_doApplySettings
Definition: cwkeyergui.h:66
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
Definition: cwkeyer.h:104
CWKeyer * m_cwKeyer
Definition: cwkeyergui.h:64
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

void CWKeyerGUI::blockApplySettings ( bool  block)
private

Definition at line 346 of file cwkeyergui.cpp.

References m_doApplySettings.

Referenced by displaySettings().

347 {
348  m_doApplySettings = !block;
349 }
bool m_doApplySettings
Definition: cwkeyergui.h:66
+ Here is the caller graph for this function:

◆ commandKeyPressed

void CWKeyerGUI::commandKeyPressed ( Qt::Key  key,
Qt::KeyboardModifiers  keyModifiers,
bool  release 
)
privateslot

Definition at line 221 of file cwkeyergui.cpp.

References applySettings(), DashKeyScope, DotKeyScope, m_commandKeyReceiver, CWKeyerSettings::m_dashKey, CWKeyerSettings::m_dashKeyModifiers, CWKeyerSettings::m_dotKey, CWKeyerSettings::m_dotKeyModifiers, m_keyScope, m_settings, setKeyLabel(), CommandKeyReceiver::setRelease(), and ui.

Referenced by on_keyDashCapture_toggled(), and on_keyDotCapture_toggled().

222 {
223  (void) release;
224  // qDebug("CWKeyerGUI::commandKeyPressed: key scope: %d", (int) m_keyScope);
225  // qDebug("CWKeyerGUI::commandKeyPressed: key: %x", key);
226  // qDebug("CWKeyerGUI::commandKeyPressed: has modifiers: %x", QFlags<Qt::KeyboardModifier>::Int(keyModifiers));
227 
228  if (m_keyScope == DotKeyScope)
229  {
230  setKeyLabel(ui->keyDotLabel, key, keyModifiers);
231  ui->keyDotCapture->setChecked(false);
232  m_settings.m_dotKey = key;
233  m_settings.m_dotKeyModifiers = keyModifiers;
234  applySettings();
235  }
236  else if (m_keyScope == DashKeyScope)
237  {
238  setKeyLabel(ui->keyDashLabel, key, keyModifiers);
239  ui->keyDashCapture->setChecked(false);
240  m_settings.m_dashKey = key;
241  m_settings.m_dashKeyModifiers = keyModifiers;
242  applySettings();
243  }
244 
246 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
void setKeyLabel(QLabel *label, Qt::Key key, Qt::KeyboardModifiers keyModifiers)
Definition: cwkeyergui.cpp:328
CommandKeyReceiver * m_commandKeyReceiver
Definition: cwkeyergui.h:67
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
void setRelease(bool release)
Qt::KeyboardModifiers m_dotKeyModifiers
Qt::KeyboardModifiers m_dashKeyModifiers
KeyScope m_keyScope
Definition: cwkeyergui.h:68
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

bool CWKeyerGUI::deserialize ( const QByteArray &  data)
virtual

Implements Serializable.

Definition at line 69 of file cwkeyergui.cpp.

References applySettings(), CWKeyerSettings::deserialize(), displaySettings(), m_settings, and resetToDefaults().

70 {
71  if (m_settings.deserialize(data))
72  {
74  applySettings(true);
75  return true;
76  }
77  else
78  {
80  return false;
81  }
82 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
bool deserialize(const QByteArray &data)
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
void resetToDefaults()
Definition: cwkeyergui.cpp:57
void displaySettings()
Definition: cwkeyergui.cpp:299
+ Here is the call graph for this function:

◆ displaySettings()

void CWKeyerGUI::displaySettings ( )

Definition at line 299 of file cwkeyergui.cpp.

References arg(), blockApplySettings(), CWKeyerSettings::CWDashes, CWKeyerSettings::CWDots, CWKeyerSettings::CWKeyboard, CWKeyerSettings::CWNone, CWKeyerSettings::CWText, CWKeyerSettings::m_dashKey, CWKeyerSettings::m_dashKeyModifiers, CWKeyerSettings::m_dotKey, CWKeyerSettings::m_dotKeyModifiers, CWKeyerSettings::m_keyboardIambic, CWKeyerSettings::m_loop, CWKeyerSettings::m_mode, m_settings, CWKeyerSettings::m_text, CWKeyerSettings::m_wpm, setKeyLabel(), and ui.

Referenced by deserialize(), resetToDefaults(), and setCWKeyer().

300 {
301  blockApplySettings(true);
302 
303  ui->playLoopCW->setChecked(m_settings.m_loop);
304 
306  ui->playDots->setChecked(m_settings.m_mode == CWKeyerSettings::CWDots);
307 
309  ui->playDashes->setChecked(m_settings.m_mode == CWKeyerSettings::CWDashes);
310 
312  ui->playText->setChecked(m_settings.m_mode == CWKeyerSettings::CWText);
313 
315  ui->keyboardKeyer->setChecked(m_settings.m_mode == CWKeyerSettings::CWKeyboard);
316 
317  ui->cwTextEdit->setText(m_settings.m_text);
318  ui->cwSpeed->setValue(m_settings.m_wpm);
319  ui->cwSpeedText->setText(QString("%1").arg(m_settings.m_wpm));
320  ui->keyingStyle->setChecked(!m_settings.m_keyboardIambic);
321 
324 
325  blockApplySettings(false);
326 }
void setKeyLabel(QLabel *label, Qt::Key key, Qt::KeyboardModifiers keyModifiers)
Definition: cwkeyergui.cpp:328
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
Qt::KeyboardModifiers m_dotKeyModifiers
Qt::KeyboardModifiers m_dashKeyModifiers
void blockApplySettings(bool block)
Definition: cwkeyergui.cpp:346
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ keyboardKeyPressed

void CWKeyerGUI::keyboardKeyPressed ( Qt::Key  key,
Qt::KeyboardModifiers  keyModifiers,
bool  release 
)
privateslot

Definition at line 264 of file cwkeyergui.cpp.

References CWKeyer::getSettings(), m_cwKeyer, CWKeyerSettings::m_dashKey, CWKeyerSettings::m_dashKeyModifiers, CWKeyerSettings::m_dotKey, CWKeyerSettings::m_dotKeyModifiers, CWKeyer::setKeyboardDashes(), CWKeyer::setKeyboardDots(), and CWKeyer::setKeyboardSilence().

Referenced by on_keyboardKeyer_toggled().

265 {
266  const CWKeyerSettings& settings = m_cwKeyer->getSettings();
267 
268  if ((key == settings.m_dotKey) && (keyModifiers == settings.m_dotKeyModifiers))
269  {
270  qDebug("CWKeyerGUI::keyboardKeyPressed: dot %s", release ? "released" : "pressed");
271  if (release) {
273  } else {
275  }
276  }
277  else if ((key == settings.m_dashKey) && (keyModifiers == settings.m_dashKeyModifiers))
278  {
279  qDebug("CWKeyerGUI::keyboardKeyPressed: dash %s", release ? "released" : "pressed");
280  if (release) {
282  } else {
284  }
285  }
286 }
void setKeyboardDashes()
Definition: cwkeyer.cpp:430
void setKeyboardDots()
Definition: cwkeyer.cpp:423
void setKeyboardSilence()
Definition: cwkeyer.cpp:437
CWKeyer * m_cwKeyer
Definition: cwkeyergui.h:64
Qt::KeyboardModifiers m_dotKeyModifiers
Qt::KeyboardModifiers m_dashKeyModifiers
const CWKeyerSettings & getSettings() const
Definition: cwkeyer.h:107
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_cwSpeed_valueChanged

void CWKeyerGUI::on_cwSpeed_valueChanged ( int  value)
privateslot

Definition at line 100 of file cwkeyergui.cpp.

References applySettings(), arg(), m_settings, CWKeyerSettings::m_wpm, and ui.

101 {
102  ui->cwSpeedText->setText(QString("%1").arg(value));
103  m_settings.m_wpm = value;
104  applySettings();
105 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:

◆ on_cwTextClear_clicked

void CWKeyerGUI::on_cwTextClear_clicked ( bool  checked)
privateslot

Definition at line 86 of file cwkeyergui.cpp.

References applySettings(), m_settings, CWKeyerSettings::m_text, and ui.

87 {
88  (void) checked;
89  ui->cwTextEdit->clear();
90  m_settings.m_text = "";
91  applySettings();
92 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:

◆ on_cwTextEdit_editingFinished

void CWKeyerGUI::on_cwTextEdit_editingFinished ( )
privateslot

Definition at line 94 of file cwkeyergui.cpp.

References applySettings(), m_settings, CWKeyerSettings::m_text, and ui.

95 {
96  m_settings.m_text = ui->cwTextEdit->text();
97  applySettings();
98 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:

◆ on_keyboardKeyer_toggled

void CWKeyerGUI::on_keyboardKeyer_toggled ( bool  checked)
privateslot

Definition at line 248 of file cwkeyergui.cpp.

References applySettings(), MainWindow::commandKeysConnect(), MainWindow::commandKeysDisconnect(), CWKeyerSettings::CWKeyboard, CWKeyerSettings::CWNone, MainWindow::getInstance(), keyboardKeyPressed(), CWKeyerSettings::m_mode, m_settings, and ui.

249 {
250  qDebug("CWKeyerGUI::on_keyboardKeyer_toggled: %s", checked ? "true" : "false");
251  ui->playDots->setEnabled(!checked); // block or release other source inputs
252  ui->playDashes->setEnabled(!checked);
253  ui->playText->setEnabled(!checked);
255  applySettings();
256 
257  if (checked) {
258  MainWindow::getInstance()->commandKeysConnect(this, SLOT(keyboardKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool)));
259  } else {
260  MainWindow::getInstance()->commandKeysDisconnect(this, SLOT(keyboardKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool)));
261  }
262 }
static MainWindow * getInstance()
Definition: mainwindow.h:73
void commandKeysConnect(QObject *object, const char *slot)
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
void keyboardKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release)
Definition: cwkeyergui.cpp:264
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
void commandKeysDisconnect(QObject *object, const char *slot)
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:

◆ on_keyDashCapture_toggled

void CWKeyerGUI::on_keyDashCapture_toggled ( bool  checked)
privateslot

Definition at line 192 of file cwkeyergui.cpp.

References commandKeyPressed(), DashKeyScope, m_commandKeyReceiver, m_keyScope, NoKeyScope, CommandKeyReceiver::setRelease(), and ui.

193 {
194  if (checked && ui->keyDotCapture->isChecked())
195  {
196  ui->keyDotCapture->setChecked(false);
197  ui->keyDashCapture->setChecked(false);
198  return;
199  }
200 
201  if (checked)
202  {
205  setFocus();
206  setFocusPolicy(Qt::StrongFocus);
207  connect(m_commandKeyReceiver, SIGNAL(capturedKey(Qt::Key, Qt::KeyboardModifiers, bool)),
208  this, SLOT(commandKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool)));
209  }
210  else
211  {
214  disconnect(m_commandKeyReceiver, SIGNAL(capturedKey(Qt::Key, Qt::KeyboardModifiers, bool)),
215  this, SLOT(commandKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool)));
216  setFocusPolicy(Qt::NoFocus);
217  clearFocus();
218  }
219 }
void commandKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release)
Definition: cwkeyergui.cpp:221
CommandKeyReceiver * m_commandKeyReceiver
Definition: cwkeyergui.h:67
void setRelease(bool release)
KeyScope m_keyScope
Definition: cwkeyergui.h:68
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:

◆ on_keyDotCapture_toggled

void CWKeyerGUI::on_keyDotCapture_toggled ( bool  checked)
privateslot

Definition at line 165 of file cwkeyergui.cpp.

References commandKeyPressed(), DotKeyScope, m_commandKeyReceiver, m_keyScope, NoKeyScope, and ui.

166 {
167  if (checked && ui->keyDashCapture->isChecked())
168  {
169  ui->keyDotCapture->setChecked(false);
170  ui->keyDashCapture->setChecked(false);
171  return;
172  }
173 
174  if (checked)
175  {
177  setFocus();
178  setFocusPolicy(Qt::StrongFocus);
179  connect(m_commandKeyReceiver, SIGNAL(capturedKey(Qt::Key, Qt::KeyboardModifiers, bool)),
180  this, SLOT(commandKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool)));
181  }
182  else
183  {
185  disconnect(m_commandKeyReceiver, SIGNAL(capturedKey(Qt::Key, Qt::KeyboardModifiers, bool)),
186  this, SLOT(commandKeyPressed(Qt::Key, Qt::KeyboardModifiers, bool)));
187  setFocusPolicy(Qt::NoFocus);
188  clearFocus();
189  }
190 }
void commandKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release)
Definition: cwkeyergui.cpp:221
CommandKeyReceiver * m_commandKeyReceiver
Definition: cwkeyergui.h:67
KeyScope m_keyScope
Definition: cwkeyergui.h:68
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:

◆ on_keyingStyle_toggled

void CWKeyerGUI::on_keyingStyle_toggled ( bool  checked)
privateslot

Definition at line 159 of file cwkeyergui.cpp.

References applySettings(), CWKeyerSettings::m_keyboardIambic, and m_settings.

160 {
161  m_settings.m_keyboardIambic = !checked;
162  applySettings();
163 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
+ Here is the call graph for this function:

◆ on_playDashes_toggled

void CWKeyerGUI::on_playDashes_toggled ( bool  checked)
privateslot

Definition at line 117 of file cwkeyergui.cpp.

References applySettings(), CWKeyerSettings::CWDashes, CWKeyerSettings::CWNone, CWKeyerSettings::m_mode, m_settings, and ui.

118 {
119  ui->playDots->setEnabled(!checked); // release other source inputs
120  //ui->playDashes->setEnabled(!checked);
121  ui->playText->setEnabled(!checked);
122  ui->keyboardKeyer->setEnabled(!checked);
124  applySettings();
125 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:

◆ on_playDots_toggled

void CWKeyerGUI::on_playDots_toggled ( bool  checked)
privateslot

Definition at line 107 of file cwkeyergui.cpp.

References applySettings(), CWKeyerSettings::CWDots, CWKeyerSettings::CWNone, CWKeyerSettings::m_mode, m_settings, and ui.

108 {
109  //ui->playDots->setEnabled(!checked); // release other source inputs
110  ui->playDashes->setEnabled(!checked);
111  ui->playText->setEnabled(!checked);
112  ui->keyboardKeyer->setEnabled(!checked);
114  applySettings();
115 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:

◆ on_playLoopCW_toggled

void CWKeyerGUI::on_playLoopCW_toggled ( bool  checked)
privateslot

Definition at line 144 of file cwkeyergui.cpp.

References applySettings(), CWKeyerSettings::m_loop, and m_settings.

145 {
146  m_settings.m_loop = checked;
147  applySettings();
148 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
+ Here is the call graph for this function:

◆ on_playStop_toggled

void CWKeyerGUI::on_playStop_toggled ( bool  checked)
privateslot

Definition at line 150 of file cwkeyergui.cpp.

References m_cwKeyer, CWKeyer::resetText(), and CWKeyer::stopText().

151 {
152  if (checked) {
153  m_cwKeyer->resetText();
154  } else {
155  m_cwKeyer->stopText();
156  }
157 }
void resetText()
Definition: cwkeyer.h:114
CWKeyer * m_cwKeyer
Definition: cwkeyergui.h:64
void stopText()
Definition: cwkeyer.h:115
+ Here is the call graph for this function:

◆ on_playText_toggled

void CWKeyerGUI::on_playText_toggled ( bool  checked)
privateslot

Definition at line 127 of file cwkeyergui.cpp.

References applySettings(), CWKeyerSettings::CWNone, CWKeyerSettings::CWText, CWKeyerSettings::m_mode, m_settings, and ui.

128 {
129  ui->playDots->setEnabled(!checked); // release other source inputs
130  ui->playDashes->setEnabled(!checked);
131  //ui->playText->setEnabled(!checked);
132  ui->keyboardKeyer->setEnabled(!checked);
133 
134  if (checked) {
135  ui->playStop->setChecked(true);
136  } else {
137  ui->playStop->setChecked(false);
138  }
139 
141  applySettings();
142 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
Ui::CWKeyerGUI * ui
Definition: cwkeyergui.h:62
+ Here is the call graph for this function:

◆ resetToDefaults()

void CWKeyerGUI::resetToDefaults ( )

Definition at line 57 of file cwkeyergui.cpp.

References applySettings(), displaySettings(), m_settings, and CWKeyerSettings::resetToDefaults().

Referenced by deserialize().

58 {
61  applySettings(true);
62 }
void applySettings(bool force=false)
Definition: cwkeyergui.cpp:290
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
void displaySettings()
Definition: cwkeyergui.cpp:299
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray CWKeyerGUI::serialize ( ) const
virtual

Implements Serializable.

Definition at line 64 of file cwkeyergui.cpp.

References m_settings, and CWKeyerSettings::serialize().

65 {
66  return m_settings.serialize();
67 }
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCWKeyer()

void CWKeyerGUI::setCWKeyer ( CWKeyer cwKeyer)

Definition at line 50 of file cwkeyergui.cpp.

References displaySettings(), CWKeyer::getSettings(), m_cwKeyer, and setSettings().

51 {
52  m_cwKeyer = cwKeyer;
53  setSettings(cwKeyer->getSettings());
55 }
void setSettings(const CWKeyerSettings &settings)
Definition: cwkeyergui.h:51
CWKeyer * m_cwKeyer
Definition: cwkeyergui.h:64
void displaySettings()
Definition: cwkeyergui.cpp:299
const CWKeyerSettings & getSettings() const
Definition: cwkeyer.h:107
+ Here is the call graph for this function:

◆ setKeyLabel()

void CWKeyerGUI::setKeyLabel ( QLabel *  label,
Qt::Key  key,
Qt::KeyboardModifiers  keyModifiers 
)
private

Definition at line 328 of file cwkeyergui.cpp.

Referenced by commandKeyPressed(), and displaySettings().

329 {
330  if (key == 0)
331  {
332  label->setText("");
333  }
334  else if (keyModifiers != Qt::NoModifier)
335  {
336  QString altGrStr = keyModifiers & Qt::GroupSwitchModifier ? "Gr " : "";
337  int maskedModifiers = (keyModifiers & 0x3FFFFFFF) + ((keyModifiers & 0x40000000)>>3);
338  label->setText(altGrStr + QKeySequence(maskedModifiers, key).toString());
339  }
340  else
341  {
342  label->setText(QKeySequence(key).toString());
343  }
344 }
+ Here is the caller graph for this function:

◆ setSettings()

void CWKeyerGUI::setSettings ( const CWKeyerSettings settings)
inline

Definition at line 51 of file cwkeyergui.h.

Referenced by setCWKeyer().

51 { m_settings = settings; }
CWKeyerSettings m_settings
Definition: cwkeyergui.h:65
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_commandKeyReceiver

CommandKeyReceiver* CWKeyerGUI::m_commandKeyReceiver
private

◆ m_cwKeyer

CWKeyer* CWKeyerGUI::m_cwKeyer
private

Definition at line 64 of file cwkeyergui.h.

Referenced by applySettings(), keyboardKeyPressed(), on_playStop_toggled(), and setCWKeyer().

◆ m_doApplySettings

bool CWKeyerGUI::m_doApplySettings
private

Definition at line 66 of file cwkeyergui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_keyScope

KeyScope CWKeyerGUI::m_keyScope
private

◆ m_settings

CWKeyerSettings CWKeyerGUI::m_settings
private

◆ ui

Ui::CWKeyerGUI* CWKeyerGUI::ui
private

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