diff options
Diffstat (limited to 'meta/packages/networkmanager/files/applet-no-animation.patch')
| -rw-r--r-- | meta/packages/networkmanager/files/applet-no-animation.patch | 234 |
1 files changed, 234 insertions, 0 deletions
diff --git a/meta/packages/networkmanager/files/applet-no-animation.patch b/meta/packages/networkmanager/files/applet-no-animation.patch new file mode 100644 index 0000000000..d437fd0fc9 --- /dev/null +++ b/meta/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; | ||
