Example #1
0
static void search_cb(GtkWidget *button, PidginLogViewer *lv)
{
	const char *search_term = gtk_entry_get_text(GTK_ENTRY(lv->entry));
	GList *logs;

	if (!(*search_term)) {
		/* reset the tree */
		gtk_tree_store_clear(lv->treestore);
		populate_log_tree(lv);
		g_free(lv->search);
		lv->search = NULL;
		gtk_imhtml_search_clear(GTK_IMHTML(lv->imhtml));
		select_first_log(lv);
		return;
	}

	if (lv->search != NULL && !strcmp(lv->search, search_term))
	{
		/* Searching for the same term acts as "Find Next" */
		gtk_imhtml_search_find(GTK_IMHTML(lv->imhtml), lv->search);
		return;
	}

	pidgin_set_cursor(lv->window, GDK_WATCH);

	g_free(lv->search);
	lv->search = g_strdup(search_term);

	gtk_tree_store_clear(lv->treestore);
	gtk_imhtml_clear(GTK_IMHTML(lv->imhtml));

	for (logs = lv->logs; logs != NULL; logs = logs->next) {
		char *read = purple_log_read((PurpleLog*)logs->data, NULL);
		if (read && *read && purple_strcasestr(read, search_term)) {
			GtkTreeIter iter;
			PurpleLog *log = logs->data;

			gtk_tree_store_append (lv->treestore, &iter, NULL);
			gtk_tree_store_set(lv->treestore, &iter,
					   0, log_get_date(log),
					   1, log, -1);
		}
		g_free(read);
	}

	select_first_log(lv);
	pidgin_clear_cursor(lv->window);
}
Example #2
0
void
replay_log_clear(ReplayLog *self)
{
  g_return_if_fail(REPLAY_IS_LOG(self));

  gtk_tree_store_clear(GTK_TREE_STORE(self));
}
Example #3
0
/* cleans up the item list, sets up the iter hash when called for the first time */
void
item_list_view_clear (ItemListView *ilv)
{
	GtkAdjustment		*adj;
	GtkTreeStore		*itemstore;

	itemstore = GTK_TREE_STORE (gtk_tree_view_get_model (ilv->priv->treeview));
	
	/* unselecting all items is important to remove items
	   whose removal is deferred until unselecting */
	gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (ilv->priv->treeview));
	
	adj = gtk_tree_view_get_vadjustment (ilv->priv->treeview);
	gtk_adjustment_set_value (adj, 0.0);
#if GTK_API_VERSION >= 3
	gtk_scrollable_set_vadjustment (GTK_SCROLLABLE (ilv->priv->treeview), adj);
#else
	gtk_tree_view_set_vadjustment (ilv->priv->treeview, adj);
