[ekiga/ds-gtk-application] CallWindow: Dynamically add/remove audio/video actions.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gtk-application] CallWindow: Dynamically add/remove audio/video actions.
- Date: Sun, 2 Nov 2014 16:32:51 +0000 (UTC)
commit 081d2c2e328584a914e3b6179f3954c6a11c0f05
Author: Damien Sandras <dsandras seconix com>
Date: Sun Nov 2 17:30:52 2014 +0100
CallWindow: Dynamically add/remove audio/video actions.
This should be done here as those actions are not engine actions.
lib/engine/gui/gtk-frontend/call-window.cpp | 37 +++++++++++++++++++++++++-
1 files changed, 35 insertions(+), 2 deletions(-)
---
diff --git a/lib/engine/gui/gtk-frontend/call-window.cpp b/lib/engine/gui/gtk-frontend/call-window.cpp
index 984ba1e..56f7a63 100644
--- a/lib/engine/gui/gtk-frontend/call-window.cpp
+++ b/lib/engine/gui/gtk-frontend/call-window.cpp
@@ -328,6 +328,9 @@ static gboolean ekiga_call_window_fullscreen_event_cb (GtkWidget *widget,
G_GNUC_UNUSED GdkEventAny *event);
/**/
+static void ekiga_call_window_remove_action_entries (GActionMap *map,
+ const GActionEntry *entries);
+
static void ekiga_call_window_update_calling_state (EkigaCallWindow *self,
unsigned calling_state);
@@ -403,11 +406,19 @@ static const char* win_menu =
static GActionEntry win_entries[] =
{
- { "audio-volume-settings", show_audio_settings_cb, NULL, NULL, NULL, 0 },
- { "video-color-settings", show_video_settings_cb, NULL, NULL, NULL, 0 },
{ "show-extended-video", show_extended_video_window_cb, NULL, NULL, NULL, 0 },
{ "enable-fullscreen", fullscreen_changed_cb, NULL, NULL, NULL, 0 }
};
+
+static GActionEntry video_settings_entries[] =
+{
+ { "video-color-settings", show_video_settings_cb, NULL, NULL, NULL, 0 },
+};
+
+static GActionEntry audio_settings_entries[] =
+{
+ { "audio-volume-settings", show_audio_settings_cb, NULL, NULL, NULL, 0 },
+};
/**/
@@ -643,6 +654,10 @@ on_videoinput_device_opened_cb (Ekiga::VideoInputManager & /* manager */,
gtk_adjustment_set_value (GTK_ADJUSTMENT (self->priv->adj_contrast), settings.contrast);
gtk_widget_queue_draw (self->priv->video_settings_frame);
+
+ g_action_map_add_action_entries (G_ACTION_MAP (g_application_get_default ()),
+ video_settings_entries, G_N_ELEMENTS (video_settings_entries),
+ self);
}
static void
@@ -652,6 +667,8 @@ on_videoinput_device_closed_cb (Ekiga::VideoInputManager & /* manager */,
{
EkigaCallWindow *self = EKIGA_CALL_WINDOW (data);
+ ekiga_call_window_remove_action_entries (G_ACTION_MAP (g_application_get_default ()),
+ video_settings_entries);
}
static void
@@ -1025,6 +1042,11 @@ on_stream_opened_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
bool is_video = (type == Ekiga::Call::Video);
set_codec (self->priv, name, is_video, is_transmitting);
+
+ if (!is_video)
+ g_action_map_add_action_entries (G_ACTION_MAP (g_application_get_default ()),
+ audio_settings_entries, G_N_ELEMENTS (audio_settings_entries),
+ self);
}
@@ -1040,6 +1062,9 @@ on_stream_closed_cb (boost::shared_ptr<Ekiga::CallManager> /*manager*/,
bool is_video = (type == Ekiga::Call::Video);
set_codec (self->priv, "", is_video, is_transmitting);
+ if (!is_video)
+ ekiga_call_window_remove_action_entries (G_ACTION_MAP (g_application_get_default ()),
+ audio_settings_entries);
}
@@ -1146,6 +1171,14 @@ ekiga_call_window_fullscreen_event_cb (GtkWidget *widget,
}
static void
+ekiga_call_window_remove_action_entries (GActionMap *map,
+ const GActionEntry *entries)
+{
+ for (unsigned int i = 0 ; i < G_N_ELEMENTS (entries) ; i++)
+ g_action_map_remove_action (map, entries[i].name);
+}
+
+static void
ekiga_call_window_update_calling_state (EkigaCallWindow *self,
unsigned calling_state)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]