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

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

  ViewVC Help
Powered by ViewVC