~cairo-dock-team/cairo-dock-plug-ins/plug-ins

« back to all changes in this revision

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

  • Committer: Fabrice Rey
  • Date: 2010-09-04 00:50:31 UTC
  • Revision ID: fabounet03@gmail.com-20100904005031-cospbn3n8r4g0152
updated menus so that they are correctly layed out when the dock is locked 

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
{
61
61
        cd_musicplayer_popup_info ();
62
62
}
 
63
static void _cd_musicplayer_launch (GtkMenuItem *menu_item, gpointer *data)
 
64
{
 
65
        cairo_dock_launch_command (myData.pCurrentHandeler->launch);
 
66
}
63
67
 
64
68
static void _cd_musicplayer_find_player (GtkMenuItem *menu_item, gpointer *data)
65
69
{
84
88
                cd_musicplayer_launch_handler ();
85
89
                if (myConfig.bStealTaskBarIcon)
86
90
                        CD_APPLET_MANAGE_APPLICATION (myData.pCurrentHandeler->appclass);
 
91
                
 
92
                cairo_dock_update_conf_file (CD_APPLET_MY_CONF_FILE,
 
93
                        G_TYPE_STRING, "Configuration", "current-player", pHandler->name,
 
94
                        G_TYPE_INVALID);
87
95
        }
88
96
        CD_APPLET_LEAVE ();
89
97
}
162
170
        if (! myData.bIsRunning)
163
171
        {
164
172
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Find opened player"), GTK_STOCK_FIND, _cd_musicplayer_find_player, CD_APPLET_MY_MENU);
 
173
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (myData.pCurrentHandeler->name, GTK_STOCK_MEDIA_PLAY, _cd_musicplayer_launch, CD_APPLET_MY_MENU);
 
174
                CD_APPLET_ADD_SEPARATOR_IN_MENU (pSubMenu);
 
175
        }
 
176
        else
 
177
        {
 
178
                if (myData.pCurrentHandeler->iPlayerControls & PLAYER_PREVIOUS)
 
179
                        CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Previous"), GTK_STOCK_MEDIA_PREVIOUS, _cd_musicplayer_prev, CD_APPLET_MY_MENU);
165
180
                if (myData.pCurrentHandeler->iPlayerControls & PLAYER_PLAY_PAUSE)
166
 
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (myData.pCurrentHandeler->name, (myData.iPlayingStatus != PLAYER_PLAYING ? GTK_STOCK_MEDIA_PLAY : GTK_STOCK_MEDIA_PAUSE), _cd_musicplayer_pp, CD_APPLET_MY_MENU);
167
 
        }
168
 
        else
169
 
        {
170
 
                if (myData.pCurrentHandeler->iPlayerControls)
171
 
                {
172
 
                        if (PLAYER_PREVIOUS)
173
 
                                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Previous"), GTK_STOCK_MEDIA_PREVIOUS, _cd_musicplayer_prev, CD_APPLET_MY_MENU);
174
 
                        if (PLAYER_PLAY_PAUSE)
175
 
                                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Play/Pause (left-click)"), (myData.iPlayingStatus != PLAYER_PLAYING ? GTK_STOCK_MEDIA_PLAY : GTK_STOCK_MEDIA_PAUSE), _cd_musicplayer_pp, CD_APPLET_MY_MENU);
176
 
                        if (PLAYER_NEXT)
177
 
                                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Next (middle-click)"), GTK_STOCK_MEDIA_NEXT, _cd_musicplayer_next, CD_APPLET_MY_MENU);
178
 
                        if (PLAYER_STOP)
179
 
                                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Stop"), GTK_STOCK_MEDIA_STOP, _cd_musicplayer_stop, CD_APPLET_MY_MENU);
180
 
        
181
 
                        if (PLAYER_PREVIOUS || PLAYER_PLAY_PAUSE || PLAYER_NEXT || PLAYER_STOP)
182
 
                                CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU);
183
 
                }
 
181
                        CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Play/Pause (left-click)"), (myData.iPlayingStatus != PLAYER_PLAYING ? GTK_STOCK_MEDIA_PLAY : GTK_STOCK_MEDIA_PAUSE), _cd_musicplayer_pp, CD_APPLET_MY_MENU);
 
182
                if (myData.pCurrentHandeler->iPlayerControls & PLAYER_NEXT)
 
