~didrocks/cairo-dock-plug-ins/fix-abi-transition

« back to all changes in this revision

Viewing changes to clock/src/applet-notifications.c

  • Committer: matttbe
  • Date: 2010-08-07 01:43:25 UTC
  • Revision ID: matttbe@gmail.com-20100807014325-36tmlrc8n1rrksk5
* New Upstream Version (LP: #614625)
* debian/rules:
 - Autotools has been replaced by CMake
 - cdbs is now used.
* debian/copyright:
 - Updated with the new applets
* debian/control:
 - Autotools has been replaced by CMake
 - Added libcurl4-gnutls-dev, libindicator-dev, libdbusmenu-glib-dev
   libido-0.1-dev, libical-dev, libdbusmenu-gtk-dev as Build-deps
 - Bump Standard-Version to 3.9.1
 - Wget is required for dnd2share applet
* debian/cairo-dock-plug-ins*.install:
 - All sonames are now installed into lib32 or lib64 (lib*)
* Fixed a few bugs on LP:
 - LP: #483963, LP: #485159, LP: #500677, LP: #500979
 - LP: #521531, LP: #519915, LP: #526138, LP: #531317
 - LP: #531319, LP: #537115, LP: #537943, LP: #538637
 - More details on the 'ChangeLog' file

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
#include "applet-struct.h"
26
26
#include "applet-draw.h"
 
27
#include "applet-calendar.h"
27
28
#include "applet-notifications.h"
28
29
 
29
30
 
50
51
}
51
52
 
52
53
 
53
 
 
54
 
 
55
54
CD_APPLET_ON_CLICK_BEGIN
56
 
        if (myData.pCalendarDialog != NULL)
57
 
        {
58
 
                cairo_dock_dialog_unreference (myData.pCalendarDialog);
59
 
                myData.pCalendarDialog = NULL;
60
 
        }
61
 
        else
62
 
        {
63
 
                GtkWidget *pCalendar = gtk_calendar_new ();
64
 
                myData.pCalendarDialog = cairo_dock_show_dialog_full (D_("Calendar"),
65
 
                        myIcon, myContainer,
66
 
                        0,
67
 
                        MY_APPLET_SHARE_DATA_DIR"/dates.svg",
68
 
                        pCalendar,
69
 
                        NULL, NULL, NULL);
70
 
        }
 
55
        cd_clock_show_hide_calendar (myApplet);
71
56
CD_APPLET_ON_CLICK_END
72
57
 
73
 
 
 
58
static void _cd_clock_show_tasks_today (GtkMenuItem *menu_item, CairoDockModuleInstance *myApplet)
 
59
{
 
60
        gchar *cTasks = cd_clock_get_tasks_for_today (myApplet);
 
61
        if (cTasks == NULL)
 
62
                cTasks = g_strdup (D_("No task is sheduled for today.\n\nYou can add tasks by clicking on the applet to open the calendar, and then double-clicking on a day."));
 
63
        
 
64
        cd_clock_hide_dialogs (myApplet);
 
65
        myDialogs.dialogTextDescription.bUseMarkup = TRUE;
 
66
        cairo_dock_show_temporary_dialog_with_icon (cTasks, myIcon, myContainer, 30e3, MY_APPLET_SHARE_DATA_DIR"/icon-task.png");
 
67
        myDialogs.dialogTextDescription.bUseMarkup = TRUE;
 
68
        
 
69
        g_free (cTasks);
 
70
}
 
71
static void _cd_clock_show_tasks_week (GtkMenuItem *menu_item, CairoDockModuleInstance *myApplet)
 
72
{
 
73
        gchar *cTasks = cd_clock_get_tasks_for_this_week (myApplet);
 
74
        double fDelay = 30e3;
 
75
        if (cTasks == NULL)
 
76
        {
 
77
                cTasks = g_strdup (D_("No task is sheduled for the next 7 days.\n\nYou can add tasks by clicking on the applet to open the calendar, and then double-clicking on a day."));
 
78
                fDelay = 4e3;
 
79
        }
 
80
        
 
81
        cd_clock_hide_dialogs (myApplet);
 
82
        myDialogs.dialogTextDescription.bUseMarkup = TRUE;
 
83
        cairo_dock_show_temporary_dialog_with_icon (cTasks, myIcon, myContainer, fDelay, MY_APPLET_SHARE_DATA_DIR"/icon-task.png");
 
84
        myDialogs.dialogTextDescription.bUseMarkup = TRUE;
 
85
        
 
86
        g_free (cTasks);
 
87
}
74
88
CD_APPLET_ON_BUILD_MENU_BEGIN
75
89
        GtkWidget *pSubMenu = CD_APPLET_CREATE_MY_SUB_MENU ();
76
90
                CD_APPLET_ADD_IN_MENU (D_("Set up time and date"), _cd_clock_launch_time_admin, pSubMenu);
 
91
                CD_APPLET_ADD_IN_MENU (D_("Show today's tasks"), _cd_clock_show_tasks_today, pSubMenu);
 
92
                CD_APPLET_ADD_IN_MENU (D_("Show this week's tasks"), _cd_clock_show_tasks_week, pSubMenu);
77
93
                CD_APPLET_ADD_ABOUT_IN_MENU (pSubMenu);
78
94
CD_APPLET_ON_BUILD_MENU_END
79
95
 
84
100
                kill (myData.iAlarmPID, 1);
85
101
                myData.iAlarmPID = 0;
86
102
        }
87
 
        cairo_dock_remove_dialog_if_any (myIcon);
88
 
        myData.pCalendarDialog = NULL;
 
103
        cd_clock_hide_dialogs (myApplet);
 
104
        CD_APPLET_STOP_DEMANDING_ATTENTION;
89
105
CD_APPLET_ON_MIDDLE_CLICK_END
90
106
 
91
107