Exemplo n.º 1
0
GtkTreeView*
ifaces_list_create (GstTool *tool)
{
  GtkWidget        *table = gst_dialog_get_widget (tool->main_dialog, "interfaces_list");
  GstTablePopup    *table_popup;
  GtkTreeSelection *selection;
  GtkTreeModel     *model;

  model = GST_NETWORK_TOOL (tool)->interfaces_model;
  gtk_tree_view_set_model (GTK_TREE_VIEW (table), model);

  gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (GTK_LIST_STORE (model)),
					   ifaces_list_sort,
					   NULL, NULL);
  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GTK_LIST_STORE (model)),
					GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
					GTK_SORT_DESCENDING);

  add_list_columns (GTK_TREE_VIEW (table), model);

  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (table));
  g_signal_connect (G_OBJECT (selection), "changed",
		    G_CALLBACK (on_table_selection_changed), NULL);

  table_popup = g_new0 (GstTablePopup, 1);
  table_popup->properties = on_iface_properties_clicked;
  table_popup->popup = popup_menu_create (table);

  g_signal_connect (G_OBJECT (table), "button-press-event",
		    G_CALLBACK (on_table_button_press), (gpointer) table_popup);
  g_signal_connect (G_OBJECT (table), "popup_menu",
		    G_CALLBACK (on_table_popup_menu), (gpointer) table_popup);

  return GTK_TREE_VIEW (table);
}
Exemplo n.º 2
0
void
table_create (GstTool *tool)
{
	GtkWidget        *table = gst_dialog_get_widget (tool->main_dialog, "shares_table");
	GtkWidget        *popup;
	GtkTreeSelection *selection;
	GtkTreeModel     *model;

	model = create_table_model ();
	gtk_tree_view_set_model (GTK_TREE_VIEW (table), model);
	g_object_unref (G_OBJECT (model));

	add_table_columns (GTK_TREE_VIEW (table));

	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (table));
	g_signal_connect (G_OBJECT (selection), "changed",
			  G_CALLBACK (on_shares_table_selection_changed), NULL);

	popup = popup_menu_create (GTK_TREE_VIEW (table));
	g_signal_connect (G_OBJECT (table), "button-press-event",
			  G_CALLBACK (on_shares_table_button_press), (gpointer) popup);
	g_signal_connect (G_OBJECT (table), "popup_menu",
			  G_CALLBACK (on_shares_table_popup_menu), (gpointer) popup);

	/* Drag and Drop stuff */
	gtk_drag_dest_unset (table);
	gtk_drag_dest_set (table, GTK_DEST_DEFAULT_ALL, drop_types,
			   sizeof (drop_types) / sizeof (drop_types[0]),
			   GDK_ACTION_COPY);
	g_signal_connect (G_OBJECT (table), "drag_data_received",
			  G_CALLBACK (on_shares_dragged_folder), NULL);
}
Exemplo n.º 3
0
GtkTreeView*
host_aliases_list_create (GstTool *tool)
{
  GtkWidget     *list;
  GstTablePopup *table_popup;
  GtkTreeModel  *model;

  list = gst_dialog_get_widget (tool->main_dialog, "host_aliases_list");

  model = host_aliases_model_create ();
  gtk_tree_view_set_model (GTK_TREE_VIEW (list), model);
  g_object_unref (model);

  add_list_columns (GTK_TREE_VIEW (list));

  table_popup = g_new0 (GstTablePopup, 1);
  table_popup->setup = NULL;
  table_popup->properties = on_host_aliases_properties_clicked;
  table_popup->popup = popup_menu_create (list);

  g_signal_connect (G_OBJECT (list), "button-press-event",
		    G_CALLBACK (on_table_button_press), (gpointer) table_popup);
  g_signal_connect (G_OBJECT (list), "popup_menu",
		    G_CALLBACK (on_table_popup_menu), (gpointer) table_popup);

  return GTK_TREE_VIEW (list);
}