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

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

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

revision 1509 by capela, Thu Nov 22 11:10:44 2007 UTC revision 1558 by capela, Thu Dec 6 09:35:33 2007 UTC
# Line 33  Line 33 
33  #endif  #endif
34    
35    
36    namespace QSampler {
37    
38  //-------------------------------------------------------------------------  //-------------------------------------------------------------------------
39  // qsamplerOptions - Prototype settings structure.  // QSampler::Options - Prototype settings structure.
40  //  //
41    
42  // Constructor.  // Constructor.
43  qsamplerOptions::qsamplerOptions (void)  Options::Options (void)
44          : m_settings(QSAMPLER_DOMAIN, QSAMPLER_TITLE)          : m_settings(QSAMPLER_DOMAIN, QSAMPLER_TITLE)
45  {  {
46          // Begin into general options group.          // Begin into general options group.
# Line 69  qsamplerOptions::qsamplerOptions (void) Line 71  qsamplerOptions::qsamplerOptions (void)
71          bStdoutCapture   = m_settings.value("/StdoutCapture", true).toBool();          bStdoutCapture   = m_settings.value("/StdoutCapture", true).toBool();
72          bCompletePath    = m_settings.value("/CompletePath", true).toBool();          bCompletePath    = m_settings.value("/CompletePath", true).toBool();
73          iMaxRecentFiles  = m_settings.value("/MaxRecentFiles", 5).toInt();          iMaxRecentFiles  = m_settings.value("/MaxRecentFiles", 5).toInt();
74    // if libgig provides a fast way to retrieve instrument names even for large
75    // .gig files, then we enable this feature by default
76    #if HAVE_LIBGIG_SETAUTOLOAD
77            bInstrumentNames = m_settings.value("/InstrumentNames", true).toBool();
78    #else
79          bInstrumentNames = m_settings.value("/InstrumentNames", false).toBool();          bInstrumentNames = m_settings.value("/InstrumentNames", false).toBool();
80    #endif
81          m_settings.endGroup();          m_settings.endGroup();
82    
83          // And go into view options group.          // And go into view options group.
# Line 110  qsamplerOptions::qsamplerOptions (void) Line 118  qsamplerOptions::qsamplerOptions (void)
118    
119    
120  // Default Destructor.  // Default Destructor.
121  qsamplerOptions::~qsamplerOptions (void)  Options::~Options (void)
122  {  {
123          // Make program version available in the future.          // Make program version available in the future.
124          m_settings.beginGroup("/Program");          m_settings.beginGroup("/Program");
# Line 185  qsamplerOptions::~qsamplerOptions (void) Line 193  qsamplerOptions::~qsamplerOptions (void)
193  // Settings accessor.  // Settings accessor.
194  //  //
195    
196  QSettings& qsamplerOptions::settings (void)  QSettings& Options::settings (void)
197  {  {
198          return m_settings;          return m_settings;
199  }  }
# Line 196  QSettings& qsamplerOptions::settings (vo Line 204  QSettings& qsamplerOptions::settings (vo
204  //  //
205    
206  // Help about command line options.  // Help about command line options.
207  void qsamplerOptions::print_usage ( const char *arg0 )  void Options::print_usage ( const char *arg0 )
208  {  {
209          QTextStream out(stderr);          QTextStream out(stderr);
210          out << QObject::tr("Usage: %1 [options] [session-file]\n\n"          out << QObject::tr("Usage: %1 [options] [session-file]\n\n"
# Line 212  void qsamplerOptions::print_usage ( cons Line 220  void qsamplerOptions::print_usage ( cons
220    
221    
222  // Parse command line arguments into m_settings.  // Parse command line arguments into m_settings.
223  bool qsamplerOptions::parse_args ( int argc, char **argv )  bool Options::parse_args ( int argc, char **argv )
224  {  {
225          QTextStream out(stderr);          QTextStream out(stderr);
226          const QString sEol = "\n\n";          const QString sEol = "\n\n";
# Line 291  bool qsamplerOptions::parse_args ( int a Line 299  bool qsamplerOptions::parse_args ( int a
299  //---------------------------------------------------------------------------  //---------------------------------------------------------------------------
300  // Widget geometry persistence helper methods.  // Widget geometry persistence helper methods.
301    
302  void qsamplerOptions::loadWidgetGeometry ( QWidget *pWidget )  void Options::loadWidgetGeometry ( QWidget *pWidget )
303  {  {
304          // Try to restore old form window positioning.          // Try to restore old form window positioning.
305          if (pWidget) {          if (pWidget) {
# Line 319  void qsamplerOptions::loadWidgetGeometry Line 327  void qsamplerOptions::loadWidgetGeometry
327  }  }
328    
329    
330  void qsamplerOptions::saveWidgetGeometry ( QWidget *pWidget )  void Options::saveWidgetGeometry ( QWidget *pWidget )
331  {  {
332          // Try to save form window position...          // Try to save form window position...
333          // (due to X11 window managers ideossincrasies, we better          // (due to X11 window managers ideossincrasies, we better
# Line 342  void qsamplerOptions::saveWidgetGeometry Line 350  void qsamplerOptions::saveWidgetGeometry
350  //---------------------------------------------------------------------------  //---------------------------------------------------------------------------
351  // Combo box history persistence helper implementation.  // Combo box history persistence helper implementation.
352    
353  void qsamplerOptions::loadComboBoxHistory ( QComboBox *pComboBox, int iLimit )  void Options::loadComboBoxHistory ( QComboBox *pComboBox, int iLimit )
354  {  {
355          // Load combobox list from configuration settings file...          // Load combobox list from configuration settings file...
356          m_settings.beginGroup("/History/" + pComboBox->objectName());          m_settings.beginGroup("/History/" + pComboBox->objectName());
# Line 365  void qsamplerOptions::loadComboBoxHistor Line 373  void qsamplerOptions::loadComboBoxHistor
373  }  }
374    
375    
376  void qsamplerOptions::saveComboBoxHistory ( QComboBox *pComboBox, int iLimit )  void Options::saveComboBoxHistory ( QComboBox *pComboBox, int iLimit )
377  {  {
378          // Add current text as latest item...          // Add current text as latest item...
379          const QString& sCurrentText = pComboBox->currentText();          const QString& sCurrentText = pComboBox->currentText();
# Line 394  void qsamplerOptions::saveComboBoxHistor Line 402  void qsamplerOptions::saveComboBoxHistor
402          m_settings.endGroup();          m_settings.endGroup();
403  }  }
404    
405    } // namespace QSampler
406    
407    
408  // end of qsamplerOptions.cpp  // end of qsamplerOptions.cpp

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

  ViewVC Help
Powered by ViewVC