From f6554a924aed29e537a5d1fd729305c0ddfc5709 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 14 May 2020 14:14:54 +0200 Subject: [PATCH 1/3] gui/gui_about.h.in: rename to gui_text.h.in --- gui/CMakeLists.txt | 2 +- gui/{gui_about.h.in => gui_text.h.in} | 10 +++++----- gui/src/MainWindow.cpp | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) rename gui/{gui_about.h.in => gui_text.h.in} (86%) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 1ec2ead..3628f7a 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -24,7 +24,7 @@ string(REGEX REPLACE "\n\n([^\n]+)" "

\\1

" GUI_ABOUT_LICENSE ${GUI_ABOUT_L string(REGEX REPLACE "\n" "" GUI_ABOUT_LICENSE ${GUI_ABOUT_LICENSE}) string(REGEX REPLACE "\<(.+)\>" "- \\1" GUI_ABOUT_AUTHOR ${PROJECT_MAINTAINER}) -configure_file(gui_about.h.in "${CMAKE_CURRENT_BINARY_DIR}/gui_about.h" @ONLY ESCAPE_QUOTES) +configure_file(gui_text.h.in "${CMAKE_CURRENT_BINARY_DIR}/gui_text.h" @ONLY ESCAPE_QUOTES) include_directories(${CMAKE_CURRENT_BINARY_DIR}) # -------------------------------- diff --git a/gui/gui_about.h.in b/gui/gui_text.h.in similarity index 86% rename from gui/gui_about.h.in rename to gui/gui_text.h.in index 1f6ab9f..4c81c9d 100644 --- a/gui/gui_about.h.in +++ b/gui/gui_text.h.in @@ -21,12 +21,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef EOSIOKEYGEN_GUI_ABOUT_H -#define EOSIOKEYGEN_GUI_ABOUT_H +#ifndef EOSIOKEYGEN_GUI_TEXT_H +#define EOSIOKEYGEN_GUI_TEXT_H -#define EOSIOKEYGEN_GUI_ABOUT_TITLE "@PROJECT_NAME@ - About" +#define EOSIOKEYGEN_GUI_TEXT_ABOUT_TITLE "@PROJECT_NAME@ - About" -#define EOSIOKEYGEN_GUI_ABOUT_TEXT \ +#define EOSIOKEYGEN_GUI_TEXT_ABOUT_BODY \ "

@PROJECT_NAME@ - v@PROJECT_VERSION@

" \ "

@PROJECT_DESCRIPTION@

" \ "

@PROJECT_HOMEPAGE_URL@

" \ @@ -34,4 +34,4 @@ "

Author

" \ "

@GUI_ABOUT_AUTHOR@

" -#endif /* EOSIOKEYGEN_CONFIG_ABOUT_H */ +#endif /* EOSIOKEYGEN_GUI_TEXT_H */ diff --git a/gui/src/MainWindow.cpp b/gui/src/MainWindow.cpp index ce2d579..cfed710 100644 --- a/gui/src/MainWindow.cpp +++ b/gui/src/MainWindow.cpp @@ -25,7 +25,7 @@ #include #include #include -#include "gui_about.h" +#include "gui_text.h" #include "GenerateWindow.hpp" #include "SearchWindow.hpp" #include "MainWindow.hpp" @@ -59,5 +59,7 @@ void MainWindow::switchToSearch() void MainWindow::showAbout() { - QMessageBox::about(this, EOSIOKEYGEN_GUI_ABOUT_TITLE, EOSIOKEYGEN_GUI_ABOUT_TEXT); + QMessageBox::about(this, + EOSIOKEYGEN_GUI_TEXT_ABOUT_TITLE, + EOSIOKEYGEN_GUI_TEXT_ABOUT_BODY); } From 88bd1217babe512acf3648f1011e15140ae5ecc8 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 15 May 2020 13:38:19 +0200 Subject: [PATCH 2/3] gui/gui_text.h.in: define tooltip text for dictionary widgets. --- gui/gui_text.h.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gui/gui_text.h.in b/gui/gui_text.h.in index 4c81c9d..a8a1cff 100644 --- a/gui/gui_text.h.in +++ b/gui/gui_text.h.in @@ -24,6 +24,8 @@ #ifndef EOSIOKEYGEN_GUI_TEXT_H #define EOSIOKEYGEN_GUI_TEXT_H +#include + #define EOSIOKEYGEN_GUI_TEXT_ABOUT_TITLE "@PROJECT_NAME@ - About" #define EOSIOKEYGEN_GUI_TEXT_ABOUT_BODY \ @@ -34,4 +36,19 @@ "

Author

" \ "

@GUI_ABOUT_AUTHOR@

" +#define EOSIOKEYGEN_GUI_TEXT_DICT_LANG_TOOLTIP \ + "

Highlight words from given language dictionary in the found keys (note that the words " \ + "are not used for search. only for highlight output).

" \ + "

There can be more then one language. In that case contents " \ + "of all languges are merged into one dictionary.

" \ + "

The langauges are stored in files at " CONFIG_SHARE_FULL_PATH "/dict

" + + +#define EOSIOKEYGEN_GUI_TEXT_DICT_FILE_TOOLTIP \ + "

Use words found in file (separated by newline) to highlight " \ + "words in the keys found (note that the words in this " \ + "file are not used for search. only for highlight output).

" \ + "

There can be more then one file. In that case contents " \ + "of all files are merged into one dictionary.

" + #endif /* EOSIOKEYGEN_GUI_TEXT_H */ From e0a388dac192a2001773d3e95cd7c82ee6beda4f Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 15 May 2020 13:38:41 +0200 Subject: [PATCH 3/3] gui/src/SearchWindow.cpp: show tooltip for dictionary widgets. --- gui/src/SearchWindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gui/src/SearchWindow.cpp b/gui/src/SearchWindow.cpp index 42b54ff..2128fed 100644 --- a/gui/src/SearchWindow.cpp +++ b/gui/src/SearchWindow.cpp @@ -31,6 +31,7 @@ #include #include #include +#include "gui_text.h" #include "config.hpp" #include "helpers.hpp" #include "SearchWindow.hpp" @@ -61,6 +62,9 @@ m_btn_clear ("Clear") // First row. m_dict_lang.addItems(get_files(CONFIG_DICT_FULL_PATH)); + m_dict_lang.setToolTip(EOSIOKEYGEN_GUI_TEXT_DICT_LANG_TOOLTIP); + m_dict_file.setToolTip(EOSIOKEYGEN_GUI_TEXT_DICT_FILE_TOOLTIP); + m_layout.addWidget(&m_dict_lang, 0, 0); m_layout.addWidget(&m_dict_file, 0, 1);