Changeset 51
- Timestamp:
- 04/24/07 12:55:17 (2 years ago)
- Files:
-
- osso-statusbar-cpu/trunk/Makefile.am (modified) (1 diff)
- osso-statusbar-cpu/trunk/configure.ac (modified) (3 diffs)
- osso-statusbar-cpu/trunk/debian/changelog (modified) (1 diff)
- osso-statusbar-cpu/trunk/debian/rules (modified) (1 diff)
- osso-statusbar-cpu/trunk/osso-statusbar-cpu.desktop (added)
- osso-statusbar-cpu/trunk/osso-statusbar-cpu.schemas (modified) (3 diffs)
- osso-statusbar-cpu/trunk/src/Makefile.am (modified) (1 diff)
- osso-statusbar-cpu/trunk/src/common.c (modified) (5 diffs)
- osso-statusbar-cpu/trunk/src/osso-applet-graph.c (modified) (14 diffs)
- osso-statusbar-cpu/trunk/src/osso-statusbar-combo.c (modified) (10 diffs)
- osso-statusbar-cpu/trunk/src/osso-statusbar-combo.h (modified) (2 diffs)
- osso-statusbar-cpu/trunk/src/osso-statusbar-cpu.c (deleted)
- osso-statusbar-cpu/trunk/src/osso-statusbar-cpu.h (deleted)
- osso-statusbar-cpu/trunk/src/osso-statusbar-mem.c (deleted)
- osso-statusbar-cpu/trunk/src/osso-statusbar-mem.h (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
osso-statusbar-cpu/trunk/Makefile.am
r3 r51 28 28 schemasdir=/etc/gconf/schemas 29 29 schemas_DATA=osso-statusbar-cpu.schemas 30 31 hildonstatusbardesktop_DATA=osso-statusbar-cpu.desktop osso-statusbar-cpu/trunk/configure.ac
r3 r51 2 2 3 3 # Mandatory, inits autoconf 4 AC_INIT(osso-statusbar-cpu, 0. 5.7)4 AC_INIT(osso-statusbar-cpu, 0.6.0) 5 5 6 6 # Tests that source dir exists … … 40 40 #return the flag 41 41 #CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wmissing-prototypes -Wmissing-declarations -Werror -Wunreachable-code -Wcast-align -std=c99" 42 CFLAGS="$CFLAGS - Wall -ansi -Wmissing-prototypes -Wmissing-declarations -Werror"42 CFLAGS="$CFLAGS -D_POSIX_SOURCE -W -Wall -ansi -Wmissing-prototypes -Wmissing-declarations -Werror" 43 43 AC_SUBST(CFLAGS) 44 44 … … 68 68 AC_SUBST(hildonstatusbarplugindir) 69 69 70 hildonstatusbardesktopdir=/usr/share/applications/hildon-status-bar 71 AC_SUBST(hildonstatusbardesktopdir) 72 70 73 hildoncontrolpanelappletdir=`pkg-config hildon-control-panel --variable=pluginlibdir` 71 74 AC_SUBST(hildoncontrolpanelappletdir) osso-statusbar-cpu/trunk/debian/changelog
r3 r51 1 osso-statusbar-cpu (0.6.0) mistral; urgency=low 2 3 * First version for bora. 4 5 -- Santtu Lakkala <inz@inz.fi> Tue, 24 Apr 2007 11:31:49 +0300 6 1 7 osso-statusbar-cpu (0.5.7) mistral; urgency=low 2 8 osso-statusbar-cpu/trunk/debian/rules
r3 r51 88 88 # dh_installpam 89 89 # dh_installmime 90 dh_gconf90 # dh_gconf 91 91 dh_installinit -- defaults 60 40 92 92 # dh_installcron osso-statusbar-cpu/trunk/osso-statusbar-cpu.schemas
r3 r51 7 7 <owner>osso-statusbar-cpu</owner> 8 8 <type>bool</type> 9 <default> false</default>9 <default>true</default> 10 10 <locale name="C"> 11 11 <short>Show CPU applet</short> … … 27 27 <owner>osso-statusbar-cpu</owner> 28 28 <type>bool</type> 29 <default> false</default>29 <default>true</default> 30 30 <locale name="C"> 31 31 <short>Show MEM applet</short> … … 40 40 <locale name="C"> 41 41 <short>Colour of mem graph</short> 42 </locale>43 </schema>44 <schema>45 <key>/schemas/apps/osso/graph/combo_on</key>46 <applyto>/apps/osso/graph/combo_on</applyto>47 <owner>osso-statusbar-cpu</owner>48 <type>bool</type>49 <default>true</default>50 <locale name="C">51 <short>Show combo applet</short>52 42 </locale> 53 43 </schema> osso-statusbar-cpu/trunk/src/Makefile.am
r3 r51 4 4 AM_LDFLAGS = -module -avoid-version 5 5 6 hildonstatusbarplugin_LTLIBRARIES = libc pu.la libmem.la libcombo.la6 hildonstatusbarplugin_LTLIBRARIES = libcombo.la 7 7 hildoncontrolpanelapplet_LTLIBRARIES = libgraph.la 8 8 hildoncontrolpaneldesktop_DATA = cpgraph.desktop 9 9 10 libcpu_la_LIBADD = $(DEPS_LIBS)11 libmem_la_LIBADD = $(DEPS_LIBS)12 10 libcombo_la_LIBADD = $(DEPS_LIBS) 13 11 libgraph_la_LIBADD = $(DEPS_LIBS) 14 12 15 libcpu_la_SOURCES = osso-statusbar-cpu.c osso-statusbar-cpu.h \16 common.c dialog.c dialog.h common.h17 libmem_la_SOURCES = osso-statusbar-mem.c osso-statusbar-mem.h \18 common.c dialog.c dialog.h common.h19 13 libcombo_la_SOURCES = osso-statusbar-combo.c osso-statusbar-combo.h \ 20 14 common.c dialog.c dialog.h common.h osso-statusbar-cpu/trunk/src/common.c
r3 r51 15 15 guchar r, guchar g, guchar b, guint xx, guint w) 16 16 { 17 int x, y;18 int width, height, rowstride, n_channels;17 guint x, y; 18 guint width, height, rowstride, n_channels; 19 19 guchar *pixels, *p, *p0; 20 20 … … 101 101 102 102 void popup_place(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data) { 103 GtkRequisition req; 103 104 GtkWidget *btn = GTK_WIDGET(user_data); 105 gint sw; 106 107 (void)push_in; 108 109 gtk_widget_size_request(GTK_WIDGET(menu), &req); 110 sw = gdk_screen_get_width(gtk_widget_get_screen(btn)); 104 111 105 112 gdk_window_get_position(btn->window, x, y); … … 107 114 *y += btn->allocation.y + btn->allocation.height; 108 115 *x += btn->allocation.x; 116 117 if (*x + req.width > sw) { 118 *x -= req.width - btn->allocation.width; 119 } 109 120 } 110 121 … … 170 181 GtkWidget *entry; 171 182 183 (void)item; 184 (void)user_data; 185 172 186 dialog = gtk_dialog_new_with_buttons("Run command", 173 187 NULL, … … 265 279 static void run_settings(GtkMenuItem *item, gpointer user_data) 266 280 { 281 (void)item; 267 282 osso_cp_plugin_execute((osso_context_t *)user_data, "libgraph.so", NULL, TRUE); 268 283 } osso-statusbar-cpu/trunk/src/osso-applet-graph.c
r3 r51 43 43 GraphApplet applet; 44 44 gint response = GRAPH_RESPONSE_COMMANDS; 45 46 /* (void) bindtextdomain(PACKAGE, LOCALEDIR); */ 45 46 (void)user_activated; 47 47 48 48 /* Create the main dialog and refresh the ui */ … … 69 69 gconf_client_set_bool(applet.gcc, GCONF_PATH_CLOCK_ON, 70 70 applet.flags & CLOCK ? TRUE : FALSE, NULL); 71 if (applet.flags & COMBO) { 72 gconf_client_set_bool(applet.gcc, GCONF_PATH_CPU_ON, 73 FALSE, NULL); 74 gconf_client_set_bool(applet.gcc, GCONF_PATH_MEM_ON, 75 FALSE, NULL); 76 gconf_client_set_bool(applet.gcc, GCONF_PATH_COMBO_ON, 77 TRUE, NULL); 78 osso_statusbar_send_event(applet.osso, "cpu", 79 1, 0, "", NULL); 80 osso_statusbar_send_event(applet.osso, "mem", 81 1, 0, "", NULL); 82 osso_statusbar_send_event(applet.osso, "combo", 83 1, 1, "", NULL); 84 } else { 85 gconf_client_set_bool(applet.gcc, GCONF_PATH_COMBO_ON, 86 FALSE, 87 NULL); 88 gconf_client_set_bool(applet.gcc, GCONF_PATH_CPU_ON, 89 (applet.flags & CPU_ON ? TRUE : FALSE), 90 NULL); 91 gconf_client_set_bool(applet.gcc, GCONF_PATH_MEM_ON, 92 (applet.flags & MEM_ON ? TRUE : FALSE), 93 NULL); 94 osso_statusbar_send_event(applet.osso, "cpu", 95 1, (applet.flags & CPU_ON ? 1 : 0), 96 "", NULL); 97 osso_statusbar_send_event(applet.osso, "mem", 98 1, (applet.flags & MEM_ON ? 1 : 0), 99 "", NULL); 100 osso_statusbar_send_event(applet.osso, "combo", 101 1, 0, "", NULL); 102 } 71 gconf_client_set_bool(applet.gcc, GCONF_PATH_CPU_ON, 72 applet.flags & CPU_ON ? TRUE : FALSE, NULL); 73 gconf_client_set_bool(applet.gcc, GCONF_PATH_MEM_ON, 74 applet.flags & MEM_ON ? TRUE : FALSE, NULL); 103 75 gconf_client_set_int(applet.gcc, GCONF_PATH_CPU_COLOR, 104 76 applet.cpu_color, NULL); … … 107 79 update_cmds(gtk_tree_view_get_model(GTK_TREE_VIEW(applet.commands_list)), 108 80 applet.gcc); 81 gconf_client_unset(applet.gcc, GCONF_PATH_COMBO_ON, NULL); 109 82 } 110 83 … … 185 158 NULL); 186 159 187 if (b_combine) { 188 b_show_cpu = TRUE; 189 b_show_mem = TRUE; 190 } 191 applet->flags = b_combine * COMBO | 192 b_show_cpu * CPU_ON | 193 b_show_mem * MEM_ON | 194 b_clock * CLOCK; 160 g_debug("cb: %d, cp: %d, me: %d", b_combine, b_show_cpu, b_show_mem); 161 if (b_combine || (b_show_cpu && b_show_mem)) { 162 b_show_cpu = FALSE; 163 b_show_mem = FALSE; 164 applet->flags = CPU_ON | MEM_ON | b_clock * CLOCK; 165 } else { 166 applet->flags = b_show_cpu * CPU_ON | 167 b_show_mem * MEM_ON | 168 b_clock * CLOCK; 169 } 170 g_debug("cb: %d, cp: %d, me: %d", b_combine, b_show_cpu, b_show_mem); 195 171 196 172 applet->dialog = … … 212 188 size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 213 189 214 show_cpu = gtk_check_button_new(); 215 216 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(show_cpu), 217 b_show_cpu); 190 show_cpu = gtk_radio_button_new(NULL); 218 191 219 192 cpu_caption = hildon_caption_new(size_group, _("Show CPU usage"), … … 237 210 applet); 238 211 239 show_mem = gtk_check_button_new(); 240 241 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(show_mem), 242 b_show_mem); 212 show_mem = gtk_radio_button_new(gtk_radio_button_get_group( 213 GTK_RADIO_BUTTON(show_cpu))); 243 214 244 215 mem_caption = hildon_caption_new(size_group, _("Show mem usage"), … … 277 248 ); 278 249 279 applet->combo_check = gtk_check_button_new(); 280 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(applet->combo_check), 281 b_combine); 250 applet->combo_check = gtk_radio_button_new(gtk_radio_button_get_group( 251 GTK_RADIO_BUTTON(show_cpu))); 252 253 if (b_show_mem) { 254 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(show_mem), 255 TRUE); 256 } else if (b_show_cpu) { 257 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(show_cpu), 258 TRUE); 259 } else { 260 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(applet->combo_check), 261 TRUE); 262 } 282 263 applet->combo_caption = hildon_caption_new(size_group, 283 _(" Combine graphs"), applet->combo_check, NULL,264 _("Both"), applet->combo_check, NULL, 284 265 HILDON_CAPTION_OPTIONAL); 285 266 … … 290 271 _("Show clock"), applet->clock_check, NULL, 291 272 HILDON_CAPTION_OPTIONAL); 292 293 gtk_widget_set_sensitive(applet->combo_caption,294 b_show_cpu && b_show_mem);295 gtk_widget_set_sensitive(applet->clock_caption,296 b_show_cpu || b_show_mem);297 273 298 274 g_signal_connect_after(G_OBJECT(applet->combo_check), … … 375 351 osso_return_t save_state(osso_context_t * osso, gpointer data) 376 352 { 353 (void)osso; 354 (void)data; 377 355 return OSSO_OK; 378 356 } … … 386 364 static void show_cpu_toggled(GtkWidget *widget, GraphApplet *applet) 387 365 { 388 applet->flags &= ~CPU_ON; 389 applet->flags |= gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) * CPU_ON; 390 gconf_client_clear_cache(applet->gcc); 391 while (gtk_events_pending()) 392 gtk_main_iteration(); 393 if (applet->flags & (CPU_ON | MEM_ON)) { 394 gtk_widget_set_sensitive(applet->clock_caption, TRUE); 395 } 396 else { 397 gtk_widget_set_sensitive(applet->clock_caption, FALSE); 398 } 399 if ((applet->flags & (CPU_ON | MEM_ON)) == (CPU_ON | MEM_ON)) { 400 gtk_widget_set_sensitive(applet->combo_caption, TRUE); 401 } else { 402 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(applet->combo_check), FALSE); 403 gtk_widget_set_sensitive(applet->combo_caption, FALSE); 366 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { 367 applet->flags &= ~MEM_ON; 368 applet->flags |= CPU_ON; 404 369 } 405 370 } … … 407 372 static void show_mem_toggled(GtkWidget *widget, GraphApplet *applet) 408 373 { 409 applet->flags &= ~MEM_ON; 410 applet->flags |= gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) * MEM_ON; 411 gconf_client_clear_cache(applet->gcc); 412 while (gtk_events_pending()) 413 gtk_main_iteration(); 414 if (applet->flags & (CPU_ON | MEM_ON)) { 415 gtk_widget_set_sensitive(applet->clock_caption, TRUE); 416 } 417 else { 418 gtk_widget_set_sensitive(applet->clock_caption, FALSE); 419 } 420 if ((applet->flags & (CPU_ON | MEM_ON)) == (CPU_ON | MEM_ON)) { 421 gtk_widget_set_sensitive(applet->combo_caption, TRUE); 422 } else { 423 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(applet->combo_check), FALSE); 424 gtk_widget_set_sensitive(applet->combo_caption, FALSE); 374 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { 375 applet->flags &= ~CPU_ON; 376 applet->flags |= MEM_ON; 425 377 } 426 378 } … … 428 380 static void combo_toggled(GtkWidget *widget, GraphApplet *applet) 429 381 { 430 applet->flags &= ~COMBO; 431 applet->flags |= gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) * COMBO; 432 gconf_client_clear_cache(applet->gcc); 433 while (gtk_events_pending()) 434 gtk_main_iteration(); 382 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { 383 applet->flags |= MEM_ON | CPU_ON; 384 } 435 385 } 436 386 … … 617 567 GtkTreeModel *model; 618 568 569 (void)button; 570 619 571 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(applet->commands_list)); 620 572 … … 639 591 GtkTreeModel *model; 640 592 593 (void)button; 594 641 595 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(applet->commands_list)); 642 596 osso-statusbar-cpu/trunk/src/osso-statusbar-combo.c
r3 r51 35 35 36 36 static gboolean my_timeout(gpointer data); 37 static void cpuon_gconf_handler(GConfClient *gcc, 38 guint con, 39 GConfEntry *entry, gpointer user_data); 40 static void memon_gconf_handler(GConfClient *gcc, 41 guint con, 42 GConfEntry *entry, gpointer user_data); 37 43 static void my_gconf_handler(GConfClient * gcc, 38 44 guint conn, … … 99 105 info->icon = gtk_image_new_from_pixbuf(icon_pixbuf); 100 106 107 info->show_cpu = gconf_client_get_bool(info->gcc, 108 GCONF_PATH_CPU_ON, NULL); 109 info->show_mem = gconf_client_get_bool(info->gcc, 110 GCONF_PATH_MEM_ON, NULL); 111 101 112 info->color_cpu = gc_get_int_fall(info->gcc, 102 113 GCONF_PATH_CPU_COLOR, CPU_DEFAULT); … … 114 125 *button = info->button; 115 126 116 info->notify_id = g_timeout_add(2000, my_timeout, info); 127 info->notify_id = 0; 128 if (info->show_cpu || info->show_mem) { 129 info->notify_id = g_timeout_add(2000, my_timeout, info); 130 } 117 131 118 132 gconf_client_add_dir(info->gcc, 119 133 GCONF_PATH, GCONF_CLIENT_PRELOAD_NONE, NULL); 134 135 info->gc_notify_id_scpu = gconf_client_notify_add(info->gcc, 136 GCONF_PATH_CPU_ON, 137 cpuon_gconf_handler, 138 info, NULL, NULL); 139 140 info->gc_notify_id_smem = gconf_client_notify_add(info->gcc, 141 GCONF_PATH_MEM_ON, 142 memon_gconf_handler, 143 info, NULL, NULL); 120 144 121 145 info->gc_notify_id_cpu = gconf_client_notify_add(info->gcc, … … 143 167 144 168 gconf_client_clear_cache(info->gcc); 145 if (!gconf_client_get_bool(info->gcc, GCONF_PATH_COMBO_ON, NULL)) { 146 gtk_object_destroy(GTK_OBJECT(item)); 147 } else { 148 gtk_widget_show_all(info->button); 149 } 169 gtk_widget_show_all(info->button); 150 170 151 171 return info; … … 163 183 info->notify_id = 0; 164 184 185 gconf_client_notify_remove(info->gcc, info->gc_notify_id_scpu); 186 gconf_client_notify_remove(info->gcc, info->gc_notify_id_smem); 165 187 gconf_client_notify_remove(info->gcc, info->gc_notify_id_cpu); 166 188 gconf_client_notify_remove(info->gcc, info->gc_notify_id_mem); … … 178 200 gint combo_get_priority(void *data) 179 201 { 202 (void)data; 180 203 return HILDON_STATUS_BAR_CPU_PRIORITY; 181 204 } … … 185 208 PluginInfo *info = (PluginInfo *)data; 186 209 g_return_if_fail(info); 210 211 (void)value1; 212 (void)str; 187 213 188 214 if (value2 == 0) … … 197 223 GdkPixbuf *buf = gtk_image_get_pixbuf(image); 198 224 199 FILE *foo = fopen("/proc/stat", "r"); 200 int user, nice, kern, idle, total_change; 225 int user, nice, kern, idle, total_change = 0; 201 226 static int old_user, old_nice, old_kern, old_idle; 202 int muser, mnice, mkern, midle; 203 fscanf(foo, "cpu %d %d %d %d", &user, &nice, &kern, &idle); 204 fclose(foo); 205 foo = fopen("/proc/meminfo", "r"); 206 fscanf(foo, 207 "MemTotal: %d kB MemFree: %d kB Buffers: %d kB Cached: %d kB", 208 &muser, &mnice, &mkern, &midle); 209 fclose(foo); 210 211 total_change = user + nice + kern + idle - 212 (old_user + old_nice + old_kern + old_idle); 213 214 move_left_and_draw(buf, 215 (user - old_user) * AREA_H / (total_change), 216 (nice - old_nice) * AREA_H / (total_change), 217 (kern - old_kern) * AREA_H / (total_change), 218 (info->color_cpu >> 16) & 0xff, 219 (info->color_cpu >> 8) & 0xff, 220 info->color_cpu & 0xff, 221 AREA_X, AREA_W / 2); 222 move_left_and_draw(buf, 223 (muser - mnice - mkern - midle) * AREA_H / muser, 224 mkern * AREA_H / muser, 225 midle * AREA_H / muser, 226 (info->color_mem >> 16) & 0xff, 227 (info->color_mem >> 8) & 0xff, 228 info->color_mem & 0xff, 229 AREA_X + AREA_W / 2, (AREA_W + 1) / 2); 227 int muser, mnice, mkern, midle, mused = 0; 228 int w = (info->show_cpu && info->show_mem) ? AREA_W : AREA_W * 2; 229 int x = info->show_cpu ? AREA_X + AREA_W / 2 : AREA_X; 230 231 if (info->show_cpu) { 232 FILE *foo = fopen("/proc/stat", "r"); 233 fscanf(foo, "cpu %d %d %d %d", &user, &nice, &kern, &idle); 234 fclose(foo); 235 total_change = user + nice + kern + idle - 236 (old_user + old_nice + old_kern + old_idle); 237 } 238 if (info->show_mem) { 239 FILE *foo = fopen("/proc/meminfo", "r"); 240 fscanf(foo, 241 "MemTotal: %d kB MemFree: %d kB " 242 "Buffers: %d kB Cached: %d kB", 243 &muser, &mnice, &mkern, &midle); 244 fclose(foo); 245 mused = muser - mnice - mkern - midle; 246 } 247 248 if (info->show_cpu) 249 move_left_and_draw(buf, 250 (user - old_user) * AREA_H / (total_change), 251 (nice - old_nice) * AREA_H / (total_change), 252 (kern - old_kern) * AREA_H / (total_change), 253 (info->color_cpu >> 16) & 0xff, 254 (info->color_cpu >> 8) & 0xff, 255 info->color_cpu & 0xff, 256 AREA_X, w / 2); 257 if (info->show_mem) 258 move_left_and_draw(buf, 259 mused * AREA_H / muser, 260 mkern * AREA_H / muser, 261 midle * AREA_H / muser, 262 (info->color_mem >> 16) & 0xff, 263 (info->color_mem >> 8) & 0xff, 264 info->color_mem & 0xff, 265 x, (w + 1) / 2); 230 266 231 267 gtk_image_set_from_pixbuf(image, buf); 232 268 233 old_user = user; 234 old_nice = nice; 235 old_kern = kern; 236 old_idle = idle; 269 if (info->show_cpu) { 270 old_user = user; 271 old_nice = nice; 272 old_kern = kern; 273 old_idle = idle; 274 } 237 275 238 276 return TRUE; 277 } 278 279 static void cpuon_gconf_handler(GConfClient *gcc, 280 guint con, 281 GConfEntry *entry, gpointer user_data) 282 { 283 PluginInfo *info = user_data; 284 285 (void)gcc; 286 (void)con; 287 288 info->show_cpu = gconf_value_get_bool(entry->value); 289 290 if (info->show_cpu) { 291 if (!info->notify_id) { 292 info->notify_id = 293 g_timeout_add(2000, my_timeout, user_data); 294 } 295 } else if (!info->show_mem && info->notify_id) { 296 g_source_remove(info->notify_id); 297 info->notify_id = 0; 298 } 299 } 300 301 static void memon_gconf_handler(GConfClient *gcc, 302 guint con, 303 GConfEntry *entry, gpointer user_data) 304 { 305 PluginInfo *info = user_data; 306 307 (void)gcc; 308 (void)con; 309 310 info->show_mem = gconf_value_get_bool(entry->value); 311 312 313 if (info->show_mem) { 314 if (!info->notify_id) { 315 info->notify_id = 316 g_timeout_add(2000, my_timeout, user_data); 317 } 318 } else if (!info->show_cpu && info->notify_id) { 319 g_source_remove(info->notify_id); 320 info->notify_id = 0; 321 } 239 322 } 240 323 … … 243 326 { 244 327 PluginInfo *info = (PluginInfo *)data; 328 329 (void)gcc; 330 (void)conn; 245 331 246 332 if (strcmp(entry->key, GCONF_PATH_CPU_COLOR) == 0) { … … 257 343 { 258 344 PluginInfo *info = (PluginInfo *)data; 345 346 (void)gcc; 347 (void)conn; 259 348 260 349 info->clock = gconf_value_get_bool(gconf_entry_get_value(entry) osso-statusbar-cpu/trunk/src/osso-statusbar-combo.h
r3 r51 18 18 osso_context_t *osso; 19 19 guint notify_id; 20 guint gc_notify_id_scpu; 21 guint gc_notify_id_smem; 20 22 guint gc_notify_id_cpu; 21 23 guint gc_notify_id_mem; … … 25 27 gboolean clock; 26 28 gulong clock_id; 29 gboolean show_cpu; 30 gboolean show_mem; 27 31 } PluginInfo; 28 32
