Skip to content
GitLab
Explore
Sign in
Register
Hypra
compiz
Compare revisions
1badbfeb6700a0a33d5630d1279681c40b77aad2 to e4b728ad3065f1c1a3cc88223078c96c4ac83adb
Commits on Source (3)
colorfilter: Improve notifications wording
· 85b8bb79
Colomban Wendling
authored
Mar 21, 2019
85b8bb79
colorfilter: Add an option to enable or disable notifications
· 2741fd5a
Colomban Wendling
authored
Mar 21, 2019
2741fd5a
colorfilter: Don't show a notification for internal filter switches
· e4b728ad
Colomban Wendling
authored
Mar 21, 2019
e4b728ad
Hide whitespace changes
Inline
Side-by-side
plugins/colorfilter/colorfilter.xml.in
View file @
e4b728ad
...
...
@@ -72,6 +72,11 @@
<_long>
Windows to exclude from filtering.
</_long>
<default>
type=Desktop
</default>
</option>
<option
name=
"notifications_enable"
type=
"bool"
>
<_short>
Enable notifications upon filter change
</_short>
<_long>
Whether to show a notification when switching filter. This requires for the plugin to have been built with libnotify support.
</_long>
<default>
true
</default>
</option>
</options>
</plugin>
</compiz>
plugins/colorfilter/src/colorfilter.cpp
View file @
e4b728ad
...
...
@@ -75,7 +75,8 @@ ColorfilterScreen::toggle ()
}
void
ColorfilterScreen
::
logFilterChange
(
const
char
*
fmt
,
...)
ColorfilterScreen
::
logFilterChange
(
bool
notify
,
const
char
*
fmt
,
...)
{
va_list
ap
;
char
message
[
2048
];
...
...
@@ -85,9 +86,10 @@ ColorfilterScreen::logFilterChange (const char *fmt, ...)
fmt
,
ap
);
va_end
(
ap
);
compLogMessage
(
"colorfilter"
,
CompLogLevelInfo
,
"%s"
,
message
);
compLogMessage
(
"colorfilter"
,
CompLogLevelInfo
,
"Filter change: %s"
,
message
);
#ifdef HAVE_LIBNOTIFY
if
(
notification
)
if
(
notify
&&
optionGetNotificationsEnable
()
&&
notification
)
{
notify_notification_update
(
notification
,
_
(
"Color filter change"
),
...
...
@@ -102,7 +104,7 @@ ColorfilterScreen::logFilterChange (const char *fmt, ...)
* Switch current filter
*/
void
ColorfilterScreen
::
switchFilter
()
ColorfilterScreen
::
switchFilter
(
bool
userAction
)
{
/* % (count + 1) because of the cumulative filters mode */
currentFilter
=
(
currentFilter
+
1
)
%
(
filtersFunctions
.
size
()
+
1
);
...
...
@@ -113,19 +115,19 @@ ColorfilterScreen::switchFilter ()
{
/* avoid the message if no filter is loaded and cumulative mode is disabled */
if
(
optionGetCumulativeEnable
())
logFilterChange
(
_
(
"Cumulative filters mode"
));
logFilterChange
(
userAction
,
_
(
"Cumulative filters mode"
));
}
else
{
std
::
shared_ptr
<
ColorfilterFunction
>
func
=
filtersFunctions
.
at
(
currentFilter
-
1
);
if
(
func
&&
func
->
loaded
())
{
logFilterChange
(
_
(
"Single filter mode (u
sing %s filter
)
"
),
logFilterChange
(
userAction
,
_
(
"U
sing %s filter"
),
func
->
name
.
c_str
());
}
else
{
logFilterChange
(
_
(
"Single filter mode (f
ilter loading failure
)
"
));
logFilterChange
(
userAction
,
_
(
"F
ilter loading failure"
));
}
}
...
...
@@ -329,7 +331,7 @@ ColorfilterScreen::loadFilters ()
count
,
loaded
);
if
(
currentFilter
==
0
&&
!
optionGetCumulativeEnable
())
switchFilter
();
switchFilter
(
false
);
/* Damage currently filtered windows */
foreach
(
CompWindow
*
w
,
screen
->
windows
())
...
...
@@ -469,7 +471,7 @@ ColorfilterScreen::cumulativeEnableChanged (CompOption *opt,
ColorfilterOptions
::
Options
num
)
{
if
(
currentFilter
==
0
&&
!
optionGetCumulativeEnable
())
switchFilter
();
switchFilter
(
false
);
}
/*
...
...
plugins/colorfilter/src/colorfilter.h
View file @
e4b728ad
...
...
@@ -80,11 +80,12 @@ class ColorfilterScreen :
toggle
();
void
logFilterChange
(
const
char
*
fmt
,
logFilterChange
(
bool
notify
,
const
char
*
fmt
,
...);
void
switchFilter
();
switchFilter
(
bool
userAction
=
true
);
bool
toggleWindow
(
CompAction
*
action
,
...
...
po/fr.po
View file @
e4b728ad
...
...
@@ -13,7 +13,7 @@ msgstr ""
"Project-Id-Version: fr-compiz\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-12 17:37+0100\n"
"PO-Revision-Date: 2019-03-2
0
1
5:36
+0100\n"
"PO-Revision-Date: 2019-03-2
1
1
4:13
+0100\n"
"Last-Translator: Colomban Wendling <cwendling@hypra.fr>\n"
"Language-Team: <fr@li.org>\n"
"Language: \n"
...
...
@@ -991,6 +991,19 @@ msgstr ""
"Définit si un mode qui applique tous les filtres en même temps est activé "
"et peut être sélectionné avec le raccourci \"Changer de filtre\"."
#: ../plugins/colorfilter/colorfilter.xml.in.h
msgid "Enable notifications upon filter change"
msgstr "Activer les notifications lors du changement de filtre"
#: ../plugins/colorfilter/colorfilter.xml.in.h
msgid ""
"Whether to show a notification when switching filter. This requires "
"for the plugin to have been built with libnotify support."
msgstr ""
"Définit si une notification est affichée quand le filtre actif change. "
"Cette option n'a d'effet que si le plugin a été construit avec le "
"support de libnotify."
#: ../plugins/colorfilter/src/colorfilter.cpp:92
#: ../plugins/colorfilter/src/colorfilter.cpp:506
msgid "Color filter change"
...
...
@@ -1002,12 +1015,12 @@ msgstr "Mode de filtrage cumulatif"
#: ../plugins/colorfilter/src/colorfilter.cpp:121
#, c-format
msgid "
Single filter mode (u
sing %s filter
)
"
msgstr "
Mode de filtrage simple (avec le
filtre « %s »
)
"
msgid "
U
sing %s filter"
msgstr "
Utilisation du
filtre « %s »"
#: ../plugins/colorfilter/src/colorfilter.cpp:126
msgid "
Single filter mode (f
ilter loading failure
)
"
msgstr "
Mode de filtrage simple (e
rreur de chargement du filtre
)
"
msgid "
F
ilter loading failure"
msgstr "
E
rreur de chargement du filtre"
#: ../plugins/colorfilter/src/colorfilter.cpp:510
msgid "Next Filter"
...
...