2009-02-05 20:55:00 +00:00
|
|
|
#include "preferences.hh"
|
|
|
|
#include "keyboardstate.hh"
|
2009-07-29 16:39:27 +00:00
|
|
|
#include "language.hh"
|
|
|
|
#include "langcoder.hh"
|
2009-04-12 20:46:25 +00:00
|
|
|
#include <QMessageBox>
|
2009-09-29 13:01:05 +00:00
|
|
|
#include "broken_xrecord.hh"
|
2013-05-05 10:22:12 +00:00
|
|
|
|
2009-02-05 20:55:00 +00:00
|
|
|
|
|
|
|
Preferences::Preferences( QWidget * parent, Config::Preferences const & p ):
|
2009-04-12 20:46:25 +00:00
|
|
|
QDialog( parent ), prevInterfaceLanguage( 0 )
|
2009-02-05 20:55:00 +00:00
|
|
|
{
|
|
|
|
ui.setupUi( this );
|
|
|
|
|
|
|
|
connect( ui.enableScanPopup, SIGNAL( toggled( bool ) ),
|
|
|
|
this, SLOT( enableScanPopupToggled( bool ) ) );
|
|
|
|
|
|
|
|
connect( ui.enableScanPopupModifiers, SIGNAL( toggled( bool ) ),
|
|
|
|
this, SLOT( enableScanPopupModifiersToggled( bool ) ) );
|
|
|
|
|
|
|
|
connect( ui.altKey, SIGNAL( clicked( bool ) ),
|
|
|
|
this, SLOT( wholeAltClicked( bool ) ) );
|
|
|
|
connect( ui.ctrlKey, SIGNAL( clicked( bool ) ),
|
|
|
|
this, SLOT( wholeCtrlClicked( bool ) ) );
|
|
|
|
connect( ui.shiftKey, SIGNAL( clicked( bool ) ),
|
|
|
|
this, SLOT( wholeShiftClicked( bool ) ) );
|
|
|
|
|
|
|
|
connect( ui.leftAlt, SIGNAL( clicked( bool ) ),
|
|
|
|
this, SLOT( sideAltClicked( bool ) ) );
|
|
|
|
connect( ui.rightAlt, SIGNAL( clicked( bool ) ),
|
|
|
|
this, SLOT( sideAltClicked( bool ) ) );
|
|
|
|
connect( ui.leftCtrl, SIGNAL( clicked( bool ) ),
|
|
|
|
this, SLOT( sideCtrlClicked( bool ) ) );
|
|
|
|
connect( ui.rightCtrl, SIGNAL( clicked( bool ) ),
|
|
|
|
this, SLOT( sideCtrlClicked( bool ) ) );
|
|
|
|
connect( ui.leftShift, SIGNAL( clicked( bool ) ),
|
|
|
|
this, SLOT( sideShiftClicked( bool ) ) );
|
|
|
|
connect( ui.rightShift, SIGNAL( clicked( bool ) ),
|
|
|
|
this, SLOT( sideShiftClicked( bool ) ) );
|
|
|
|
|
|
|
|
// Load values into form
|
|
|
|
|
2009-04-12 20:46:25 +00:00
|
|
|
ui.interfaceLanguage->addItem( tr( "System default" ), QString() );
|
2009-07-29 16:39:27 +00:00
|
|
|
ui.interfaceLanguage->addItem( QIcon( ":/flags/us.png" ), Language::localizedNameForId( LangCoder::code2toInt( "en" ) ), QString( "en_US" ) );
|
|
|
|
|
|
|
|
// See which other translations do we have
|
|
|
|
|
|
|
|
QStringList availLocs = QDir( Config::getLocDir() ).entryList( QStringList( "*.qm" ),
|
|
|
|
QDir::Files );
|
|
|
|
|
|
|
|
// We need to sort by language name -- otherwise list looks really weird
|
|
|
|
QMap< QString, QPair< QIcon, QString > > sortedLocs;
|
|
|
|
|
|
|
|
for( QStringList::iterator i = availLocs.begin(); i != availLocs.end(); ++i )
|
|
|
|
{
|
|
|
|
// Here we assume the xx_YY naming, where xx is language and YY is region.
|
|
|
|
QString lang = i->mid( 0, 2 );
|
2010-12-03 12:35:06 +00:00
|
|
|
|
|
|
|
if ( lang == "qt" )
|
2010-12-03 19:14:14 +00:00
|
|
|
continue; // We skip qt's own localizations
|
2010-12-03 12:35:06 +00:00
|
|
|
|
2011-03-04 07:11:29 +00:00
|
|
|
sortedLocs.insertMulti(
|
2013-02-03 20:19:55 +00:00
|
|
|
Language::localizedNameForId( LangCoder::code2toInt( lang.toLatin1().data() ) ),
|
2011-03-04 07:11:29 +00:00
|
|
|
QPair< QIcon, QString >(
|
|
|
|
QIcon( QString( ":/flags/%1.png" ).arg( i->mid( 3, 2 ).toLower() ) ),
|
|
|
|
i->mid( 0, i->size() - 3 ) ) );
|
2009-07-29 16:39:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for( QMap< QString, QPair< QIcon, QString > >::iterator i = sortedLocs.begin();
|
|
|
|
i != sortedLocs.end(); ++i )
|
|
|
|
ui.interfaceLanguage->addItem( i.value().first, i.key(), i.value().second );
|
2009-04-12 20:46:25 +00:00
|
|
|
|
|
|
|
for( int x = 0; x < ui.interfaceLanguage->count(); ++x )
|
|
|
|
if ( ui.interfaceLanguage->itemData( x ).toString() == p.interfaceLanguage )
|
|
|
|
{
|
|
|
|
ui.interfaceLanguage->setCurrentIndex( x );
|
|
|
|
prevInterfaceLanguage = x;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-07-19 17:07:32 +00:00
|
|
|
ui.displayStyle->addItem( QIcon( ":/icons/programicon_old.png" ), tr( "Default" ), QString() );
|
2013-03-23 16:48:31 +00:00
|
|
|
ui.displayStyle->addItem( QIcon( ":/icons/programicon.png" ), tr( "Modern" ), QString( "modern" ) );
|
2009-05-11 11:03:36 +00:00
|
|
|
ui.displayStyle->addItem( QIcon( ":/icons/icon32_dsl.png" ), tr( "Lingvo" ), QString( "lingvo" ) );
|
2012-01-28 03:07:23 +00:00
|
|
|
ui.displayStyle->addItem( QIcon( ":/icons/icon32_bgl.png" ), tr( "Babylon" ), QString( "babylon" ) );
|
2013-03-23 18:17:40 +00:00
|
|
|
ui.displayStyle->addItem( QIcon( ":/icons/icon32_lingoes.png" ), tr( "Lingoes" ), QString( "lingoes" ) );
|
2013-03-24 20:19:03 +00:00
|
|
|
ui.displayStyle->addItem( QIcon( ":/icons/icon32_lingoes.png" ), tr( "Lingoes-Blue" ), QString( "lingoes-blue" ) );
|
2009-05-11 11:03:36 +00:00
|
|
|
|
|
|
|
for( int x = 0; x < ui.displayStyle->count(); ++x )
|
|
|
|
if ( ui.displayStyle->itemData( x ).toString() == p.displayStyle )
|
|
|
|
{
|
|
|
|
ui.displayStyle->setCurrentIndex( x );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2009-04-13 12:51:25 +00:00
|
|
|
ui.newTabsOpenAfterCurrentOne->setChecked( p.newTabsOpenAfterCurrentOne );
|
|
|
|
ui.newTabsOpenInBackground->setChecked( p.newTabsOpenInBackground );
|
2011-06-23 14:17:09 +00:00
|
|
|
ui.hideSingleTab->setChecked( p.hideSingleTab );
|
2011-11-02 23:37:50 +00:00
|
|
|
ui.mruTabOrder->setChecked( p.mruTabOrder );
|
2009-02-05 20:55:00 +00:00
|
|
|
ui.enableTrayIcon->setChecked( p.enableTrayIcon );
|
|
|
|
ui.startToTray->setChecked( p.startToTray );
|
|
|
|
ui.closeToTray->setChecked( p.closeToTray );
|
2009-04-18 18:21:12 +00:00
|
|
|
ui.cbAutostart->setChecked( p.autoStart );
|
2010-04-08 20:37:59 +00:00
|
|
|
ui.doubleClickTranslates->setChecked( p.doubleClickTranslates );
|
2012-09-26 13:59:48 +00:00
|
|
|
ui.selectBySingleClick->setChecked( p.selectWordBySingleClick);
|
2011-05-07 13:42:49 +00:00
|
|
|
ui.escKeyHidesMainWindow->setChecked( p.escKeyHidesMainWindow );
|
2009-04-21 18:27:26 +00:00
|
|
|
|
|
|
|
ui.enableMainWindowHotkey->setChecked( p.enableMainWindowHotkey );
|
|
|
|
ui.mainWindowHotkey->setHotKey( p.mainWindowHotkey );
|
|
|
|
ui.enableClipboardHotkey->setChecked( p.enableClipboardHotkey );
|
|
|
|
ui.clipboardHotkey->setHotKey( p.clipboardHotkey );
|
|
|
|
|
2009-02-05 20:55:00 +00:00
|
|
|
ui.enableScanPopup->setChecked( p.enableScanPopup );
|
2009-02-08 20:20:02 +00:00
|
|
|
ui.startWithScanPopupOn->setChecked( p.startWithScanPopupOn );
|
2009-02-05 20:55:00 +00:00
|
|
|
ui.enableScanPopupModifiers->setChecked( p.enableScanPopupModifiers );
|
|
|
|
|
|
|
|
ui.altKey->setChecked( p.scanPopupModifiers & KeyboardState::Alt );
|
|
|
|
ui.ctrlKey->setChecked( p.scanPopupModifiers & KeyboardState::Ctrl );
|
|
|
|
ui.shiftKey->setChecked( p.scanPopupModifiers & KeyboardState::Shift );
|
|
|
|
ui.winKey->setChecked( p.scanPopupModifiers & KeyboardState::Win );
|
|
|
|
ui.leftAlt->setChecked( p.scanPopupModifiers & KeyboardState::LeftAlt );
|
|
|
|
ui.rightAlt->setChecked( p.scanPopupModifiers & KeyboardState::RightAlt );
|
|
|
|
ui.leftCtrl->setChecked( p.scanPopupModifiers & KeyboardState::LeftCtrl );
|
|
|
|
ui.rightCtrl->setChecked( p.scanPopupModifiers & KeyboardState::RightCtrl );
|
|
|
|
ui.leftShift->setChecked( p.scanPopupModifiers & KeyboardState::LeftShift );
|
|
|
|
ui.rightShift->setChecked( p.scanPopupModifiers & KeyboardState::RightShift );
|
|
|
|
|
2009-04-11 16:44:14 +00:00
|
|
|
ui.scanPopupAltMode->setChecked( p.scanPopupAltMode );
|
|
|
|
ui.scanPopupAltModeSecs->setValue( p.scanPopupAltModeSecs );
|
2011-11-16 12:52:25 +00:00
|
|
|
ui.scanToMainWindow->setChecked( p.scanToMainWindow );
|
2011-07-09 19:26:30 +00:00
|
|
|
ui.scanPopupUseUIAutomation->setChecked( p.scanPopupUseUIAutomation );
|
|
|
|
ui.scanPopupUseIAccessibleEx->setChecked( p.scanPopupUseIAccessibleEx );
|
|
|
|
ui.scanPopupUseGDMessage->setChecked( p.scanPopupUseGDMessage );
|
2009-04-11 16:44:14 +00:00
|
|
|
|
2012-09-11 13:03:10 +00:00
|
|
|
ui.storeHistory->setChecked( p.storeHistory );
|
2013-01-17 09:08:53 +00:00
|
|
|
ui.historyMaxSizeField->setValue( p.maxStringsInHistory );
|
2013-02-05 12:51:23 +00:00
|
|
|
ui.historySaveIntervalField->setValue( p.historyStoreInterval );
|
2012-09-16 10:19:47 +00:00
|
|
|
ui.alwaysExpandOptionalParts->setChecked( p.alwaysExpandOptionalParts );
|
2012-09-11 13:03:10 +00:00
|
|
|
|
2013-06-02 11:20:33 +00:00
|
|
|
ui.collapseBigArticles->setChecked( p.collapseBigArticles );
|
|
|
|
ui.articleSizeLimit->setValue( p.articleSizeLimit );
|
|
|
|
|
2013-06-11 18:31:01 +00:00
|
|
|
ui.maxDictsInContextMenu->setValue( p.maxDictionaryRefsInContextMenu );
|
|
|
|
|
2009-02-05 20:55:00 +00:00
|
|
|
// Different platforms have different keys available
|
|
|
|
|
|
|
|
#ifdef Q_OS_WIN32
|
|
|
|
ui.winKey->hide();
|
|
|
|
#else
|
|
|
|
ui.leftAlt->hide();
|
|
|
|
ui.rightAlt->hide();
|
|
|
|
ui.leftCtrl->hide();
|
|
|
|
ui.rightCtrl->hide();
|
|
|
|
ui.leftShift->hide();
|
|
|
|
ui.rightShift->hide();
|
2014-02-17 13:48:05 +00:00
|
|
|
#ifdef Q_OS_MACX
|
|
|
|
ui.altKey->setText( "Opt" );
|
|
|
|
ui.winKey->setText( "Ctrl" );
|
|
|
|
ui.ctrlKey->setText( "Cmd" );
|
|
|
|
#endif
|
2009-02-05 20:55:00 +00:00
|
|
|
#endif
|
2009-04-03 17:10:27 +00:00
|
|
|
|
2011-07-23 11:32:15 +00:00
|
|
|
//Platform-specific options
|
|
|
|
|
|
|
|
#ifndef Q_OS_WIN32
|
2012-09-11 13:03:10 +00:00
|
|
|
ui.groupBox_ScanPopupTechnologies->hide();
|
|
|
|
// ui.tabWidget->removeTab( 5 );
|
2011-07-23 11:32:15 +00:00
|
|
|
#endif
|
2009-04-03 17:10:27 +00:00
|
|
|
|
2009-04-10 21:07:03 +00:00
|
|
|
// Sound
|
|
|
|
|
|
|
|
ui.pronounceOnLoadMain->setChecked( p.pronounceOnLoadMain );
|
|
|
|
ui.pronounceOnLoadPopup->setChecked( p.pronounceOnLoadPopup );
|
|
|
|
|
2013-06-18 01:11:21 +00:00
|
|
|
#ifdef DISABLE_INTERNAL_PLAYER
|
|
|
|
ui.useInternalPlayer->hide();
|
|
|
|
#else
|
2013-05-05 10:22:12 +00:00
|
|
|
if ( p.useInternalPlayer )
|
|
|
|
ui.useInternalPlayer->setChecked( true );
|
|
|
|
else
|
2013-06-18 01:11:21 +00:00
|
|
|
#endif
|
2013-05-05 10:22:12 +00:00
|
|
|
ui.useExternalPlayer->setChecked( p.useExternalPlayer );
|
2010-11-14 15:38:41 +00:00
|
|
|
|
2010-01-02 18:16:22 +00:00
|
|
|
ui.audioPlaybackProgram->setText( p.audioPlaybackProgram );
|
2009-04-10 21:07:03 +00:00
|
|
|
|
2009-09-29 13:01:05 +00:00
|
|
|
if ( !isRECORDBroken() )
|
|
|
|
ui.brokenXRECORD->hide();
|
|
|
|
|
2009-04-03 17:10:27 +00:00
|
|
|
// Proxy server
|
|
|
|
|
|
|
|
ui.useProxyServer->setChecked( p.proxyServer.enabled );
|
|
|
|
|
|
|
|
ui.proxyType->addItem( "SOCKS5" );
|
|
|
|
ui.proxyType->addItem( "HTTP Transp." );
|
|
|
|
ui.proxyType->addItem( "HTTP Caching" );
|
|
|
|
|
|
|
|
ui.proxyType->setCurrentIndex( p.proxyServer.type );
|
|
|
|
|
|
|
|
ui.proxyHost->setText( p.proxyServer.host );
|
|
|
|
ui.proxyPort->setValue( p.proxyServer.port );
|
|
|
|
|
|
|
|
ui.proxyUser->setText( p.proxyServer.user );
|
|
|
|
ui.proxyPassword->setText( p.proxyServer.password );
|
2009-04-20 19:54:34 +00:00
|
|
|
|
|
|
|
ui.checkForNewReleases->setChecked( p.checkForNewReleases );
|
2009-08-31 12:18:08 +00:00
|
|
|
ui.disallowContentFromOtherSites->setChecked( p.disallowContentFromOtherSites );
|
2011-05-08 21:19:08 +00:00
|
|
|
ui.enableWebPlugins->setChecked( p.enableWebPlugins );
|
2013-04-08 12:20:12 +00:00
|
|
|
ui.hideGoldenDictHeader->setChecked( p.hideGoldenDictHeader );
|
2012-12-10 14:14:13 +00:00
|
|
|
|
|
|
|
// Add-on styles
|
|
|
|
ui.addonStylesLabel->setVisible( ui.addonStyles->count() > 1 );
|
|
|
|
ui.addonStyles->setCurrentStyle( p.addonStyle );
|
2009-02-05 20:55:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Config::Preferences Preferences::getPreferences()
|
|
|
|
{
|
|
|
|
Config::Preferences p;
|
|
|
|
|
2009-04-12 20:46:25 +00:00
|
|
|
p.interfaceLanguage =
|
|
|
|
ui.interfaceLanguage->itemData(
|
|
|
|
ui.interfaceLanguage->currentIndex() ).toString();
|
|
|
|
|
2009-05-11 11:03:36 +00:00
|
|
|
p.displayStyle =
|
|
|
|
ui.displayStyle->itemData(
|
|
|
|
ui.displayStyle->currentIndex() ).toString();
|
|
|
|
|
2009-04-13 12:51:25 +00:00
|
|
|
p.newTabsOpenAfterCurrentOne = ui.newTabsOpenAfterCurrentOne->isChecked();
|
|
|
|
p.newTabsOpenInBackground = ui.newTabsOpenInBackground->isChecked();
|
2011-06-23 14:17:09 +00:00
|
|
|
p.hideSingleTab = ui.hideSingleTab->isChecked();
|
2011-11-02 23:37:50 +00:00
|
|
|
p.mruTabOrder = ui.mruTabOrder->isChecked();
|
2009-02-08 20:20:02 +00:00
|
|
|
p.enableTrayIcon = ui.enableTrayIcon->isChecked();
|
|
|
|
p.startToTray = ui.startToTray->isChecked();
|
|
|
|
p.closeToTray = ui.closeToTray->isChecked();
|
2009-04-18 18:21:12 +00:00
|
|
|
p.autoStart = ui.cbAutostart->isChecked();
|
2010-04-08 20:37:59 +00:00
|
|
|
p.doubleClickTranslates = ui.doubleClickTranslates->isChecked();
|
2012-09-26 13:59:48 +00:00
|
|
|
p.selectWordBySingleClick = ui.selectBySingleClick->isChecked();
|
2011-05-07 13:42:49 +00:00
|
|
|
p.escKeyHidesMainWindow = ui.escKeyHidesMainWindow->isChecked();
|
2009-04-21 18:27:26 +00:00
|
|
|
|
|
|
|
p.enableMainWindowHotkey = ui.enableMainWindowHotkey->isChecked();
|
|
|
|
p.mainWindowHotkey = ui.mainWindowHotkey->getHotKey();
|
|
|
|
p.enableClipboardHotkey = ui.enableClipboardHotkey->isChecked();
|
|
|
|
p.clipboardHotkey = ui.clipboardHotkey->getHotKey();
|
|
|
|
|
2009-02-08 20:20:02 +00:00
|
|
|
p.enableScanPopup = ui.enableScanPopup->isChecked();
|
|
|
|
p.startWithScanPopupOn = ui.startWithScanPopupOn->isChecked();
|
|
|
|
p.enableScanPopupModifiers = ui.enableScanPopupModifiers->isChecked();
|
2009-02-05 20:55:00 +00:00
|
|
|
|
|
|
|
p.scanPopupModifiers += ui.altKey->isChecked() ? KeyboardState::Alt : 0;
|
|
|
|
p.scanPopupModifiers += ui.ctrlKey->isChecked() ? KeyboardState::Ctrl: 0;
|
|
|
|
p.scanPopupModifiers += ui.shiftKey->isChecked() ? KeyboardState::Shift: 0;
|
|
|
|
p.scanPopupModifiers += ui.winKey->isChecked() ? KeyboardState::Win: 0;
|
|
|
|
p.scanPopupModifiers += ui.leftAlt->isChecked() ? KeyboardState::LeftAlt: 0;
|
|
|
|
p.scanPopupModifiers += ui.rightAlt->isChecked() ? KeyboardState::RightAlt: 0;
|
|
|
|
p.scanPopupModifiers += ui.leftCtrl->isChecked() ? KeyboardState::LeftCtrl: 0;
|
|
|
|
p.scanPopupModifiers += ui.rightCtrl->isChecked() ? KeyboardState::RightCtrl: 0;
|
|
|
|
p.scanPopupModifiers += ui.leftShift->isChecked() ? KeyboardState::LeftShift: 0;
|
|
|
|
p.scanPopupModifiers += ui.rightShift->isChecked() ? KeyboardState::RightShift: 0;
|
|
|
|
|
2009-04-11 16:44:14 +00:00
|
|
|
p.scanPopupAltMode = ui.scanPopupAltMode->isChecked();
|
|
|
|
p.scanPopupAltModeSecs = ui.scanPopupAltModeSecs->value();
|
2011-11-16 12:52:25 +00:00
|
|
|
p.scanToMainWindow = ui.scanToMainWindow->isChecked();
|
2011-07-09 19:26:30 +00:00
|
|
|
p.scanPopupUseUIAutomation = ui.scanPopupUseUIAutomation->isChecked();
|
|
|
|
p.scanPopupUseIAccessibleEx = ui.scanPopupUseIAccessibleEx->isChecked();
|
|
|
|
p.scanPopupUseGDMessage = ui.scanPopupUseGDMessage->isChecked();
|
2009-04-11 16:44:14 +00:00
|
|
|
|
2012-09-11 13:03:10 +00:00
|
|
|
p.storeHistory = ui.storeHistory->isChecked();
|
2013-01-17 09:08:53 +00:00
|
|
|
p.maxStringsInHistory = ui.historyMaxSizeField->text().toUInt();
|
2013-02-05 12:51:23 +00:00
|
|
|
p.historyStoreInterval = ui.historySaveIntervalField->text().toUInt();
|
2012-09-16 10:19:47 +00:00
|
|
|
p.alwaysExpandOptionalParts = ui.alwaysExpandOptionalParts->isChecked();
|
2012-09-11 13:03:10 +00:00
|
|
|
|
2013-06-02 11:20:33 +00:00
|
|
|
p.collapseBigArticles = ui.collapseBigArticles->isChecked();
|
|
|
|
p.articleSizeLimit = ui.articleSizeLimit->text().toInt();
|
|
|
|
|
2013-06-11 18:31:01 +00:00
|
|
|
p.maxDictionaryRefsInContextMenu = ui.maxDictsInContextMenu->text().toInt();
|
|
|
|
|
2009-04-10 21:07:03 +00:00
|
|
|
p.pronounceOnLoadMain = ui.pronounceOnLoadMain->isChecked();
|
|
|
|
p.pronounceOnLoadPopup = ui.pronounceOnLoadPopup->isChecked();
|
2010-01-02 18:16:22 +00:00
|
|
|
p.useExternalPlayer = ui.useExternalPlayer->isChecked();
|
2013-05-05 10:22:12 +00:00
|
|
|
p.useInternalPlayer = ui.useInternalPlayer->isChecked();
|
2009-04-10 21:07:03 +00:00
|
|
|
p.audioPlaybackProgram = ui.audioPlaybackProgram->text();
|
|
|
|
|
2009-04-03 17:10:27 +00:00
|
|
|
p.proxyServer.enabled = ui.useProxyServer->isChecked();
|
|
|
|
|
|
|
|
p.proxyServer.type = ( Config::ProxyServer::Type ) ui.proxyType->currentIndex();
|
|
|
|
|
|
|
|
p.proxyServer.host = ui.proxyHost->text();
|
|
|
|
p.proxyServer.port = ( unsigned ) ui.proxyPort->value();
|
|
|
|
|
|
|
|
p.proxyServer.user = ui.proxyUser->text();
|
|
|
|
p.proxyServer.password = ui.proxyPassword->text();
|
|
|
|
|
2009-04-20 19:54:34 +00:00
|
|
|
p.checkForNewReleases = ui.checkForNewReleases->isChecked();
|
2009-08-31 12:18:08 +00:00
|
|
|
p.disallowContentFromOtherSites = ui.disallowContentFromOtherSites->isChecked();
|
2011-05-08 21:19:08 +00:00
|
|
|
p.enableWebPlugins = ui.enableWebPlugins->isChecked();
|
2013-04-08 12:20:12 +00:00
|
|
|
p.hideGoldenDictHeader = ui.hideGoldenDictHeader->isChecked();
|
2009-04-20 19:54:34 +00:00
|
|
|
|
2012-12-10 14:14:13 +00:00
|
|
|
p.addonStyle = ui.addonStyles->getCurrentStyle();
|
|
|
|
|
2009-02-05 20:55:00 +00:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Preferences::enableScanPopupToggled( bool b )
|
|
|
|
{
|
|
|
|
ui.scanPopupModifiers->setEnabled( b && ui.enableScanPopupModifiers->isChecked() );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Preferences::enableScanPopupModifiersToggled( bool b )
|
|
|
|
{
|
|
|
|
ui.scanPopupModifiers->setEnabled( b && ui.enableScanPopup->isChecked() );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Preferences::wholeAltClicked( bool b )
|
|
|
|
{
|
|
|
|
if ( b )
|
|
|
|
{
|
|
|
|
ui.leftAlt->setChecked( false );
|
|
|
|
ui.rightAlt->setChecked( false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Preferences::wholeCtrlClicked( bool b )
|
|
|
|
{
|
|
|
|
if ( b )
|
|
|
|
{
|
|
|
|
ui.leftCtrl->setChecked( false );
|
|
|
|
ui.rightCtrl->setChecked( false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Preferences::wholeShiftClicked( bool b )
|
|
|
|
{
|
|
|
|
if ( b )
|
|
|
|
{
|
|
|
|
ui.leftShift->setChecked( false );
|
|
|
|
ui.rightShift->setChecked( false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Preferences::sideAltClicked( bool )
|
|
|
|
{
|
|
|
|
if ( ui.leftAlt->isChecked() || ui.rightAlt->isChecked() )
|
|
|
|
ui.altKey->setChecked( false );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Preferences::sideCtrlClicked( bool )
|
|
|
|
{
|
|
|
|
if ( ui.leftCtrl->isChecked() || ui.rightCtrl->isChecked() )
|
|
|
|
ui.ctrlKey->setChecked( false );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Preferences::sideShiftClicked( bool )
|
|
|
|
{
|
|
|
|
if ( ui.leftShift->isChecked() || ui.rightShift->isChecked() )
|
|
|
|
ui.shiftKey->setChecked( false );
|
|
|
|
}
|
2009-04-12 20:46:25 +00:00
|
|
|
|
2009-04-21 18:27:26 +00:00
|
|
|
void Preferences::on_enableMainWindowHotkey_toggled( bool checked )
|
|
|
|
{
|
|
|
|
ui.mainWindowHotkey->setEnabled( checked );
|
|
|
|
}
|
|
|
|
|
|
|
|
void Preferences::on_enableClipboardHotkey_toggled( bool checked )
|
|
|
|
{
|
|
|
|
ui.clipboardHotkey->setEnabled( checked );
|
|
|
|
}
|
|
|
|
|
2009-04-12 20:46:25 +00:00
|
|
|
void Preferences::on_buttonBox_accepted()
|
|
|
|
{
|
|
|
|
if ( prevInterfaceLanguage != ui.interfaceLanguage->currentIndex() )
|
|
|
|
QMessageBox::information( this, tr( "Changing Language" ),
|
|
|
|
tr( "Restart the program to apply the language change." ) );
|
|
|
|
}
|
|
|
|
|
2010-01-02 18:16:22 +00:00
|
|
|
void Preferences::on_useExternalPlayer_toggled( bool enabled )
|
|
|
|
{
|
|
|
|
ui.audioPlaybackProgram->setEnabled( enabled );
|
|
|
|
}
|
|
|
|
|