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. |
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"); |
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 |
} |
} |
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" |
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"; |
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) { |
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 |
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()); |
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(); |
402 |
m_settings.endGroup(); |
m_settings.endGroup(); |
403 |
} |
} |
404 |
|
|
405 |
|
} // namespace QSampler |
406 |
|
|
407 |
|
|
408 |
// end of qsamplerOptions.cpp |
// end of qsamplerOptions.cpp |