Commit 9a637822 authored by Giovanni Panozzo's avatar Giovanni Panozzo Committed by GitHub

Merge pull request #1294 from FreeRDP/notiffix

Fixes for notifications
parents 25e4b13b 0d78931a
......@@ -49,7 +49,7 @@ tags
remmina-plugins/libvncserver/rfb/rfbconfig.h
remmina-plugins/telepathy/org.freedesktop.Telepathy.Client.Remmina.service
remmina/desktop/remmina.desktop
remmina/desktop/org.Remmina.desktop
remmina/remmina
remmina/src/remmina
......
......@@ -279,6 +279,12 @@ void remmina_pref_init(void)
else
remmina_pref.hide_connection_toolbar = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "enable_notifications", NULL))
remmina_pref.enable_notifications = g_key_file_get_boolean(gkeyfile, "remmina_pref",
"enable_notifications", NULL);
else
remmina_pref.enable_notifications = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "default_action", NULL))
remmina_pref.default_action = g_key_file_get_integer(gkeyfile, "remmina_pref", "default_action", NULL);
else
......@@ -721,6 +727,7 @@ void remmina_pref_save(void)
g_key_file_set_integer(gkeyfile, "remmina_pref", "toolbar_placement", remmina_pref.toolbar_placement);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "always_show_tab", remmina_pref.always_show_tab);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_connection_toolbar", remmina_pref.hide_connection_toolbar);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "enable_notifications", remmina_pref.enable_notifications);
g_key_file_set_integer(gkeyfile, "remmina_pref", "default_action", remmina_pref.default_action);
g_key_file_set_integer(gkeyfile, "remmina_pref", "scale_quality", remmina_pref.scale_quality);
g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_loglevel", remmina_pref.ssh_loglevel);
......
......@@ -107,6 +107,7 @@ typedef struct _RemminaPref
gboolean fullscreen_on_auto;
gboolean always_show_tab;
gboolean hide_connection_toolbar;
gboolean enable_notifications;
gint default_mode;
gint tab_mode;
gint fullscreen_toolbar_visibility;
......
......@@ -159,6 +159,7 @@ void remmina_pref_on_dialog_destroy(GtkWidget *widget, gpointer user_data)
remmina_pref.fullscreen_on_auto = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto));
remmina_pref.always_show_tab = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_show_tabs));
remmina_pref.hide_connection_toolbar = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_hide_toolbar));
remmina_pref.enable_notifications = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_enable_notifications));
remmina_pref.default_action = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_options_double_click);
remmina_pref.default_mode = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_appearance_view_mode);
......@@ -347,6 +348,7 @@ static void remmina_pref_dialog_init(void)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_remember_last_view_mode), remmina_pref.save_view_mode);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_show_tabs), remmina_pref.always_show_tab);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_hide_toolbar), remmina_pref.hide_connection_toolbar);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_enable_notifications), remmina_pref.enable_notifications);
g_snprintf(buf, sizeof(buf), "%i", remmina_pref.sshtunnel_port);
gtk_entry_set_text(remmina_pref_dialog->entry_options_ssh_port, buf);
......@@ -480,6 +482,7 @@ GtkDialog* remmina_pref_dialog_new(gint default_tab, GtkWindow *parent)
remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_fullscreen_on_auto"));
remmina_pref_dialog->checkbutton_appearance_show_tabs = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_show_tabs"));
remmina_pref_dialog->checkbutton_appearance_hide_toolbar = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_hide_toolbar"));
remmina_pref_dialog->checkbutton_appearance_enable_notifications = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_enable_notifications"));
remmina_pref_dialog->comboboxtext_options_double_click = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_options_double_click"));
remmina_pref_dialog->comboboxtext_appearance_view_mode = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_appearance_view_mode"));
remmina_pref_dialog->comboboxtext_appearance_tab_interface = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_appearance_tab_interface"));
......
......@@ -55,6 +55,7 @@ typedef struct _RemminaPrefDialog
GtkCheckButton *checkbutton_appearance_fullscreen_on_auto;
GtkCheckButton *checkbutton_appearance_show_tabs;
GtkCheckButton *checkbutton_appearance_hide_toolbar;
GtkCheckButton *checkbutton_appearance_enable_notifications;
GtkComboBox *comboboxtext_options_double_click;
GtkComboBox *comboboxtext_appearance_view_mode;
GtkComboBox *comboboxtext_appearance_tab_interface;
......
......@@ -56,6 +56,7 @@
#endif
#include "remmina_public.h"
#include "remmina/remmina_trace_calls.h"
#include "remmina_pref.h"
GtkWidget*
remmina_public_create_combo_entry(const gchar *text, const gchar *def, gboolean descending)
......@@ -688,6 +689,9 @@ void remmina_public_send_notification (const gchar *notification_id,
{
TRACE_CALL("remmina_public_send_notification");
if (!remmina_pref.enable_notifications)
return;
GNotification *notification = g_notification_new (notification_title);
g_notification_set_body (notification, notification_message);
#if GLIB_CHECK_VERSION(2,42,0)
......
......@@ -378,7 +378,7 @@ Author: Antenore Gatta
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
......@@ -395,7 +395,7 @@ Author: Antenore Gatta
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="top_attach">5</property>
<property name="width">2</property>
</packing>
</child>
......@@ -408,7 +408,7 @@ Author: Antenore Gatta
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
......@@ -425,7 +425,7 @@ Author: Antenore Gatta
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
<property name="top_attach">6</property>
<property name="width">2</property>
</packing>
</child>
......@@ -439,7 +439,7 @@ Author: Antenore Gatta
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
......@@ -456,7 +456,7 @@ Author: Antenore Gatta
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
<property name="width">2</property>
</packing>
</child>
......@@ -469,7 +469,7 @@ Author: Antenore Gatta
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
......@@ -486,7 +486,7 @@ Author: Antenore Gatta
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
<property name="top_attach">8</property>
<property name="width">2</property>
</packing>
</child>
......@@ -520,7 +520,7 @@ Author: Antenore Gatta
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
<property name="width">2</property>
</packing>
</child>
......@@ -531,9 +531,23 @@ Author: Antenore Gatta
<property name="halign">start</property>
<property name="label" translatable="yes">Fullscreen toolbar visibility</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_appearance_enable_notifications">
<property name="label" translatable="yes">Enable notifications (experimental)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">3</property>
</packing>
</child>
</object>
......@@ -1805,8 +1819,5 @@ Author: Antenore Gatta
</child>
</object>
</child>
<child>
<placeholder/>
</child>
</object>
</interface>
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