35 |
#include "qsamplerOptionsForm.h" |
#include "qsamplerOptionsForm.h" |
36 |
#include "qsamplerDeviceStatusForm.h" |
#include "qsamplerDeviceStatusForm.h" |
37 |
|
|
38 |
|
#include "qsamplerPaletteForm.h" |
39 |
|
|
40 |
|
#include <QStyleFactory> |
41 |
|
|
42 |
#include <QMdiArea> |
#include <QMdiArea> |
43 |
#include <QMdiSubWindow> |
#include <QMdiSubWindow> |
44 |
|
|
1878 |
if (m_pOptions->sMessagesFont.isEmpty() && m_pMessages) |
if (m_pOptions->sMessagesFont.isEmpty() && m_pMessages) |
1879 |
m_pOptions->sMessagesFont = m_pMessages->messagesFont().toString(); |
m_pOptions->sMessagesFont = m_pMessages->messagesFont().toString(); |
1880 |
// To track down deferred or immediate changes. |
// To track down deferred or immediate changes. |
1881 |
const QString sOldServerHost = m_pOptions->sServerHost; |
const QString sOldServerHost = m_pOptions->sServerHost; |
1882 |
const int iOldServerPort = m_pOptions->iServerPort; |
const int iOldServerPort = m_pOptions->iServerPort; |
1883 |
const int iOldServerTimeout = m_pOptions->iServerTimeout; |
const int iOldServerTimeout = m_pOptions->iServerTimeout; |
1884 |
const bool bOldServerStart = m_pOptions->bServerStart; |
const bool bOldServerStart = m_pOptions->bServerStart; |
1885 |
const QString sOldServerCmdLine = m_pOptions->sServerCmdLine; |
const QString sOldServerCmdLine = m_pOptions->sServerCmdLine; |
1886 |
const bool bOldMessagesLog = m_pOptions->bMessagesLog; |
const bool bOldMessagesLog = m_pOptions->bMessagesLog; |
1887 |
const QString sOldMessagesLogPath = m_pOptions->sMessagesLogPath; |
const QString sOldMessagesLogPath = m_pOptions->sMessagesLogPath; |
1888 |
const QString sOldDisplayFont = m_pOptions->sDisplayFont; |
const QString sOldDisplayFont = m_pOptions->sDisplayFont; |
1889 |
const bool bOldDisplayEffect = m_pOptions->bDisplayEffect; |
const bool bOldDisplayEffect = m_pOptions->bDisplayEffect; |
1890 |
const int iOldMaxVolume = m_pOptions->iMaxVolume; |
const int iOldMaxVolume = m_pOptions->iMaxVolume; |
1891 |
const QString sOldMessagesFont = m_pOptions->sMessagesFont; |
const QString sOldMessagesFont = m_pOptions->sMessagesFont; |
1892 |
const bool bOldKeepOnTop = m_pOptions->bKeepOnTop; |
const bool bOldKeepOnTop = m_pOptions->bKeepOnTop; |
1893 |
const bool bOldStdoutCapture = m_pOptions->bStdoutCapture; |
const bool bOldStdoutCapture = m_pOptions->bStdoutCapture; |
1894 |
const int bOldMessagesLimit = m_pOptions->bMessagesLimit; |
const int bOldMessagesLimit = m_pOptions->bMessagesLimit; |
1895 |
const int iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines; |
const int iOldMessagesLimitLines = m_pOptions->iMessagesLimitLines; |
1896 |
const bool bOldCompletePath = m_pOptions->bCompletePath; |
const bool bOldCompletePath = m_pOptions->bCompletePath; |
1897 |
const bool bOldInstrumentNames = m_pOptions->bInstrumentNames; |
const bool bOldInstrumentNames = m_pOptions->bInstrumentNames; |
1898 |
const int iOldMaxRecentFiles = m_pOptions->iMaxRecentFiles; |
const int iOldMaxRecentFiles = m_pOptions->iMaxRecentFiles; |
1899 |
const int iOldBaseFontSize = m_pOptions->iBaseFontSize; |
const int iOldBaseFontSize = m_pOptions->iBaseFontSize; |
1900 |
|
const QString sOldCustomStyleTheme = m_pOptions->sCustomStyleTheme; |
1901 |
|
const QString sOldCustomColorTheme = m_pOptions->sCustomColorTheme; |
1902 |
// Load the current setup settings. |
// Load the current setup settings. |
1903 |
pOptionsForm->setup(m_pOptions); |
pOptionsForm->setup(m_pOptions); |
1904 |
// Show the setup dialog... |
// Show the setup dialog... |
1905 |
if (pOptionsForm->exec()) { |
if (pOptionsForm->exec()) { |
1906 |
// Warn if something will be only effective on next run. |
// Warn if something will be only effective on next run. |
1907 |
|
int iNeedRestart = 0; |
1908 |
if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) || |
if (( bOldStdoutCapture && !m_pOptions->bStdoutCapture) || |
1909 |
(!bOldStdoutCapture && m_pOptions->bStdoutCapture) || |
(!bOldStdoutCapture && m_pOptions->bStdoutCapture)) { |
1910 |
( bOldKeepOnTop && !m_pOptions->bKeepOnTop) || |
updateMessagesCapture(); |
1911 |
|
++iNeedRestart; |
1912 |
|
} |
1913 |
|
if (( bOldKeepOnTop && !m_pOptions->bKeepOnTop) || |
1914 |
(!bOldKeepOnTop && m_pOptions->bKeepOnTop) || |
(!bOldKeepOnTop && m_pOptions->bKeepOnTop) || |
1915 |
(iOldBaseFontSize != m_pOptions->iBaseFontSize)) { |
(iOldBaseFontSize != m_pOptions->iBaseFontSize)) { |
1916 |
QMessageBox::information(this, |
++iNeedRestart; |
1917 |
tr("Information"), |
} |
1918 |
tr("Some settings may be only effective\n" |
// Check whether restart is needed or whether |
1919 |
"next time you start this program.")); |
// custom options maybe set up immediately... |
1920 |
updateMessagesCapture(); |
if (m_pOptions->sCustomStyleTheme != sOldCustomStyleTheme) { |
1921 |
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) |
1922 |
|
++iNeedRestart; |
1923 |
|
#else |
1924 |
|
if (m_pOptions->sCustomStyleTheme.isEmpty()) { |
1925 |
|
++iNeedRestart; |
1926 |
|
} else { |
1927 |
|
QApplication::setStyle( |
1928 |
|
QStyleFactory::create(m_pOptions->sCustomStyleTheme)); |
1929 |
|
} |
1930 |
|
#endif |
1931 |
|
} |
1932 |
|
if (m_pOptions->sCustomColorTheme != sOldCustomColorTheme) { |
1933 |
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) |
1934 |
|
++iNeedRestart; |
1935 |
|
#else |
1936 |
|
if (m_pOptions->sCustomColorTheme.isEmpty()) { |
1937 |
|
++iNeedRestart; |
1938 |
|
} else { |
1939 |
|
QPalette pal; |
1940 |
|
if (PaletteForm::namedPalette( |
1941 |
|
&m_pOptions->settings(), m_pOptions->sCustomColorTheme, pal)) |
1942 |
|
QApplication::setPalette(pal); |
1943 |
|
} |
1944 |
|
#endif |
1945 |
} |
} |
1946 |
// Check wheather something immediate has changed. |
// Check wheather something immediate has changed. |
1947 |
if (( bOldMessagesLog && !m_pOptions->bMessagesLog) || |
if (( bOldMessagesLog && !m_pOptions->bMessagesLog) || |
1969 |
(!bOldMessagesLimit && m_pOptions->bMessagesLimit) || |
(!bOldMessagesLimit && m_pOptions->bMessagesLimit) || |
1970 |
(iOldMessagesLimitLines != m_pOptions->iMessagesLimitLines)) |
(iOldMessagesLimitLines != m_pOptions->iMessagesLimitLines)) |
1971 |
updateMessagesLimit(); |
updateMessagesLimit(); |
1972 |
|
// Show restart needed message... |
1973 |
|
if (iNeedRestart > 0) { |
1974 |
|
QMessageBox::information(this, |
1975 |
|
tr("Information"), |
1976 |
|
tr("Some settings may be only effective\n" |
1977 |
|
"next time you start this program.")); |
1978 |
|
} |
1979 |
// And now the main thing, whether we'll do client/server recycling? |
// And now the main thing, whether we'll do client/server recycling? |
1980 |
if ((sOldServerHost != m_pOptions->sServerHost) || |
if ((sOldServerHost != m_pOptions->sServerHost) || |
1981 |
(iOldServerPort != m_pOptions->iServerPort) || |
(iOldServerPort != m_pOptions->iServerPort) || |