1 |
// qsamplerOptionsForm.cpp |
// qsamplerOptionsForm.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2019, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2020, 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 |
345 |
m_pOptions->iMaxRecentFiles = m_ui.MaxRecentFilesSpinBox->value(); |
m_pOptions->iMaxRecentFiles = m_ui.MaxRecentFilesSpinBox->value(); |
346 |
m_pOptions->iBaseFontSize = m_ui.BaseFontSizeComboBox->currentText().toInt(); |
m_pOptions->iBaseFontSize = m_ui.BaseFontSizeComboBox->currentText().toInt(); |
347 |
// Custom color/style theme options... |
// Custom color/style theme options... |
|
const QString sOldCustomStyleTheme = m_pOptions->sCustomStyleTheme; |
|
348 |
if (m_ui.CustomStyleThemeComboBox->currentIndex() > 0) |
if (m_ui.CustomStyleThemeComboBox->currentIndex() > 0) |
349 |
m_pOptions->sCustomStyleTheme = m_ui.CustomStyleThemeComboBox->currentText(); |
m_pOptions->sCustomStyleTheme = m_ui.CustomStyleThemeComboBox->currentText(); |
350 |
else |
else |
351 |
m_pOptions->sCustomStyleTheme.clear(); |
m_pOptions->sCustomStyleTheme.clear(); |
|
const QString sOldCustomColorTheme = m_pOptions->sCustomColorTheme; |
|
352 |
if (m_ui.CustomColorThemeComboBox->currentIndex() > 0) |
if (m_ui.CustomColorThemeComboBox->currentIndex() > 0) |
353 |
m_pOptions->sCustomColorTheme = m_ui.CustomColorThemeComboBox->currentText(); |
m_pOptions->sCustomColorTheme = m_ui.CustomColorThemeComboBox->currentText(); |
354 |
else |
else |
355 |
m_pOptions->sCustomColorTheme.clear(); |
m_pOptions->sCustomColorTheme.clear(); |
|
// Check whether restart is needed or whether |
|
|
// custom options maybe set up immediately... |
|
|
int iNeedRestart = 0; |
|
|
if (m_pOptions->sCustomStyleTheme != sOldCustomStyleTheme) { |
|
|
if (m_pOptions->sCustomStyleTheme.isEmpty()) { |
|
|
++iNeedRestart; |
|
|
} else { |
|
|
QApplication::setStyle( |
|
|
QStyleFactory::create(m_pOptions->sCustomStyleTheme)); |
|
|
} |
|
|
} |
|
|
if (m_pOptions->sCustomColorTheme != sOldCustomColorTheme) { |
|
|
if (m_pOptions->sCustomColorTheme.isEmpty()) { |
|
|
++iNeedRestart; |
|
|
} else { |
|
|
QPalette pal; |
|
|
if (PaletteForm::namedPalette( |
|
|
&m_pOptions->settings(), m_pOptions->sCustomColorTheme, pal)) |
|
|
QApplication::setPalette(pal); |
|
|
} |
|
|
} |
|
|
// Show restart message if needed... |
|
|
if (iNeedRestart > 0) { |
|
|
QMessageBox::information(this, |
|
|
tr("Information"), |
|
|
tr("Some settings may be only effective\n" |
|
|
"next time you start this application.")); |
|
|
} |
|
356 |
// Reset dirty flag. |
// Reset dirty flag. |
357 |
m_iDirtyCount = 0; |
m_iDirtyCount = 0; |
358 |
} |
} |