Commit 7df1cac9 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

panel-addto-dialog: remove support for old menu button object

Adding menu buttons using "Application Launcher..." are no longer
supported. Use new Menu Button applet if you want menu buttons.
parent e9c54b4c
...@@ -95,8 +95,6 @@ typedef struct { ...@@ -95,8 +95,6 @@ typedef struct {
GIcon *icon; GIcon *icon;
PanelActionButtonType action_type; PanelActionButtonType action_type;
char *launcher_path; char *launcher_path;
char *menu_filename;
char *menu_path;
char *iid; char *iid;
} PanelAddtoItemInfo; } PanelAddtoItemInfo;
...@@ -450,19 +448,9 @@ panel_addto_prepend_directory (GSList **parent_list, ...@@ -450,19 +448,9 @@ panel_addto_prepend_directory (GSList **parent_list,
data->item_info.name = g_strdup (gmenu_tree_directory_get_name (directory)); data->item_info.name = g_strdup (gmenu_tree_directory_get_name (directory));
data->item_info.description = g_strdup (gmenu_tree_directory_get_comment (directory)); data->item_info.description = g_strdup (gmenu_tree_directory_get_comment (directory));
data->item_info.icon = icon; data->item_info.icon = icon;
data->item_info.menu_filename = g_strdup (filename);
data->item_info.menu_path = gmenu_tree_directory_make_path (directory, NULL);
/* We should set the iid here to something and do
* iid = g_strdup_printf ("MENU:%s", tfr->name)
* but this means we'd have to free the iid later
* and this would complexify too much the free
* function.
* So the iid is built when we select the row.
*/
*parent_list = g_slist_prepend (*parent_list, data); *parent_list = g_slist_prepend (*parent_list, data);
/* We always want to show everything in non-root directories */ /* We always want to show everything in non-root directories */
panel_addto_make_application_list (&data->children, directory, panel_addto_make_application_list (&data->children, directory,
filename, PANEL_ADDTO_MENU_SHOW_ALL); filename, PANEL_ADDTO_MENU_SHOW_ALL);
...@@ -566,15 +554,22 @@ panel_addto_populate_application_model (GtkTreeStore *store, ...@@ -566,15 +554,22 @@ panel_addto_populate_application_model (GtkTreeStore *store,
GSList *app; GSList *app;
for (app = app_list; app != NULL; app = app->next) { for (app = app_list; app != NULL; app = app->next) {
PanelAddtoItemInfo *column_data;
data = app->data; data = app->data;
gtk_tree_store_append (store, &iter, parent); gtk_tree_store_append (store, &iter, parent);
text = panel_addto_make_text (data->item_info.name, text = panel_addto_make_text (data->item_info.name,
data->item_info.description); data->item_info.description);
column_data = NULL;
if (data->item_info.type != PANEL_ADDTO_MENU)
column_data = &data->item_info;
gtk_tree_store_set (store, &iter, gtk_tree_store_set (store, &iter,
COLUMN_ICON, data->item_info.icon, COLUMN_ICON, data->item_info.icon,
COLUMN_TEXT, text, COLUMN_TEXT, text,
COLUMN_DATA, &(data->item_info), COLUMN_DATA, column_data,
COLUMN_SEARCH, data->item_info.name, COLUMN_SEARCH, data->item_info.name,
-1); -1);
...@@ -769,13 +764,6 @@ panel_addto_add_item (PanelAddtoDialog *dialog, ...@@ -769,13 +764,6 @@ panel_addto_add_item (PanelAddtoDialog *dialog,
dialog->insert_pack_type); dialog->insert_pack_type);
break; break;
case PANEL_ADDTO_MENU: case PANEL_ADDTO_MENU:
panel_menu_button_create (dialog->panel_widget->toplevel,
dialog->insert_pack_type,
pack_index,
item_info->menu_filename,
item_info->menu_path,
item_info->name);
break;
default: default:
break; break;
} }
...@@ -884,12 +872,6 @@ panel_addto_dialog_free_item_info (PanelAddtoItemInfo *item_info) ...@@ -884,12 +872,6 @@ panel_addto_dialog_free_item_info (PanelAddtoItemInfo *item_info)
g_free (item_info->launcher_path); g_free (item_info->launcher_path);
item_info->launcher_path = NULL; item_info->launcher_path = NULL;
g_free (item_info->menu_filename);
item_info->menu_filename = NULL;
g_free (item_info->menu_path);
item_info->menu_path = NULL;
} }
static void static void
...@@ -1023,7 +1005,6 @@ panel_addto_selection_changed (PanelAddtoDialog *dialog, ...@@ -1023,7 +1005,6 @@ panel_addto_selection_changed (PanelAddtoDialog *dialog,
GtkTreeIter iter; GtkTreeIter iter;
GtkTreeIter filter_iter; GtkTreeIter filter_iter;
PanelAddtoItemInfo *data; PanelAddtoItemInfo *data;
char *iid;
if (!gtk_tree_selection_get_selected (selection, if (!gtk_tree_selection_get_selected (selection,
&filter_model, &filter_model,
...@@ -1039,6 +1020,7 @@ panel_addto_selection_changed (PanelAddtoDialog *dialog, ...@@ -1039,6 +1020,7 @@ panel_addto_selection_changed (PanelAddtoDialog *dialog,
gtk_tree_model_get (child_model, &iter, COLUMN_DATA, &data, -1); gtk_tree_model_get (child_model, &iter, COLUMN_DATA, &data, -1);
if (!data) { if (!data) {
gtk_tree_view_unset_rows_drag_source (GTK_TREE_VIEW (dialog->tree_view));
gtk_widget_set_sensitive (GTK_WIDGET (dialog->add_button), gtk_widget_set_sensitive (GTK_WIDGET (dialog->add_button),
FALSE); FALSE);
return; return;
...@@ -1065,17 +1047,6 @@ panel_addto_selection_changed (PanelAddtoDialog *dialog, ...@@ -1065,17 +1047,6 @@ panel_addto_selection_changed (PanelAddtoDialog *dialog,
} else if (data->type == PANEL_ADDTO_LAUNCHER_MENU) { } else if (data->type == PANEL_ADDTO_LAUNCHER_MENU) {
gtk_tree_view_unset_rows_drag_source (GTK_TREE_VIEW (dialog->tree_view)); gtk_tree_view_unset_rows_drag_source (GTK_TREE_VIEW (dialog->tree_view));
} else if (data->type == PANEL_ADDTO_MENU) { } else if (data->type == PANEL_ADDTO_MENU) {
/* build the iid for menus other than the main menu */
if (data->iid == NULL) {
iid = g_strdup_printf ("MENU:%s/%s",
data->menu_filename,
data->menu_path);
} else {
iid = g_strdup (data->iid);
}
panel_addto_setup_internal_applet_drag (GTK_TREE_VIEW (dialog->tree_view),
iid);
g_free (iid);
} else { } else {
panel_addto_setup_internal_applet_drag (GTK_TREE_VIEW (dialog->tree_view), panel_addto_setup_internal_applet_drag (GTK_TREE_VIEW (dialog->tree_view),
data->iid); data->iid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment