~ubuntu-branches/ubuntu/precise/cairo-dock-plug-ins/precise

« back to all changes in this revision

Viewing changes to mail/src/cd-mail-applet-notifications.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe), Matthieu Baerts (matttbe), Didier Roche
  • Date: 2010-09-18 14:20:27 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100918142027-b0zsay70mqxv63l0
Tags: 2.2.0~2-0ubuntu1
[ Matthieu Baerts (matttbe) ]
* New Upstream Version (LP: #638529)
* Fixed a few bugs on LP:
 - Fixed a crash in rainbow view when the cone is completely opened
 - Fixed a crash in rainbow view if the subdock is empty
 - Installed in lib directory by default even in 64bits arch
 - Status-Notifier: fixed few bugs
 - Clock applet:
   - Notify of missed tasks (moved some functions to a new file)
   - Fixed a little memory leak
 - Removed some 'g_print' (LP: #500677: xsession-errors log)
* Updated translations
* debian/control
 - Updated the version of cairo-dock-dev and cairo-dock-core

[ Didier Roche ]
* debian/control: depends on latest libindicator-dev (LP: #637692)

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        }
104
104
}
105
105
 
 
106
static void _cd_mail_update_all_accounts (GtkMenuItem *menu_item, CairoDockModuleInstance *myApplet)
 
107
{
 
108
        _cd_mail_force_update (myApplet);
 
109
}
 
110
 
106
111
CD_APPLET_ON_MIDDLE_CLICK_BEGIN
107
112
 
108
113
    _cd_mail_force_update(myApplet);
131
136
        _cd_mail_force_update(myApplet);
132
137
}
133
138
CD_APPLET_ON_BUILD_MENU_BEGIN
134
 
        
135
139
        GtkWidget *pSubMenu = CD_APPLET_CREATE_MY_SUB_MENU ();
 
140
        
 
141
        // Main Menu
136
142
        if(myData.pMailAccounts && myData.pMailAccounts->len > 0)
137
143
        {
138
 
                        /* add a "update account" item for each mailbox */
139
 
                        GtkWidget *pRefreshAccountSubMenu = CD_APPLET_ADD_SUB_MENU (D_("Refresh a mail account"), pSubMenu);
140
 
                        
 
144
                if (myData.pMailAccounts->len > 1)  // many accounts -> list them in a sub-menu
 
145
                {
 
146
                        // add a "update account" item for each mailbox
 
147
                        GtkWidget *pRefreshAccountSubMenu = CD_APPLET_ADD_SUB_MENU_WITH_IMAGE (D_("Refresh a mail account"), CD_APPLET_MY_MENU, GTK_STOCK_REFRESH);
141
148
                        guint i;
142
149
                        for (i = 0; i < myData.pMailAccounts->len; i ++)
143
150
                        {
144
 
                CDMailAccount *pMailAccount = g_ptr_array_index (myData.pMailAccounts, i);
145
 
                CD_APPLET_ADD_IN_MENU_WITH_DATA (pMailAccount->name, _cd_mail_update_account, pRefreshAccountSubMenu, pMailAccount);
 
151
                                CDMailAccount *pMailAccount = g_ptr_array_index (myData.pMailAccounts, i);
 
152
                                CD_APPLET_ADD_IN_MENU_WITH_DATA (pMailAccount->name, _cd_mail_update_account, pRefreshAccountSubMenu, pMailAccount);
146
153
                        }
 
154
                        CD_APPLET_ADD_IN_MENU_WITH_STOCK_AND_DATA (D_("Refresh all (Middle-click)"), GTK_STOCK_REFRESH, _cd_mail_update_all_accounts, CD_APPLET_MY_MENU, myApplet);
 
155
                }
 
156
                else  // 1 account -> in main menu
 
157
                {
 
158
                        CDMailAccount *pMailAccount = g_ptr_array_index (myData.pMailAccounts, 0);
 
159
                        gchar *cLabel = g_strdup_printf (D_("Refresh %s"), pMailAccount->name);
 
160
                        CD_APPLET_ADD_IN_MENU_WITH_STOCK_AND_DATA (cLabel, GTK_STOCK_REFRESH, _cd_mail_update_account, CD_APPLET_MY_MENU, pMailAccount);
 
161
                        g_free (cLabel);
 
162
                }
147
163
        }
148
 
        CD_APPLET_ADD_IN_MENU (D_("Mark all emails as read"), _cd_mail_mark_all_as_read, pSubMenu);
 
164
        
 
165
        CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Mark all emails as read"), GTK_STOCK_OK, _cd_mail_mark_all_as_read, CD_APPLET_MY_MENU);
149
166
        if (myConfig.cMailApplication)
150
167
        {
151
168
                gchar *cLabel = g_strdup_printf (D_("Launch %s"), myConfig.cMailApplication);
152
 
                CD_APPLET_ADD_IN_MENU (cLabel, _cd_mail_launch_mail_appli, pSubMenu);
 
169
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel, GTK_STOCK_EXECUTE, _cd_mail_launch_mail_appli, CD_APPLET_MY_MENU);
153
170
                g_free (cLabel);
154
171
        }
 
172
        
 
173
        // Sub-Menu
 
174
        if (pSubMenu == CD_APPLET_MY_MENU)
 
175
                CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU);
155
176
        CD_APPLET_ADD_ABOUT_IN_MENU (pSubMenu);
156
 
 
157
177
CD_APPLET_ON_BUILD_MENU_END
158
178
 
159
179
void _cd_mail_show_current_mail(CDMailAccount *pMailAccount)