Skip to content

Commit e972a53

Browse files
committed
Show state in tool tip
1 parent 9c12b19 commit e972a53

File tree

4 files changed

+52
-29
lines changed

4 files changed

+52
-29
lines changed

po/StayAwake.pot

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# SOME DESCRIPTIVE TITLE.
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3-
# This file is distributed under the same license as the 0.4.3 package.
3+
# This file is distributed under the same license as the 0.5.0 package.
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55
#
66
#, fuzzy
77
msgid ""
88
msgstr ""
9-
"Project-Id-Version: 0.4.3\n"
9+
"Project-Id-Version: 0.5.0\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2019-01-27 17:26+0100\n"
11+
"POT-Creation-Date: 2019-01-27 18:06+0100\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -51,18 +51,30 @@ msgstr ""
5151
msgid "Set icon"
5252
msgstr ""
5353

54-
#: stayawake.cpp:195 stayawake.cpp:246
54+
#: stayawake.cpp:195 stayawake.cpp:250
5555
msgid "Activate"
5656
msgstr ""
5757

5858
#: stayawake.cpp:197
5959
msgid "Quit"
6060
msgstr ""
6161

62-
#: stayawake.cpp:235
62+
#: stayawake.cpp:237
6363
msgid "Automatic activated"
6464
msgstr ""
6565

66-
#: stayawake.cpp:241
66+
#: stayawake.cpp:239
67+
msgid " (automatically activated)"
68+
msgstr ""
69+
70+
#: stayawake.cpp:244
6771
msgid "Deactivate"
6872
msgstr ""
73+
74+
#: stayawake.cpp:246
75+
msgid " (active)"
76+
msgstr ""
77+
78+
#: stayawake.cpp:252
79+
msgid " (inactive)"
80+
msgstr ""

po/de_DE.po

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: 0.4\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2019-01-27 17:26+0100\n"
10+
"POT-Creation-Date: 2019-01-27 18:06+0100\n"
1111
"PO-Revision-Date: 2017-05-13 20:37+0200\n"
1212
"Last-Translator: \n"
1313
"Language-Team: \n"
@@ -54,27 +54,30 @@ msgstr "Tee-Symbol"
5454
msgid "Set icon"
5555
msgstr "Symbol setzen"
5656

57-
#: stayawake.cpp:195 stayawake.cpp:246
57+
#: stayawake.cpp:195 stayawake.cpp:250
5858
msgid "Activate"
5959
msgstr "Aktivieren"
6060

6161
#: stayawake.cpp:197
6262
msgid "Quit"
6363
msgstr "&Beenden"
6464

65-
#: stayawake.cpp:235
65+
#: stayawake.cpp:237
6666
msgid "Automatic activated"
6767
msgstr "Automatisch aktiviert"
6868

69-
#: stayawake.cpp:241
69+
#: stayawake.cpp:239
70+
msgid " (automatically activated)"
71+
msgstr " (automatisch aktiviert)"
72+
73+
#: stayawake.cpp:244
7074
msgid "Deactivate"
7175
msgstr "Deaktivieren"
7276

73-
#~ msgid "Options"
74-
#~ msgstr "Einstellungen"
75-
76-
#~ msgid "Hello World!"
77-
#~ msgstr "Hallo Welt!"
77+
#: stayawake.cpp:246
78+
msgid " (active)"
79+
msgstr " (aktiv)"
7880

79-
#~ msgid "Stay awake!"
80-
#~ msgstr "Wach bleiben!"
81+
#: stayawake.cpp:252
82+
msgid " (inactive)"
83+
msgstr " (inaktiv)"

po/en.po

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: 0.4\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2019-01-27 17:26+0100\n"
10+
"POT-Creation-Date: 2019-01-27 18:06+0100\n"
1111
"PO-Revision-Date: 2017-05-13 20:38+0200\n"
1212
"Last-Translator: \n"
1313
"Language-Team: \n"
@@ -54,27 +54,30 @@ msgstr "Tea icon"
5454
msgid "Set icon"
5555
msgstr "Set icon"
5656

57-
#: stayawake.cpp:195 stayawake.cpp:246
57+
#: stayawake.cpp:195 stayawake.cpp:250
5858
msgid "Activate"
5959
msgstr "&Activate"
6060

6161
#: stayawake.cpp:197
6262
msgid "Quit"
6363
msgstr "&Quit"
6464

65-
#: stayawake.cpp:235
65+
#: stayawake.cpp:237
6666
msgid "Automatic activated"
6767
msgstr "Automatic activated"
6868

69-
#: stayawake.cpp:241
69+
#: stayawake.cpp:239
70+
msgid " (automatically activated)"
71+
msgstr " (automatically activated)"
72+
73+
#: stayawake.cpp:244
7074
msgid "Deactivate"
7175
msgstr "&Deactivate"
7276

73-
#~ msgid "Options"
74-
#~ msgstr "Options"
75-
76-
#~ msgid "Hello World!"
77-
#~ msgstr "Hello World!"
77+
#: stayawake.cpp:246
78+
msgid " (active)"
79+
msgstr " (active)"
7880

79-
#~ msgid "Stay awake!"
80-
#~ msgstr "Stay awake!"
81+
#: stayawake.cpp:252
82+
msgid " (inactive)"
83+
msgstr " (inactive)"

src/stayawake.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ void StayAwakeUi::onCreate()
204204
coffein_.setAutomatic(properties_.GetAutomatic());
205205
coffein_.setManuellState(properties_.GetLastState());
206206
coffein_.update();
207+
208+
onStateChanged();
207209
}
208210

209211
StayAwakeUi::~StayAwakeUi()
@@ -234,17 +236,20 @@ StayAwakeUi::onStateChanged()
234236
{
235237
popup_menu_.modifyEntry(SetManuellEntry, _("Automatic activated"), MenuEntryFlags::Grayed);
236238
trayicon_.setIcon(active_icon_.getHICON());
239+
trayicon_.setToolTip(CPP_TO_WIDESTRING(PROJECT_NAME) + _(" (automatically activated)"));
237240
return;
238241
}
239242

240243
if (coffein_.getManuellState()) {
241244
popup_menu_.modifyEntry(SetManuellEntry, _("Deactivate"), MenuEntryFlags::Enabled);
242245
trayicon_.setIcon(active_icon_.getHICON());
246+
trayicon_.setToolTip(CPP_TO_WIDESTRING(PROJECT_NAME) + _(" (active)"));
243247
}
244248
else
245249
{
246250
popup_menu_.modifyEntry(SetManuellEntry, _("Activate"), MenuEntryFlags::Enabled);
247251
trayicon_.setIcon(inactive_icon_.getHICON());
252+
trayicon_.setToolTip(CPP_TO_WIDESTRING(PROJECT_NAME) + _(" (inactive)"));
248253
}
249254
}
250255

@@ -258,7 +263,7 @@ void StayAwakeUi::onAutomaticSet(bool value)
258263
{
259264
properties_.SetAutomatic(value);
260265
coffein_.setAutomatic(value);
261-
popup_menu_.check(AutomaticEntry, value);
266+
popup_menu_.check(AutomaticEntry, value);
262267
}
263268

264269
void StayAwakeUi::onIconSet(IconEntry icon)

0 commit comments

Comments
 (0)