diff --git a/config.cc b/config.cc index cf226dbc..a17789f9 100644 --- a/config.cc +++ b/config.cc @@ -227,7 +227,6 @@ Preferences::Preferences(): enableClipboardHotkey( true ), clipboardHotkey( QKeySequence( "Ctrl+C,C" ) ), - enableScanPopup( true ), startWithScanPopupOn( false ), enableScanPopupModifiers( false ), scanPopupModifiers( 0 ), @@ -887,7 +886,6 @@ Class load() if ( !preferences.namedItem( "clipboardHotkey" ).isNull() ) c.preferences.clipboardHotkey = QKeySequence::fromString( preferences.namedItem( "clipboardHotkey" ).toElement().text() ); - c.preferences.enableScanPopup = ( preferences.namedItem( "enableScanPopup" ).toElement().text() == "1" ); c.preferences.startWithScanPopupOn = ( preferences.namedItem( "startWithScanPopupOn" ).toElement().text() == "1" ); c.preferences.enableScanPopupModifiers = ( preferences.namedItem( "enableScanPopupModifiers" ).toElement().text() == "1" ); c.preferences.scanPopupModifiers = ( preferences.namedItem( "scanPopupModifiers" ).toElement().text().toULong() ); @@ -1748,10 +1746,6 @@ void save( Class const & c ) opt.appendChild( dd.createTextNode( c.preferences.clipboardHotkey.toKeySequence().toString() ) ); preferences.appendChild( opt ); - opt = dd.createElement( "enableScanPopup" ); - opt.appendChild( dd.createTextNode( c.preferences.enableScanPopup ? "1":"0" ) ); - preferences.appendChild( opt ); - opt = dd.createElement( "startWithScanPopupOn" ); opt.appendChild( dd.createTextNode( c.preferences.startWithScanPopupOn ? "1":"0" ) ); preferences.appendChild( opt ); diff --git a/config.hh b/config.hh index 9a4650da..5bd498ab 100644 --- a/config.hh +++ b/config.hh @@ -318,7 +318,6 @@ struct Preferences bool enableClipboardHotkey; HotKey clipboardHotkey; - bool enableScanPopup; bool startWithScanPopupOn; bool enableScanPopupModifiers; unsigned long scanPopupModifiers; // Combination of KeyboardState::Modifier diff --git a/preferences.cc b/preferences.cc index d8102939..fc4d7552 100644 --- a/preferences.cc +++ b/preferences.cc @@ -16,9 +16,6 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ): Config::Preferences const & p = cfg_.preferences; ui.setupUi( this ); - connect( ui.enableScanPopup, SIGNAL( toggled( bool ) ), - this, SLOT( enableScanPopupToggled( bool ) ) ); - connect( ui.enableScanPopupModifiers, SIGNAL( toggled( bool ) ), this, SLOT( enableScanPopupModifiersToggled( bool ) ) ); @@ -190,7 +187,6 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ): ui.enableClipboardHotkey->setChecked( p.enableClipboardHotkey ); ui.clipboardHotkey->setHotKey( p.clipboardHotkey ); - ui.enableScanPopup->setChecked( p.enableScanPopup ); ui.startWithScanPopupOn->setChecked( p.startWithScanPopupOn ); ui.enableScanPopupModifiers->setChecked( p.enableScanPopupModifiers ); @@ -407,7 +403,6 @@ Config::Preferences Preferences::getPreferences() p.enableClipboardHotkey = ui.enableClipboardHotkey->isChecked(); p.clipboardHotkey = ui.clipboardHotkey->getHotKey(); - p.enableScanPopup = ui.enableScanPopup->isChecked(); p.startWithScanPopupOn = ui.startWithScanPopupOn->isChecked(); p.enableScanPopupModifiers = ui.enableScanPopupModifiers->isChecked(); @@ -572,14 +567,9 @@ Config::Preferences Preferences::getPreferences() 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() ); + ui.scanPopupModifiers->setEnabled( b ); if( b ) ui.showScanFlag->setChecked( false ); } diff --git a/preferences.hh b/preferences.hh index 73147c81..f80dd4d3 100644 --- a/preferences.hh +++ b/preferences.hh @@ -33,7 +33,6 @@ private: private slots: - void enableScanPopupToggled( bool ); void enableScanPopupModifiersToggled( bool ); void showScanFlagToggled( bool b ); diff --git a/preferences.ui b/preferences.ui index 07184512..e5e54f09 100644 --- a/preferences.ui +++ b/preferences.ui @@ -6,8 +6,8 @@ 0 0 - 744 - 506 + 787 + 629 @@ -24,7 +24,7 @@ - 0 + 1 @@ -424,268 +424,55 @@ be the last ones. - + - When enabled, a translation popup window would be shown each time -you point your mouse on any word on the screen (Windows) or select -any word with mouse (Linux). When enabled, you can switch it on and -off from main window or tray icon. - - - Enable scan popup functionality - - - true - - - false - - - - - - Chooses whether the scan popup mode is on by default or not. If checked, + Chooses whether the scan popup mode is on by default or not. If checked, the program would always start with the scan popup active. - - - Start with scan popup turned on - - - - - - - With this enabled, the popup would only show up if all chosen keys are + + + Start with scan popup turned on + + + + + + + With this enabled, the popup would only show up if all chosen keys are in the pressed state when the word selection changes. - - - Only show popup when all selected keys are kept pressed: - - - + + + Only show popup when all selected keys are kept pressed: + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + + 0 + + + 0 + + + 0 + + + 0 + - - - QFrame::NoFrame - - - QFrame::Plain - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Left Ctrl only - - - Left Ctrl - - - - - - - Right Shift only - - - Right Shift - - - - - - - Alt key - - - Alt - - - - - - - Ctrl key - - - Ctrl - - - - - - - Left Alt only - - - Left Alt - - - - - - - Shift key - - - Shift - - - - - - - Right Alt only - - - Right Alt - - - - - - - Right Ctrl only - - - Right Ctrl - - - - - - - Left Shift only - - - Left Shift - - - - - - - Windows key or Meta key - - - Win/Meta - - - - - - - - - QFrame::NoFrame - - - QFrame::Raised - - - 0 - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - - + - - - Normally, in order to activate a popup you have to -maintain the chosen keys pressed while you select -a word. With this enabled, the chosen keys may also -be pressed shortly after the selection is done. - - - Keys may also be pressed afterwards, within - - - - - - - To avoid false positives, the keys are only monitored -after the selection's done for a limited amount of -seconds, which is specified here. - - - false - - - true - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - 1 - - - 99 - - - - - - - secs - - - - - + Qt::Horizontal @@ -697,31 +484,223 @@ seconds, which is specified here. + + + + + + Left Ctrl only + + + Left Ctrl + + + + + + + Right Shift only + + + Right Shift + + + + + + + Alt key + + + Alt + + + + + + + Ctrl key + + + Ctrl + + + + + + + Left Alt only + + + Left Alt + + + + + + + Shift key + + + Shift + + + + + + + Right Alt only + + + Right Alt + + + + + + + Right Ctrl only + + + Right Ctrl + + + + + + + Left Shift only + + + Left Shift + + + + + + + Windows key or Meta key + + + Win/Meta + + + + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + 0 + + + + 0 + + + 0 + + + 0 + + + 0 + + + + - - - - Show a flag window before showing popup window, click the flag to show popup window. - - - Show scan flag when word is selected - - - - - - - Do not show popup when selection or clipboard in one of GoldenDict's own windows changes - - - Ignore GoldenDict's own selection and clipboard changes - - - + + + + + + Normally, in order to activate a popup you have to +maintain the chosen keys pressed while you select +a word. With this enabled, the chosen keys may also +be pressed shortly after the selection is done. + + + Keys may also be pressed afterwards, within + + + + + + + To avoid false positives, the keys are only monitored +after the selection's done for a limited amount of +seconds, which is specified here. + + + false + + + true + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 1 + + + 99 + + + + + + + secs + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Show a flag window before showing popup window, click the flag to show popup window. + + + Show scan flag when word is selected + + + + + + + Do not show popup when selection or clipboard in one of GoldenDict's own windows changes + + + Ignore GoldenDict's own selection and clipboard changes + + + @@ -1844,8 +1823,6 @@ from Stardict, Babylon and GLS dictionaries closeToTray cbAutostart interfaceLanguage - startWithScanPopupOn - enableScanPopupModifiers leftCtrl rightShift altKey