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