From 14d7cbdbf5c0d84395ca6c55d604e1322ccf64c8 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Sun, 18 May 2014 01:21:10 +0800 Subject: Don't use global hotkey by default. --- src/common/fqterm.h | 2 -- src/fqterm/CMakeLists.txt | 18 +++++++++++------- src/fqterm/fqterm_frame.cpp | 7 ++----- src/fqterm/fqterm_frame.h | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/common/fqterm.h b/src/common/fqterm.h index 515cedc..6cb9c67 100644 --- a/src/common/fqterm.h +++ b/src/common/fqterm.h @@ -42,8 +42,6 @@ namespace FQTerm { //#define HAVE_PYTHON #endif //FOUND_PYTHON -#define USE_GLOBAL_HOTKEY - //code convert enum EncodingID {FQTERM_ENCODING_GBK = 0, FQTERM_ENCODING_BIG5 = 1, FQTERM_ENCODING_UTF8 = 2, FQTERM_ENCODING_HKSCS = 3, diff --git a/src/fqterm/CMakeLists.txt b/src/fqterm/CMakeLists.txt index 2f7cb1a..b8d6e9a 100644 --- a/src/fqterm/CMakeLists.txt +++ b/src/fqterm/CMakeLists.txt @@ -15,7 +15,7 @@ set(fqterm_SRCS fqterm_scriptengine.cpp ) - +IF(GLOBAL_HOTKEY EQUAL 1) IF(WIN32) set(global_shortcut_impl_SRCS 3rdparty/qxtglobalshortcut_win.cpp) ELSE(WIN32) @@ -25,19 +25,23 @@ ELSE(WIN32) set(global_shortcut_impl_SRCS 3rdparty/qxtglobalshortcut_x11.cpp) ENDIF(APPLE) ENDIF(WIN32) - +set(GLOBAL_SHORTCUT_SRC + ${global_shortcut_impl_SRCS} + 3rdparty/qxtglobalshortcut.cpp + 3rdparty/qxtglobalshortcut.h + 3rdparty/qxtglobalshortcut_p.h + 3rdparty/qxtglobal.h +) +ADD_DEFINITIONS(-DUSE_GLOBAL_HOTKEY) +ENDIF(GLOBAL_HOTKEY EQUAL 1) set(3rdparty_SRCS 3rdparty/dotnetstyle.cpp 3rdparty/dotnetstyle.h - 3rdparty/qxtglobalshortcut.cpp - 3rdparty/qxtglobalshortcut.h - 3rdparty/qxtglobalshortcut_p.h - 3rdparty/qxtglobal.h 3rdparty/uaocodec.h 3rdparty/uaocodec.cpp - ${global_shortcut_impl_SRCS} + ${GLOBAL_SHORTCUT_SRC} ) qt4_automoc(${fqterm_SRCS} diff --git a/src/fqterm/fqterm_frame.cpp b/src/fqterm/fqterm_frame.cpp index c12ccf8..d570470 100644 --- a/src/fqterm/fqterm_frame.cpp +++ b/src/fqterm/fqterm_frame.cpp @@ -2092,7 +2092,7 @@ void FQTermFrame::schemaUpdated() { } } - +#ifdef USE_GLOBAL_HOTKEY void FQTermFrame::globalHotkeyTriggered() { if (isActiveWindow() && !isMinimized() && isVisible()) { @@ -2112,12 +2112,9 @@ void FQTermFrame::globalHotkeyTriggered() { void FQTermFrame::globalHotkeyChanged() { -#ifdef USE_GLOBAL_HOTKEY globalHotkey_->setShortcut(shortcutHelper_->getAction(FQTermShortcutHelper::GLOBAL_SHOW_FQTERM)->shortcut()); -#endif //USE_GLOBAL_HOTKEY } - - +#endif //USE_GLOBAL_HOTKEY TranslatorInstaller::TranslatorInstaller(const QString& language, FQTermFrame* frame) diff --git a/src/fqterm/fqterm_frame.h b/src/fqterm/fqterm_frame.h index 8adaf49..c7c3d26 100644 --- a/src/fqterm/fqterm_frame.h +++ b/src/fqterm/fqterm_frame.h @@ -295,10 +295,10 @@ private: #ifdef USE_GLOBAL_HOTKEY QxtGlobalShortcut* globalHotkey_; -#endif //USE_GLOBAL_HOTKEY private slots: void globalHotkeyTriggered(); void globalHotkeyChanged(); +#endif //USE_GLOBAL_HOTKEY }; class TranslatorInstaller : public QObject -- cgit v1.2.3