#endif
	if (itemstore)
		gtk_tree_store_clear (itemstore);
	if (ilv->priv->item_id_to_iter)
		g_hash_table_destroy (ilv->priv->item_id_to_iter);
	
	ilv->priv->item_id_to_iter = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
	
	/* enable batch mode for following item adds */
	ilv->priv->batch_mode = TRUE;
	ilv->priv->batch_itemstore = item_list_view_create_tree_store ();
}
Example #4
0
static void
git_status_pane_clear (GitStatusPane *self)
{
	GtkTreeStore *status_model;

	status_model = GTK_TREE_STORE (gtk_builder_get_object (self->priv->builder,	
	                                                       "status_model"));

	/* Clear any existing model data and create the placeholders */
	gtk_tree_store_clear (status_model);
	
	gtk_tree_store_append (status_model, &(self->priv->commit_iter), NULL);
	gtk_tree_store_set (status_model, &(self->priv->commit_iter), 
	                    COL_PATH, _("Changes to be committed"), 
	                    COL_SELECTED, FALSE,
	                    COL_STATUS, ANJUTA_VCS_STATUS_NONE,
	                    COL_TYPE, STATUS_TYPE_NONE,
	                    -1);

	gtk_tree_store_append (status_model, &(self->priv->not_updated_iter), 
	                       NULL);
	gtk_tree_store_set (status_model, &(self->priv->not_updated_iter), 
	                    COL_PATH, _("Changed but not updated"), 
	                    COL_SELECTED, FALSE, 
	                    COL_STATUS, ANJUTA_VCS_STATUS_NONE,
	                    COL_TYPE, STATUS_TYPE_NONE,
	                    -1);

	g_hash_table_remove_all (self->priv->selected_commit_items);
	g_hash_table_remove_all (self->priv->selected_not_updated_items);
}
Example #5
0
void sync_select_callback(GObject* obj, gpointer user_data) {
    GtkTreePath* path;
    gtk_tree_view_get_cursor(GTK_TREE_VIEW(obj), &path, NULL);
    
    if (!path)
        return;
    
    size_t index = gtk_tree_path_get_indices(path)[0];
    
    inspect_sync_t* sync = get_inspect_sync_vec(inspector->syncs, index);
    if (!sync)
        return;
    
    GtkTreeView* tree = GTK_TREE_VIEW(gtk_builder_get_object(builder, "sync_treeview"));
    GtkTreeStore* store = GTK_TREE_STORE(gtk_tree_view_get_model(tree));
    gtk_tree_store_clear(store);
    
    GtkTreeIter row;
    gtk_tree_store_append(store, &row, NULL);
    gtk_tree_store_set(store, &row, 0, "Type", 1, get_enum_str(NULL, sync->type), -1);
    gtk_tree_store_append(store, &row, NULL);
    gtk_tree_store_set(store, &row, 0, "Condition", 1, get_enum_str(NULL, sync->condition), -1);
    gtk_tree_store_append(store, &row, NULL);
    gtk_tree_store_set(store, &row, 0, "Flags", 1, static_format("%u", sync->flags), -1);
}
static VALUE
rg_clear(VALUE self)
{
    G_CHILD_REMOVE_ALL(self);
    gtk_tree_store_clear(_SELF(self));
    return self;
}
static void
gsltma_added_cb(GncSxInstanceModel *instances, SchedXaction *sx_added, gpointer user_data)
{
    GncSxListTreeModelAdapter *model = GNC_SX_LIST_TREE_MODEL_ADAPTER(user_data);
    gtk_tree_store_clear(model->orig);
    gsltma_populate_tree_store(model);
}
Example #8
0
static gboolean
refresh_list_idle (GeditDocumentsPanel *panel)
{
	GtkTreeSelection *selection;

	gedit_debug (DEBUG_PANEL);

	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (panel->priv->treeview));
	g_signal_handler_block (selection, panel->priv->selection_changed_handler_id);

	gtk_tree_store_clear (GTK_TREE_STORE (panel->priv->model));

	panel->priv->adding_tab = TRUE;
	gedit_multi_notebook_foreach_notebook (panel->priv->mnb,
					       (GtkCallback)refresh_notebook_foreach,
					       panel);
	panel->priv->adding_tab = FALSE;

	gtk_tree_view_expand_all (GTK_TREE_VIEW (panel->priv->treeview));

	select_active_tab (panel);

	panel->priv->refresh_idle_id = 0;

	g_signal_handler_unblock (selection, panel->priv->selection_changed_handler_id);

	return FALSE;
}
Example #9
0
/*! \todo Finish function documentation!!!
 *  \brief
 *  \par Function Description
 *
 */
void pagesel_update (Pagesel *pagesel)
{
    GtkTreeModel *model;
    TOPLEVEL *toplevel;
    PAGE *p_current;
    GList *iter;

    g_assert (IS_PAGESEL (pagesel));

    g_return_if_fail (GSCHEM_DIALOG (pagesel)->w_current);

    toplevel = GSCHEM_DIALOG (pagesel)->w_current->toplevel;
    model    = gtk_tree_view_get_model (pagesel->treeview);

    /* wipe out every thing in the store */
    gtk_tree_store_clear (GTK_TREE_STORE (model));
    /* now rebuild */
    for ( iter = geda_list_get_glist( toplevel->pages );
            iter != NULL;
            iter = g_list_next( iter ) ) {

        p_current = (PAGE *)iter->data;
        /* find every page that is not a hierarchy-down of another page */
        if (p_current->up < 0 ||
                s_page_search_by_page_id (toplevel->pages,
                                          p_current->up) == NULL) {
            add_page (model, NULL, toplevel->pages, p_current);
        }
    }

    /* select the current page in the treeview */
    select_page (pagesel->treeview, NULL, toplevel->page_current);
}
Example #10
0
void
gourmap_ui_update_list (GourmapUi *ui,
		        GList     *poi_list)
{
	GourmapUiPrivate *priv = GET_PRIVATE (ui);
	GList *list_i;
	guint index = 0;

	gtk_tree_store_clear (priv->store);

	if (poi_list == NULL) {
		gtk_widget_set_sensitive (priv->rand_button, FALSE);
		return;
	}

	for (list_i = poi_list; list_i; list_i = list_i->next) {
		Restaurant *rest = (Restaurant *)list_i->data;
		GtkTreeIter iter;
		gtk_tree_store_append (priv->store, &iter, NULL);
		gtk_tree_store_set (priv->store, &iter,
				    NAME_COLUMN, rest->name,
				    INDEX_COLUMN, index++,
				    -1);
	}

	gtk_widget_set_sensitive (priv->rand_button, TRUE);
}
Example #11
0
/*
 * Gets called when the addlist window is about to be destroyed
 */
