summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2014-05-18 01:21:10 +0800
committerIru Cai <mytbk920423@gmail.com>2014-05-18 01:33:24 +0800
commit14d7cbdbf5c0d84395ca6c55d604e1322ccf64c8 (patch)
treea1466ae7e67c9fd844c0dbbce657453912811791
parentfba9594087d9f2b4e15c18766f8f18b5c8ad11c3 (diff)
downloadfqterm-14d7cbdbf5c0d84395ca6c55d604e1322ccf64c8.tar.xz
Don't use global hotkey by default.
-rw-r--r--src/common/fqterm.h2
-rw-r--r--src/fqterm/CMakeLists.txt18
-rw-r--r--src/fqterm/fqterm_frame.cpp7
-rw-r--r--src/fqterm/fqterm_frame.h2
4 files changed, 14 insertions, 15 deletions
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