Commit 4b67a3a2 authored by Vladislav's avatar Vladislav

Updated tray_pp, now translations and icon are not required in the directory

parent b03827df
...@@ -28,9 +28,9 @@ endif() ...@@ -28,9 +28,9 @@ endif()
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
add_executable(pw_tray example/example_pp.cpp) add_executable(tray_gui_pp example/example_pp.cpp)
set_target_properties(pw_tray PROPERTIES CXX_STANDARD 17) set_target_properties(tray_gui_pp PROPERTIES CXX_STANDARD 17)
target_link_libraries(pw_tray PRIVATE tray) target_link_libraries(tray_gui_pp PRIVATE tray)
endif() endif()
......
...@@ -8,11 +8,13 @@ ...@@ -8,11 +8,13 @@
#define _(STRING) gettext(STRING) #define _(STRING) gettext(STRING)
int main() { int main() {
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
bindtextdomain ("tray", getenv("PWD")); bindtextdomain ("tray", "../locales");
textdomain ("tray"); textdomain ("tray");
std::string icon_name = "../img/gui/portproton_tray.svg";
auto icon_path = std::filesystem::current_path() / icon_name;
trays::Menu q; trays::Menu q;
q.text_ = _("WINEFILE"); q.text_ = _("WINEFILE");
trays::Menu w; trays::Menu w;
...@@ -22,16 +24,10 @@ int main() { ...@@ -22,16 +24,10 @@ int main() {
trays::Menu r; trays::Menu r;
r.text_ = _("FORCE EXIT"); r.text_ = _("FORCE EXIT");
// linux: png, svg
std::string icon_name = "portproton_tray.svg";
// absolute path for linux.
auto icon_path = std::filesystem::current_path() / icon_name;
q.on_click_ = [](auto) { system("bash -c pw_tray_winefile &"); }; q.on_click_ = [](auto) { system("bash -c pw_tray_winefile &"); };
w.on_click_ = [](auto) { system("bash -c pw_tray_taskmgr &"); }; w.on_click_ = [](auto) { system("bash -c pw_tray_taskmgr &"); };
e.on_click_ = [](auto) { system("bash -c open_changelog &"); }; e.on_click_ = [](auto) { system("bash -c open_changelog &"); };
r.on_click_ = [](auto) { system("bash -c tray_icon_click_exit"); tray_exit(); }; r.on_click_ = [](auto) { system("bash -c tray_icon_click_exit"); tray_exit(); };
trays::Tray t{icon_path.string(), {q,w,e,r}}; trays::Tray t{icon_path.string(), {q,w,e,r}};
t.run(); t.run();
......
...@@ -18,18 +18,18 @@ msgstr "" ...@@ -18,18 +18,18 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.4\n" "X-Generator: Poedit 3.4.4\n"
#: example/example_pp.cpp:17 #: example/example_pp.cpp:19
msgid "WINEFILE" msgid "WINEFILE"
msgstr "WINEFILE" msgstr "WINEFILE"
#: example/example_pp.cpp:19 #: example/example_pp.cpp:21
msgid "TASKMGR" msgid "TASKMGR"
msgstr "GESTOR DE TAREAS" msgstr "GESTOR DE TAREAS"
#: example/example_pp.cpp:21 #: example/example_pp.cpp:23
msgid "CHANGELOG" msgid "CHANGELOG"
msgstr "LISTA DE CAMBIOS" msgstr "LISTA DE CAMBIOS"
#: example/example_pp.cpp:23 #: example/example_pp.cpp:25
msgid "FORCE EXIT" msgid "FORCE EXIT"
msgstr "SALIDA FORZADA" msgstr "SALIDA FORZADA"
...@@ -18,18 +18,18 @@ msgstr "" ...@@ -18,18 +18,18 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.4\n" "X-Generator: Poedit 3.4.4\n"
#: example/example_pp.cpp:17 #: example/example_pp.cpp:19
msgid "WINEFILE" msgid "WINEFILE"
msgstr "ФАЙЛОВЫЙ МЕНЕДЖЕР" msgstr "ФАЙЛОВЫЙ МЕНЕДЖЕР"
#: example/example_pp.cpp:19 #: example/example_pp.cpp:21
msgid "TASKMGR" msgid "TASKMGR"
msgstr "ДИСПЕТЧЕР ЗАДАЧ" msgstr "ДИСПЕТЧЕР ЗАДАЧ"
#: example/example_pp.cpp:21 #: example/example_pp.cpp:23
msgid "CHANGELOG" msgid "CHANGELOG"
msgstr "ИЗМЕНЕНИЯ" msgstr "ИЗМЕНЕНИЯ"
#: example/example_pp.cpp:23 #: example/example_pp.cpp:25
msgid "FORCE EXIT" msgid "FORCE EXIT"
msgstr "ПРИНУДИТЕЛЬНЫЙ ВЫХОД" msgstr "ПРИНУДИТЕЛЬНЫЙ ВЫХОД"
...@@ -4,30 +4,31 @@ ...@@ -4,30 +4,31 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "Project-Id-Version: PACKAGE VERSION\n" msgstr ""
"Report-Msgid-Bugs-To: \n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-07-03 13:04+0500\n" "Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "POT-Creation-Date: 2024-07-26 23:04+0500\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: \n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "Language: \n"
"Content-Type: text/plain; charset=CHARSET\n" "MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: example/example_pp.cpp:17
msgid "WINEFILE"
msgstr ""
#: example/example_pp.cpp:19 #: example/example_pp.cpp:19
msgid "TASKMGR" msgid "WINEFILE"
msgstr "" msgstr ""
#: example/example_pp.cpp:21 #: example/example_pp.cpp:21
msgid "CHANGELOG" msgid "TASKMGR"
msgstr "" msgstr ""
#: example/example_pp.cpp:23 #: example/example_pp.cpp:23
msgid "FORCE EXIT" msgid "CHANGELOG"
msgstr "" msgstr ""
#: example/example_pp.cpp:25
msgid "FORCE EXIT"
msgstr ""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment