/[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 1474 by schoenebeck, Mon Nov 5 20:47:38 2007 UTC revision 1499 by capela, Tue Nov 20 16:48:04 2007 UTC
# Line 28  Line 28 
28  #include <QMessageBox>  #include <QMessageBox>
29  #include <QFontDialog>  #include <QFontDialog>
30    
31    
32  namespace QSampler {  namespace QSampler {
33    
34  OptionsForm::OptionsForm(QWidget* parent) : QDialog(parent)  OptionsForm::OptionsForm(QWidget* parent) : QDialog(parent)
# Line 136  void OptionsForm::setup ( qsamplerOption Line 137  void OptionsForm::setup ( qsamplerOption
137      m_pOptions->loadComboBoxHistory(ui.ServerCmdLineComboBox);      m_pOptions->loadComboBoxHistory(ui.ServerCmdLineComboBox);
138    
139      // Load Server settings...      // Load Server settings...
140      ui.ServerHostComboBox->setCurrentText(m_pOptions->sServerHost);          ui.ServerHostComboBox->setItemText(
141      ui.ServerPortComboBox->setCurrentText(QString::number(m_pOptions->iServerPort));                  ui.ServerHostComboBox->currentIndex(),
142                    m_pOptions->sServerHost);
143            ui.ServerPortComboBox->setItemText(
144                    ui.ServerPortComboBox->currentIndex(),
145                    QString::number(m_pOptions->iServerPort));
146      ui.ServerTimeoutSpinBox->setValue(m_pOptions->iServerTimeout);      ui.ServerTimeoutSpinBox->setValue(m_pOptions->iServerTimeout);
147      ui.ServerStartCheckBox->setChecked(m_pOptions->bServerStart);      ui.ServerStartCheckBox->setChecked(m_pOptions->bServerStart);
148      ui.ServerCmdLineComboBox->setCurrentText(m_pOptions->sServerCmdLine);          ui.ServerCmdLineComboBox->setItemText(
149                    ui.ServerCmdLineComboBox->currentIndex(),
150                    m_pOptions->sServerCmdLine);
151      ui.StartDelaySpinBox->setValue(m_pOptions->iStartDelay);      ui.StartDelaySpinBox->setValue(m_pOptions->iStartDelay);
152    
153      // Load Display options...      // Load Display options...
# Line 195  void OptionsForm::accept (void) Line 202  void OptionsForm::accept (void)
202      // Save options...      // Save options...
203      if (m_iDirtyCount > 0) {      if (m_iDirtyCount > 0) {
204          // Server settings....          // Server settings....
205          m_pOptions->sServerHost         = ui.ServerHostComboBox->currentText().stripWhiteSpace();          m_pOptions->sServerHost         = ui.ServerHostComboBox->currentText().trimmed();
206          m_pOptions->iServerPort         = ui.ServerPortComboBox->currentText().toInt();          m_pOptions->iServerPort         = ui.ServerPortComboBox->currentText().toInt();
207          m_pOptions->iServerTimeout      = ui.ServerTimeoutSpinBox->value();          m_pOptions->iServerTimeout      = ui.ServerTimeoutSpinBox->value();
208          m_pOptions->bServerStart        = ui.ServerStartCheckBox->isChecked();          m_pOptions->bServerStart        = ui.ServerStartCheckBox->isChecked();
209          m_pOptions->sServerCmdLine      = ui.ServerCmdLineComboBox->currentText().stripWhiteSpace();          m_pOptions->sServerCmdLine      = ui.ServerCmdLineComboBox->currentText().trimmed();
210          m_pOptions->iStartDelay         = ui.StartDelaySpinBox->value();          m_pOptions->iStartDelay         = ui.StartDelaySpinBox->value();
211          // Channels options...          // Channels options...
212          m_pOptions->sDisplayFont        = ui.DisplayFontTextLabel->font().toString();          m_pOptions->sDisplayFont        = ui.DisplayFontTextLabel->font().toString();
# Line 315  void OptionsForm::chooseMessagesFont (vo Line 322  void OptionsForm::chooseMessagesFont (vo
322  // The channel display effect demo changer.  // The channel display effect demo changer.
323  void OptionsForm::toggleDisplayEffect ( bool bOn )  void OptionsForm::toggleDisplayEffect ( bool bOn )
324  {  {
325      QPixmap pm;          QPalette pal;
326      if (bOn)          pal.setColor(QPalette::Foreground, Qt::green);
327          pm = QPixmap(":/qsampler/pixmaps/displaybg1.png");          if (bOn) {
328      ui.DisplayFontTextLabel->setPaletteBackgroundPixmap(pm);                  QPixmap pm(":/qsampler/pixmaps/displaybg1.png");
329                    pal.setBrush(QPalette::Background, QBrush(pm));
330            } else {
331                    pal.setColor(QPalette::Background, Qt::black);
332            }
333            ui.DisplayFontTextLabel->setPalette(pal);
334    
335      optionsChanged();          optionsChanged();
336  }  }
337    
338  } // namespace QSampler  } // namespace QSampler

Legend:
Removed from v.1474  
changed lines
  Added in v.1499

  ViewVC Help
Powered by ViewVC