|
Lines 291-302
Link Here
|
| 291 |
|
291 |
|
| 292 |
const gchar *name; |
292 |
const gchar *name; |
| 293 |
const gchar *desc; |
293 |
const gchar *desc; |
|
|
294 |
gchar *package_name; |
| 294 |
|
295 |
|
| 295 |
const gchar *comment; |
296 |
const gchar *comment; |
| 296 |
|
297 |
|
| 297 |
const gchar *key; |
298 |
const gchar *key; |
| 298 |
gchar *markup; |
299 |
gchar *markup; |
| 299 |
|
300 |
|
|
|
301 |
gboolean supports_package_management; |
| 300 |
/*Fixme - need to address the entire gconf key location issue */ |
302 |
/*Fixme - need to address the entire gconf key location issue */ |
| 301 |
/*Fixme - this is just a temporary stop gap */ |
303 |
/*Fixme - this is just a temporary stop gap */ |
| 302 |
gboolean use_new_prefix; |
304 |
gboolean use_new_prefix; |
|
Lines 412-452
Link Here
|
| 412 |
gtk_container_add (menu_ctnr, menu_item); |
414 |
gtk_container_add (menu_ctnr, menu_item); |
| 413 |
} |
415 |
} |
| 414 |
|
416 |
|
| 415 |
/* make upgrade action */ |
417 |
package_name = get_package_name_from_desktop_item (priv->desktop_item); |
| 416 |
|
418 |
if (package_name != NULL) |
| 417 |
if (this->gconf_prefix && ! g_str_has_prefix (this->gconf_prefix, "/desktop/")) |
419 |
supports_package_management = TRUE; |
| 418 |
use_new_prefix = TRUE; |
|
|
| 419 |
else |
420 |
else |
| 420 |
use_new_prefix = FALSE; |
421 |
supports_package_management = FALSE; |
| 421 |
|
422 |
|
| 422 |
if(!use_new_prefix) |
423 |
/* make upgrade action */ |
| 423 |
key = SLAB_UPGRADE_PACKAGE_KEY; |
424 |
if (supports_package_management) { |
| 424 |
else |
425 |
if (this->gconf_prefix && ! g_str_has_prefix (this->gconf_prefix, "/desktop/")) |
| 425 |
key = "/apps/main-menu/upgrade_package_command"; |
426 |
use_new_prefix = TRUE; |
| 426 |
|
427 |
else |
| 427 |
if (verify_package_management_command (key)) { |
428 |
use_new_prefix = FALSE; |
| 428 |
action = tile_action_new (TILE (this), upgrade_trigger, _("Upgrade"), TILE_ACTION_OPENS_NEW_WINDOW); |
429 |
|
| 429 |
actions [APPLICATION_TILE_ACTION_UPGRADE_PACKAGE] = action; |
430 |
if(!use_new_prefix) |
| 430 |
menu_item = GTK_WIDGET (tile_action_get_menu_item (action)); |
431 |
key = SLAB_UPGRADE_PACKAGE_KEY; |
| 431 |
gtk_container_add (menu_ctnr, menu_item); |
432 |
else |
| 432 |
} else |
433 |
key = "/apps/main-menu/upgrade_package_command"; |
| 433 |
actions [APPLICATION_TILE_ACTION_UPGRADE_PACKAGE] = NULL; |
434 |
|
| 434 |
|
435 |
if (verify_package_management_command (key)) { |
|
|
436 |
action = tile_action_new (TILE (this), upgrade_trigger, _("Upgrade"), TILE_ACTION_OPENS_NEW_WINDOW); |
| 437 |
actions [APPLICATION_TILE_ACTION_UPGRADE_PACKAGE] = action; |
| 438 |
menu_item = GTK_WIDGET (tile_action_get_menu_item (action)); |
| 439 |
gtk_container_add (menu_ctnr, menu_item); |
| 440 |
} else |
| 441 |
actions [APPLICATION_TILE_ACTION_UPGRADE_PACKAGE] = NULL; |
| 442 |
} |
| 443 |
|
| 435 |
/* make uninstall action */ |
444 |
/* make uninstall action */ |
| 436 |
|
445 |
|
| 437 |
if(!use_new_prefix) |
446 |
if (supports_package_management) { |
| 438 |
key = SLAB_UNINSTALL_PACKAGE_KEY; |
447 |
if(!use_new_prefix) |
| 439 |
else |
448 |
key = SLAB_UNINSTALL_PACKAGE_KEY; |
| 440 |
key = "/apps/main-menu/uninstall_package_command"; |
449 |
else |
| 441 |
|
450 |
key = "/apps/main-menu/uninstall_package_command"; |
| 442 |
if (verify_package_management_command (key)) { |
451 |
|
| 443 |
action = tile_action_new (TILE (this), uninstall_trigger, _("Uninstall"), TILE_ACTION_OPENS_NEW_WINDOW); |
452 |
if (verify_package_management_command (key)) { |
| 444 |
actions [APPLICATION_TILE_ACTION_UNINSTALL_PACKAGE] = action; |
453 |
action = tile_action_new (TILE (this), uninstall_trigger, _("Uninstall"), TILE_ACTION_OPENS_NEW_WINDOW); |
| 445 |
menu_item = GTK_WIDGET (tile_action_get_menu_item (action)); |
454 |
actions [APPLICATION_TILE_ACTION_UNINSTALL_PACKAGE] = action; |
| 446 |
gtk_container_add (menu_ctnr, menu_item); |
455 |
menu_item = GTK_WIDGET (tile_action_get_menu_item (action)); |
| 447 |
} else |
456 |
gtk_container_add (menu_ctnr, menu_item); |
| 448 |
actions [APPLICATION_TILE_ACTION_UNINSTALL_PACKAGE] = NULL; |
457 |
} else |
| 449 |
|
458 |
actions [APPLICATION_TILE_ACTION_UNINSTALL_PACKAGE] = NULL; |
|
|
459 |
} |
| 460 |
|
| 450 |
gtk_widget_show_all (GTK_WIDGET (TILE (this)->context_menu)); |
461 |
gtk_widget_show_all (GTK_WIDGET (TILE (this)->context_menu)); |
| 451 |
} |
462 |
} |
| 452 |
|
463 |
|