/[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 1803 by schoenebeck, Sun Dec 7 13:58:16 2008 UTC revision 2107 by capela, Sat Jul 10 09:47:33 2010 UTC
# Line 1  Line 1 
1  // qsamplerOptionsForm.cpp  // qsamplerOptionsForm.cpp
2  //  //
3  /****************************************************************************  /****************************************************************************
4     Copyright (C) 2004-2008, rncbc aka Rui Nuno Capela. All rights reserved.     Copyright (C) 2004-2010, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007, Christian Schoenebeck     Copyright (C) 2007, Christian Schoenebeck
6    
7     This program is free software; you can redistribute it and/or     This program is free software; you can redistribute it and/or
# Line 133  OptionsForm::OptionsForm ( QWidget* pPar Line 133  OptionsForm::OptionsForm ( QWidget* pPar
133          QObject::connect(m_ui.MaxStreamsSpinBox,          QObject::connect(m_ui.MaxStreamsSpinBox,
134                  SIGNAL(valueChanged(int)),                  SIGNAL(valueChanged(int)),
135                  SLOT(maxStreamsChanged(int)));                  SLOT(maxStreamsChanged(int)));
136          QObject::connect(m_ui.OkPushButton,          QObject::connect(m_ui.DialogButtonBox,
137                  SIGNAL(clicked()),                  SIGNAL(accepted()),
138                  SLOT(accept()));                  SLOT(accept()));
139          QObject::connect(m_ui.CancelPushButton,          QObject::connect(m_ui.DialogButtonBox,
140                  SIGNAL(clicked()),                  SIGNAL(rejected()),
141                  SLOT(reject()));                  SLOT(reject()));
142  }  }
143    
# Line 325  void OptionsForm::accept (void) Line 325  void OptionsForm::accept (void)
325          m_pOptions->saveComboBoxHistory(m_ui.ServerCmdLineComboBox);          m_pOptions->saveComboBoxHistory(m_ui.ServerCmdLineComboBox);
326          m_pOptions->saveComboBoxHistory(m_ui.MessagesLogPathComboBox);          m_pOptions->saveComboBoxHistory(m_ui.MessagesLogPathComboBox);
327    
328            // Save/commit to disk.
329            m_pOptions->saveOptions();
330    
331          // Just go with dialog acceptance.          // Just go with dialog acceptance.
332          QDialog::accept();          QDialog::accept();
333  }  }
# Line 341  void OptionsForm::reject (void) Line 344  void OptionsForm::reject (void)
344                          QSAMPLER_TITLE ": " + tr("Warning"),                          QSAMPLER_TITLE ": " + tr("Warning"),
345                          tr("Some settings have been changed.\n\n"                          tr("Some settings have been changed.\n\n"
346                          "Do you want to apply the changes?"),                          "Do you want to apply the changes?"),
347                          tr("Apply"), tr("Discard"), tr("Cancel"))) {                          QMessageBox::Apply |
348                  case 0:     // Apply...                          QMessageBox::Discard |
349                            QMessageBox::Cancel)) {
350                    case QMessageBox::Apply:
351                          accept();                          accept();
352                          return;                          return;
353                  case 1:     // Discard                  case QMessageBox::Discard:
354                          break;                          break;
355                  default:    // Cancel.                  default:    // Cancel.
356                          bReject = false;                          bReject = false;
# Line 392  void OptionsForm::stabilizeForm (void) Line 397  void OptionsForm::stabilizeForm (void)
397          m_ui.MessagesLimitLinesSpinBox->setEnabled(          m_ui.MessagesLimitLinesSpinBox->setEnabled(
398                  m_ui.MessagesLimitCheckBox->isChecked());                  m_ui.MessagesLimitCheckBox->isChecked());
399    
400          m_ui.OkPushButton->setEnabled(bValid);          m_ui.DialogButtonBox->button(QDialogButtonBox::Ok)->setEnabled(bValid);
401  }  }
402    
403    
# Line 450  void OptionsForm::toggleDisplayEffect ( Line 455  void OptionsForm::toggleDisplayEffect (
455          QPalette pal;          QPalette pal;
456          pal.setColor(QPalette::Foreground, Qt::green);          pal.setColor(QPalette::Foreground, Qt::green);
457          if (bOn) {          if (bOn) {
458                  QPixmap pm(":/icons/displaybg1.png");                  QPixmap pm(":/images/displaybg1.png");
459                  pal.setBrush(QPalette::Background, QBrush(pm));                  pal.setBrush(QPalette::Background, QBrush(pm));
460          } else {          } else {
461                  pal.setColor(QPalette::Background, Qt::black);                  pal.setColor(QPalette::Background, Qt::black);

Legend:
Removed from v.1803  
changed lines
  Added in v.2107

  ViewVC Help
Powered by ViewVC