[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/traverso dialogs/settings/Pages.cp...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src/traverso dialogs/settings/Pages.cp... |
Date: |
Sat, 21 Feb 2009 14:50:24 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 09/02/21 14:50:24
Modified files:
src/traverso/dialogs/settings: Pages.cpp Pages.h
SettingsDialog.cpp
src/traverso/ui: BehaviorConfigPage.ui RecordingConfigPage.ui
Log message:
* Merged the fooConfig classes into their fooConfigPage classes which
obviously should have been done right from the beginning (by using multiple
inheritance, such a nice C++ feature ;-) )
* The Layout of the config pages, margins, spacing etc is can be
managed properly now by QDesigner, the defaults are just fine, which makes
adjusting the ConfigPages much easier.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/settings/Pages.cpp?cvsroot=traverso&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/settings/Pages.h?cvsroot=traverso&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/settings/SettingsDialog.cpp?cvsroot=traverso&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/ui/BehaviorConfigPage.ui?cvsroot=traverso&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/ui/RecordingConfigPage.ui?cvsroot=traverso&r1=1.6&r2=1.7
Patches:
Index: dialogs/settings/Pages.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/dialogs/settings/Pages.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- dialogs/settings/Pages.cpp 21 Feb 2009 08:03:53 -0000 1.48
+++ dialogs/settings/Pages.cpp 21 Feb 2009 14:50:22 -0000 1.49
@@ -51,17 +51,17 @@
/****************************************/
-AudioDriverPage::AudioDriverPage(QWidget *parent)
+AudioDriverConfigPage::AudioDriverConfigPage(QWidget *parent)
: ConfigPage(parent)
{
- m_driverConfigPage = new DriverConfigPage(this);
- mainLayout->addWidget(m_driverConfigPage);
+ setupUi(this);
+ periodBufferSizesList << 16 << 32 << 64 << 128 << 256 << 512 << 1024 <<
2048 << 4096;
- m_mainLayout = qobject_cast<QVBoxLayout*>(m_driverConfigPage->layout());
+ m_mainLayout = qobject_cast<QVBoxLayout*>(layout());
QStringList drivers = audiodevice().get_available_drivers();
foreach(const QString &name, drivers) {
- m_driverConfigPage->driverCombo->addItem(name);
+ driverCombo->addItem(name);
}
@@ -72,30 +72,31 @@
m_alsadevices->layout()->setMargin(0);
m_mainLayout->addWidget(m_alsadevices);
- connect(m_driverConfigPage->driverCombo,
SIGNAL(currentIndexChanged(QString)), this,
SLOT(driver_combobox_index_changed(QString)));
- connect(m_driverConfigPage->restartDriverButton, SIGNAL(clicked()),
this, SLOT(restart_driver_button_clicked()));
+ connect(driverCombo, SIGNAL(currentIndexChanged(QString)), this,
SLOT(driver_combobox_index_changed(QString)));
+ connect(restartDriverButton, SIGNAL(clicked()), this,
SLOT(restart_driver_button_clicked()));
+ connect(rateComboBox, SIGNAL(currentIndexChanged(QString)), this,
SLOT(rate_combobox_index_changed(QString)));
load_config();
}
-void AudioDriverPage::save_config()
+void AudioDriverConfigPage::save_config()
{
- config().set_property("Hardware", "samplerate",
m_driverConfigPage->rateComboBox->currentText());
- int bufferindex = m_driverConfigPage->latencyComboBox->currentIndex();
+ config().set_property("Hardware", "samplerate",
rateComboBox->currentText());
+ int bufferindex = latencyComboBox->currentIndex();
int buffersize = 1024;
if (bufferindex >= 0) {
- buffersize =
m_driverConfigPage->periodBufferSizesList.at(bufferindex);
+ buffersize = periodBufferSizesList.at(bufferindex);
}
config().set_property("Hardware", "buffersize", buffersize);
- config().set_property("Hardware", "drivertype",
m_driverConfigPage->driverCombo->currentText());
+ config().set_property("Hardware", "drivertype",
driverCombo->currentText());
int playback=1, capture=1;
- if(m_driverConfigPage->duplexComboBox->currentIndex() == 1) {
+ if(duplexComboBox->currentIndex() == 1) {
capture = 0;
}
- if(m_driverConfigPage->duplexComboBox->currentIndex() == 2) {
+ if(duplexComboBox->currentIndex() == 2) {
playback = 0;
}
@@ -118,10 +119,10 @@
config().set_property("Hardware", "pahostapi",
m_portaudiodrivers->driverCombo->itemData(paindex));
#endif
- config().set_property("Hardware", "jackslave",
m_driverConfigPage->jackTransportCheckBox->isChecked());
+ config().set_property("Hardware", "jackslave",
jackTransportCheckBox->isChecked());
}
-void AudioDriverPage::reset_default_config()
+void AudioDriverConfigPage::reset_default_config()
{
config().set_property("Hardware", "samplerate", 44100);
config().set_property("Hardware", "buffersize", 512);
@@ -157,7 +158,7 @@
load_config();
}
-void AudioDriverPage::load_config( )
+void AudioDriverConfigPage::load_config( )
{
int samplerate = config().get_property("Hardware", "samplerate",
44100).toInt();
int buffersize = config().get_property("Hardware", "buffersize",
512).toInt();
@@ -170,26 +171,26 @@
bool playback = config().get_property("Hardware", "playback",
1).toInt();
- int driverTypeIndex =
m_driverConfigPage->driverCombo->findText(driverType);
+ int driverTypeIndex = driverCombo->findText(driverType);
if (driverTypeIndex >= 0) {
-
m_driverConfigPage->driverCombo->setCurrentIndex(driverTypeIndex);
+ driverCombo->setCurrentIndex(driverTypeIndex);
}
driver_combobox_index_changed(driverType);
- int buffersizeIndex =
m_driverConfigPage->periodBufferSizesList.indexOf(buffersize);
- int samplerateIndex =
m_driverConfigPage->rateComboBox->findText(QString::number(samplerate));
+ int buffersizeIndex = periodBufferSizesList.indexOf(buffersize);
+ int samplerateIndex =
rateComboBox->findText(QString::number(samplerate));
- m_driverConfigPage->rateComboBox->setCurrentIndex(samplerateIndex);
- m_driverConfigPage->latencyComboBox->setCurrentIndex(buffersizeIndex);
+ rateComboBox->setCurrentIndex(samplerateIndex);
+ latencyComboBox->setCurrentIndex(buffersizeIndex);
if (capture && playback) {
- m_driverConfigPage->duplexComboBox->setCurrentIndex(0);
+ duplexComboBox->setCurrentIndex(0);
} else if (playback) {
- m_driverConfigPage->duplexComboBox->setCurrentIndex(1);
+ duplexComboBox->setCurrentIndex(1);
} else {
- m_driverConfigPage->duplexComboBox->setCurrentIndex(2);
+ duplexComboBox->setCurrentIndex(2);
}
int index;
@@ -257,27 +258,27 @@
m_portaudiodrivers->driverCombo->setCurrentIndex(index);
}
- m_driverConfigPage->update_latency_combobox();
+ update_latency_combobox();
#endif //end PORTAUDIO_SUPPORT
bool usetransport = config().get_property("Hardware", "jackslave",
false).toBool();
- m_driverConfigPage->jackTransportCheckBox->setChecked(usetransport);
+ jackTransportCheckBox->setChecked(usetransport);
}
-void AudioDriverPage::restart_driver_button_clicked()
+void AudioDriverConfigPage::restart_driver_button_clicked()
{
- QString driver = m_driverConfigPage->driverCombo->currentText();
- int rate = m_driverConfigPage->rateComboBox->currentText().toInt();
- int buffersize =
m_driverConfigPage->periodBufferSizesList.at(m_driverConfigPage->latencyComboBox->currentIndex());
+ QString driver = driverCombo->currentText();
+ int rate = rateComboBox->currentText().toInt();
+ int buffersize =
periodBufferSizesList.at(latencyComboBox->currentIndex());
int playback=1, capture=1;
- if(m_driverConfigPage->duplexComboBox->currentIndex() == 1) {
+ if(duplexComboBox->currentIndex() == 1) {
capture = 0;
}
- if(m_driverConfigPage->duplexComboBox->currentIndex() == 2) {
+ if(duplexComboBox->currentIndex() == 2) {
playback = 0;
}
@@ -314,20 +315,20 @@
config().set_property("Hardware", "numberofperiods", currentperiods);
#endif
- config().set_property("Hardware", "jackslave",
m_driverConfigPage->jackTransportCheckBox->isChecked());
+ config().set_property("Hardware", "jackslave",
jackTransportCheckBox->isChecked());
}
-void AudioDriverPage::driver_combobox_index_changed(QString driver)
+void AudioDriverConfigPage::driver_combobox_index_changed(QString driver)
{
m_mainLayout->removeWidget(m_alsadevices);
m_mainLayout->removeWidget(m_portaudiodrivers);
- m_mainLayout->removeWidget(m_driverConfigPage->jackGroupBox);
+ m_mainLayout->removeWidget(jackGroupBox);
if (driver == "ALSA") {
m_alsadevices->show();
-
m_mainLayout->insertWidget(m_mainLayout->indexOf(m_driverConfigPage->driverConfigGroupBox)
+ 1, m_alsadevices);
+
m_mainLayout->insertWidget(m_mainLayout->indexOf(driverConfigGroupBox) + 1,
m_alsadevices);
} else {
m_alsadevices->hide();
m_mainLayout->removeWidget(m_alsadevices);
@@ -335,33 +336,23 @@
if (driver == "PortAudio") {
m_portaudiodrivers->show();
-
m_mainLayout->insertWidget(m_mainLayout->indexOf(m_driverConfigPage->driverConfigGroupBox),
m_portaudiodrivers);
+
m_mainLayout->insertWidget(m_mainLayout->indexOf(driverConfigGroupBox),
m_portaudiodrivers);
} else {
m_portaudiodrivers->hide();
m_mainLayout->removeWidget(m_portaudiodrivers);
}
if (driver == "Jack") {
- m_driverConfigPage->jackGroupBox->show();
-
m_mainLayout->insertWidget(m_mainLayout->indexOf(m_driverConfigPage->driverConfigGroupBox)
+ 1, m_driverConfigPage->jackGroupBox);
+ jackGroupBox->show();
+
m_mainLayout->insertWidget(m_mainLayout->indexOf(driverConfigGroupBox) + 1,
jackGroupBox);
} else {
- m_driverConfigPage->jackGroupBox->hide();
- m_mainLayout->removeWidget(m_driverConfigPage->jackGroupBox);
+ jackGroupBox->hide();
+ m_mainLayout->removeWidget(jackGroupBox);
}
}
-DriverConfigPage::DriverConfigPage( QWidget * parent )
- : QWidget(parent)
-{
- setupUi(this);
- periodBufferSizesList << 16 << 32 << 64 << 128 << 256 << 512 << 1024 <<
2048 << 4096;
-
- connect(rateComboBox, SIGNAL(currentIndexChanged(QString)), this,
SLOT(rate_combobox_index_changed(QString)));
-}
-
-
-void DriverConfigPage::update_latency_combobox( )
+void AudioDriverConfigPage::update_latency_combobox( )
{
latencyComboBox->clear();
int rate = rateComboBox->currentText().toInt();
@@ -376,173 +367,40 @@
latencyComboBox->setCurrentIndex(index);
}
-void DriverConfigPage::rate_combobox_index_changed(QString )
+void AudioDriverConfigPage::rate_combobox_index_changed(QString )
{
update_latency_combobox();
}
-AlsaDevicesPage::AlsaDevicesPage(QWidget * parent)
- : QWidget(parent)
-{
- setupUi(this);
-}
-
-
-PaDriverPage::PaDriverPage(QWidget * parent)
- : QWidget(parent)
-{
- setupUi(this);
-}
-
-
-ConfigPage::ConfigPage(QWidget * parent)
- : QWidget(parent)
-{
- mainLayout = new QVBoxLayout;
- setLayout(mainLayout);
- mainLayout->setMargin(0);
-}
-
-
-
-/****************************************/
-/* Behavior */
-/****************************************/
-
-
-BehaviorPage::BehaviorPage(QWidget *parent)
- : ConfigPage(parent)
-{
- m_configpage = new BehaviorConfigPage(this);
- mainLayout->addWidget(m_configpage);
- mainLayout->addStretch(1);
- connect(&config(), SIGNAL(configChanged()), this,
SLOT(update_follow()));
- load_config();
-}
-
-
-void BehaviorPage::save_config()
-{
- config().set_property("Project", "loadLastUsed",
m_configpage->loadLastProjectCheckBox->isChecked());
- config().set_property("Sheet", "trackCreationCount",
m_configpage->numberOfTrackSpinBox->value());
- config().set_property("PlayHead", "Follow",
m_configpage->keepCursorVisibleCheckBox->isChecked());
- config().set_property("PlayHead", "Scrollmode",
m_configpage->scrollModeComboBox->currentIndex());
- config().set_property("AudioClip", "SyncDuringDrag",
m_configpage->resyncAudioCheckBox->isChecked());
- config().set_property("AudioClip", "LockByDefault",
m_configpage->lockClipsCheckBox->isChecked());
-
- QString oncloseaction;
- if (m_configpage->saveRadioButton->isChecked()) {
- config().set_property("Project", "onclose", "save");
- } else if (m_configpage->askRadioButton->isChecked()) {
- config().set_property("Project", "onclose", "ask");
- } else {
- config().set_property("Project", "onclose", "dontsave");
- }
-}
-
-void BehaviorPage::load_config()
-{
- bool loadLastUsedProject = config().get_property("Project",
"loadLastUsed", 1).toBool();
- QString oncloseaction = config().get_property("Project", "onclose",
"save").toString();
- int defaultNumTracks = config().get_property("Sheet",
"trackCreationCount", 6).toInt();
- int scrollMode = config().get_property("PlayHead", "Scrollmode",
2).toInt();
- bool resyncAudio = config().get_property("AudioClip", "SyncDuringDrag",
false).toBool();
- bool lockClips = config().get_property("AudioClip", "LockByDefault",
false).toBool();
-
- m_configpage->loadLastProjectCheckBox->setChecked(loadLastUsedProject);
- m_configpage->numberOfTrackSpinBox->setValue(defaultNumTracks);
- m_configpage->scrollModeComboBox->setCurrentIndex(scrollMode);
- m_configpage->resyncAudioCheckBox->setChecked(resyncAudio);
- m_configpage->lockClipsCheckBox->setChecked(lockClips);
-
- if (oncloseaction == "save") {
- m_configpage->saveRadioButton->setChecked(true);
- } else if (oncloseaction == "ask") {
- m_configpage->askRadioButton->setChecked(true);
- } else {
- m_configpage->neverRadioButton->setChecked(true);
- }
-
- update_follow();
-
-}
-
-
-void BehaviorPage::update_follow()
-{
- bool keepCursorVisible = config().get_property("PlayHead", "Follow",
true).toBool();
- m_configpage->keepCursorVisibleCheckBox->setChecked(keepCursorVisible);
- m_configpage->scrollModeComboBox->setEnabled(keepCursorVisible);
-}
-
-void BehaviorPage::reset_default_config()
-{
- config().set_property("Project", "loadLastUsed", true);
- config().set_property("Project", "onclose", "save");
- config().set_property("Sheet", "trackCreationCount", 6);
- config().set_property("PlayHead", "Follow", 0);
- config().set_property("PlayHead", "Scrollmode", 2);
- config().set_property("AudioClip", "SyncDuringDrag", false);
- config().set_property("AudioClip", "LockByDefault", false);
-
- load_config();
-}
-
-
-BehaviorConfigPage::BehaviorConfigPage(QWidget * parent)
- : QWidget(parent)
-{
- setupUi(this);
-}
-
/****************************************/
/* Appearance */
/****************************************/
-AppearancePage::AppearancePage(QWidget *parent)
- : ConfigPage(parent)
-{
- m_themepage = new ThemeConfigPage(this);
- mainLayout->addWidget(m_themepage);
- m_themepage->languageComboBox->addItem(tr("Default Language"), "");
- foreach(const QString &lang, find_qm_files()) {
-
m_themepage->languageComboBox->addItem(language_name_from_qm_file(lang), lang);
- }
-
- load_config();
- m_themepage->create_connections();
-
- #if defined Q_WS_MAC
- m_themepage->iconSizeCombo->hide();
- m_themepage->toolbarStyleCombo->hide();
- #endif
-}
-
-void AppearancePage::save_config()
+void AppearenceConfigPage::save_config()
{
- config().set_property("Themer", "themepath",
m_themepage->themePathLineEdit->text());
- config().set_property("Themer", "currenttheme",
m_themepage->themeSelecterCombo->currentText());
- config().set_property("Themer", "coloradjust",
m_themepage->colorAdjustBox->value());
- config().set_property("Themer", "style",
m_themepage->styleCombo->currentText());
- config().set_property("Themer", "usestylepallet",
m_themepage->useStylePalletCheckBox->isChecked());
- config().set_property("Themer", "paintaudiorectified",
m_themepage->rectifiedCheckBox->isChecked());
- config().set_property("Themer", "paintstereoaudioasmono",
m_themepage->mergedCheckBox->isChecked());
- config().set_property("Themer", "drawdbgrid",
m_themepage->dbGridCheckBox->isChecked());
- config().set_property("Themer", "paintwavewithoutline",
m_themepage->paintAudioWithOutlineCheckBox->isChecked());
- config().set_property("Themer", "iconsize",
m_themepage->iconSizeCombo->currentText());
- config().set_property("Themer", "toolbuttonstyle",
m_themepage->toolbarStyleCombo->currentIndex());
+ config().set_property("Themer", "themepath", themePathLineEdit->text());
+ config().set_property("Themer", "currenttheme",
themeSelecterCombo->currentText());
+ config().set_property("Themer", "coloradjust", colorAdjustBox->value());
+ config().set_property("Themer", "style", styleCombo->currentText());
+ config().set_property("Themer", "usestylepallet",
useStylePalletCheckBox->isChecked());
+ config().set_property("Themer", "paintaudiorectified",
rectifiedCheckBox->isChecked());
+ config().set_property("Themer", "paintstereoaudioasmono",
mergedCheckBox->isChecked());
+ config().set_property("Themer", "drawdbgrid",
dbGridCheckBox->isChecked());
+ config().set_property("Themer", "paintwavewithoutline",
paintAudioWithOutlineCheckBox->isChecked());
+ config().set_property("Themer", "iconsize",
iconSizeCombo->currentText());
+ config().set_property("Themer", "toolbuttonstyle",
toolbarStyleCombo->currentIndex());
config().set_property("Themer", "supportediconsizes",
supportedIconSizes);
- config().set_property("Themer", "transportconsolesize",
m_themepage->transportConsoleCombo->currentText());
- config().set_property("Interface", "LanguageFile",
m_themepage->languageComboBox->itemData(m_themepage->languageComboBox->currentIndex()));
+ config().set_property("Themer", "transportconsolesize",
transportConsoleCombo->currentText());
+ config().set_property("Interface", "LanguageFile",
languageComboBox->itemData(languageComboBox->currentIndex()));
}
-void AppearancePage::load_config()
+void AppearenceConfigPage::load_config()
{
QIcon icon =
QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon);
- m_themepage->pathSelectButton->setIcon(icon);
+ pathSelectButton->setIcon(icon);
QString themepath = config().get_property("Themer", "themepath",
QString(QDir::homePath()).append(".traverso/themes")).toString();
@@ -550,10 +408,10 @@
QStringList keys = QStyleFactory::keys();
keys.sort();
foreach(const QString &key, keys) {
- m_themepage->styleCombo->addItem(key);
+ styleCombo->addItem(key);
}
- m_themepage->update_theme_combobox(themepath);
+ update_theme_combobox(themepath);
// Hmm, there seems no way to get the name of the current
@@ -570,25 +428,25 @@
QString interfaceLanguage = config().get_property("Interface",
"LanguageFile", "").toString();
- int index = m_themepage->styleCombo->findText(style);
- m_themepage->styleCombo->setCurrentIndex(index);
- index = m_themepage->themeSelecterCombo->findText(theme);
- m_themepage->themeSelecterCombo->setCurrentIndex(index);
- m_themepage->colorAdjustBox->setValue(coloradjust);
- m_themepage->useStylePalletCheckBox->setChecked(usestylepallete);
- m_themepage->themePathLineEdit->setText(themepath);
- m_themepage->rectifiedCheckBox->setChecked(paintRectified);
- m_themepage->mergedCheckBox->setChecked(paintStereoAsMono);
- m_themepage->dbGridCheckBox->setChecked(dbGrid);
-
m_themepage->paintAudioWithOutlineCheckBox->setChecked(paintWaveWithLines);
-
- m_themepage->toolbarStyleCombo->clear();
- m_themepage->toolbarStyleCombo->addItem(tr("Icons only"));
- m_themepage->toolbarStyleCombo->addItem(tr("Text only"));
- m_themepage->toolbarStyleCombo->addItem(tr("Text beside Icons"));
- m_themepage->toolbarStyleCombo->addItem(tr("Text below Icons"));
+ int index = styleCombo->findText(style);
+ styleCombo->setCurrentIndex(index);
+ index = themeSelecterCombo->findText(theme);
+ themeSelecterCombo->setCurrentIndex(index);
+ colorAdjustBox->setValue(coloradjust);
+ useStylePalletCheckBox->setChecked(usestylepallete);
+ themePathLineEdit->setText(themepath);
+ rectifiedCheckBox->setChecked(paintRectified);
+ mergedCheckBox->setChecked(paintStereoAsMono);
+ dbGridCheckBox->setChecked(dbGrid);
+ paintAudioWithOutlineCheckBox->setChecked(paintWaveWithLines);
+
+ toolbarStyleCombo->clear();
+ toolbarStyleCombo->addItem(tr("Icons only"));
+ toolbarStyleCombo->addItem(tr("Text only"));
+ toolbarStyleCombo->addItem(tr("Text beside Icons"));
+ toolbarStyleCombo->addItem(tr("Text below Icons"));
int tbstyle = config().get_property("Themer", "toolbuttonstyle",
0).toInt();
- m_themepage->toolbarStyleCombo->setCurrentIndex(tbstyle);
+ toolbarStyleCombo->setCurrentIndex(tbstyle);
// icon sizes of the toolbars
QString iconsize = config().get_property("Themer", "iconsize",
"22").toString();
@@ -608,10 +466,10 @@
iconSizesList.sort();
}
- m_themepage->iconSizeCombo->clear();
- m_themepage->iconSizeCombo->addItems(iconSizesList);
- int iconsizeindex = m_themepage->iconSizeCombo->findText(iconsize);
- m_themepage->iconSizeCombo->setCurrentIndex(iconsizeindex);
+ iconSizeCombo->clear();
+ iconSizeCombo->addItems(iconSizesList);
+ int iconsizeindex = iconSizeCombo->findText(iconsize);
+ iconSizeCombo->setCurrentIndex(iconsizeindex);
// and the same again for the icons size of the transport console
QString trspsize = config().get_property("Themer",
"transportconsolesize", "22").toString();
@@ -622,21 +480,21 @@
iconSizesList.sort();
}
- m_themepage->transportConsoleCombo->clear();
- m_themepage->transportConsoleCombo->addItems(iconSizesList);
- int trspsizeindex = m_themepage->iconSizeCombo->findText(trspsize);
- m_themepage->transportConsoleCombo->setCurrentIndex(trspsizeindex);
+ transportConsoleCombo->clear();
+ transportConsoleCombo->addItems(iconSizesList);
+ int trspsizeindex = iconSizeCombo->findText(trspsize);
+ transportConsoleCombo->setCurrentIndex(trspsizeindex);
- int langIndex =
m_themepage->languageComboBox->findData(interfaceLanguage);
+ int langIndex = languageComboBox->findData(interfaceLanguage);
if (langIndex >= 0) {
- m_themepage->languageComboBox->setCurrentIndex(langIndex);
+ languageComboBox->setCurrentIndex(langIndex);
}
}
-void AppearancePage::reset_default_config()
+void AppearenceConfigPage::reset_default_config()
{
- m_themepage->styleCombo->clear();
+ styleCombo->clear();
config().set_property("Themer", "themepath",
QString(QDir::homePath()).append("/.traverso/themes"));
config().set_property("Themer", "currenttheme", "TraversoLight");
@@ -657,14 +515,28 @@
}
-ThemeConfigPage::ThemeConfigPage(QWidget * parent)
- : QWidget(parent)
+AppearenceConfigPage::AppearenceConfigPage(QWidget * parent)
+ : ConfigPage(parent)
{
setupUi(this);
+
themeSelecterCombo->setInsertPolicy(QComboBox::InsertAlphabetically);
+
+ languageComboBox->addItem(tr("Default Language"), "");
+ foreach(const QString &lang, find_qm_files()) {
+ languageComboBox->addItem(language_name_from_qm_file(lang),
lang);
+ }
+
+ load_config();
+ create_connections();
+
+#if defined Q_WS_MAC
+ iconSizeCombo->hide();
+ toolbarStyleCombo->hide();
+#endif
}
-void ThemeConfigPage::create_connections()
+void AppearenceConfigPage::create_connections()
{
connect(styleCombo, SIGNAL(currentIndexChanged(const QString)), this,
SLOT(style_index_changed(const QString)));
connect(themeSelecterCombo, SIGNAL(currentIndexChanged(const QString)),
this, SLOT(theme_index_changed(const QString)));
@@ -677,7 +549,7 @@
connect(paintAudioWithOutlineCheckBox, SIGNAL(toggled(bool)), this,
SLOT(theme_option_changed()));
}
-void ThemeConfigPage::style_index_changed(const QString& text)
+void AppearenceConfigPage::style_index_changed(const QString& text)
{
QApplication::setStyle(text);
QIcon icon =
QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon);
@@ -685,7 +557,7 @@
use_selected_styles_pallet_checkbox_toggled(useStylePalletCheckBox->isChecked());
}
-void ThemeConfigPage::theme_index_changed(const QString & theme)
+void AppearenceConfigPage::theme_index_changed(const QString & theme)
{
int index = themeSelecterCombo->findText(theme);
QString data = themeSelecterCombo->itemData(index).toString();
@@ -698,7 +570,7 @@
}
}
-void ThemeConfigPage::use_selected_styles_pallet_checkbox_toggled(bool checked)
+void AppearenceConfigPage::use_selected_styles_pallet_checkbox_toggled(bool
checked)
{
if (checked) {
QApplication::setPalette(QApplication::style()->standardPalette());
@@ -707,12 +579,12 @@
}
}
-void ThemeConfigPage::color_adjustbox_changed(int value)
+void AppearenceConfigPage::color_adjustbox_changed(int value)
{
themer()->set_color_adjust_value(value);
}
-void ThemeConfigPage::dirselect_button_clicked()
+void AppearenceConfigPage::dirselect_button_clicked()
{
QString path = themePathLineEdit->text();
if (path.isEmpty()) {
@@ -727,7 +599,7 @@
}
}
-void ThemeConfigPage::update_theme_combobox(const QString& path)
+void AppearenceConfigPage::update_theme_combobox(const QString& path)
{
themeSelecterCombo->clear();
@@ -745,7 +617,7 @@
}
-void ThemeConfigPage::theme_option_changed()
+void AppearenceConfigPage::theme_option_changed()
{
config().set_property("Themer", "paintaudiorectified",
rectifiedCheckBox->isChecked());
config().set_property("Themer", "paintstereoaudioasmono",
mergedCheckBox->isChecked());
@@ -755,51 +627,143 @@
}
+
+
+
+/****************************************/
+/* Behavior */
+/****************************************/
+
+BehaviorConfigPage::BehaviorConfigPage(QWidget * parent)
+ : ConfigPage(parent)
+{
+ setupUi(this);
+
+ connect(&config(), SIGNAL(configChanged()), this,
SLOT(update_follow()));
+
+ load_config();
+}
+
+
+void BehaviorConfigPage::save_config()
+{
+ config().set_property("Project", "loadLastUsed",
loadLastProjectCheckBox->isChecked());
+ config().set_property("Sheet", "trackCreationCount",
numberOfTrackSpinBox->value());
+ config().set_property("PlayHead", "Follow",
keepCursorVisibleCheckBox->isChecked());
+ config().set_property("PlayHead", "Scrollmode",
scrollModeComboBox->currentIndex());
+ config().set_property("AudioClip", "SyncDuringDrag",
resyncAudioCheckBox->isChecked());
+ config().set_property("AudioClip", "LockByDefault",
lockClipsCheckBox->isChecked());
+
+ QString oncloseaction;
+ if (saveRadioButton->isChecked()) {
+ config().set_property("Project", "onclose", "save");
+ } else if (askRadioButton->isChecked()) {
+ config().set_property("Project", "onclose", "ask");
+ } else {
+ config().set_property("Project", "onclose", "dontsave");
+ }
+}
+
+void BehaviorConfigPage::load_config()
+{
+ bool loadLastUsedProject = config().get_property("Project",
"loadLastUsed", 1).toBool();
+ QString oncloseaction = config().get_property("Project", "onclose",
"save").toString();
+ int defaultNumTracks = config().get_property("Sheet",
"trackCreationCount", 6).toInt();
+ int scrollMode = config().get_property("PlayHead", "Scrollmode",
2).toInt();
+ bool resyncAudio = config().get_property("AudioClip", "SyncDuringDrag",
false).toBool();
+ bool lockClips = config().get_property("AudioClip", "LockByDefault",
false).toBool();
+
+ loadLastProjectCheckBox->setChecked(loadLastUsedProject);
+ numberOfTrackSpinBox->setValue(defaultNumTracks);
+ scrollModeComboBox->setCurrentIndex(scrollMode);
+ resyncAudioCheckBox->setChecked(resyncAudio);
+ lockClipsCheckBox->setChecked(lockClips);
+
+ if (oncloseaction == "save") {
+ saveRadioButton->setChecked(true);
+ } else if (oncloseaction == "ask") {
+ askRadioButton->setChecked(true);
+ } else {
+ neverRadioButton->setChecked(true);
+ }
+
+ update_follow();
+
+}
+
+
+void BehaviorConfigPage::update_follow()
+{
+ bool keepCursorVisible = config().get_property("PlayHead", "Follow",
true).toBool();
+ keepCursorVisibleCheckBox->setChecked(keepCursorVisible);
+ scrollModeComboBox->setEnabled(keepCursorVisible);
+}
+
+void BehaviorConfigPage::reset_default_config()
+{
+ config().set_property("Project", "loadLastUsed", true);
+ config().set_property("Project", "onclose", "save");
+ config().set_property("Sheet", "trackCreationCount", 6);
+ config().set_property("PlayHead", "Follow", 0);
+ config().set_property("PlayHead", "Scrollmode", 2);
+ config().set_property("AudioClip", "SyncDuringDrag", false);
+ config().set_property("AudioClip", "LockByDefault", false);
+
+ load_config();
+}
+
+
+
+
/****************************************/
/* Keyboard */
/****************************************/
-KeyboardPage::KeyboardPage(QWidget * parent)
+
+KeyboardConfigPage::KeyboardConfigPage(QWidget * parent)
: ConfigPage(parent)
{
- m_configpage = new KeyboardConfigPage(this);
- mainLayout->addWidget(m_configpage);
+ setupUi(this);
+ connect(keymapComboBox, SIGNAL(currentIndexChanged(const QString)),
+ this, SLOT(keymap_index_changed(const QString)));
load_config();
+
+ update_keymap_combo();
}
-void KeyboardPage::load_config()
+void KeyboardConfigPage::load_config()
{
int doubleFactTimeout = config().get_property("CCE",
"doublefactTimeout", 180).toInt();
int holdTimeout = config().get_property("CCE", "holdTimeout",
150).toInt();
- m_configpage->doubleFactTimeoutSpinBox->setValue(doubleFactTimeout);
- m_configpage->holdTimeoutSpinBox->setValue(holdTimeout);
+ doubleFactTimeoutSpinBox->setValue(doubleFactTimeout);
+ holdTimeoutSpinBox->setValue(holdTimeout);
QString defaultkeymap = config().get_property("CCE", "keymap",
"default").toString();
- int index = m_configpage->keymapComboBox->findText(defaultkeymap);
+ int index = keymapComboBox->findText(defaultkeymap);
if (index >= 0) {
- m_configpage->keymapComboBox->setCurrentIndex(index);
+ keymapComboBox->setCurrentIndex(index);
}
}
-void KeyboardPage::save_config()
+void KeyboardConfigPage::save_config()
{
QString currentkeymap = config().get_property("CCE", "keymap",
"default").toString();
- QString newkeymap = m_configpage->keymapComboBox->currentText();
+ QString newkeymap = keymapComboBox->currentText();
- config().set_property("CCE", "doublefactTimeout",
m_configpage->doubleFactTimeoutSpinBox->value());
- config().set_property("CCE", "holdTimeout",
m_configpage->holdTimeoutSpinBox->value());
+ config().set_property("CCE", "doublefactTimeout",
doubleFactTimeoutSpinBox->value());
+ config().set_property("CCE", "holdTimeout",
holdTimeoutSpinBox->value());
config().set_property("CCE", "keymap", newkeymap);
-
ie().set_double_fact_interval(m_configpage->doubleFactTimeoutSpinBox->value());
- ie().set_hold_sensitiveness(m_configpage->holdTimeoutSpinBox->value());
+ ie().set_double_fact_interval(doubleFactTimeoutSpinBox->value());
+ ie().set_hold_sensitiveness(holdTimeoutSpinBox->value());
if (currentkeymap != newkeymap) {
ie().init_map(newkeymap);
}
}
-void KeyboardPage::reset_default_config()
+void KeyboardConfigPage::reset_default_config()
{
config().set_property("CCE", "doublefactTimeout", 180);
config().set_property("CCE", "holdTimeout", 150);
@@ -807,15 +771,6 @@
load_config();
}
-KeyboardConfigPage::KeyboardConfigPage(QWidget * parent)
- : QWidget(parent)
-{
- setupUi(this);
- connect(keymapComboBox, SIGNAL(currentIndexChanged(const QString)),
- this, SLOT(keymap_index_changed(const QString)));
-
- update_keymap_combo();
-}
void KeyboardConfigPage::keymap_index_changed(const QString& keymap)
{
@@ -882,37 +837,49 @@
-PerformancePage::PerformancePage(QWidget * parent)
+PerformanceConfigPage::PerformanceConfigPage(QWidget* parent)
: ConfigPage(parent)
{
- m_configpage = new PerformanceConfigPage(this);
- mainLayout->addWidget(m_configpage);
+ delete layout();
+ setupUi(this);
load_config();
+
+
+ // don't show it for now, it's not making sense with current opengl
support
+ useOpenGLCheckBox->hide();
+#if defined (QT_OPENGL_SUPPORT)
+ useOpenGLCheckBox->setEnabled(true);
+#else
+ useOpenGLCheckBox->setEnabled(false);
+#endif
+ QIcon icon =
QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation);
+ reloadWarningLabel->setPixmap(icon.pixmap(22, 22));
}
-void PerformancePage::load_config()
+
+void PerformanceConfigPage::load_config()
{
int jogUpdateInterval = config().get_property("CCE",
"jogupdateinterval", 28).toInt();
bool useOpenGL = config().get_property("Interface", "OpenGL",
false).toBool();
- m_configpage->jogUpdateIntervalSpinBox->setValue(1000 /
jogUpdateInterval);
- m_configpage->useOpenGLCheckBox->setChecked(useOpenGL);
+ jogUpdateIntervalSpinBox->setValue(1000 / jogUpdateInterval);
+ useOpenGLCheckBox->setChecked(useOpenGL);
double buffertime = config().get_property("Hardware", "readbuffersize",
1.0).toDouble();
- m_configpage->bufferTimeSpinBox->setValue(buffertime);
+ bufferTimeSpinBox->setValue(buffertime);
}
-void PerformancePage::save_config()
+void PerformanceConfigPage::save_config()
{
- config().set_property("Interface", "OpenGL",
m_configpage->useOpenGLCheckBox->isChecked());
- config().set_property("CCE", "jogupdateinterval", 1000 /
m_configpage->jogUpdateIntervalSpinBox->value());
- double buffertime = m_configpage->bufferTimeSpinBox->value();
+ config().set_property("Interface", "OpenGL",
useOpenGLCheckBox->isChecked());
+ config().set_property("CCE", "jogupdateinterval", 1000 /
jogUpdateIntervalSpinBox->value());
+ double buffertime = bufferTimeSpinBox->value();
config().set_property("Hardware", "readbuffersize", buffertime);
}
-void PerformancePage::reset_default_config()
+void PerformanceConfigPage::reset_default_config()
{
config().set_property("CCE", "jogupdateinterval", 28);
config().set_property("Interface", "OpenGL", false);
@@ -920,82 +887,76 @@
load_config();
}
-PerformanceConfigPage::PerformanceConfigPage(QWidget* parent)
- : QWidget(parent)
-{
- setupUi(this);
-
- // don't show it for now, it's not making sense with current opengl
support
- useOpenGLCheckBox->hide();
-#if defined (QT_OPENGL_SUPPORT)
- useOpenGLCheckBox->setEnabled(true);
-#else
- useOpenGLCheckBox->setEnabled(false);
-#endif
- QIcon icon =
QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation);
- reloadWarningLabel->setPixmap(icon.pixmap(22, 22));
-}
/****************************************/
/* Recording */
/****************************************/
-
-RecordingPage::RecordingPage(QWidget * parent)
+RecordingConfigPage::RecordingConfigPage(QWidget * parent)
: ConfigPage(parent)
{
- m_config = new RecordingConfigPage(this);
- mainLayout->addWidget(m_config);
+ setupUi(this);
+
+ encodingComboBox->addItem("WAV", "wav");
+ encodingComboBox->addItem("WavPack", "wavpack");
+ encodingComboBox->addItem("WAV64", "w64");
+ wavpackCompressionComboBox->addItem("Very high", "very_high");
+ wavpackCompressionComboBox->addItem("High", "high");
+ wavpackCompressionComboBox->addItem("Fast", "fast");
+
+ connect(encodingComboBox, SIGNAL(currentIndexChanged(int)), this,
SLOT(encoding_index_changed(int)));
+ connect(useResamplingCheckBox, SIGNAL(stateChanged(int)),
+ this, SLOT(use_onthefly_resampling_checkbox_changed(int)));
load_config();
}
-void RecordingPage::load_config()
+void RecordingConfigPage::load_config()
{
bool useResampling = config().get_property("Conversion",
"DynamicResampling", true).toBool();
if (useResampling) {
- m_config->use_onthefly_resampling_checkbox_changed(Qt::Checked);
+ use_onthefly_resampling_checkbox_changed(Qt::Checked);
} else {
-
m_config->use_onthefly_resampling_checkbox_changed(Qt::Unchecked);
+ use_onthefly_resampling_checkbox_changed(Qt::Unchecked);
}
QString recordFormat = config().get_property("Recording", "FileFormat",
"wav").toString();
if (recordFormat == "wavpack") {
- m_config->encoding_index_changed(1);
+ encoding_index_changed(1);
} else if (recordFormat == "w64") {
- m_config->encoding_index_changed(2);
+ encoding_index_changed(2);
} else {
- m_config->encoding_index_changed(0);
+ encoding_index_changed(0);
}
QString wavpackcompression = config().get_property("Recording",
"WavpackCompressionType", "fast").toString();
if (wavpackcompression == "very_high") {
- m_config->wavpackCompressionComboBox->setCurrentIndex(0);
+ wavpackCompressionComboBox->setCurrentIndex(0);
} else if (wavpackcompression == "high") {
- m_config->wavpackCompressionComboBox->setCurrentIndex(1);
+ wavpackCompressionComboBox->setCurrentIndex(1);
} else {
- m_config->wavpackCompressionComboBox->setCurrentIndex(2);
+ wavpackCompressionComboBox->setCurrentIndex(2);
}
int index = config().get_property("Conversion",
"RTResamplingConverterType", DEFAULT_RESAMPLE_QUALITY).toInt();
- m_config->ontheflyResampleComboBox->setCurrentIndex(index);
+ ontheflyResampleComboBox->setCurrentIndex(index);
index = config().get_property("Conversion",
"ExportResamplingConverterType", 1).toInt();
- m_config->exportDefaultResampleQualityComboBox->setCurrentIndex(index);
+ exportDefaultResampleQualityComboBox->setCurrentIndex(index);
}
-void RecordingPage::save_config()
+void RecordingConfigPage::save_config()
{
- config().set_property("Conversion", "DynamicResampling",
m_config->useResamplingCheckBox->isChecked());
- config().set_property("Conversion", "RTResamplingConverterType",
m_config->ontheflyResampleComboBox->currentIndex());
- config().set_property("Conversion", "ExportResamplingConverterType",
m_config->exportDefaultResampleQualityComboBox->currentIndex());
- config().set_property("Recording", "FileFormat",
m_config->encodingComboBox->itemData(m_config->encodingComboBox->currentIndex()).toString());
- config().set_property("Recording", "WavpackCompressionType",
m_config->wavpackCompressionComboBox->itemData(m_config->wavpackCompressionComboBox->currentIndex()).toString());
- QString skipwvx =
m_config->wavpackUseAlmostLosslessCheckBox->isChecked() ? "true" : "false";
+ config().set_property("Conversion", "DynamicResampling",
useResamplingCheckBox->isChecked());
+ config().set_property("Conversion", "RTResamplingConverterType",
ontheflyResampleComboBox->currentIndex());
+ config().set_property("Conversion", "ExportResamplingConverterType",
exportDefaultResampleQualityComboBox->currentIndex());
+ config().set_property("Recording", "FileFormat",
encodingComboBox->itemData(encodingComboBox->currentIndex()).toString());
+ config().set_property("Recording", "WavpackCompressionType",
wavpackCompressionComboBox->itemData(wavpackCompressionComboBox->currentIndex()).toString());
+ QString skipwvx = wavpackUseAlmostLosslessCheckBox->isChecked() ?
"true" : "false";
config().set_property("Recording", "WavpackSkipWVX", skipwvx);
}
-void RecordingPage::reset_default_config()
+void RecordingConfigPage::reset_default_config()
{
config().set_property("Conversion", "DynamicResampling", true);
config().set_property("Conversion", "RTResamplingConverterType",
DEFAULT_RESAMPLE_QUALITY);
@@ -1007,22 +968,6 @@
load_config();
}
-RecordingConfigPage::RecordingConfigPage(QWidget * parent)
- : QWidget(parent)
-{
- setupUi(this);
-
- encodingComboBox->addItem("WAV", "wav");
- encodingComboBox->addItem("WavPack", "wavpack");
- encodingComboBox->addItem("WAV64", "w64");
- wavpackCompressionComboBox->addItem("Very high", "very_high");
- wavpackCompressionComboBox->addItem("High", "high");
- wavpackCompressionComboBox->addItem("Fast", "fast");
-
- connect(encodingComboBox, SIGNAL(currentIndexChanged(int)), this,
SLOT(encoding_index_changed(int)));
- connect(useResamplingCheckBox, SIGNAL(stateChanged(int)),
- this, SLOT(use_onthefly_resampling_checkbox_changed(int)));
-}
void RecordingConfigPage::encoding_index_changed(int index)
{
Index: dialogs/settings/Pages.h
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/dialogs/settings/Pages.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- dialogs/settings/Pages.h 20 Feb 2009 22:18:46 -0000 1.12
+++ dialogs/settings/Pages.h 21 Feb 2009 14:50:23 -0000 1.13
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2007 Remon Sijrier
+Copyright (C) 2007-2009 Remon Sijrier
This file is part of Traverso
@@ -19,112 +19,98 @@
*/
-#ifndef PAGES_H
-#define PAGES_H
+#ifndef CONFIG_PAGES_H
+#define CONFIG_PAGES_H
#include <QWidget>
-#include "ui_DriverConfigPage.h"
+#include "ui_AudioDriverConfigPage.h"
#include "ui_KeyboardConfigPage.h"
#include "ui_BehaviorConfigPage.h"
#include "ui_RecordingConfigPage.h"
-#include "ui_ThemeConfigPage.h"
+#include "ui_AppearenceConfigPage.h"
#include "ui_PerformanceConfigPage.h"
#include "ui_AlsaDevicesPage.h"
#include "ui_PaDriverPage.h"
-class PerformanceConfigPage : public QWidget, private Ui::PerformanceConfigPage
-{
-public:
- PerformanceConfigPage(QWidget* parent = 0);
-
-private:
- friend class PerformancePage;
-};
-
-class DriverConfigPage : public QWidget, private Ui::DriverConfigPage
-{
- Q_OBJECT
-
-public:
- DriverConfigPage(QWidget* parent = 0);
-
-private:
- QList<int> periodBufferSizesList;
- friend class AudioDriverPage;
-
-private slots:
- void update_latency_combobox();
- void rate_combobox_index_changed(QString);
-};
class AlsaDevicesPage : public QWidget, private Ui::AlsaDevicesPage
{
public:
- AlsaDevicesPage(QWidget* parent = 0);
+ AlsaDevicesPage(QWidget* parent) : QWidget(parent) {
+ setupUi(this);
+ }
private:
- friend class AudioDriverPage;
+ friend class AudioDriverConfigPage;
};
class PaDriverPage : public QWidget, private Ui::PaDriverPage
{
public:
- PaDriverPage(QWidget* parent = 0);
+ PaDriverPage(QWidget* parent) : QWidget(parent) {
+ setupUi(this);
+ }
+
private:
- friend class AudioDriverPage;
+ friend class AudioDriverConfigPage;
};
-class KeyboardConfigPage : public QWidget, private Ui::KeyboardConfigPage
-{
- Q_OBJECT
-public:
- KeyboardConfigPage(QWidget* parent = 0);
-private:
- friend class KeyboardPage;
-private slots:
- void keymap_index_changed(const QString& keymap);
- void update_keymap_combo();
- void on_exportButton_clicked();
- void on_printButton_clicked();
-};
-
-class BehaviorConfigPage : public QWidget, private Ui::BehaviorConfigPage
+class ConfigPage : public QWidget
{
Q_OBJECT
public:
- BehaviorConfigPage(QWidget* parent = 0);
-private:
- friend class BehaviorPage;
+ ConfigPage(QWidget* parent) : QWidget(parent) {};
+ virtual void save_config() = 0;
+ virtual void load_config() = 0;
+ virtual void reset_default_config() = 0;
};
-class RecordingConfigPage : public QWidget, private Ui::RecordingConfigPage
+
+class AudioDriverConfigPage : public ConfigPage, private
Ui::AudioDriverConfigPage
{
Q_OBJECT
public:
- RecordingConfigPage(QWidget* parent = 0);
+ AudioDriverConfigPage(QWidget *parent = 0);
+
+ void load_config();
+ void save_config();
+ void reset_default_config();
+
private:
- friend class RecordingPage;
+ QVBoxLayout* m_mainLayout;
+ AudioDriverConfigPage* m_driverConfigPage;
+ AlsaDevicesPage* m_alsadevices;
+ PaDriverPage* m_portaudiodrivers;
+ QList<int> periodBufferSizesList;
+
private slots:
- void encoding_index_changed(int index);
- void use_onthefly_resampling_checkbox_changed(int state);
+ void update_latency_combobox();
+ void rate_combobox_index_changed(QString);
+ void driver_combobox_index_changed(QString);
+ void restart_driver_button_clicked();
};
-class ThemeConfigPage : public QWidget, private Ui::ThemeConfigPage
+class AppearenceConfigPage : public ConfigPage, private
Ui::AppearenceConfigPage
{
Q_OBJECT
public:
- ThemeConfigPage(QWidget* parent = 0);
+ AppearenceConfigPage(QWidget* parent = 0);
+
+ void load_config();
+ void save_config();
+ void reset_default_config();
+
private:
void update_theme_combobox(const QString& path);
void create_connections();
- friend class AppearancePage;
+ QString supportedIconSizes;
private slots:
void dirselect_button_clicked();
@@ -136,108 +122,64 @@
};
-
-
-class ConfigPage : public QWidget
+class BehaviorConfigPage : public ConfigPage, private Ui::BehaviorConfigPage
{
Q_OBJECT
public:
- ConfigPage(QWidget* parent);
- virtual void save_config() = 0;
- virtual void load_config() = 0;
- virtual void reset_default_config() = 0;
-protected:
- QVBoxLayout* mainLayout;
-};
-
+ BehaviorConfigPage(QWidget* parent = 0);
-class AudioDriverPage : public ConfigPage
-{
- Q_OBJECT
-public:
- AudioDriverPage(QWidget *parent = 0);
+ void load_config();
void save_config();
void reset_default_config();
-private:
- QVBoxLayout* m_mainLayout;
- DriverConfigPage* m_driverConfigPage;
- AlsaDevicesPage* m_alsadevices;
- PaDriverPage* m_portaudiodrivers;
-
- void load_config();
-
private slots:
- void driver_combobox_index_changed(QString);
- void restart_driver_button_clicked();
+ void update_follow();
};
-class RecordingPage : public ConfigPage
+class KeyboardConfigPage : public ConfigPage, private Ui::KeyboardConfigPage
{
+ Q_OBJECT
public:
- RecordingPage(QWidget *parent = 0);
- void load_config();
- void save_config();
- void reset_default_config();
-private:
- RecordingConfigPage* m_config;
-};
-
+ KeyboardConfigPage(QWidget* parent = 0);
-class KeyboardPage : public ConfigPage
-{
-public:
- KeyboardPage(QWidget* parent=0);
void load_config();
void save_config();
void reset_default_config();
-private:
- KeyboardConfigPage* m_configpage;
+private slots:
+ void keymap_index_changed(const QString& keymap);
+ void update_keymap_combo();
+ void on_exportButton_clicked();
+ void on_printButton_clicked();
};
-class AppearancePage : public ConfigPage
+class PerformanceConfigPage : public ConfigPage, private
Ui::PerformanceConfigPage
{
public:
- AppearancePage(QWidget *parent = 0);
+ PerformanceConfigPage(QWidget* parent = 0);
+
void load_config();
void save_config();
void reset_default_config();
-
-private:
- QString supportedIconSizes;
- ThemeConfigPage* m_themepage;
};
-class BehaviorPage : public ConfigPage
+class RecordingConfigPage : public ConfigPage, private Ui::RecordingConfigPage
{
Q_OBJECT
public:
- BehaviorPage(QWidget *parent = 0);
+ RecordingConfigPage(QWidget* parent = 0);
+
void load_config();
void save_config();
void reset_default_config();
private slots:
- void update_follow();
-
-private:
- BehaviorConfigPage* m_configpage;
+ void encoding_index_changed(int index);
+ void use_onthefly_resampling_checkbox_changed(int state);
};
-class PerformancePage : public ConfigPage
-{
-public:
- PerformancePage(QWidget *parent = 0);
- void load_config();
- void save_config();
- void reset_default_config();
-
-private:
- PerformanceConfigPage* m_configpage;
-};
#endif
Index: dialogs/settings/SettingsDialog.cpp
===================================================================
RCS file:
/sources/traverso/traverso/src/traverso/dialogs/settings/SettingsDialog.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- dialogs/settings/SettingsDialog.cpp 20 Feb 2009 22:18:46 -0000 1.14
+++ dialogs/settings/SettingsDialog.cpp 21 Feb 2009 14:50:23 -0000 1.15
@@ -46,12 +46,12 @@
contentsWidget->setSpacing(12);
pagesWidget = new QStackedWidget;
- pagesWidget->addWidget(new BehaviorPage(this));
- pagesWidget->addWidget(new AppearancePage(this));
- pagesWidget->addWidget(new AudioDriverPage(this));
- pagesWidget->addWidget(new RecordingPage(this));
- pagesWidget->addWidget(new KeyboardPage(this));
- pagesWidget->addWidget(new PerformancePage(this));
+ pagesWidget->addWidget(new BehaviorConfigPage(this));
+ pagesWidget->addWidget(new AppearenceConfigPage(this));
+ pagesWidget->addWidget(new AudioDriverConfigPage(this));
+ pagesWidget->addWidget(new RecordingConfigPage(this));
+ pagesWidget->addWidget(new KeyboardConfigPage(this));
+ pagesWidget->addWidget(new PerformanceConfigPage(this));
createIcons();
contentsWidget->setCurrentRow(0);
@@ -76,16 +76,15 @@
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(horizontalLayout);
- mainLayout->addStretch(1);
- mainLayout->addSpacing(12);
mainLayout->addLayout(buttonsLayout);
+
setLayout(mainLayout);
- setWindowTitle(tr("Configure - Traverso"));
+ setWindowTitle(tr("Preferences - Traverso"));
connect(&config(), SIGNAL(configChanged()), this,
SLOT(external_change_to_settings()));
- resize(500, 300);
+ resize(400, 300);
}
void SettingsDialog::show_page(const QString & page)
Index: ui/BehaviorConfigPage.ui
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/ui/BehaviorConfigPage.ui,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- ui/BehaviorConfigPage.ui 20 Feb 2009 22:18:46 -0000 1.12
+++ ui/BehaviorConfigPage.ui 21 Feb 2009 14:50:24 -0000 1.13
@@ -6,13 +6,13 @@
<x>0</x>
<y>0</y>
<width>336</width>
- <height>344</height>
+ <height>412</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
@@ -22,16 +22,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>9</number>
</property>
<item>
@@ -39,16 +30,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>0</number>
</property>
<item>
@@ -63,7 +45,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>23</height>
@@ -116,16 +98,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>9</number>
</property>
<item>
@@ -133,16 +106,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>0</number>
</property>
<item>
@@ -179,16 +143,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>9</number>
</property>
<item>
@@ -210,16 +165,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>9</number>
</property>
<item>
@@ -227,16 +173,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>0</number>
</property>
<item>
@@ -289,6 +226,19 @@
</layout>
</widget>
</item>
+ <item>
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>51</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
<resources/>
Index: ui/RecordingConfigPage.ui
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/ui/RecordingConfigPage.ui,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- ui/RecordingConfigPage.ui 20 Feb 2009 22:18:46 -0000 1.6
+++ ui/RecordingConfigPage.ui 21 Feb 2009 14:50:24 -0000 1.7
@@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>443</width>
- <height>311</height>
+ <width>354</width>
+ <height>248</height>
</rect>
</property>
<property name="sizePolicy" >
@@ -18,7 +18,7 @@
<property name="windowTitle" >
<string>Form</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
@@ -28,16 +28,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>9</number>
</property>
<item>
@@ -45,16 +36,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>0</number>
</property>
<item>
@@ -89,7 +71,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -111,16 +93,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>9</number>
</property>
<item>
@@ -128,16 +101,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>0</number>
</property>
<item>
@@ -184,16 +148,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>9</number>
</property>
<item>
@@ -208,16 +163,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>0</number>
</property>
<item>
@@ -225,16 +171,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>0</number>
</property>
<item>
@@ -258,16 +195,7 @@
<property name="spacing" >
<number>6</number>
</property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
+ <property name="margin" >
<number>0</number>
</property>
<item>
@@ -326,14 +254,14 @@
</widget>
</item>
<item>
- <spacer>
+ <spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
- <width>425</width>
- <height>16</height>
+ <width>20</width>
+ <height>3</height>
</size>
</property>
</spacer>