[Xfce4-commits] <orage:master> 4.9.1.2 Enhancement 8231 alarm type selectable for foreign files

Juha noreply at xfce.org
Tue Feb 5 12:16:01 CET 2013


Updating branch refs/heads/master
         to 2e88ef13dafb15f49b55e6564872a5f2efbad2d0 (commit)
       from 93df404a27b1fe7e1ea8425d51f49d5c2f4f86dd (commit)

commit 2e88ef13dafb15f49b55e6564872a5f2efbad2d0
Author: Juha <juha at xfce.org>
Date:   Tue Feb 5 13:11:32 2013 +0200

    4.9.1.2 Enhancement 8231 alarm type selectable for foreign files
    
    Made the selection visible and user configurable from parameters menu.
    Also fixed tooltip as note needs to be escaped.

 src/mainbox.c    |    5 ++-
 src/parameters.c |   64 ++++++++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 60 insertions(+), 9 deletions(-)

diff --git a/src/mainbox.c b/src/mainbox.c
index b83659d..1c44e01 100644
--- a/src/mainbox.c
+++ b/src/mainbox.c
@@ -379,7 +379,7 @@ static void add_info_row(xfical_appt *appt, GtkBox *parentBox, gboolean todo)
 #define P_N "add_info_row: "
     GtkWidget *ev, *label;
     CalWin *cal = (CalWin *)g_par.xfcal;
-    gchar *tip, *tmp, *tmp_title;
+    gchar *tip, *tmp, *tmp_title, *tmp_note;
     gchar *tip_title, *tip_location, *tip_note;
     gchar *format_bold = "<span weight=\"bold\"> %s </span>";
     struct tm *t;
@@ -457,7 +457,8 @@ static void add_info_row(xfical_appt *appt, GtkBox *parentBox, gboolean todo)
         tip_location = g_strdup("");
     }
     if (appt->note) {
-        tmp = orage_process_text_commands(appt->note);
+        tmp_note = orage_process_text_commands(appt->note);
+        tmp = g_markup_escape_text(tmp_note, strlen(tmp_note));
         tip_note = g_strdup_printf(_("\n Note:\n%s"), tmp);
         g_free(tmp);
     }
diff --git a/src/parameters.c b/src/parameters.c
index 737aa44..0138501 100644
--- a/src/parameters.c
+++ b/src/parameters.c
@@ -113,11 +113,10 @@ typedef struct _Itf
     GtkWidget *extra_vbox;
     /* select_always_today */
     GtkWidget *select_day_frame;
-    /* GtkWidget *always_today_checkbutton; */
     GSList    *select_day_radiobutton_group;
     GtkWidget *select_day_today_radiobutton;
     GtkWidget *select_day_old_radiobutton;
-    /* icon size */
+    /* Dynamic icon */
     GtkWidget *use_dynamic_icon_frame;
     GtkWidget *use_dynamic_icon_checkbutton;
     /* show event/days window from main calendar */
@@ -128,13 +127,18 @@ typedef struct _Itf
     /* eventlist window number of extra days to show */
     GtkWidget *el_extra_days_frame;
     GtkWidget *el_extra_days_spin;
-    /* the rest */
-    GtkWidget *close_button;
-    GtkWidget *help_button;
-    GtkWidget *dialog_action_area1;
-    /* icon size */
+    /* Use wakeup timer for suspend */
     GtkWidget *use_wakeup_timer_frame;
     GtkWidget *use_wakeup_timer_checkbutton;
+    /* default foreign file display alarm */
+    GtkWidget *foreign_alarm_frame;
+    GSList    *foreign_alarm_radiobutton_group;
+    GtkWidget *foreign_alarm_orage_radiobutton;
+    GtkWidget *foreign_alarm_notification_radiobutton;
+
+    /***** the rest in all tabs *****/
+    GtkWidget *close_button;
+    GtkWidget *help_button;
 } Itf;
 
 /* Return the first day of the week, where 0=monday, 6=sunday.
@@ -405,6 +409,15 @@ static void show_changed(GtkWidget *dialog, gpointer user_data)
             itf->click_to_show_days_radiobutton));
 }
 
+static void foreign_alarm_changed(GtkWidget *dialog, gpointer user_data)
+{
+    Itf *itf = (Itf *)user_data;
+
+    g_par.use_foreign_display_alarm_notify = 
+        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
+            itf->foreign_alarm_notification_radiobutton));
+}
+
 static void sound_application_open_button_clicked(GtkButton *button
         , gpointer user_data)
 {
@@ -922,6 +935,43 @@ static void create_parameter_dialog_extra_setup_tab(Itf *dialog)
             , NULL);
     g_signal_connect(G_OBJECT(dialog->use_wakeup_timer_checkbutton), "toggled"
             , G_CALLBACK(use_wakeup_timer_changed), dialog);
+
+    /***** Default Display alarm for Foreign files *****/
+    dialog->foreign_alarm_radiobutton_group = NULL;
+    vbox = gtk_vbox_new(FALSE, 0);
+    dialog->foreign_alarm_frame = orage_create_framebox_with_content(
+            _("Foreign file default visual alarm"), vbox);
+    gtk_box_pack_start(GTK_BOX(dialog->extra_vbox)
+            , dialog->foreign_alarm_frame, FALSE, FALSE, 5);
+
+    dialog->foreign_alarm_orage_radiobutton =
+            gtk_radio_button_new_with_mnemonic(NULL, _("Orage window"));
+    gtk_box_pack_start(GTK_BOX(vbox)
+            , dialog->foreign_alarm_orage_radiobutton, FALSE, FALSE, 0);
+    gtk_radio_button_set_group(
+            GTK_RADIO_BUTTON(dialog->foreign_alarm_orage_radiobutton)
+            , dialog->foreign_alarm_radiobutton_group);
+    dialog->foreign_alarm_radiobutton_group = gtk_radio_button_get_group(
+            GTK_RADIO_BUTTON(dialog->foreign_alarm_orage_radiobutton));
+    gtk_toggle_button_set_active(
+            GTK_TOGGLE_BUTTON(dialog->foreign_alarm_orage_radiobutton)
+            , !g_par.use_foreign_display_alarm_notify);
+
+    dialog->foreign_alarm_notification_radiobutton =
+            gtk_radio_button_new_with_mnemonic(NULL, _("Notify notification"));
+    gtk_box_pack_start(GTK_BOX(vbox)
+            , dialog->foreign_alarm_notification_radiobutton, FALSE, FALSE, 0);
+    gtk_radio_button_set_group(
+            GTK_RADIO_BUTTON(dialog->foreign_alarm_notification_radiobutton)
+            , dialog->foreign_alarm_radiobutton_group);
+    dialog->foreign_alarm_radiobutton_group = gtk_radio_button_get_group(
+            GTK_RADIO_BUTTON(dialog->foreign_alarm_notification_radiobutton));
+    gtk_toggle_button_set_active(
+            GTK_TOGGLE_BUTTON(dialog->foreign_alarm_notification_radiobutton)
+            , g_par.use_foreign_display_alarm_notify);
+
+    g_signal_connect(G_OBJECT(dialog->foreign_alarm_notification_radiobutton)
+            , "toggled", G_CALLBACK(foreign_alarm_changed), dialog);
 }
 
 static Itf *create_parameter_dialog(void)


More information about the Xfce4-commits mailing list