cli: Allow to set profile per event
We allowed set the global profile via `-P` use it as per event profile when used with `-E`. Ironically the manpage always said it'd be that way.
This commit is contained in:
committed by
Guido Gunther
parent
dfafe8d7c1
commit
41304c36fd
+4
-2
@@ -71,6 +71,8 @@ trigger_event (const char *name, const gchar *profile, gint timeout)
|
||||
g_print ("Triggering feedback for event '%s'\n", name);
|
||||
event = lfb_event_new (name);
|
||||
lfb_event_set_timeout (event, timeout);
|
||||
if (profile)
|
||||
lfb_event_set_feedback_profile (event, profile);
|
||||
|
||||
g_signal_connect (event, "feedback-ended", (GCallback)on_feedback_ended, &success);
|
||||
if (!lfb_event_trigger_feedback (event, &err)) {
|
||||
@@ -162,10 +164,10 @@ main (int argc, char *argv[0])
|
||||
name = g_strdup (DEFAULT_EVENT);
|
||||
|
||||
g_timeout_add_seconds (watch, (GSourceFunc)on_watch_expired, NULL);
|
||||
if (profile)
|
||||
if (profile && !name)
|
||||
success = set_profile (profile);
|
||||
else
|
||||
success = trigger_event (name, timeout);
|
||||
success = trigger_event (name, profile, timeout);
|
||||
|
||||
lfb_uninit ();
|
||||
return !success;
|
||||
|
||||
+2
-1
@@ -70,7 +70,8 @@ print help and exit
|
||||
<term><option>--profile=<replaceable>PROFILE</replaceable></option></term>
|
||||
<para>
|
||||
The feedback profile (<literal>full</literal>, <literal>quiet</literal>, <literal>silent</literal>)
|
||||
to use for the given event.
|
||||
to use for the given event. If no event is specified then the global
|
||||
feedback profile is changed.
|
||||
</para>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user