void mpc_addlist_destroy_event(GtkWidget *widget, gpointer data) {
	/* Blow it up :) */
	gtk_tree_store_clear(mpc_addlist_store);
	mpc_addlist = NULL;
	mpc_addlist_store = NULL;
	mpc_addlist_tree = NULL;
}
Example #12
0
/* If code in PCB should change the netlist, call this to update
   |  what's in the netlist window.
*/
void
ghid_netlist_window_update (gboolean init_nodes)
{
  GtkTreeModel *model;

  /* Make sure there is something to update */
  ghid_netlist_window_create (gport);

  model = net_model;
  net_model = net_model_create ();
  gtk_tree_view_set_model (net_treeview, net_model);
  gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (net_model),
					NET_NAME_COLUMN, GTK_SORT_ASCENDING);
  if (model)
    {
      gtk_tree_store_clear (GTK_TREE_STORE (model));
      g_object_unref (model);
    }

  selected_net = NULL;

  /* XXX Check if the select callback does this for us */
  if (init_nodes)
    node_model_update ((&PCB->NetlistLib)->Menu);
}
void
empathy_contact_list_store_set_show_groups (EmpathyContactListStore *store,
					    gboolean                 show_groups)
{
	EmpathyContactListStorePriv *priv;
	GList                       *contacts, *l;

	g_return_if_fail (EMPATHY_IS_CONTACT_LIST_STORE (store));

	priv = GET_PRIV (store);

	if (priv->show_groups == show_groups) {
		return;
	}

	priv->show_groups = show_groups;

	/* Remove all contacts and add them back, not optimized but that's the
	 * easy way :) */
	gtk_tree_store_clear (GTK_TREE_STORE (store));
	contacts = empathy_contact_list_get_members (priv->list);
	for (l = contacts; l; l = l->next) {
		contact_list_store_members_changed_cb (priv->list, l->data,
						       NULL, 0, NULL,
						       TRUE,
						       store);

		g_object_unref (l->data);
	}
	g_list_free (contacts);

	g_object_notify (G_OBJECT (store), "show-groups");
}
/*! \fn void CDesktopAppChooser::m_DeinitValue(void)
    \brief Deinitialize values

    \param[in] NONE
    \return NONE
*/
void CDesktopAppChooser::m_DeinitValue(void)
{
  if(m_pWidgets[APPCHOOSER_GtkTreeView])
  {
     GtkTreeModel *model =NULL;
     GtkTreeIter iter;

     m_TreeStore = GTK_TREE_STORE( gtk_tree_view_get_model(GTK_TREE_VIEW(m_pWidgets[APPCHOOSER_GtkTreeView])) );

     /* Make sure the model stays with us after the tree view unrefs it */
     g_object_ref( (GObject*)m_TreeStore );

     /* Detach model from view */
     gtk_tree_view_set_model(GTK_TREE_VIEW(m_pWidgets[APPCHOOSER_GtkTreeView]), NULL);
     model = (GtkTreeModel*)m_TreeStore;

     /* Initializes iter with the first iterator in the tree
        (the top-level item, e.g. the one at the path "0") */
     if(gtk_tree_model_get_iter_first(model, &iter) == FALSE) 
       return;

     /* To remove the node's data first. */
     gtk_tree_model_foreach(model, (GtkTreeModelForeachFunc)cb_remove_node_data, NULL);

     /* Then, to clear all tree model data. */
     gtk_tree_store_clear(m_TreeStore);
     g_object_unref(m_TreeStore); 
     m_TreeStore = NULL;
  }
}
static void
dialog_goto_load_names (GotoState *state)
{
	Sheet *sheet;
	LoadNames closure;
	int i, l;

	gtk_tree_store_clear (state->model);

	closure.state = state;
	gtk_tree_store_append (state->model, &closure.iter, NULL);
	gtk_tree_store_set (state->model, &closure.iter,
			    SHEET_NAME,		_("Workbook Level"),
			    ITEM_NAME,		NULL,
			    SHEET_POINTER,	NULL,
			    EXPRESSION,		NULL,
			    -1);
	workbook_foreach_name (state->wb, FALSE,
			       (GHFunc)cb_load_names, &closure);

	l = workbook_sheet_count (state->wb);
	for (i = 0; i < l; i++) {
		sheet = workbook_sheet_by_index (state->wb, i);
		gtk_tree_store_append (state->model, &closure.iter, NULL);
		gtk_tree_store_set (state->model, &closure.iter,
				    SHEET_NAME,		sheet->name_unquoted,
				    ITEM_NAME,		NULL,
				    SHEET_POINTER,	sheet,
				    EXPRESSION,		NULL,
				    -1);
	}
}
Example #16
0
void
on_set_option_mode3_activate(GtkMenuItem *menuitem, gpointer user_data)
{
	opt_mode = OPT_PROMPT;
	gtk_tree_store_clear(tree2);
	display_tree(&rootmenu);	/* instead of update_tree to speed-up */
}
Example #17
0
void
tree_store_clear(GtkWidget *w)
{
  GtkTreeModel *model;

  model = gtk_tree_view_get_model(GTK_TREE_VIEW(w));
  gtk_tree_store_clear(GTK_TREE_STORE(model));
}
Example #18
0
void clear_room_list(void)
{
	/* Clear current list of rooms */
	GtkTreeStore *store;

	store = GTK_TREE_STORE(ggz_lookup_widget(room_list, "room_list_store"));
	gtk_tree_store_clear(store);
}
Example #19
0
void
on_show_all_options1_activate(GtkMenuItem * menuitem, gpointer user_data)
{
	show_all = GTK_CHECK_MENU_ITEM(menuitem)->active;

	gtk_tree_store_clear(tree2);
	display_tree(&rootmenu);	// instead of update_tree to speed-up
}
Example #20
0
void clear_statistics()
{
    GtkTreeStore *store;

    store = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(yearly_tree)));
    gtk_tree_store_clear(store);
    yearly_tree = NULL;
}
Example #21
0
void
parasite_widget_tree_scan(ParasiteWidgetTree *widget_tree,
                          GtkWidget *window)
{
    gtk_tree_store_clear(widget_tree->priv->model);
    append_widget(widget_tree->priv->model, window, NULL);
    gtk_tree_view_columns_autosize(GTK_TREE_VIEW(widget_tree));
}
Example #22
0
void on_full_clicked(GtkButton * button, gpointer user_data)
{
	view_mode = FULL_VIEW;
	gtk_widget_hide(tree1_w);
	if (tree2)
		gtk_tree_store_clear(tree2);
	display_tree(&rootmenu);
	gtk_widget_set_sensitive(back_btn, FALSE);
}
Example #23
0
/*
 *	clear tree view completely
 */
