diff options
author | Richard Purdie <richard@openedhand.com> | 2008-02-06 21:07:15 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-02-06 21:07:15 +0000 |
commit | 7693a4f6722c1ba65346135bf8dc41ae6bd2074b (patch) | |
tree | a97ed10e11274d51181f84c50c77f1bfa4168762 /meta-extras | |
parent | 5d2296c8b5135e33de5883c8d7f128dc72502f84 (diff) | |
download | poky-7693a4f6722c1ba65346135bf8dc41ae6bd2074b.tar.gz |
networkmanager-applet: Remove animated icons improving functionality with sato
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3689 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta-extras')
-rw-r--r-- | meta-extras/packages/networkmanager/files/applet-no-animation.patch | 234 | ||||
-rw-r--r-- | meta-extras/packages/networkmanager/networkmanager-applet_svn.bb | 4 |
2 files changed, 237 insertions, 1 deletions
diff --git a/meta-extras/packages/networkmanager/files/applet-no-animation.patch b/meta-extras/packages/networkmanager/files/applet-no-animation.patch new file mode 100644 index 0000000000..d437fd0fc9 --- /dev/null +++ b/meta-extras/packages/networkmanager/files/applet-no-animation.patch | |||
@@ -0,0 +1,234 @@ | |||
1 | Index: trunk/src/applet.c | ||
2 | =================================================================== | ||
3 | --- trunk.orig/src/applet.c 2008-02-06 20:30:04.000000000 +0000 | ||
4 | +++ trunk/src/applet.c 2008-02-06 20:46:59.000000000 +0000 | ||
5 | @@ -111,8 +111,6 @@ | ||
6 | |||
7 | static void nma_init (NMApplet *applet) | ||
8 | { | ||
9 | - applet->animation_id = 0; | ||
10 | - applet->animation_step = 0; | ||
11 | applet->passphrase_dialog = NULL; | ||
12 | applet->icon_theme = NULL; | ||
13 | #ifdef ENABLE_NOTIFY | ||
14 | @@ -1006,20 +1004,6 @@ | ||
15 | } | ||
16 | } | ||
17 | |||
18 | -static gboolean | ||
19 | -vpn_animation_timeout (gpointer data) | ||
20 | -{ | ||
21 | - NMApplet *applet = NM_APPLET (data); | ||
22 | - | ||
23 | - foo_set_icon (applet, applet->vpn_connecting_icons[applet->animation_step], ICON_LAYER_VPN); | ||
24 | - | ||
25 | - applet->animation_step++; | ||
26 | - if (applet->animation_step >= NUM_VPN_CONNECTING_FRAMES) | ||
27 | - applet->animation_step = 0; | ||
28 | - | ||
29 | - return TRUE; | ||
30 | -} | ||
31 | - | ||
32 | static void | ||
33 | vpn_connection_state_changed (NMVPNConnection *connection, | ||
34 | NMVPNConnectionState state, | ||
35 | @@ -1030,10 +1014,6 @@ | ||
36 | |||
37 | switch (state) { | ||
38 | case NM_VPN_CONNECTION_STATE_ACTIVATED: | ||
39 | - if (applet->animation_id) { | ||
40 | - g_source_remove (applet->animation_id); | ||
41 | - applet->animation_id = 0; | ||
42 | - } | ||
43 | foo_set_icon (applet, applet->vpn_lock_icon, ICON_LAYER_VPN); | ||
44 | // vpn_connection_info_set_last_attempt_success (info, TRUE); | ||
45 | break; | ||
46 | @@ -1041,10 +1021,7 @@ | ||
47 | case NM_VPN_CONNECTION_STATE_NEED_AUTH: | ||
48 | case NM_VPN_CONNECTION_STATE_CONNECT: | ||
49 | case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET: | ||
50 | - if (applet->animation_id == 0) { | ||
51 | - applet->animation_step = 0; | ||
52 | - applet->animation_id = g_timeout_add (100, vpn_animation_timeout, applet); | ||
53 | - } | ||
54 | + foo_set_icon (applet, applet->network_connecting_icon, ICON_LAYER_VPN); | ||
55 | break; | ||
56 | case NM_VPN_CONNECTION_STATE_FAILED: | ||
57 | // vpn_connection_info_set_last_attempt_success (info, FALSE); | ||
58 | @@ -1053,10 +1030,6 @@ | ||
59 | g_hash_table_remove (applet->vpn_connections, nm_vpn_connection_get_name (connection)); | ||
60 | /* Fall through */ | ||
61 | default: | ||
62 | - if (applet->animation_id) { | ||
63 | - g_source_remove (applet->animation_id); | ||
64 | - applet->animation_id = 0; | ||
65 | - } | ||
66 | foo_set_icon (applet, NULL, ICON_LAYER_VPN); | ||
67 | break; | ||
68 | } | ||
69 | @@ -2295,45 +2268,6 @@ | ||
70 | } FooAnimationTimeoutInfo; | ||
71 | |||
72 | static void | ||
73 | -foo_animation_timeout_info_destroy (gpointer data) | ||
74 | -{ | ||
75 | - g_slice_free (FooAnimationTimeoutInfo, data); | ||
76 | -} | ||
77 | - | ||
78 | -static gboolean | ||
79 | -foo_animation_timeout (gpointer data) | ||
80 | -{ | ||
81 | - FooAnimationTimeoutInfo *info = (FooAnimationTimeoutInfo *) data; | ||
82 | - NMApplet *applet = info->applet; | ||
83 | - int stage = -1; | ||
84 | - | ||
85 | - switch (info->state) { | ||
86 | - case NM_DEVICE_STATE_PREPARE: | ||
87 | - stage = 0; | ||
88 | - break; | ||
89 | - case NM_DEVICE_STATE_CONFIG: | ||
90 | - stage = 1; | ||
91 | - break; | ||
92 | - case NM_DEVICE_STATE_IP_CONFIG: | ||
93 | - stage = 2; | ||
94 | - break; | ||
95 | - default: | ||
96 | - break; | ||
97 | - } | ||
98 | - | ||
99 | - if (stage >= 0) | ||
100 | - foo_set_icon (applet, | ||
101 | - applet->network_connecting_icons[stage][applet->animation_step], | ||
102 | - ICON_LAYER_LINK); | ||
103 | - | ||
104 | - applet->animation_step++; | ||
105 | - if (applet->animation_step >= NUM_CONNECTING_FRAMES) | ||
106 | - applet->animation_step = 0; | ||
107 | - | ||
108 | - return TRUE; | ||
109 | -} | ||
110 | - | ||
111 | -static void | ||
112 | foo_common_state_change (NMDevice *device, NMDeviceState state, NMApplet *applet) | ||
113 | { | ||
114 | FooAnimationTimeoutInfo *info; | ||
115 | @@ -2345,11 +2279,7 @@ | ||
116 | info = g_slice_new (FooAnimationTimeoutInfo); | ||
117 | info->applet = applet; | ||
118 | info->state = state; | ||
119 | - applet->animation_step = 0; | ||
120 | - applet->animation_id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, | ||
121 | - 100, foo_animation_timeout, | ||
122 | - info, | ||
123 | - foo_animation_timeout_info_destroy); | ||
124 | + foo_set_icon (applet, applet->network_connecting_icon, ICON_LAYER_LINK); | ||
125 | break; | ||
126 | case NM_DEVICE_STATE_ACTIVATED: | ||
127 | break; | ||
128 | @@ -2602,12 +2532,6 @@ | ||
129 | NMApplet *applet = NM_APPLET (user_data); | ||
130 | gboolean handled = FALSE; | ||
131 | |||
132 | - applet->animation_step = 0; | ||
133 | - if (applet->animation_id) { | ||
134 | - g_source_remove (applet->animation_id); | ||
135 | - applet->animation_id = 0; | ||
136 | - } | ||
137 | - | ||
138 | clear_active_connections (applet); | ||
139 | applet->active_connections = nm_client_get_active_connections (applet->nm_client); | ||
140 | |||
141 | @@ -3166,17 +3090,8 @@ | ||
142 | if (applet->wireless_100_icon) | ||
143 | g_object_unref (applet->wireless_100_icon); | ||
144 | |||
145 | - for (i = 0; i < NUM_CONNECTING_STAGES; i++) { | ||
146 | - int j; | ||
147 | - | ||
148 | - for (j = 0; j < NUM_CONNECTING_FRAMES; j++) | ||
149 | - if (applet->network_connecting_icons[i][j]) | ||
150 | - g_object_unref (applet->network_connecting_icons[i][j]); | ||
151 | - } | ||
152 | - | ||
153 | - for (i = 0; i < NUM_VPN_CONNECTING_FRAMES; i++) | ||
154 | - if (applet->vpn_connecting_icons[i]) | ||
155 | - g_object_unref (applet->vpn_connecting_icons[i]); | ||
156 | + if (applet->network_connecting_icon) | ||
157 | + g_object_unref (applet->network_connecting_icon); | ||
158 | |||
159 | nma_icons_zero (applet); | ||
160 | } | ||
161 | @@ -3196,16 +3111,7 @@ | ||
162 | applet->wireless_75_icon = NULL; | ||
163 | applet->wireless_100_icon = NULL; | ||
164 | |||
165 | - for (i = 0; i < NUM_CONNECTING_STAGES; i++) | ||
166 | - { | ||
167 | - int j; | ||
168 | - | ||
169 | - for (j = 0; j < NUM_CONNECTING_FRAMES; j++) | ||
170 | - applet->network_connecting_icons[i][j] = NULL; | ||
171 | - } | ||
172 | - | ||
173 | - for (i = 0; i < NUM_VPN_CONNECTING_FRAMES; i++) | ||
174 | - applet->vpn_connecting_icons[i] = NULL; | ||
175 | + applet->network_connecting_icon = NULL; | ||
176 | |||
177 | applet->icons_loaded = FALSE; | ||
178 | } | ||
179 | @@ -3257,28 +3163,7 @@ | ||
180 | ICON_LOAD(applet->wireless_75_icon, "nm-signal-75"); | ||
181 | ICON_LOAD(applet->wireless_100_icon, "nm-signal-100"); | ||
182 | |||
183 | - for (i = 0; i < NUM_CONNECTING_STAGES; i++) | ||
184 | - { | ||
185 | - int j; | ||
186 | - | ||
187 | - for (j = 0; j < NUM_CONNECTING_FRAMES; j++) | ||
188 | - { | ||
189 | - char *name; | ||
190 | - | ||
191 | - name = g_strdup_printf ("nm-stage%02d-connecting%02d", i+1, j+1); | ||
192 | - ICON_LOAD(applet->network_connecting_icons[i][j], name); | ||
193 | - g_free (name); | ||
194 | - } | ||
195 | - } | ||
196 | - | ||
197 | - for (i = 0; i < NUM_VPN_CONNECTING_FRAMES; i++) | ||
198 | - { | ||
199 | - char *name; | ||
200 | - | ||
201 | - name = g_strdup_printf ("nm-vpn-connecting%02d", i+1); | ||
202 | - ICON_LOAD(applet->vpn_connecting_icons[i], name); | ||
203 | - g_free (name); | ||
204 | - } | ||
205 | + ICON_LOAD(applet->network_connecting_icon, "nm-connecting"); | ||
206 | |||
207 | success = TRUE; | ||
208 | |||
209 | Index: trunk/src/applet.h | ||
210 | =================================================================== | ||
211 | --- trunk.orig/src/applet.h 2008-02-06 20:30:06.000000000 +0000 | ||
212 | +++ trunk/src/applet.h 2008-02-06 20:46:05.000000000 +0000 | ||
213 | @@ -111,20 +111,12 @@ | ||
214 | GdkPixbuf * wireless_50_icon; | ||
215 | GdkPixbuf * wireless_75_icon; | ||
216 | GdkPixbuf * wireless_100_icon; | ||
217 | -#define NUM_CONNECTING_STAGES 3 | ||
218 | -#define NUM_CONNECTING_FRAMES 11 | ||
219 | - GdkPixbuf * network_connecting_icons[NUM_CONNECTING_STAGES][NUM_CONNECTING_FRAMES]; | ||
220 | -#define NUM_VPN_CONNECTING_FRAMES 14 | ||
221 | - GdkPixbuf * vpn_connecting_icons[NUM_VPN_CONNECTING_FRAMES]; | ||
222 | + GdkPixbuf * network_connecting_icon; | ||
223 | GdkPixbuf * vpn_lock_icon; | ||
224 | |||
225 | /* Active status icon pixbufs */ | ||
226 | GdkPixbuf * icon_layers[ICON_LAYER_MAX + 1]; | ||
227 | |||
228 | - /* Animation stuff */ | ||
229 | - int animation_step; | ||
230 | - guint animation_id; | ||
231 | - | ||
232 | /* Direct UI elements */ | ||
233 | #ifdef HAVE_STATUS_ICON | ||
234 | GtkStatusIcon * status_icon; | ||
diff --git a/meta-extras/packages/networkmanager/networkmanager-applet_svn.bb b/meta-extras/packages/networkmanager/networkmanager-applet_svn.bb index d61e134e96..c6c4be425f 100644 --- a/meta-extras/packages/networkmanager/networkmanager-applet_svn.bb +++ b/meta-extras/packages/networkmanager/networkmanager-applet_svn.bb | |||
@@ -3,11 +3,13 @@ LICENSE = "GPL" | |||
3 | DEPENDS = "networkmanager dbus-glib libglade gconf gnome-keyring" | 3 | DEPENDS = "networkmanager dbus-glib libglade gconf gnome-keyring" |
4 | #TODO DEPENDS libnotify | 4 | #TODO DEPENDS libnotify |
5 | RDEPENDS = "networkmanager" | 5 | RDEPENDS = "networkmanager" |
6 | PR = "r1" | ||
6 | 7 | ||
7 | inherit gnome gtk-icon-cache | 8 | inherit gnome gtk-icon-cache |
8 | 9 | ||
9 | SRC_URI = "svn://svn.gnome.org/svn/network-manager-applet/;module=trunk;proto=http \ | 10 | SRC_URI = "svn://svn.gnome.org/svn/network-manager-applet/;module=trunk;proto=http \ |
10 | file://applet-no-gnome.diff;patch=1;pnum=0" | 11 | file://applet-no-gnome.diff;patch=1;pnum=0 \ |
12 | file://applet-no-animation.patch;patch=1" | ||
11 | 13 | ||
12 | PV = "0.0+svnr${SRCREV}" | 14 | PV = "0.0+svnr${SRCREV}" |
13 | 15 | ||