Mercurial > audlegacy-plugins
annotate src/statusicon/si_ui.c @ 3085:ac0af6b39272
Introduce new GIO plugin to buildsystem. stdio is now deprecated.
Thoughts:
- getc()/ungetc() should be moved to VFS core now
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Wed, 29 Apr 2009 20:58:36 -0500 |
parents | 2a4eb326eb1d |
children | a522493de76e |
rev | line source |
---|---|
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
1 /* |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
2 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
3 * Author: Giacomo Lozito <james@develia.org>, (C) 2005-2007 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
4 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify it |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License as published by the |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
7 * Free Software Foundation; either version 2 of the License, or (at your |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
8 * option) any later version. |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
9 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, but |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
11 * WITHOUT ANY WARRANTY; without even the implied warranty of |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
13 * General Public License for more details. |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
14 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License along |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
16 * with this program; if not, write to the Free Software Foundation, Inc., |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
18 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
19 */ |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
20 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
21 #include "si_ui.h" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
22 #include "si_audacious.h" |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
23 #include "si_cfg.h" |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
24 #include "si_common.h" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
25 #include "gtktrayicon.h" |
2971
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2577
diff
changeset
|
26 #include <audlegacy/ui_fileinfopopup.h> |
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2577
diff
changeset
|
27 #include <audlegacy/plugin.h> |
3134a0987162
- changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
2577
diff
changeset
|
28 #include <audlegacy/i18n.h> |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
29 #include <glib.h> |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
30 #include <gdk/gdk.h> |
542
d58404ba9af9
[svn] - made popup window use audacious_fileinfopopup_show_from_title if track_name and song length is not available
giacomo
parents:
527
diff
changeset
|
31 #include <gdk/gdkx.h> |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
32 #include <gtk/gtk.h> |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
33 |
2223
6b34a88b1408
statusicon: more elegant solution, workaround removed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2222
diff
changeset
|
34 #ifndef MAX |
6b34a88b1408
statusicon: more elegant solution, workaround removed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2222
diff
changeset
|
35 # define MAX(a,b) ((a) > (b) ? (a) : (b)) |
6b34a88b1408
statusicon: more elegant solution, workaround removed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2222
diff
changeset
|
36 #endif |
6b34a88b1408
statusicon: more elegant solution, workaround removed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2222
diff
changeset
|
37 |
796
f3ce11fad729
[svn] statusicon: improvements in title changes detection while the popup is being displayed
giacomo
parents:
795
diff
changeset
|
38 static void si_ui_statusicon_popup_timer_start ( GtkWidget * ); |
f3ce11fad729
[svn] statusicon: improvements in title changes detection while the popup is being displayed
giacomo
parents:
795
diff
changeset
|
39 static void si_ui_statusicon_popup_timer_stop ( GtkWidget * ); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
40 static void si_ui_statusicon_smallmenu_show ( gint x, gint y, guint button, guint32 time , gpointer ); |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
41 static void si_ui_statusicon_smallmenu_recreate ( GtkWidget * ); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
42 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
43 extern si_cfg_t si_cfg; |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
44 static gboolean recreate_smallmenu = FALSE; |
796
f3ce11fad729
[svn] statusicon: improvements in title changes detection while the popup is being displayed
giacomo
parents:
795
diff
changeset
|
45 |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
46 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
47 /* this stuff required to make titlechange hook work properly */ |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
48 typedef struct |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
49 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
50 gchar *title; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
51 gchar *filename; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
52 gpointer evbox; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
53 } |
2060 | 54 si_aud_hook_tchange_prevs_t; |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
55 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
56 |
886
f2fde7b4dccd
[svn] - statusicon: use function/define names that do not collide with gtk >= 2.10 internals (paranoia)
giacomo
parents:
855
diff
changeset
|
57 static AudGtkTrayIcon * |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
58 si_ui_statusicon_create ( void ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
59 { |
886
f2fde7b4dccd
[svn] - statusicon: use function/define names that do not collide with gtk >= 2.10 internals (paranoia)
giacomo
parents:
855
diff
changeset
|
60 AudGtkTrayIcon *si_applet = NULL; |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
61 |
886
f2fde7b4dccd
[svn] - statusicon: use function/define names that do not collide with gtk >= 2.10 internals (paranoia)
giacomo
parents:
855
diff
changeset
|
62 si_applet = _aud_gtk_tray_icon_new( "audacious" ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
63 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
64 gtk_widget_show( GTK_WIDGET(si_applet) ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
65 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
66 return si_applet; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
67 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
68 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
69 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
70 static gboolean |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
71 si_ui_statusicon_cb_btpress ( GtkWidget * evbox , GdkEventButton * event ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
72 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
73 switch ( event->button ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
74 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
75 case 1: |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
76 { |
2422
e780330f6189
jump between songs using shift+lmb and shift+rmb (Bugzilla #157)
Cristi Magherusan <majeru@atheme.org>
parents:
2223
diff
changeset
|
77 if (event->state & GDK_SHIFT_MASK) |
e780330f6189
jump between songs using shift+lmb and shift+rmb (Bugzilla #157)
Cristi Magherusan <majeru@atheme.org>
parents:
2223
diff
changeset
|
78 audacious_drct_pl_next(); |
e780330f6189
jump between songs using shift+lmb and shift+rmb (Bugzilla #157)
Cristi Magherusan <majeru@atheme.org>
parents:
2223
diff
changeset
|
79 else |
e780330f6189
jump between songs using shift+lmb and shift+rmb (Bugzilla #157)
Cristi Magherusan <majeru@atheme.org>
parents:
2223
diff
changeset
|
80 si_audacious_toggle_visibility(); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
81 break; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
82 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
83 |
2167
d44adaddae8b
applied a patch from Igor Stirbu, middleclick on SI toggles play/pause
Cristi Magherusan <majeru@atheme-project.org>
parents:
2161
diff
changeset
|
84 case 2: |
d44adaddae8b
applied a patch from Igor Stirbu, middleclick on SI toggles play/pause
Cristi Magherusan <majeru@atheme-project.org>
parents:
2161
diff
changeset
|
85 { |
d44adaddae8b
applied a patch from Igor Stirbu, middleclick on SI toggles play/pause
Cristi Magherusan <majeru@atheme-project.org>
parents:
2161
diff
changeset
|
86 si_audacious_toggle_playback(); |
d44adaddae8b
applied a patch from Igor Stirbu, middleclick on SI toggles play/pause
Cristi Magherusan <majeru@atheme-project.org>
parents:
2161
diff
changeset
|
87 break; |
d44adaddae8b
applied a patch from Igor Stirbu, middleclick on SI toggles play/pause
Cristi Magherusan <majeru@atheme-project.org>
parents:
2161
diff
changeset
|
88 } |
d44adaddae8b
applied a patch from Igor Stirbu, middleclick on SI toggles play/pause
Cristi Magherusan <majeru@atheme-project.org>
parents:
2161
diff
changeset
|
89 |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
90 case 3: |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
91 { |
2422
e780330f6189
jump between songs using shift+lmb and shift+rmb (Bugzilla #157)
Cristi Magherusan <majeru@atheme.org>
parents:
2223
diff
changeset
|
92 if (event->state & GDK_SHIFT_MASK) |
e780330f6189
jump between songs using shift+lmb and shift+rmb (Bugzilla #157)
Cristi Magherusan <majeru@atheme.org>
parents:
2223
diff
changeset
|
93 audacious_drct_pl_prev(); |
e780330f6189
jump between songs using shift+lmb and shift+rmb (Bugzilla #157)
Cristi Magherusan <majeru@atheme.org>
parents:
2223
diff
changeset
|
94 else{ |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
95 switch ( si_cfg.rclick_menu ) |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
96 { |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
97 case SI_CFG_RCLICK_MENU_SMALL1: |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
98 case SI_CFG_RCLICK_MENU_SMALL2: |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
99 if ( recreate_smallmenu == TRUE ) |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
100 si_ui_statusicon_smallmenu_recreate( evbox ); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
101 si_ui_statusicon_smallmenu_show( event->x_root , event->y_root , 3 , event->time , evbox ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
102 break; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
103 case SI_CFG_RCLICK_MENU_AUD: |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
104 default: |
2992
2a4eb326eb1d
fixed crash of the new GUI when right clicking on the StatusIcon
Cristi Magherusan <majeru@atheme.org>
parents:
2971
diff
changeset
|
105 if(audacious_menu_main_show != NULL) |
2a4eb326eb1d
fixed crash of the new GUI when right clicking on the StatusIcon
Cristi Magherusan <majeru@atheme.org>
parents:
2971
diff
changeset
|
106 audacious_menu_main_show ( event->x_root , event->y_root , 3 , event->time ); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
107 break; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
108 } |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
109 break; |
2422
e780330f6189
jump between songs using shift+lmb and shift+rmb (Bugzilla #157)
Cristi Magherusan <majeru@atheme.org>
parents:
2223
diff
changeset
|
110 } |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
111 } |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
112 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
113 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
114 return FALSE; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
115 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
116 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
117 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
118 static gboolean |
453
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
119 si_ui_statusicon_cb_btscroll ( GtkWidget * evbox , GdkEventScroll * event ) |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
120 { |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
121 switch ( event->direction ) |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
122 { |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
123 case GDK_SCROLL_UP: |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
124 { |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
125 switch ( si_cfg.scroll_action ) |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
126 { |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
127 case SI_CFG_SCROLL_ACTION_VOLUME: |
2425
ced4a5392948
made status plugin use the main mouse wheel setting when changing the volume
Cristi Magherusan <majeru@atheme.org>
parents:
2422
diff
changeset
|
128 si_audacious_volume_change( si_cfg.volume_delta ); |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
129 break; |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
130 case SI_CFG_SCROLL_ACTION_SKIP: |
919
d16737cc85f6
[svn] - statusicon: invert skip direction in mouse wheel; much better this way
giacomo
parents:
918
diff
changeset
|
131 si_audacious_playback_skip( -1 ); |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
132 break; |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
133 } |
453
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
134 break; |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
135 } |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
136 |
453
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
137 case GDK_SCROLL_DOWN: |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
138 { |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
139 switch ( si_cfg.scroll_action ) |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
140 { |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
141 case SI_CFG_SCROLL_ACTION_VOLUME: |
2425
ced4a5392948
made status plugin use the main mouse wheel setting when changing the volume
Cristi Magherusan <majeru@atheme.org>
parents:
2422
diff
changeset
|
142 si_audacious_volume_change( -si_cfg.volume_delta ); |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
143 break; |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
144 case SI_CFG_SCROLL_ACTION_SKIP: |
919
d16737cc85f6
[svn] - statusicon: invert skip direction in mouse wheel; much better this way
giacomo
parents:
918
diff
changeset
|
145 si_audacious_playback_skip( 1 ); |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
146 break; |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
147 } |
453
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
148 break; |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
149 } |
2219
d7acad3d50e8
statusicon: warnings suppressed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2167
diff
changeset
|
150 |
d7acad3d50e8
statusicon: warnings suppressed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2167
diff
changeset
|
151 default: ; |
453
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
152 } |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
153 |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
154 return FALSE; |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
155 } |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
156 |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
157 |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
452
diff
changeset
|
158 static gboolean |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
159 si_ui_statusicon_popup_show ( gpointer evbox ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
160 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
161 if ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(evbox) , "timer_active" )) == 1 ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
162 { |
1442
95b8abed24c7
statusicon: new tuple API
William Pitcock <nenolod@atheme-project.org>
parents:
1054
diff
changeset
|
163 Tuple *tuple; |
2057
cf4fa45ffd80
playlist API vtabling
William Pitcock <nenolod@atheme.org>
parents:
1976
diff
changeset
|
164 Playlist *pl_active = aud_playlist_get_active(); |
cf4fa45ffd80
playlist API vtabling
William Pitcock <nenolod@atheme.org>
parents:
1976
diff
changeset
|
165 gint pos = aud_playlist_get_position(pl_active); |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
166 GtkWidget *popup = g_object_get_data( G_OBJECT(evbox) , "popup" ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
167 |
2057
cf4fa45ffd80
playlist API vtabling
William Pitcock <nenolod@atheme.org>
parents:
1976
diff
changeset
|
168 tuple = aud_playlist_get_tuple( pl_active , pos ); |
1976
5fa26178eaef
s/tuple_/aud_tuple_/g
William Pitcock <nenolod@atheme.org>
parents:
1697
diff
changeset
|
169 if ( ( tuple == NULL ) || ( aud_tuple_get_int(tuple, FIELD_LENGTH, NULL) < 1 ) ) |
542
d58404ba9af9
[svn] - made popup window use audacious_fileinfopopup_show_from_title if track_name and song length is not available
giacomo
parents:
527
diff
changeset
|
170 { |
2057
cf4fa45ffd80
playlist API vtabling
William Pitcock <nenolod@atheme.org>
parents:
1976
diff
changeset
|
171 gchar *title = aud_playlist_get_songtitle( pl_active , pos ); |
542
d58404ba9af9
[svn] - made popup window use audacious_fileinfopopup_show_from_title if track_name and song length is not available
giacomo
parents:
527
diff
changeset
|
172 audacious_fileinfopopup_show_from_title( popup , title ); |
d58404ba9af9
[svn] - made popup window use audacious_fileinfopopup_show_from_title if track_name and song length is not available
giacomo
parents:
527
diff
changeset
|
173 g_free( title ); |
d58404ba9af9
[svn] - made popup window use audacious_fileinfopopup_show_from_title if track_name and song length is not available
giacomo
parents:
527
diff
changeset
|
174 } |
d58404ba9af9
[svn] - made popup window use audacious_fileinfopopup_show_from_title if track_name and song length is not available
giacomo
parents:
527
diff
changeset
|
175 else |
d58404ba9af9
[svn] - made popup window use audacious_fileinfopopup_show_from_title if track_name and song length is not available
giacomo
parents:
527
diff
changeset
|
176 { |
d58404ba9af9
[svn] - made popup window use audacious_fileinfopopup_show_from_title if track_name and song length is not available
giacomo
parents:
527
diff
changeset
|
177 audacious_fileinfopopup_show_from_tuple( popup , tuple ); |
d58404ba9af9
[svn] - made popup window use audacious_fileinfopopup_show_from_title if track_name and song length is not available
giacomo
parents:
527
diff
changeset
|
178 } |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
179 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
180 g_object_set_data( G_OBJECT(evbox) , "popup_active" , GINT_TO_POINTER(1) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
181 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
182 |
796
f3ce11fad729
[svn] statusicon: improvements in title changes detection while the popup is being displayed
giacomo
parents:
795
diff
changeset
|
183 si_ui_statusicon_popup_timer_stop( evbox ); |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
184 return FALSE; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
185 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
186 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
187 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
188 static void |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
189 si_ui_statusicon_popup_hide ( gpointer evbox ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
190 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
191 if ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(evbox) , "popup_active" )) == 1 ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
192 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
193 GtkWidget *popup = g_object_get_data( G_OBJECT(evbox) , "popup" ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
194 g_object_set_data( G_OBJECT(evbox) , "popup_active" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
195 audacious_fileinfopopup_hide( popup , NULL ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
196 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
197 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
198 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
199 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
200 static void |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
201 si_ui_statusicon_popup_timer_start ( GtkWidget * evbox ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
202 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
203 gint timer_id = g_timeout_add( 500 , si_ui_statusicon_popup_show , evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
204 g_object_set_data( G_OBJECT(evbox) , "timer_id" , GINT_TO_POINTER(timer_id) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
205 g_object_set_data( G_OBJECT(evbox) , "timer_active" , GINT_TO_POINTER(1) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
206 return; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
207 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
208 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
209 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
210 static void |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
211 si_ui_statusicon_popup_timer_stop ( GtkWidget * evbox ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
212 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
213 if ( GPOINTER_TO_INT(g_object_get_data(G_OBJECT(evbox),"timer_active")) == 1 ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
214 g_source_remove( GPOINTER_TO_INT(g_object_get_data(G_OBJECT(evbox),"timer_id")) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
215 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
216 g_object_set_data( G_OBJECT(evbox) , "timer_id" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
217 g_object_set_data( G_OBJECT(evbox) , "timer_active" , GINT_TO_POINTER(0) ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
218 return; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
219 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
220 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
221 |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
222 static void |
2060 | 223 si_ui_statusicon_cb_aud_hook_pbstart ( gpointer plentry_gp , gpointer evbox ) |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
224 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
225 if ( ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(evbox) , "popup_active" )) == 1 ) && |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
226 ( plentry_gp != NULL ) ) |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
227 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
228 si_ui_statusicon_popup_hide( evbox ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
229 si_ui_statusicon_popup_timer_start( evbox ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
230 } |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
231 } |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
232 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
233 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
234 static void |
2060 | 235 si_ui_statusicon_cb_aud_hook_tchange ( gpointer plentry_gp , gpointer prevs_gp ) |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
236 { |
2060 | 237 si_aud_hook_tchange_prevs_t *prevs = prevs_gp; |
796
f3ce11fad729
[svn] statusicon: improvements in title changes detection while the popup is being displayed
giacomo
parents:
795
diff
changeset
|
238 PlaylistEntry *pl_entry = plentry_gp; |
1054
2d6a00ed166f
[svn] - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
giacomo
parents:
1053
diff
changeset
|
239 gboolean upd_pop = FALSE; |
2d6a00ed166f
[svn] - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
giacomo
parents:
1053
diff
changeset
|
240 |
2d6a00ed166f
[svn] - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
giacomo
parents:
1053
diff
changeset
|
241 if ( pl_entry != NULL ) |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
242 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
243 if ( ( prevs->title != NULL ) && ( prevs->filename != NULL ) ) |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
244 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
245 if ( ( pl_entry->filename != NULL ) && |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
246 ( !strcmp(pl_entry->filename,prevs->filename) ) ) |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
247 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
248 if ( ( pl_entry->title != NULL ) && |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
249 ( strcmp(pl_entry->title,prevs->title) ) ) |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
250 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
251 g_free( prevs->title ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
252 prevs->title = g_strdup(pl_entry->title); |
1054
2d6a00ed166f
[svn] - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
giacomo
parents:
1053
diff
changeset
|
253 upd_pop = TRUE; |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
254 } |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
255 } |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
256 else |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
257 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
258 g_free(prevs->filename); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
259 prevs->filename = g_strdup(pl_entry->filename); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
260 /* if filename changes, reset title as well */ |
1054
2d6a00ed166f
[svn] - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
giacomo
parents:
1053
diff
changeset
|
261 g_free(prevs->title); |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
262 prevs->title = g_strdup(pl_entry->title); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
263 } |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
264 } |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
265 else |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
266 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
267 if ( prevs->title != NULL ) |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
268 g_free(prevs->title); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
269 prevs->title = g_strdup(pl_entry->title); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
270 if ( prevs->filename != NULL ) |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
271 g_free(prevs->filename); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
272 prevs->filename = g_strdup(pl_entry->filename); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
273 } |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
274 } |
1054
2d6a00ed166f
[svn] - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
giacomo
parents:
1053
diff
changeset
|
275 |
2d6a00ed166f
[svn] - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
giacomo
parents:
1053
diff
changeset
|
276 if ( ( upd_pop == TRUE ) && |
2d6a00ed166f
[svn] - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
giacomo
parents:
1053
diff
changeset
|
277 ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(prevs->evbox) , "popup_active" )) == 1 ) ) |
796
f3ce11fad729
[svn] statusicon: improvements in title changes detection while the popup is being displayed
giacomo
parents:
795
diff
changeset
|
278 { |
1054
2d6a00ed166f
[svn] - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
giacomo
parents:
1053
diff
changeset
|
279 si_ui_statusicon_popup_hide( prevs->evbox ); |
2d6a00ed166f
[svn] - statusicon: partial rewrite of si_ui_statusicon_cb_hook_tchange , nicer this way
giacomo
parents:
1053
diff
changeset
|
280 si_ui_statusicon_popup_timer_start( prevs->evbox ); |
796
f3ce11fad729
[svn] statusicon: improvements in title changes detection while the popup is being displayed
giacomo
parents:
795
diff
changeset
|
281 } |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
282 } |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
283 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
284 |
439
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
285 static gboolean |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
286 si_ui_statusicon_cb_popup ( GtkWidget * evbox , GdkEvent * event ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
287 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
288 if ((event->type == GDK_LEAVE_NOTIFY || event->type == GDK_ENTER_NOTIFY) && |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
289 event->crossing.detail == GDK_NOTIFY_INFERIOR) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
290 return FALSE; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
291 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
292 if ( event->type != GDK_KEY_PRESS && event->type != GDK_KEY_RELEASE ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
293 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
294 GtkWidget *event_widget = gtk_get_event_widget( event ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
295 if ( event_widget != evbox ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
296 return FALSE; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
297 } |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
298 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
299 switch (event->type) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
300 { |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
301 case GDK_EXPOSE: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
302 /* do nothing */ |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
303 break; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
304 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
305 case GDK_ENTER_NOTIFY: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
306 si_ui_statusicon_popup_timer_start( evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
307 break; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
308 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
309 case GDK_LEAVE_NOTIFY: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
310 si_ui_statusicon_popup_timer_stop( evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
311 if ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(evbox) , "popup_active" )) == 1 ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
312 si_ui_statusicon_popup_hide( evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
313 break; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
314 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
315 case GDK_MOTION_NOTIFY: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
316 break; /* ignore */ |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
317 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
318 case GDK_BUTTON_PRESS: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
319 case GDK_BUTTON_RELEASE: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
320 case GDK_KEY_PRESS: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
321 case GDK_KEY_RELEASE: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
322 case GDK_PROXIMITY_IN: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
323 case GDK_SCROLL: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
324 si_ui_statusicon_popup_timer_stop( evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
325 if ( GPOINTER_TO_INT(g_object_get_data( G_OBJECT(evbox) , "popup_active" )) == 1 ) |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
326 si_ui_statusicon_popup_hide( evbox ); |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
327 break; |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
328 |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
329 default: |
84029a5250c1
[svn] - status icon plugin: made a tooltip popup that displays metadata of the current song
giacomo
parents:
433
diff
changeset
|
330 break; |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
331 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
332 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
333 return FALSE; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
334 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
335 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
336 |
440
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
337 static void |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
338 si_ui_statusicon_image_update ( GtkWidget * image ) |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
339 { |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
340 GdkPixbuf *si_pixbuf, *si_scaled_pixbuf; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
341 gint size = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(image) , "size" )); |
455
f001b217c88b
[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
giacomo
parents:
454
diff
changeset
|
342 static gchar *wmname = NULL; |
2219
d7acad3d50e8
statusicon: warnings suppressed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2167
diff
changeset
|
343 |
d7acad3d50e8
statusicon: warnings suppressed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2167
diff
changeset
|
344 AUDDBG("WM reported proposed icon size: %d\n", size); |
455
f001b217c88b
[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
giacomo
parents:
454
diff
changeset
|
345 |
f001b217c88b
[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
giacomo
parents:
454
diff
changeset
|
346 /* sometimes, KDE won't give the correct size-allocation; workaround this */ |
f001b217c88b
[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
giacomo
parents:
454
diff
changeset
|
347 if ( wmname == NULL ) |
f001b217c88b
[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
giacomo
parents:
454
diff
changeset
|
348 { |
f001b217c88b
[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
giacomo
parents:
454
diff
changeset
|
349 GdkScreen *screen = gdk_screen_get_default(); |
f001b217c88b
[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
giacomo
parents:
454
diff
changeset
|
350 if ( screen != NULL ) |
f001b217c88b
[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
giacomo
parents:
454
diff
changeset
|
351 wmname = (gchar*)gdk_x11_screen_get_window_manager_name( screen ); |
2221
b4a2a7197c05
statusicon: quick workaround for Xfce4
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2219
diff
changeset
|
352 AUDDBG("WM name: %s\n", wmname); |
455
f001b217c88b
[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
giacomo
parents:
454
diff
changeset
|
353 } |
2223
6b34a88b1408
statusicon: more elegant solution, workaround removed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2222
diff
changeset
|
354 if ( ( size <= 1 || size > 22 ) && ( wmname != NULL ) && !strcmp("KWin",wmname) ) |
455
f001b217c88b
[svn] - status icon plugin: added a workaround to handle situations where KWin doesn't give a correct size for tray icons
giacomo
parents:
454
diff
changeset
|
355 size = 22; |
2427
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
356 GtkIconTheme *theme; |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
357 GtkIconInfo *info; |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
358 int *array; |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
359 int i; |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
360 const gchar *path; |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
361 gboolean scalable = FALSE; |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
362 gboolean catch = FALSE; |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
363 |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
364 theme = gtk_icon_theme_get_default (); |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
365 array = gtk_icon_theme_get_icon_sizes (theme, "audacious"); |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
366 if (array[0] != 0) { |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
367 for (i = 0; array[i] != 0; i++) { |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
368 if (array[i] == -1) |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
369 scalable = TRUE; |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
370 if (array[i] == 22) |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
371 catch = TRUE; |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
372 } |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
373 } |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
374 g_free (array); |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
375 if (catch) { |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
376 info = gtk_icon_theme_lookup_icon (theme, "audacious", 22, GTK_ICON_LOOKUP_NO_SVG); |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
377 path = gtk_icon_info_get_filename (info); |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
378 si_pixbuf = gdk_pixbuf_new_from_file (path, NULL); |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
379 } else if (scalable) { |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
380 info = gtk_icon_theme_lookup_icon (theme, "audacious", -1, GTK_ICON_LOOKUP_FORCE_SVG); |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
381 path = gtk_icon_info_get_filename (info); |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
382 si_pixbuf = gdk_pixbuf_new_from_file (path, NULL); |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
383 |
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
384 } else { |
2432
db80c2fc0b57
get rid of hardcoded paths
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2427
diff
changeset
|
385 si_pixbuf = gdk_pixbuf_new_from_file (DATA_DIR "/images/audacious_player.xpm", NULL); |
2427
e041adc026a8
Status Icon can now be changed, patch provided by Matteo (Bugzilla #182)
Cristi Magherusan <majeru@atheme.org>
parents:
2425
diff
changeset
|
386 } |
440
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
387 si_scaled_pixbuf = gdk_pixbuf_scale_simple( si_pixbuf , size , size , GDK_INTERP_BILINEAR ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
388 gtk_image_set_from_pixbuf( GTK_IMAGE(image) , si_scaled_pixbuf ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
389 g_object_unref( si_pixbuf ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
390 g_object_unref( si_scaled_pixbuf ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
391 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
392 return; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
393 } |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
394 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
395 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
396 static void |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
397 si_ui_statusicon_cb_image_sizalloc ( GtkWidget * image , GtkAllocation * allocation , gpointer si_applet ) |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
398 { |
2223
6b34a88b1408
statusicon: more elegant solution, workaround removed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2222
diff
changeset
|
399 /*GtkOrientation orientation;*/ |
440
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
400 static gint prev_size = 0; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
401 gint size = 0; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
402 |
2223
6b34a88b1408
statusicon: more elegant solution, workaround removed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2222
diff
changeset
|
403 /*orientation = _aud_gtk_tray_icon_get_orientation( AUD_GTK_TRAY_ICON(si_applet) ); |
440
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
404 if ( orientation == GTK_ORIENTATION_HORIZONTAL ) |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
405 size = allocation->height; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
406 else |
2223
6b34a88b1408
statusicon: more elegant solution, workaround removed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2222
diff
changeset
|
407 size = allocation->width;*/ |
6b34a88b1408
statusicon: more elegant solution, workaround removed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2222
diff
changeset
|
408 |
6b34a88b1408
statusicon: more elegant solution, workaround removed
Eugene Zagidullin <e.asphyx@gmail.com>
parents:
2222
diff
changeset
|
409 size = MAX(allocation->height, allocation->width); /* some WMs doesn't report orientation correctly --asphyx */ |
440
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
410 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
411 if ( prev_size != size ) |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
412 { |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
413 prev_size = size; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
414 g_object_set_data( G_OBJECT(image) , "size" , GINT_TO_POINTER(size) ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
415 si_ui_statusicon_image_update( image ); |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
416 } |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
417 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
418 return; |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
419 } |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
420 |
84fdf898438b
[svn] - status icon plugin: try to auto-detect the correct size for the status icon
giacomo
parents:
439
diff
changeset
|
421 |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
422 static void |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
423 si_ui_statusicon_smallmenu_show ( gint x, gint y, guint button, guint32 time , gpointer evbox ) |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
424 { |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
425 GtkWidget *si_smenu = g_object_get_data( G_OBJECT(evbox) , "smenu" ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
426 gtk_menu_popup( GTK_MENU(si_smenu) , NULL , NULL , NULL , NULL , button , time ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
427 } |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
428 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
429 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
430 static GtkWidget * |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
431 si_ui_statusicon_smallmenu_create ( void ) |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
432 { |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
433 GtkWidget *si_smenu = gtk_menu_new(); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
434 GtkWidget *si_smenu_prev_item, *si_smenu_play_item, *si_smenu_pause_item; |
855
fbf1f593b0c6
[svn] statusicon: added a open-file item in the small right-click menu
giacomo
parents:
854
diff
changeset
|
435 GtkWidget *si_smenu_stop_item, *si_smenu_next_item, *si_smenu_sep_item, *si_smenu_eject_item; |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
436 GtkWidget *si_smenu_quit_item; |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
437 |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
438 si_smenu_eject_item = gtk_image_menu_item_new_from_stock( |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
439 GTK_STOCK_OPEN , NULL ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
440 g_signal_connect_swapped( si_smenu_eject_item , "activate" , |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
441 G_CALLBACK(si_audacious_playback_ctrl) , |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
442 GINT_TO_POINTER(SI_AUDACIOUS_PLAYBACK_CTRL_EJECT) ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
443 gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_eject_item ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
444 gtk_widget_show(si_smenu_eject_item); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
445 si_smenu_sep_item = gtk_separator_menu_item_new(); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
446 gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_sep_item ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
447 gtk_widget_show(si_smenu_sep_item); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
448 si_smenu_prev_item = gtk_image_menu_item_new_from_stock( |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
449 GTK_STOCK_MEDIA_PREVIOUS , NULL ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
450 g_signal_connect_swapped( si_smenu_prev_item , "activate" , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
451 G_CALLBACK(si_audacious_playback_ctrl) , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
452 GINT_TO_POINTER(SI_AUDACIOUS_PLAYBACK_CTRL_PREV) ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
453 gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_prev_item ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
454 gtk_widget_show(si_smenu_prev_item); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
455 si_smenu_play_item = gtk_image_menu_item_new_from_stock( |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
456 GTK_STOCK_MEDIA_PLAY , NULL ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
457 g_signal_connect_swapped( si_smenu_play_item , "activate" , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
458 G_CALLBACK(si_audacious_playback_ctrl) , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
459 GINT_TO_POINTER(SI_AUDACIOUS_PLAYBACK_CTRL_PLAY) ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
460 gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_play_item ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
461 gtk_widget_show(si_smenu_play_item); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
462 si_smenu_pause_item = gtk_image_menu_item_new_from_stock( |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
463 GTK_STOCK_MEDIA_PAUSE , NULL ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
464 g_signal_connect_swapped( si_smenu_pause_item , "activate" , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
465 G_CALLBACK(si_audacious_playback_ctrl) , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
466 GINT_TO_POINTER(SI_AUDACIOUS_PLAYBACK_CTRL_PAUSE) ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
467 gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_pause_item ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
468 gtk_widget_show(si_smenu_pause_item); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
469 si_smenu_stop_item = gtk_image_menu_item_new_from_stock( |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
470 GTK_STOCK_MEDIA_STOP , NULL ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
471 g_signal_connect_swapped( si_smenu_stop_item , "activate" , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
472 G_CALLBACK(si_audacious_playback_ctrl) , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
473 GINT_TO_POINTER(SI_AUDACIOUS_PLAYBACK_CTRL_STOP) ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
474 gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_stop_item ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
475 gtk_widget_show(si_smenu_stop_item); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
476 si_smenu_next_item = gtk_image_menu_item_new_from_stock( |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
477 GTK_STOCK_MEDIA_NEXT , NULL ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
478 g_signal_connect_swapped( si_smenu_next_item , "activate" , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
479 G_CALLBACK(si_audacious_playback_ctrl) , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
480 GINT_TO_POINTER(SI_AUDACIOUS_PLAYBACK_CTRL_NEXT) ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
481 gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_next_item ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
482 gtk_widget_show(si_smenu_next_item); |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
483 |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
484 if ( si_cfg.rclick_menu == SI_CFG_RCLICK_MENU_SMALL2 ) |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
485 { |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
486 si_smenu_sep_item = gtk_separator_menu_item_new(); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
487 gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_sep_item ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
488 gtk_widget_show(si_smenu_sep_item); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
489 si_smenu_quit_item = gtk_image_menu_item_new_from_stock( |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
490 GTK_STOCK_QUIT , NULL ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
491 g_signal_connect_swapped( si_smenu_quit_item , "activate" , |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
492 G_CALLBACK(si_audacious_quit) , NULL ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
493 gtk_menu_shell_append( GTK_MENU_SHELL(si_smenu) , si_smenu_quit_item ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
494 gtk_widget_show(si_smenu_quit_item); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
495 } |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
496 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
497 return si_smenu; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
498 } |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
499 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
500 |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
501 static void |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
502 si_ui_statusicon_smallmenu_recreate ( GtkWidget * evbox ) |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
503 { |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
504 GtkWidget *smenu = g_object_get_data( G_OBJECT(evbox) , "smenu" ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
505 gtk_widget_destroy( GTK_WIDGET(smenu) ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
506 smenu = si_ui_statusicon_smallmenu_create(); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
507 g_object_set_data( G_OBJECT(evbox) , "smenu" , smenu ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
508 recreate_smallmenu = FALSE; |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
509 return; |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
510 } |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
511 |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
512 |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
513 void |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
514 si_ui_statusicon_enable ( gboolean enable ) |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
515 { |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
516 static GtkWidget *si_evbox = NULL; |
2060 | 517 static si_aud_hook_tchange_prevs_t *si_aud_hook_tchange_prevs = NULL; |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
518 |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
519 if (( enable == TRUE ) && ( si_evbox == NULL )) |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
520 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
521 GtkWidget *si_image; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
522 GtkWidget *si_popup; |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
523 GtkWidget *si_smenu; |
886
f2fde7b4dccd
[svn] - statusicon: use function/define names that do not collide with gtk >= 2.10 internals (paranoia)
giacomo
parents:
855
diff
changeset
|
524 AudGtkTrayIcon *si_applet; |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
525 GtkRequisition req; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
526 GtkAllocation allocation; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
527 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
528 si_applet = si_ui_statusicon_create(); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
529 if ( si_applet == NULL ) |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
530 { |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
531 g_warning( "StatusIcon plugin: unable to create a status icon.\n" ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
532 return; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
533 } |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
534 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
535 si_image = gtk_image_new(); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
536 g_object_set_data( G_OBJECT(si_image) , "size" , GINT_TO_POINTER(0) ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
537 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
538 g_signal_connect( si_image , "size-allocate" , |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
539 G_CALLBACK(si_ui_statusicon_cb_image_sizalloc) , si_applet ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
540 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
541 si_evbox = gtk_event_box_new(); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
542 si_popup = audacious_fileinfopopup_create(); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
543 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
544 g_object_set_data( G_OBJECT(si_evbox) , "applet" , si_applet ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
545 |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
546 g_object_set_data( G_OBJECT(si_evbox) , "timer_id" , GINT_TO_POINTER(0) ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
547 g_object_set_data( G_OBJECT(si_evbox) , "timer_active" , GINT_TO_POINTER(0) ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
548 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
549 g_object_set_data( G_OBJECT(si_evbox) , "popup_active" , GINT_TO_POINTER(0) ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
550 g_object_set_data( G_OBJECT(si_evbox) , "popup" , si_popup ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
551 |
2161
e6522a66278a
applied a patch from chrome|debian, fixes bug#56
Cristi Magherusan <majeru@atheme-project.org>
parents:
2060
diff
changeset
|
552 g_signal_connect( G_OBJECT(si_evbox) , "button-release-event" , |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
553 G_CALLBACK(si_ui_statusicon_cb_btpress) , NULL ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
554 g_signal_connect( G_OBJECT(si_evbox) , "scroll-event" , |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
555 G_CALLBACK(si_ui_statusicon_cb_btscroll) , NULL ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
556 g_signal_connect_after( G_OBJECT(si_evbox) , "event-after" , |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
557 G_CALLBACK(si_ui_statusicon_cb_popup) , NULL ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
558 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
559 gtk_container_add( GTK_CONTAINER(si_evbox), si_image ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
560 gtk_container_add( GTK_CONTAINER(si_applet), si_evbox ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
561 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
562 gtk_widget_show_all( GTK_WIDGET(si_applet) ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
563 |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
564 gtk_widget_size_request( GTK_WIDGET(si_applet) , &req ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
565 allocation.x = 0; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
566 allocation.y = 0; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
567 allocation.width = req.width; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
568 allocation.height = req.height; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
569 gtk_widget_size_allocate( GTK_WIDGET(si_applet) , &allocation ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
570 |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
571 /* small menu that can be used in place of the audacious standard one */ |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
572 si_smenu = si_ui_statusicon_smallmenu_create(); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
573 g_object_set_data( G_OBJECT(si_evbox) , "smenu" , si_smenu ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
574 |
2060 | 575 aud_hook_associate( "playback begin" , si_ui_statusicon_cb_aud_hook_pbstart , si_evbox ); |
576 si_aud_hook_tchange_prevs = g_malloc0(sizeof(si_aud_hook_tchange_prevs_t)); | |
577 si_aud_hook_tchange_prevs->title = NULL; | |
578 si_aud_hook_tchange_prevs->filename = NULL; | |
579 si_aud_hook_tchange_prevs->evbox = si_evbox; | |
580 aud_hook_associate( "playlist set info" , si_ui_statusicon_cb_aud_hook_tchange , si_aud_hook_tchange_prevs ); | |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
581 |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
582 return; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
583 } |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
584 else |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
585 { |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
586 if ( si_evbox != NULL ) |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
587 { |
886
f2fde7b4dccd
[svn] - statusicon: use function/define names that do not collide with gtk >= 2.10 internals (paranoia)
giacomo
parents:
855
diff
changeset
|
588 AudGtkTrayIcon *si_applet = g_object_get_data( G_OBJECT(si_evbox) , "applet" ); |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
589 GtkWidget *si_smenu = g_object_get_data( G_OBJECT(si_evbox) , "smenu" ); |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
590 si_ui_statusicon_popup_timer_stop( si_evbox ); /* just in case the timer is active */ |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
591 gtk_widget_destroy( GTK_WIDGET(si_evbox) ); |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
592 gtk_widget_destroy( GTK_WIDGET(si_applet) ); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
593 gtk_widget_destroy( GTK_WIDGET(si_smenu) ); |
2060 | 594 aud_hook_dissociate( "playback begin" , si_ui_statusicon_cb_aud_hook_pbstart ); |
595 aud_hook_dissociate( "playlist set info" , si_ui_statusicon_cb_aud_hook_tchange ); | |
596 if ( si_aud_hook_tchange_prevs->title != NULL ) g_free( si_aud_hook_tchange_prevs->title ); | |
597 if ( si_aud_hook_tchange_prevs->filename != NULL ) g_free( si_aud_hook_tchange_prevs->filename ); | |
598 g_free( si_aud_hook_tchange_prevs ); | |
599 si_aud_hook_tchange_prevs = NULL; | |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
600 si_smenu = NULL; |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
601 si_evbox = NULL; |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
602 } |
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
542
diff
changeset
|
603 return; |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
604 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
605 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
606 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
607 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
608 void |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
609 si_ui_about_show ( void ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
610 { |
454 | 611 static GtkWidget *about_dlg = NULL; |
612 gchar *about_title; | |
613 gchar *about_text; | |
614 | |
615 if ( about_dlg != NULL ) | |
616 { | |
617 gtk_window_present( GTK_WINDOW(about_dlg) ); | |
618 return; | |
619 } | |
620 | |
621 about_title = g_strdup( _("About Status Icon Plugin") ); | |
622 about_text = g_strjoin( "" , "Status Icon Plugin " , SI_VERSION_PLUGIN , | |
623 _("\nwritten by Giacomo Lozito < james@develia.org >\n\n" | |
624 "This plugin provides a status icon, placed in\n" | |
625 "the system tray area of the window manager.\n") , NULL ); | |
626 | |
1677
f6f5603a0954
xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents:
1442
diff
changeset
|
627 about_dlg = audacious_info_dialog( about_title , about_text , _("Ok") , FALSE , NULL , NULL ); |
454 | 628 g_signal_connect( G_OBJECT(about_dlg) , "destroy" , |
629 G_CALLBACK(gtk_widget_destroyed), &about_dlg ); | |
630 g_free( about_text ); | |
631 g_free( about_title ); | |
632 | |
633 gtk_widget_show_all( about_dlg ); | |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
634 return; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
635 } |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
636 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
637 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
638 void |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
639 si_ui_prefs_cb_commit ( gpointer prefs_win ) |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
640 { |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
641 GSList *list = g_object_get_data( G_OBJECT(prefs_win) , "rcm_grp" ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
642 while ( list != NULL ) |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
643 { |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
644 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(list->data) ) == TRUE ) |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
645 { |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
646 si_cfg.rclick_menu = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(list->data),"val")); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
647 break; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
648 } |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
649 list = g_slist_next(list); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
650 } |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
651 |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
652 list = g_object_get_data( G_OBJECT(prefs_win) , "msa_grp" ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
653 while ( list != NULL ) |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
654 { |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
655 if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(list->data) ) == TRUE ) |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
656 { |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
657 si_cfg.scroll_action = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(list->data),"val")); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
658 break; |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
659 } |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
660 list = g_slist_next(list); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
661 } |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
662 |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
663 si_cfg_save(); |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
664 |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
665 /* request the recreation of status icon small-menu if necessary */ |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
666 if ( si_cfg.rclick_menu != SI_CFG_RCLICK_MENU_AUD ) |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
667 recreate_smallmenu = TRUE; |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
668 |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
669 gtk_widget_destroy( GTK_WIDGET(prefs_win) ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
670 } |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
671 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
672 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
673 void |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
674 si_ui_prefs_show ( void ) |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
675 { |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
676 static GtkWidget *prefs_win = NULL; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
677 GtkWidget *prefs_vbox; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
678 GtkWidget *prefs_rclick_frame, *prefs_rclick_vbox; |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
679 GtkWidget *prefs_rclick_audmenu_rbt, *prefs_rclick_smallmenu1_rbt, *prefs_rclick_smallmenu2_rbt; |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
680 GtkWidget *prefs_scroll_frame, *prefs_scroll_vbox; |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
681 GtkWidget *prefs_scroll_vol_rbt, *prefs_scroll_skip_rbt; |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
682 GtkWidget *prefs_bbar_bbox; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
683 GtkWidget *prefs_bbar_bt_ok, *prefs_bbar_bt_cancel; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
684 GdkGeometry prefs_win_hints; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
685 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
686 if ( prefs_win != NULL ) |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
687 { |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
688 gtk_window_present( GTK_WINDOW(prefs_win) ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
689 return; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
690 } |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
691 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
692 prefs_win = gtk_window_new( GTK_WINDOW_TOPLEVEL ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
693 gtk_window_set_type_hint( GTK_WINDOW(prefs_win), GDK_WINDOW_TYPE_HINT_DIALOG ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
694 gtk_window_set_position( GTK_WINDOW(prefs_win), GTK_WIN_POS_CENTER ); |
920 | 695 gtk_window_set_title( GTK_WINDOW(prefs_win), _("Status Icon Plugin - Preferences") ); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
696 gtk_container_set_border_width( GTK_CONTAINER(prefs_win) , 10 ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
697 prefs_win_hints.min_width = 320; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
698 prefs_win_hints.min_height = -1; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
699 gtk_window_set_geometry_hints( GTK_WINDOW(prefs_win) , GTK_WIDGET(prefs_win) , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
700 &prefs_win_hints , GDK_HINT_MIN_SIZE ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
701 g_signal_connect( G_OBJECT(prefs_win) , "destroy" , G_CALLBACK(gtk_widget_destroyed) , &prefs_win ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
702 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
703 prefs_vbox = gtk_vbox_new( FALSE , 0 ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
704 gtk_container_add( GTK_CONTAINER(prefs_win) , prefs_vbox ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
705 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
706 prefs_rclick_frame = gtk_frame_new( _("Right-Click Menu") ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
707 prefs_rclick_vbox = gtk_vbox_new( TRUE , 0 ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
708 gtk_container_set_border_width( GTK_CONTAINER(prefs_rclick_vbox) , 6 ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
709 gtk_container_add( GTK_CONTAINER(prefs_rclick_frame) , prefs_rclick_vbox ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
710 prefs_rclick_audmenu_rbt = gtk_radio_button_new_with_label( NULL , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
711 _("Audacious standard menu") ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
712 g_object_set_data( G_OBJECT(prefs_rclick_audmenu_rbt) , "val" , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
713 GINT_TO_POINTER(SI_CFG_RCLICK_MENU_AUD) ); |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
714 prefs_rclick_smallmenu1_rbt = gtk_radio_button_new_with_label_from_widget( |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
715 GTK_RADIO_BUTTON(prefs_rclick_audmenu_rbt) , |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
716 _("Small playback menu #1") ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
717 g_object_set_data( G_OBJECT(prefs_rclick_smallmenu1_rbt) , "val" , |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
718 GINT_TO_POINTER(SI_CFG_RCLICK_MENU_SMALL1) ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
719 prefs_rclick_smallmenu2_rbt = gtk_radio_button_new_with_label_from_widget( |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
720 GTK_RADIO_BUTTON(prefs_rclick_audmenu_rbt) , |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
721 _("Small playback menu #2") ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
722 g_object_set_data( G_OBJECT(prefs_rclick_smallmenu2_rbt) , "val" , |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
723 GINT_TO_POINTER(SI_CFG_RCLICK_MENU_SMALL2) ); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
724 g_object_set_data( G_OBJECT(prefs_win) , "rcm_grp" , |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
725 gtk_radio_button_get_group(GTK_RADIO_BUTTON(prefs_rclick_smallmenu1_rbt)) ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
726 switch ( si_cfg.rclick_menu ) |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
727 { |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
728 case SI_CFG_RCLICK_MENU_SMALL1: |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
729 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(prefs_rclick_smallmenu1_rbt) , TRUE ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
730 break; |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
731 case SI_CFG_RCLICK_MENU_SMALL2: |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
732 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(prefs_rclick_smallmenu2_rbt) , TRUE ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
733 break; |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
734 case SI_CFG_RCLICK_MENU_AUD: |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
735 default: |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
736 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(prefs_rclick_audmenu_rbt) , TRUE ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
737 break; |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
738 } |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
739 gtk_box_pack_start( GTK_BOX(prefs_rclick_vbox) , prefs_rclick_audmenu_rbt , TRUE , TRUE , 0 ); |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
740 gtk_box_pack_start( GTK_BOX(prefs_rclick_vbox) , prefs_rclick_smallmenu1_rbt , TRUE , TRUE , 0 ); |
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
741 gtk_box_pack_start( GTK_BOX(prefs_rclick_vbox) , prefs_rclick_smallmenu2_rbt , TRUE , TRUE , 0 ); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
742 gtk_box_pack_start( GTK_BOX(prefs_vbox) , prefs_rclick_frame , TRUE , TRUE , 0 ); |
962
9f0ac3bb82f4
[svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents:
920
diff
changeset
|
743 |
918
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
744 prefs_scroll_frame = gtk_frame_new( _("Mouse Scroll Action") ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
745 prefs_scroll_vbox = gtk_vbox_new( TRUE , 0 ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
746 gtk_container_set_border_width( GTK_CONTAINER(prefs_scroll_vbox) , 6 ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
747 gtk_container_add( GTK_CONTAINER(prefs_scroll_frame) , prefs_scroll_vbox ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
748 prefs_scroll_vol_rbt = gtk_radio_button_new_with_label( NULL , |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
749 _("Change volume") ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
750 g_object_set_data( G_OBJECT(prefs_scroll_vol_rbt) , "val" , |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
751 GINT_TO_POINTER(SI_CFG_SCROLL_ACTION_VOLUME) ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
752 prefs_scroll_skip_rbt = gtk_radio_button_new_with_label_from_widget( |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
753 GTK_RADIO_BUTTON(prefs_scroll_vol_rbt) , |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
754 _("Change playing song") ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
755 g_object_set_data( G_OBJECT(prefs_scroll_skip_rbt) , "val" , |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
756 GINT_TO_POINTER(SI_CFG_SCROLL_ACTION_SKIP) ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
757 g_object_set_data( G_OBJECT(prefs_win) , "msa_grp" , |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
758 gtk_radio_button_get_group(GTK_RADIO_BUTTON(prefs_scroll_skip_rbt)) ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
759 if ( si_cfg.scroll_action == SI_CFG_SCROLL_ACTION_VOLUME ) |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
760 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(prefs_scroll_vol_rbt) , TRUE ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
761 else |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
762 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(prefs_scroll_skip_rbt) , TRUE ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
763 gtk_box_pack_start( GTK_BOX(prefs_scroll_vbox) , prefs_scroll_vol_rbt , TRUE , TRUE , 0 ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
764 gtk_box_pack_start( GTK_BOX(prefs_scroll_vbox) , prefs_scroll_skip_rbt , TRUE , TRUE , 0 ); |
209bd85dc1b9
[svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents:
886
diff
changeset
|
765 gtk_box_pack_start( GTK_BOX(prefs_vbox) , prefs_scroll_frame , TRUE , TRUE , 0 ); |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
766 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
767 /* horizontal separator and buttons */ |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
768 gtk_box_pack_start( GTK_BOX(prefs_vbox) , gtk_hseparator_new() , FALSE , FALSE , 4 ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
769 prefs_bbar_bbox = gtk_hbutton_box_new(); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
770 gtk_button_box_set_layout( GTK_BUTTON_BOX(prefs_bbar_bbox) , GTK_BUTTONBOX_END ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
771 prefs_bbar_bt_cancel = gtk_button_new_from_stock( GTK_STOCK_CANCEL ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
772 g_signal_connect_swapped( G_OBJECT(prefs_bbar_bt_cancel) , "clicked" , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
773 G_CALLBACK(gtk_widget_destroy) , prefs_win ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
774 gtk_container_add( GTK_CONTAINER(prefs_bbar_bbox) , prefs_bbar_bt_cancel ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
775 prefs_bbar_bt_ok = gtk_button_new_from_stock( GTK_STOCK_OK ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
776 gtk_container_add( GTK_CONTAINER(prefs_bbar_bbox) , prefs_bbar_bt_ok ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
777 g_signal_connect_swapped( G_OBJECT(prefs_bbar_bt_ok) , "clicked" , |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
778 G_CALLBACK(si_ui_prefs_cb_commit) , prefs_win ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
779 gtk_box_pack_start( GTK_BOX(prefs_vbox) , prefs_bbar_bbox , FALSE , FALSE , 0 ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
780 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
781 gtk_widget_show_all( prefs_win ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
796
diff
changeset
|
782 } |