void stree_clear()
{
	g_signal_handler_disconnect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree))), selection_callback);
	
	gtk_tree_store_clear(store);
	g_hash_table_remove_all(threads);

	selection_callback = g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree))), "changed", G_CALLBACK (on_selection_changed), NULL);
}
Example #24
0
static void on_menu_cache_reload(MenuCache* mc, gpointer user_data)
{
    g_return_if_fail(store);
    gtk_tree_store_clear(store);
    MenuCacheDir* dir = menu_cache_get_root_dir(menu_cache);
    /* FIXME: preserve original selection */
    if(dir)
        add_menu_items(NULL, dir);
}
Example #25
0
void
dh_book_tree_reload(DhBookTree *tree)
{
	DhBookTreePriv* priv = tree->priv;

	gtk_tree_store_clear (priv->store);

	book_tree_populate_tree (tree);
}
Example #26
0
void UzblTreeTab::RebuildTree()
{    
    int i = 0;
    for(GList* l = uzblinstances; l != NULL; l = g_list_next(l)) {
        UzblInstance* cuz = (UzblInstance*)l->data;
        cuz->SetNum(i);
        cuz->SetPNum(-1);
        cuz->ClearChildren();
        cuz->SetRowRef(NULL);
        i++;
    }
    for(GList* l = uzblinstances; l != NULL; l = g_list_next(l)) {
        UzblInstance* cuz = (UzblInstance*)l->data;
        if (cuz->GetParent() != NULL) {
            cuz->SetPNum(cuz->GetParent()->GetNum());
            cuz->GetParent()->AddChild(cuz);
        }
    }
    
    totaltabs = i;
    if (currenttab >= totaltabs)
        currenttab = totaltabs-1;
    if (currenttab < 0)
        currenttab = 0;
    
    gtk_tree_store_clear(tabmodel);
    
    for(GList* l = uzblinstances; l != NULL; l = g_list_next(l)) {
        UzblInstance* iuz = ((UzblInstance*)l->data);
        GtkTreeIter iter;
        if (iuz->GetParent() != NULL) {
            GtkTreeIter piter;
            GtkTreeRowReference* pr = iuz->GetParent()->GetRowRef();
            GtkTreePath* pp = gtk_tree_row_reference_get_path(pr);
            gtk_tree_model_get_iter(GTK_TREE_MODEL(tabmodel), &piter, pp);
            gtk_tree_store_append(tabmodel, &iter, &piter);
        }
        else {
            gtk_tree_store_append(tabmodel, &iter, NULL);
        }
        
        GtkTreePath* p = gtk_tree_model_get_path(GTK_TREE_MODEL(tabmodel), &iter);
        GtkTreeRowReference* ref = gtk_tree_row_reference_new(GTK_TREE_MODEL(tabmodel), p);
        iuz->SetRowRef(ref);
    }
    
    gtk_tree_view_expand_all(tabtree);
    
    GtkTreeIter siter;
    UzblInstance* suz = (UzblInstance*)g_list_nth(uzblinstances, currenttab)->data;
    GtkTreeRowReference* sr = suz->GetRowRef();
    GtkTreePath* sp = gtk_tree_row_reference_get_path(sr);
    gtk_tree_model_get_iter(GTK_TREE_MODEL(tabmodel), &siter, sp);
    
    GtkTreeSelection* sel = gtk_tree_view_get_selection(tabtree);
    gtk_tree_selection_select_iter(sel, &siter);
}
Example #27
0
void init_syncs_list(GtkTreeView* tree) {
    GtkTreeView* content = GTK_TREE_VIEW(gtk_builder_get_object(builder, "sync_treeview"));
    GtkTreeStore* store = GTK_TREE_STORE(gtk_tree_view_get_model(content));
    gtk_tree_store_clear(store);
    
    store = GTK_TREE_STORE(gtk_tree_view_get_model(tree));
    gtk_tree_store_clear(store);
    
    inspect_sync_vec_t syncs = inspector->syncs;
    for (inspect_sync_t* sync = syncs->data; !vec_end(syncs, sync); sync++) {
        char str[64];
        memset(str, 0, 64);
        snprintf(str, 64, "0x%zx", sync->fake);
        
        GtkTreeIter row;
        gtk_tree_store_append(store, &row, NULL);
        gtk_tree_store_set(store, &row, 0, str, -1);
    }
}
Example #28
0
/* Display a part of the tree starting at current node (single/split view) */
static void display_tree_part(void)
{
	if (tree2)
		gtk_tree_store_clear(tree2);
	if(view_mode == SINGLE_VIEW)
		display_tree(current);
 	else if(view_mode == SPLIT_VIEW)
		display_tree(browsed);
	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree2_w));
}
Example #29
0
/* Display the list in the left frame (split view) */
static void display_list(void)
{
	if (tree1)
		gtk_tree_store_clear(tree1);

	tree = tree1;
	display_tree(&rootmenu);
	gtk_tree_view_expand_all(GTK_TREE_VIEW(tree1_w));
	tree = tree2;
}
Example #30
0
static void
ghb_clear_subtitle_list_ui(GtkBuilder *builder)
{
    GtkTreeView *tv;
    GtkTreeStore *ts;

    tv = GTK_TREE_VIEW(GHB_WIDGET(builder, "subtitle_list"));
    ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv));
    gtk_tree_store_clear(ts);
}