183
                        CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Next (middle-click)"), GTK_STOCK_MEDIA_NEXT, _cd_musicplayer_next, CD_APPLET_MY_MENU);
 
184
                if (myData.pCurrentHandeler->iPlayerControls & PLAYER_STOP)
 
185
                        CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Stop"), GTK_STOCK_MEDIA_STOP, _cd_musicplayer_stop, CD_APPLET_MY_MENU);
 
186
                
 
187
                CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU);  // on n'a jamais aucune action, don con met toujours un separateur.
 
188
                
 
189
                CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Information"), GTK_STOCK_INFO, _cd_musicplayer_info, CD_APPLET_MY_MENU);
184
190
 
185
191
                if (myIcon->Xid == 0)  // lecteur dans le systray.
186
192
                        CD_APPLET_ADD_IN_MENU (D_("Show the Window"), _cd_musicplayer_show_from_systray, CD_APPLET_MY_MENU);
187
 
 
188
 
                if (myData.pCurrentHandeler->iPlayerControls)
189
 
                {
190
 
                        if (PLAYER_JUMPBOX)
191
 
                        {
192
 
                                CD_APPLET_ADD_IN_MENU (D_("Show JumpBox"), _cd_musicplayer_jumpbox, pSubMenu);
193
 
                                // CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU);
194
 
                        }
195
 
                        if (PLAYER_RATE)
196
 
                                CD_APPLET_ADD_IN_MENU (D_("Rate this song"), _cd_musicplayer_rate, pSubMenu);
197
 
                        CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Information"), GTK_STOCK_INFO, _cd_musicplayer_info, CD_APPLET_MY_MENU);
198
 
        
199
 
                        if (PLAYER_SHUFFLE)
200
 
                                CD_APPLET_ADD_IN_MENU (D_("Toggle Shuffle"), _cd_musicplayer_shuffle, pSubMenu);
201
 
                        if (PLAYER_REPEAT)
202
 
                                CD_APPLET_ADD_IN_MENU (D_("Toggle Repeat"), _cd_musicplayer_repeat, pSubMenu);
203
 
                        if (PLAYER_REPEAT || PLAYER_SHUFFLE)
204
 
                                CD_APPLET_ADD_SEPARATOR_IN_MENU (pSubMenu);
205
 
                }
 
193
                
 
194
                if (pSubMenu == CD_APPLET_MY_MENU)
 
195
                        CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU);
 
196
                
 
197
                if (myData.pCurrentHandeler->iPlayerControls & PLAYER_JUMPBOX)
 
198
                        CD_APPLET_ADD_IN_MENU (D_("Show JumpBox"), _cd_musicplayer_jumpbox, pSubMenu);
 
199
                if (myData.pCurrentHandeler->iPlayerControls & PLAYER_SHUFFLE)
 
200
                        CD_APPLET_ADD_IN_MENU (D_("Toggle Shuffle"), _cd_musicplayer_shuffle, pSubMenu);
 
201
                if (myData.pCurrentHandeler->iPlayerControls & PLAYER_REPEAT)
 
202
                        CD_APPLET_ADD_IN_MENU (D_("Toggle Repeat"), _cd_musicplayer_repeat, pSubMenu);
 
203
                if (myData.pCurrentHandeler->iPlayerControls & PLAYER_RATE)
 
204
                        CD_APPLET_ADD_IN_MENU (D_("Rate this song"), _cd_musicplayer_rate, pSubMenu);
 
205
                if (myData.pCurrentHandeler->iPlayerControls & (PLAYER_REPEAT | PLAYER_SHUFFLE | PLAYER_RATE | PLAYER_JUMPBOX))
 
206
                        CD_APPLET_ADD_SEPARATOR_IN_MENU (pSubMenu);
206
207
        }
207
208
        CD_APPLET_ADD_ABOUT_IN_MENU (pSubMenu);
208
209
CD_APPLET_ON_BUILD_MENU_END
282
283
                _cd_musicplayer_prev (NULL, NULL);
283
284
        }
284
285
        else
285
 
                return CAIRO_DOCK_LET_PASS_NOTIFICATION;
 
286
                CD_APPLET_LEAVE (CAIRO_DOCK_LET_PASS_NOTIFICATION);
286
287
CD_APPLET_ON_SCROLL_END
287
288
 
288
289