/[svn]/qsampler/trunk/src/qsamplerOptionsForm.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerOptionsForm.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1505 by capela, Wed Nov 21 18:37:40 2007 UTC revision 1558 by capela, Thu Dec 6 09:35:33 2007 UTC
# Line 31  Line 31 
31    
32  namespace QSampler {  namespace QSampler {
33    
34  OptionsForm::OptionsForm(QWidget* parent) : QDialog(parent)  //-------------------------------------------------------------------------
35    // QSampler::OptionsForm -- Options form implementation.
36    //
37    
38    OptionsForm::OptionsForm ( QWidget* pParent )
39            : QDialog(pParent)
40  {  {
41          ui.setupUi(this);          m_ui.setupUi(this);
42    
43          // No settings descriptor initially (the caller will set it).          // No settings descriptor initially (the caller will set it).
44          m_pOptions = NULL;          m_pOptions = NULL;
# Line 43  OptionsForm::OptionsForm(QWidget* parent Line 48  OptionsForm::OptionsForm(QWidget* parent
48          m_iDirtyCount = 0;          m_iDirtyCount = 0;
49    
50          // Set dialog validators...          // Set dialog validators...
51          ui.ServerPortComboBox->setValidator(new QIntValidator(ui.ServerPortComboBox));          m_ui.ServerPortComboBox->setValidator(
52                    new QIntValidator(m_ui.ServerPortComboBox));
53    
54          // Try to restore old window positioning.          // Try to restore old window positioning.
55          adjustSize();          adjustSize();
56    
57          QObject::connect(ui.ServerHostComboBox,          QObject::connect(m_ui.ServerHostComboBox,
58                  SIGNAL(editTextChanged(const QString&)),                  SIGNAL(editTextChanged(const QString&)),
59                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
60          QObject::connect(ui.ServerPortComboBox,          QObject::connect(m_ui.ServerPortComboBox,
61                  SIGNAL(editTextChanged(const QString&)),                  SIGNAL(editTextChanged(const QString&)),
62                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
63          QObject::connect(ui.ServerTimeoutSpinBox,          QObject::connect(m_ui.ServerTimeoutSpinBox,
64                  SIGNAL(valueChanged(int)),                  SIGNAL(valueChanged(int)),
65                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
66          QObject::connect(ui.ServerStartCheckBox,          QObject::connect(m_ui.ServerStartCheckBox,
67                  SIGNAL(stateChanged(int)),                  SIGNAL(stateChanged(int)),
68                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
69          QObject::connect(ui.ServerCmdLineComboBox,          QObject::connect(m_ui.ServerCmdLineComboBox,
70                  SIGNAL(editTextChanged(const QString&)),                  SIGNAL(editTextChanged(const QString&)),
71                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
72          QObject::connect(ui.StartDelaySpinBox,          QObject::connect(m_ui.StartDelaySpinBox,
73                  SIGNAL(valueChanged(int)),                  SIGNAL(valueChanged(int)),
74                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
75          QObject::connect(ui.DisplayFontPushButton,          QObject::connect(m_ui.DisplayFontPushButton,
76                  SIGNAL(clicked()),                  SIGNAL(clicked()),
77                  SLOT(chooseDisplayFont()));                  SLOT(chooseDisplayFont()));
78          QObject::connect(ui.DisplayEffectCheckBox,          QObject::connect(m_ui.DisplayEffectCheckBox,
79                  SIGNAL(toggled(bool)),                  SIGNAL(toggled(bool)),
80                  SLOT(toggleDisplayEffect(bool)));                  SLOT(toggleDisplayEffect(bool)));
81          QObject::connect(ui.AutoRefreshCheckBox,          QObject::connect(m_ui.AutoRefreshCheckBox,
82                  SIGNAL(stateChanged(int)),                  SIGNAL(stateChanged(int)),
83                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
84          QObject::connect(ui.AutoRefreshTimeSpinBox,          QObject::connect(m_ui.AutoRefreshTimeSpinBox,
85                  SIGNAL(valueChanged(int)),                  SIGNAL(valueChanged(int)),
86                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
87          QObject::connect(ui.MaxVolumeSpinBox,          QObject::connect(m_ui.MaxVolumeSpinBox,
88                  SIGNAL(valueChanged(int)),                  SIGNAL(valueChanged(int)),
89                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
90          QObject::connect(ui.MessagesFontPushButton,          QObject::connect(m_ui.MessagesFontPushButton,
91                  SIGNAL(clicked()),                  SIGNAL(clicked()),
92                  SLOT(chooseMessagesFont()));                  SLOT(chooseMessagesFont()));
93          QObject::connect(ui.MessagesLimitCheckBox,          QObject::connect(m_ui.MessagesLimitCheckBox,
94                  SIGNAL(stateChanged(int)),                  SIGNAL(stateChanged(int)),
95                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
96          QObject::connect(ui.MessagesLimitLinesSpinBox,          QObject::connect(m_ui.MessagesLimitLinesSpinBox,
97                  SIGNAL(valueChanged(int)),                  SIGNAL(valueChanged(int)),
98                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
99          QObject::connect(ui.ConfirmRemoveCheckBox,          QObject::connect(m_ui.ConfirmRemoveCheckBox,
100                  SIGNAL(stateChanged(int)),                  SIGNAL(stateChanged(int)),
101                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
102          QObject::connect(ui.KeepOnTopCheckBox,          QObject::connect(m_ui.KeepOnTopCheckBox,
103                  SIGNAL(stateChanged(int)),                  SIGNAL(stateChanged(int)),
104                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
105          QObject::connect(ui.StdoutCaptureCheckBox,          QObject::connect(m_ui.StdoutCaptureCheckBox,
106                  SIGNAL(stateChanged(int)),                  SIGNAL(stateChanged(int)),
107                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
108          QObject::connect(ui.MaxRecentFilesSpinBox,          QObject::connect(m_ui.MaxRecentFilesSpinBox,
109                  SIGNAL(valueChanged(int)),                  SIGNAL(valueChanged(int)),
110                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
111          QObject::connect(ui.CompletePathCheckBox,          QObject::connect(m_ui.CompletePathCheckBox,
112                  SIGNAL(stateChanged(int)),                  SIGNAL(stateChanged(int)),
113                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
114          QObject::connect(ui.InstrumentNamesCheckBox,          QObject::connect(m_ui.InstrumentNamesCheckBox,
115                  SIGNAL(stateChanged(int)),                  SIGNAL(stateChanged(int)),
116                  SLOT(optionsChanged()));                  SLOT(optionsChanged()));
117          QObject::connect(ui.OkPushButton,          QObject::connect(m_ui.OkPushButton,
118                  SIGNAL(clicked()),                  SIGNAL(clicked()),
119                  SLOT(accept()));                  SLOT(accept()));
120          QObject::connect(ui.CancelPushButton,          QObject::connect(m_ui.CancelPushButton,
121                  SIGNAL(clicked()),                  SIGNAL(clicked()),
122                  SLOT(reject()));                  SLOT(reject()));
123  }  }
# Line 121  OptionsForm::~OptionsForm() Line 127  OptionsForm::~OptionsForm()
127  }  }
128    
129  // Populate (setup) dialog controls from settings descriptors.  // Populate (setup) dialog controls from settings descriptors.
130  void OptionsForm::setup ( qsamplerOptions *pOptions )  void OptionsForm::setup ( Options *pOptions )
131  {  {
132      // Set reference descriptor.          // Set reference descriptor.
133      m_pOptions = pOptions;          m_pOptions = pOptions;
134    
135            // Start clean.
136            m_iDirtyCount = 0;
137            // Avoid nested changes.
138            m_iDirtySetup++;
139    
140      // Start clean.          // Load combo box history...
141      m_iDirtyCount = 0;          m_pOptions->loadComboBoxHistory(m_ui.ServerHostComboBox);
142      // Avoid nested changes.          m_pOptions->loadComboBoxHistory(m_ui.ServerPortComboBox);
143      m_iDirtySetup++;          m_pOptions->loadComboBoxHistory(m_ui.ServerCmdLineComboBox);
144    
145      // Load combo box history...          // Load Server settings...
146      m_pOptions->loadComboBoxHistory(ui.ServerHostComboBox);          m_ui.ServerHostComboBox->setEditText(m_pOptions->sServerHost);
147      m_pOptions->loadComboBoxHistory(ui.ServerPortComboBox);          m_ui.ServerPortComboBox->setEditText(QString::number(m_pOptions->iServerPort));
148      m_pOptions->loadComboBoxHistory(ui.ServerCmdLineComboBox);          m_ui.ServerTimeoutSpinBox->setValue(m_pOptions->iServerTimeout);
149            m_ui.ServerStartCheckBox->setChecked(m_pOptions->bServerStart);
150      // Load Server settings...          m_ui.ServerCmdLineComboBox->setEditText(m_pOptions->sServerCmdLine);
151          ui.ServerHostComboBox->setEditText(m_pOptions->sServerHost);          m_ui.StartDelaySpinBox->setValue(m_pOptions->iStartDelay);
         ui.ServerPortComboBox->setEditText(QString::number(m_pOptions->iServerPort));  
     ui.ServerTimeoutSpinBox->setValue(m_pOptions->iServerTimeout);  
     ui.ServerStartCheckBox->setChecked(m_pOptions->bServerStart);  
         ui.ServerCmdLineComboBox->setEditText(m_pOptions->sServerCmdLine);  
     ui.StartDelaySpinBox->setValue(m_pOptions->iStartDelay);  
152    
153      // Load Display options...          // Load Display options...
154      QFont font;          QFont font;
155          QPalette pal;          QPalette pal;
156    
157      // Display font.          // Display font.
158      if (m_pOptions->sDisplayFont.isEmpty() || !font.fromString(m_pOptions->sDisplayFont))          if (m_pOptions->sDisplayFont.isEmpty()
159          font = QFont("Sans Serif", 8);                  || !font.fromString(m_pOptions->sDisplayFont))
160      ui.DisplayFontTextLabel->setFont(font);                  font = QFont("Sans Serif", 8);
161      ui.DisplayFontTextLabel->setText(font.family() + " " + QString::number(font.pointSize()));          m_ui.DisplayFontTextLabel->setFont(font);
162            m_ui.DisplayFontTextLabel->setText(font.family()
163      // Display effect.                  + ' ' + QString::number(font.pointSize()));
164      ui.DisplayEffectCheckBox->setChecked(m_pOptions->bDisplayEffect);  
165      toggleDisplayEffect(m_pOptions->bDisplayEffect);          // Display effect.
166            m_ui.DisplayEffectCheckBox->setChecked(m_pOptions->bDisplayEffect);
167      // Auto-refresh and maximum volume options.          toggleDisplayEffect(m_pOptions->bDisplayEffect);
168      ui.AutoRefreshCheckBox->setChecked(m_pOptions->bAutoRefresh);  
169      ui.AutoRefreshTimeSpinBox->setValue(m_pOptions->iAutoRefreshTime);          // Auto-refresh and maximum volume options.
170      ui.MaxVolumeSpinBox->setValue(m_pOptions->iMaxVolume);          m_ui.AutoRefreshCheckBox->setChecked(m_pOptions->bAutoRefresh);
171            m_ui.AutoRefreshTimeSpinBox->setValue(m_pOptions->iAutoRefreshTime);
172      // Messages font.          m_ui.MaxVolumeSpinBox->setValue(m_pOptions->iMaxVolume);
173      if (m_pOptions->sMessagesFont.isEmpty() || !font.fromString(m_pOptions->sMessagesFont))  
174          font = QFont("Fixed", 8);          // Messages font.
175          pal = ui.MessagesFontTextLabel->palette();          if (m_pOptions->sMessagesFont.isEmpty()
176                    || !font.fromString(m_pOptions->sMessagesFont))
177                    font = QFont("Fixed", 8);
178            pal = m_ui.MessagesFontTextLabel->palette();
179          pal.setColor(QPalette::Background, Qt::white);          pal.setColor(QPalette::Background, Qt::white);
180          ui.MessagesFontTextLabel->setPalette(pal);          m_ui.MessagesFontTextLabel->setPalette(pal);
181      ui.MessagesFontTextLabel->setFont(font);          m_ui.MessagesFontTextLabel->setFont(font);
182      ui.MessagesFontTextLabel->setText(font.family() + ' ' + QString::number(font.pointSize()));          m_ui.MessagesFontTextLabel->setText(font.family()
183                    + ' ' + QString::number(font.pointSize()));
184      // Messages limit option.  
185      ui.MessagesLimitCheckBox->setChecked(m_pOptions->bMessagesLimit);          // Messages limit option.
186      ui.MessagesLimitLinesSpinBox->setValue(m_pOptions->iMessagesLimitLines);          m_ui.MessagesLimitCheckBox->setChecked(m_pOptions->bMessagesLimit);
187            m_ui.MessagesLimitLinesSpinBox->setValue(m_pOptions->iMessagesLimitLines);
188      // Other options finally.  
189      ui.ConfirmRemoveCheckBox->setChecked(m_pOptions->bConfirmRemove);          // Other options finally.
190      ui.KeepOnTopCheckBox->setChecked(m_pOptions->bKeepOnTop);          m_ui.ConfirmRemoveCheckBox->setChecked(m_pOptions->bConfirmRemove);
191      ui.StdoutCaptureCheckBox->setChecked(m_pOptions->bStdoutCapture);          m_ui.KeepOnTopCheckBox->setChecked(m_pOptions->bKeepOnTop);
192      ui.CompletePathCheckBox->setChecked(m_pOptions->bCompletePath);          m_ui.StdoutCaptureCheckBox->setChecked(m_pOptions->bStdoutCapture);
193      ui.InstrumentNamesCheckBox->setChecked(m_pOptions->bInstrumentNames);          m_ui.CompletePathCheckBox->setChecked(m_pOptions->bCompletePath);
194      ui.MaxRecentFilesSpinBox->setValue(m_pOptions->iMaxRecentFiles);          m_ui.InstrumentNamesCheckBox->setChecked(m_pOptions->bInstrumentNames);
195            m_ui.MaxRecentFilesSpinBox->setValue(m_pOptions->iMaxRecentFiles);
196    
197  #ifndef CONFIG_LIBGIG  #ifndef CONFIG_LIBGIG
198      ui.InstrumentNamesCheckBox->setEnabled(false);          m_ui.InstrumentNamesCheckBox->setEnabled(false);
199  #endif  #endif
200    
201      // Done.          // Done.
202      m_iDirtySetup--;          m_iDirtySetup--;
203      stabilizeForm();          stabilizeForm();
204  }  }
205    
206    
207  // Accept settings (OK button slot).  // Accept settings (OK button slot).
208  void OptionsForm::accept (void)  void OptionsForm::accept (void)
209  {  {
210      // Save options...          // Save options...
211      if (m_iDirtyCount > 0) {          if (m_iDirtyCount > 0) {
212          // Server settings....                  // Server settings....
213          m_pOptions->sServerHost         = ui.ServerHostComboBox->currentText().trimmed();                  m_pOptions->sServerHost    = m_ui.ServerHostComboBox->currentText().trimmed();
214          m_pOptions->iServerPort         = ui.ServerPortComboBox->currentText().toInt();                  m_pOptions->iServerPort    = m_ui.ServerPortComboBox->currentText().toInt();
215          m_pOptions->iServerTimeout      = ui.ServerTimeoutSpinBox->value();                  m_pOptions->iServerTimeout = m_ui.ServerTimeoutSpinBox->value();
216          m_pOptions->bServerStart        = ui.ServerStartCheckBox->isChecked();                  m_pOptions->bServerStart   = m_ui.ServerStartCheckBox->isChecked();
217          m_pOptions->sServerCmdLine      = ui.ServerCmdLineComboBox->currentText().trimmed();                  m_pOptions->sServerCmdLine = m_ui.ServerCmdLineComboBox->currentText().trimmed();
218          m_pOptions->iStartDelay         = ui.StartDelaySpinBox->value();                  m_pOptions->iStartDelay      = m_ui.StartDelaySpinBox->value();
219          // Channels options...                  // Channels options...
220          m_pOptions->sDisplayFont        = ui.DisplayFontTextLabel->font().toString();                  m_pOptions->sDisplayFont   = m_ui.DisplayFontTextLabel->font().toString();
221          m_pOptions->bDisplayEffect      = ui.DisplayEffectCheckBox->isChecked();                  m_pOptions->bDisplayEffect = m_ui.DisplayEffectCheckBox->isChecked();
222          m_pOptions->bAutoRefresh        = ui.AutoRefreshCheckBox->isChecked();                  m_pOptions->bAutoRefresh   = m_ui.AutoRefreshCheckBox->isChecked();
223          m_pOptions->iAutoRefreshTime    = ui.AutoRefreshTimeSpinBox->value();                  m_pOptions->iAutoRefreshTime = m_ui.AutoRefreshTimeSpinBox->value();
224          m_pOptions->iMaxVolume          = ui.MaxVolumeSpinBox->value();                  m_pOptions->iMaxVolume     = m_ui.MaxVolumeSpinBox->value();
225          // Messages options...                  // Messages options...
226          m_pOptions->sMessagesFont       = ui.MessagesFontTextLabel->font().toString();                  m_pOptions->sMessagesFont  = m_ui.MessagesFontTextLabel->font().toString();
227          m_pOptions->bMessagesLimit      = ui.MessagesLimitCheckBox->isChecked();                  m_pOptions->bMessagesLimit = m_ui.MessagesLimitCheckBox->isChecked();
228          m_pOptions->iMessagesLimitLines = ui.MessagesLimitLinesSpinBox->value();                  m_pOptions->iMessagesLimitLines = m_ui.MessagesLimitLinesSpinBox->value();
229          // Other options...                  // Other options...
230          m_pOptions->bConfirmRemove      = ui.ConfirmRemoveCheckBox->isChecked();                  m_pOptions->bConfirmRemove = m_ui.ConfirmRemoveCheckBox->isChecked();
231          m_pOptions->bKeepOnTop          = ui.KeepOnTopCheckBox->isChecked();                  m_pOptions->bKeepOnTop     = m_ui.KeepOnTopCheckBox->isChecked();
232          m_pOptions->bStdoutCapture      = ui.StdoutCaptureCheckBox->isChecked();                  m_pOptions->bStdoutCapture = m_ui.StdoutCaptureCheckBox->isChecked();
233          m_pOptions->bCompletePath       = ui.CompletePathCheckBox->isChecked();                  m_pOptions->bCompletePath  = m_ui.CompletePathCheckBox->isChecked();
234          m_pOptions->bInstrumentNames    = ui.InstrumentNamesCheckBox->isChecked();                  m_pOptions->bInstrumentNames = m_ui.InstrumentNamesCheckBox->isChecked();
235          m_pOptions->iMaxRecentFiles     = ui.MaxRecentFilesSpinBox->value();                  m_pOptions->iMaxRecentFiles  = m_ui.MaxRecentFilesSpinBox->value();
236          // Reset dirty flag.                  // Reset dirty flag.
237          m_iDirtyCount = 0;                  m_iDirtyCount = 0;
238      }          }
239    
240      // Save combobox history...          // Save combobox history...
241      m_pOptions->saveComboBoxHistory(ui.ServerHostComboBox);          m_pOptions->saveComboBoxHistory(m_ui.ServerHostComboBox);
242      m_pOptions->saveComboBoxHistory(ui.ServerPortComboBox);          m_pOptions->saveComboBoxHistory(m_ui.ServerPortComboBox);
243      m_pOptions->saveComboBoxHistory(ui.ServerCmdLineComboBox);          m_pOptions->saveComboBoxHistory(m_ui.ServerCmdLineComboBox);
244    
245      // Just go with dialog acceptance.          // Just go with dialog acceptance.
246      QDialog::accept();          QDialog::accept();
247  }  }
248    
249    
250  // Reject settings (Cancel button slot).  // Reject settings (Cancel button slot).
251  void OptionsForm::reject (void)  void OptionsForm::reject (void)
252  {  {
253      bool bReject = true;          bool bReject = true;
254    
255      // Check if there's any pending changes...          // Check if there's any pending changes...
256      if (m_iDirtyCount > 0) {          if (m_iDirtyCount > 0) {
257          switch (QMessageBox::warning(this,                  switch (QMessageBox::warning(this,
258                          QSAMPLER_TITLE ": " + tr("Warning"),                          QSAMPLER_TITLE ": " + tr("Warning"),
259              tr("Some settings have been changed.\n\n"                          tr("Some settings have been changed.\n\n"
260                 "Do you want to apply the changes?"),                          "Do you want to apply the changes?"),
261              tr("Apply"), tr("Discard"), tr("Cancel"))) {                          tr("Apply"), tr("Discard"), tr("Cancel"))) {
262          case 0:     // Apply...                  case 0:     // Apply...
263              accept();                          accept();
264              return;                          return;
265          case 1:     // Discard                  case 1:     // Discard
266              break;                          break;
267          default:    // Cancel.                  default:    // Cancel.
268              bReject = false;                          bReject = false;
269          }                  }
270      }          }
271    
272      if (bReject)          if (bReject)
273          QDialog::reject();                  QDialog::reject();
274  }  }
275    
276    
277  // Dirty up settings.  // Dirty up settings.
278  void OptionsForm::optionsChanged (void)  void OptionsForm::optionsChanged (void)
279  {  {
280      if (m_iDirtySetup > 0)          if (m_iDirtySetup > 0)
281          return;                  return;
282    
283      m_iDirtyCount++;          m_iDirtyCount++;
284      stabilizeForm();          stabilizeForm();
285  }  }
286    
287    
288  // Stabilize current form state.  // Stabilize current form state.
289  void OptionsForm::stabilizeForm (void)  void OptionsForm::stabilizeForm (void)
290  {  {
291      bool bEnabled = ui.ServerStartCheckBox->isChecked();          bool bEnabled = m_ui.ServerStartCheckBox->isChecked();
292      ui.ServerCmdLineTextLabel->setEnabled(bEnabled);          m_ui.ServerCmdLineTextLabel->setEnabled(bEnabled);
293      ui.ServerCmdLineComboBox->setEnabled(bEnabled);          m_ui.ServerCmdLineComboBox->setEnabled(bEnabled);
294      ui.StartDelayTextLabel->setEnabled(bEnabled);          m_ui.StartDelayTextLabel->setEnabled(bEnabled);
295      ui.StartDelaySpinBox->setEnabled(bEnabled);          m_ui.StartDelaySpinBox->setEnabled(bEnabled);
296    
297      ui.AutoRefreshTimeSpinBox->setEnabled(ui.AutoRefreshCheckBox->isChecked());          m_ui.AutoRefreshTimeSpinBox->setEnabled(
298      ui.MessagesLimitLinesSpinBox->setEnabled(ui.MessagesLimitCheckBox->isChecked());                  m_ui.AutoRefreshCheckBox->isChecked());
299            m_ui.MessagesLimitLinesSpinBox->setEnabled(
300                    m_ui.MessagesLimitCheckBox->isChecked());
301    
302      ui.OkPushButton->setEnabled(m_iDirtyCount > 0);          m_ui.OkPushButton->setEnabled(m_iDirtyCount > 0);
303  }  }
304    
305    
306  // The channel display font selection dialog.  // The channel display font selection dialog.
307  void OptionsForm::chooseDisplayFont (void)  void OptionsForm::chooseDisplayFont (void)
308  {  {
309      bool  bOk  = false;          bool  bOk  = false;
310      QFont font = QFontDialog::getFont(&bOk, ui.DisplayFontTextLabel->font(), this);          QFont font = QFontDialog::getFont(&bOk,
311      if (bOk) {                  m_ui.DisplayFontTextLabel->font(), this);
312          ui.DisplayFontTextLabel->setFont(font);          if (bOk) {
313          ui.DisplayFontTextLabel->setText(font.family() + " " + QString::number(font.pointSize()));                  m_ui.DisplayFontTextLabel->setFont(font);
314          optionsChanged();                  m_ui.DisplayFontTextLabel->setText(font.family()
315      }                          + ' ' + QString::number(font.pointSize()));
316                    optionsChanged();
317            }
318  }  }
319    
320    
321  // The messages font selection dialog.  // The messages font selection dialog.
322  void OptionsForm::chooseMessagesFont (void)  void OptionsForm::chooseMessagesFont (void)
323  {  {
324      bool  bOk  = false;          bool  bOk  = false;
325      QFont font = QFontDialog::getFont(&bOk, ui.MessagesFontTextLabel->font(), this);          QFont font = QFontDialog::getFont(&bOk,
326      if (bOk) {                  m_ui.MessagesFontTextLabel->font(), this);
327          ui.MessagesFontTextLabel->setFont(font);          if (bOk) {
328          ui.MessagesFontTextLabel->setText(font.family() + " " + QString::number(font.pointSize()));                  m_ui.MessagesFontTextLabel->setFont(font);
329          optionsChanged();                  m_ui.MessagesFontTextLabel->setText(font.family()
330      }                          + ' ' + QString::number(font.pointSize()));
331                    optionsChanged();
332            }
333  }  }
334    
335    
# Line 328  void OptionsForm::toggleDisplayEffect ( Line 344  void OptionsForm::toggleDisplayEffect (
344          } else {          } else {
345                  pal.setColor(QPalette::Background, Qt::black);                  pal.setColor(QPalette::Background, Qt::black);
346          }          }
347          ui.DisplayFontTextLabel->setPalette(pal);          m_ui.DisplayFontTextLabel->setPalette(pal);
348    
349          optionsChanged();          optionsChanged();
350  }  }

Legend:
Removed from v.1505  
changed lines
  Added in v.1558

  ViewVC Help
Powered by ViewVC