~ubuntu-branches/ubuntu/quantal/cairo-dock-plug-ins/quantal-201208191523

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-09-07 02:38:17 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100907023817-ish9a53i2wn0m7zg
Tags: 2.2.0~0rc1-0ubuntu1
* New Upstream Version (LP: #632054)
* Fixed a few bugs on LP:
 - LP: #616176 Dust Bin Hang and Incorrect Configuration
 - LP: #604034 Change terminal tab's name lost the color
 - LP: #582452 GMenu does not contain any applications
* Fixed a few bugs on glx-dock forum:
 - Fixed support of GMusicBrowser.
 - AlsaMixer has no emblem.
 - Status-Notifier doesn't be drawed into the dock.
* Updated translations
* debian/control:
 - Added cairo-dock-core as build-depends in order to prevent
   some builds errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
{
31
31
        if (myData.pMenu != NULL)
32
32
        {
33
 
                cairo_dock_popup_menu_on_container (myData.pMenu, myContainer);
 
33
                cairo_dock_popup_menu_on_icon (myData.pMenu, myIcon, myContainer);
34
34
        }
35
35
}
36
36
 
48
48
}
49
49
 
50
50
//\___________ Define here the action to be taken when the user left-clicks on your icon or on its subdock or your desklet. The icon and the container that were clicked are available through the macros CD_APPLET_CLICKED_ICON and CD_APPLET_CLICKED_CONTAINER. CD_APPLET_CLICKED_ICON may be NULL if the user clicked in the container but out of icons.
51
 
static void _on_activate_item (GtkWidget *pMenuItem, gpointer *data);
52
 
static void _fill_menu_with_dir (gchar *cDirPath, GtkWidget *pMenu)
53
 
{
54
 
        GError *erreur = NULL;
55
 
        GDir *dir = g_dir_open (cDirPath, 0, &erreur);
56
 
        if (erreur != NULL)
57
 
        {
58
 
                return ;
59
 
        }
60
 
        
61
 
        const gchar *cFileName;
62
 
        gchar *cPath;
63
 
        gpointer *data;
64
 
        GtkWidget *pMenuItem;
65
 
        do
66
 
        {
67
 
                cFileName = g_dir_read_name (dir);
68
 
                if (cFileName == NULL)
69
 
                        break ;
70
 
                
71
 
                cPath = g_strdup_printf ("%s/%s", cDirPath, cFileName);
72
 
                pMenuItem = gtk_menu_item_new_with_label (cFileName);
73
 
                data = g_new (gpointer, 2);
74
 
                data[0] = cPath;
75
 
                
76
 
                gtk_menu_shell_append  (GTK_MENU_SHELL (pMenu), pMenuItem);
77
 
                g_signal_connect (G_OBJECT (pMenuItem), "activate", G_CALLBACK(_on_activate_item), data);
78
 
                
79
 
                if (g_file_test (cPath, G_FILE_TEST_IS_DIR))
80
 
                {
81
 
                        GtkWidget *pSubMenu = gtk_menu_new ();
82
 
                        gtk_menu_item_set_submenu (GTK_MENU_ITEM (pMenuItem), pSubMenu);
83
 
                        data[1] = pSubMenu;
84
 
                }
85
 
        }
86
 
        while (1);
87
 
        g_dir_close (dir);
88
 
}
89
 
static void _on_activate_item (GtkWidget *pMenuItem, gpointer *data)
90
 
{
91
 
        gchar *cPath = data[0];
92
 
        cd_debug ("%s (%s)\n", __func__, cPath);
93
 
        
94
 
        if (g_file_test (cPath, G_FILE_TEST_IS_DIR))
95
 
        {
96
 
                cd_debug ("c'est un repertoire\n");
97
 
                GtkWidget *pSubMenu = data[1];
98
 
                _fill_menu_with_dir (cPath, pSubMenu);
99
 
                gtk_widget_show_all (pSubMenu);
100
 
        }
101
 
        else
102
 
        {
103
 
                cairo_dock_fm_launch_uri (cPath);
104
 
        }
105
 
}
106
51
CD_APPLET_ON_CLICK_BEGIN
107
52
        cd_menu_show_menu ();
108
 
        
109
 
        /*gchar *cDirPath = g_getenv ("HOME");
110
 
        GtkWidget *pMenu = gtk_menu_new ();
111
 
        
112
 
        _fill_menu_with_dir (cDirPath, pMenu);
113
 
        
114
 
        gtk_widget_show_all (pMenu);
115
 
        
116
 
        gtk_menu_popup (GTK_MENU (pMenu),
117
 
                NULL,
118
 
                NULL,
119
 
                NULL,
120
 
                NULL,
121
 
                1,
122
 
                gtk_get_current_event_time ());*/
123
 
        
124
53
CD_APPLET_ON_CLICK_END
125
54
 
126
55
 
143
72
}
144
73
CD_APPLET_ON_BUILD_MENU_BEGIN
145
74
        GtkWidget *pSubMenu = CD_APPLET_CREATE_MY_SUB_MENU ();
 
75
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Quick launch (Middle-click)"), GTK_STOCK_EXECUTE, cd_menu_show_hide_quick_launch, CD_APPLET_MY_MENU);
 
76
                CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU);
 
77
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Configure menu"), GTK_STOCK_PREFERENCES, _cd_menu_configure_menu, CD_APPLET_MY_MENU);
 
78
                
 
79
                CD_APPLET_ADD_SEPARATOR_IN_MENU (pSubMenu);
 
80
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Clear recent"), GTK_STOCK_CLEAR, cd_menu_clear_recent, CD_APPLET_MY_MENU);
 
81
                
146
82
                CD_APPLET_ADD_ABOUT_IN_MENU (pSubMenu);
147
 
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Quick launch"), GTK_STOCK_EXECUTE, cd_menu_show_hide_quick_launch, pSubMenu);
148
 
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Configure menu"), GTK_STOCK_PREFERENCES, _cd_menu_configure_menu, pSubMenu);
149
 
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Clear recent"), GTK_STOCK_CLEAR, cd_menu_clear_recent, pSubMenu);
150
83
CD_APPLET_ON_BUILD_MENU_END
151
84
 
152
85