Rename treeviews.[hc] -> sidebar.[hc].

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4252 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2009-09-28 11:16:59 +00:00
parent 41b97edf06
commit caec1ec7c3
16 changed files with 75 additions and 65 deletions

View File

@ -1,3 +1,13 @@
2009-09-28 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/keybindings.c, src/sidebar.c, src/sidebar.h,
src/makefile.win32, src/project.c, src/prefs.c, src/treeviews.c,
src/callbacks.c, src/notebook.c, src/treeviews.h, src/document.c,
src/main.c, src/symbols.c, src/Makefile.am, src/ui_utils.c,
po/POTFILES.in, wscript:
Rename treeviews.[hc] -> sidebar.[hc].
2009-09-27 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* scripts/create_py_tags.py:

View File

@ -34,7 +34,7 @@ src/symbols.c
src/templates.c
src/toolbar.c
src/tools.c
src/treeviews.c
src/sidebar.c
src/ui_utils.c
src/utils.c
src/vte.c

View File

@ -45,7 +45,7 @@ SRCS = \
templates.c templates.h \
toolbar.c toolbar.h \
tools.c tools.h \
treeviews.c treeviews.h \
sidebar.c sidebar.h \
ui_utils.c ui_utils.h \
utils.c utils.h

View File

@ -52,7 +52,7 @@
#include "build.h"
#include "prefs.h"
#include "templates.h"
#include "treeviews.h"
#include "sidebar.h"
#include "keybindings.h"
#include "encodings.h"
#include "search.h"
@ -219,7 +219,7 @@ on_save_all1_activate (GtkMenuItem *menuitem,
else
document_save_file(doc, FALSE);
}
treeviews_update_tag_list(cur_doc, TRUE);
sidebar_update_tag_list(cur_doc, TRUE);
ui_set_window_title(cur_doc);
}
@ -739,12 +739,12 @@ on_notebook1_switch_page_after (GtkNotebook *notebook,
if (doc != NULL)
{
treeviews_select_openfiles_item(doc);
sidebar_select_openfiles_item(doc);
document_set_text_changed(doc, doc->changed); /* also sets window title and status bar */
ui_update_popup_reundo_items(doc);
ui_document_show_hide(doc); /* update the document menu */
build_menu_update(doc);
treeviews_update_tag_list(doc, FALSE);
sidebar_update_tag_list(doc, FALSE);
/* We delay the check to avoid weird fast, unintended switching of notebook pages when
* the 'file has changed' dialog is shown while the switch event is not yet completely

View File

@ -66,7 +66,7 @@
#include "dialogs.h"
#include "msgwindow.h"
#include "templates.h"
#include "treeviews.h"
#include "sidebar.h"
#include "ui_utils.h"
#include "utils.h"
#include "encodings.h"
@ -568,7 +568,7 @@ static GeanyDocument *document_create(const gchar *utf8_filename)
editor_apply_update_prefs(doc->editor);
treeviews_openfiles_add(doc); /* sets doc->iter */
sidebar_openfiles_add(doc); /* sets doc->iter */
notebook_new_tab(doc);
@ -637,7 +637,7 @@ gboolean document_remove_page(guint page_num)
doc->is_valid = FALSE;
notebook_remove_page(page_num);
treeviews_remove_document(doc);
sidebar_remove_document(doc);
navqueue_remove_file(doc->file_name);
msgwin_status_add(_("File %s closed."), DOC_FILENAME(doc));
g_free(doc->encoding);
@ -662,7 +662,7 @@ gboolean document_remove_page(guint page_num)
if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) == 0)
{
treeviews_update_tag_list(NULL, FALSE);
sidebar_update_tag_list(NULL, FALSE);
/*on_notebook1_switch_page(GTK_NOTEBOOK(main_widgets.notebook), NULL, 0, NULL);*/
ui_set_window_title(NULL);
ui_save_buttons_toggle(FALSE);
@ -1177,7 +1177,7 @@ static gboolean auto_update_tag_list(gpointer data)
return TRUE;
if (update_tags_from_buffer(doc))
treeviews_update_tag_list(doc, TRUE);
sidebar_update_tag_list(doc, TRUE);
return TRUE;
}
@ -2307,7 +2307,7 @@ static gboolean update_tags_from_buffer(GeanyDocument *doc)
void document_update_tag_list(GeanyDocument *doc, gboolean update)
{
/* We must call treeviews_update_tag_list() before returning,
/* We must call sidebar_update_tag_list() before returning,
* to ensure that the symbol list is always updated properly (e.g.
* when creating a new document with a partial filename set. */
gboolean success = FALSE;
@ -2317,7 +2317,7 @@ void document_update_tag_list(GeanyDocument *doc, gboolean update)
! filetype_has_tags(doc->file_type) || ! doc->file_name)
{
/* set the default (empty) tag list */
treeviews_update_tag_list(doc, FALSE);
sidebar_update_tag_list(doc, FALSE);
return;
}
@ -2349,7 +2349,7 @@ void document_update_tag_list(GeanyDocument *doc, gboolean update)
if (G_UNLIKELY(! success))
geany_debug("tag list updating failed");
}
treeviews_update_tag_list(doc, success);
sidebar_update_tag_list(doc, success);
}

View File

@ -49,7 +49,7 @@
#include "symbols.h"
#include "vte.h"
#include "toolbar.h"
#include "treeviews.h"
#include "sidebar.h"
#include "geanywraplabel.h"
#include "main.h"
#include "search.h"

View File

@ -59,7 +59,7 @@
#include "dialogs.h"
#include "templates.h"
#include "encodings.h"
#include "treeviews.h"
#include "sidebar.h"
#include "notebook.h"
#include "keybindings.h"
#include "editor.h"
@ -933,7 +933,7 @@ gint main(gint argc, gchar **argv)
#ifdef HAVE_PLUGINS
plugins_init();
#endif
treeviews_init();
sidebar_init();
load_settings(); /* load keyfile */
msgwin_init();
@ -1003,9 +1003,9 @@ gint main(gint argc, gchar **argv)
doc = document_get_current();
gtk_widget_grab_focus(GTK_WIDGET(doc->editor->sci));
treeviews_select_openfiles_item(doc);
sidebar_select_openfiles_item(doc);
build_menu_update(doc);
treeviews_update_tag_list(doc, FALSE);
sidebar_update_tag_list(doc, FALSE);
#ifdef G_OS_WIN32
/* Manually realise the main window to be able to set the position but don't show it.
@ -1083,7 +1083,7 @@ void main_quit()
editor_snippets_free();
encodings_finalize();
toolbar_finalize();
treeviews_finalize();
sidebar_finalize();
configuration_finalize();
filetypes_free_types();
log_finalize();

View File

@ -66,7 +66,7 @@ OBJS = about.o build.o callbacks.o dialogs.o document.o editor.o encodings.o fil
log.o main.o msgwindow.o navqueue.o notebook.o plugins.o pluginutils.o \
prefs.o printing.o project.o \
sciwrappers.o search.o socket.o stash.o \
symbols.o templates.o toolbar.o tools.o treeviews.o \
symbols.o templates.o toolbar.o tools.o sidebar.o \
ui_utils.o utils.o win32.o
.c.o:

View File

@ -31,7 +31,7 @@
#include "editor.h"
#include "documentprivate.h"
#include "ui_utils.h"
#include "treeviews.h"
#include "sidebar.h"
#include "support.h"
#include "callbacks.h"
#include "utils.h"
@ -332,7 +332,7 @@ notebook_page_reordered_cb(GtkNotebook *notebook, GtkWidget *child, guint page_n
{
/* Not necessary to update open files treeview if it's sorted.
* Note: if enabled, it's best to move the item instead of recreating all items. */
/*treeviews_openfiles_update_all();*/
/*sidebar_openfiles_update_all();*/
}

View File

@ -48,7 +48,7 @@
#include "project.h"
#include "editor.h"
#include "main.h"
#include "treeviews.h"
#include "sidebar.h"
#include "printing.h"
#include "geanywraplabel.h"
#include "templates.h"
@ -1105,7 +1105,7 @@ on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_data)
/* apply the changes made */
ui_statusbar_showhide(interface_prefs.statusbar_visible);
treeviews_openfiles_update_all(); /* to update if full path setting has changed */
sidebar_openfiles_update_all(); /* to update if full path setting has changed */
toolbar_apply_settings();
toolbar_update_ui();
toolbar_show_hide();

View File

@ -48,7 +48,7 @@
#include "interface.h"
#include "editor.h"
#include "stash.h"
#include "treeviews.h"
#include "sidebar.h"
#include "filetypes.h"
@ -318,7 +318,7 @@ static void update_ui(void)
{
ui_set_window_title(NULL);
build_menu_update(NULL);
treeviews_openfiles_update_all();
sidebar_openfiles_update_all();
}

View File

@ -1,5 +1,5 @@
/*
* treeviews.c - this file is part of Geany, a fast and lightweight IDE
* sidebar.c - this file is part of Geany, a fast and lightweight IDE
*
* Copyright 2005-2009 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* Copyright 2006-2009 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
@ -30,7 +30,7 @@
#include "geany.h"
#include "support.h"
#include "callbacks.h"
#include "treeviews.h"
#include "sidebar.h"
#include "document.h"
#include "editor.h"
#include "documentprivate.h"
@ -91,9 +91,9 @@ static GtkWidget *tag_window; /* scrolled window that holds the symbol list GtkT
static gboolean on_openfiles_tree_selection_changed(GtkTreeSelection *selection);
static void on_openfiles_document_action(GtkMenuItem *menuitem, gpointer user_data);
static gboolean on_taglist_tree_selection_changed(GtkTreeSelection *selection);
static gboolean treeviews_button_press_cb(GtkWidget *widget, GdkEventButton *event,
static gboolean sidebar_button_press_cb(GtkWidget *widget, GdkEventButton *event,
gpointer user_data);
static gboolean treeviews_key_press_cb(GtkWidget *widget, GdkEventKey *event,
static gboolean sidebar_key_press_cb(GtkWidget *widget, GdkEventKey *event,
gpointer user_data);
static void on_list_document_activate(GtkCheckMenuItem *item, gpointer user_data);
static void on_list_symbol_activate(GtkCheckMenuItem *item, gpointer user_data);
@ -129,9 +129,9 @@ static void prepare_taglist(GtkWidget *tree, GtkTreeStore *store)
g_object_unref(store);
g_signal_connect(tree, "button-press-event",
G_CALLBACK(treeviews_button_press_cb), NULL);
G_CALLBACK(sidebar_button_press_cb), NULL);
g_signal_connect(tree, "key-press-event",
G_CALLBACK(treeviews_key_press_cb), NULL);
G_CALLBACK(sidebar_key_press_cb), NULL);
if (gtk_check_version(2, 12, 0) == NULL)
{
@ -185,7 +185,7 @@ static void create_default_tag_tree(void)
/* update = rescan the tags for doc->filename */
void treeviews_update_tag_list(GeanyDocument *doc, gboolean update)
void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
{
if (gtk_bin_get_child(GTK_BIN(tag_window)))
gtk_container_remove(GTK_CONTAINER(tag_window), gtk_bin_get_child(GTK_BIN(tag_window)));
@ -280,9 +280,9 @@ static void prepare_openfiles(void)
g_object_unref(store_openfiles);
g_signal_connect(GTK_TREE_VIEW(tv.tree_openfiles), "button-press-event",
G_CALLBACK(treeviews_button_press_cb), NULL);
G_CALLBACK(sidebar_button_press_cb), NULL);
g_signal_connect(GTK_TREE_VIEW(tv.tree_openfiles), "key-press-event",
G_CALLBACK(treeviews_key_press_cb), NULL);
G_CALLBACK(sidebar_key_press_cb), NULL);
}
@ -368,8 +368,8 @@ static GtkTreeIter *get_doc_parent(GeanyDocument *doc)
/* Also sets doc->priv->iter.
* This is called recursively in treeviews_openfiles_update_all(). */
void treeviews_openfiles_add(GeanyDocument *doc)
* This is called recursively in sidebar_openfiles_update_all(). */
void sidebar_openfiles_add(GeanyDocument *doc)
{
GtkTreeIter *iter = &doc->priv->iter;
GtkTreeIter *parent = get_doc_parent(doc);
@ -409,7 +409,7 @@ static void openfiles_remove(GeanyDocument *doc)
}
void treeviews_openfiles_update(GeanyDocument *doc)
void sidebar_openfiles_update(GeanyDocument *doc)
{
GtkTreeIter *iter = &doc->priv->iter;
gchar *fname;
@ -433,7 +433,7 @@ void treeviews_openfiles_update(GeanyDocument *doc)
sel = gtk_tree_selection_iter_is_selected(treesel, &doc->priv->iter);
openfiles_remove(doc);
treeviews_openfiles_add(doc);
sidebar_openfiles_add(doc);
if (sel)
gtk_tree_selection_select_iter(treesel, &doc->priv->iter);
}
@ -441,7 +441,7 @@ void treeviews_openfiles_update(GeanyDocument *doc)
}
void treeviews_openfiles_update_all()
void sidebar_openfiles_update_all()
{
guint i, page_count;
GeanyDocument *doc;
@ -454,12 +454,12 @@ void treeviews_openfiles_update_all()
if (G_UNLIKELY(doc == NULL))
continue;
treeviews_openfiles_add(doc);
sidebar_openfiles_add(doc);
}
}
void treeviews_remove_document(GeanyDocument *doc)
void sidebar_remove_document(GeanyDocument *doc)
{
openfiles_remove(doc);
@ -468,7 +468,7 @@ void treeviews_remove_document(GeanyDocument *doc)
gtk_widget_destroy(doc->priv->tag_tree);
if (GTK_IS_TREE_VIEW(doc->priv->tag_tree))
{
/* Because it was ref'd in treeviews_update_tag_list, it needs unref'ing */
/* Because it was ref'd in sidebar_update_tag_list, it needs unref'ing */
g_object_unref((gpointer)doc->priv->tag_tree);
}
doc->priv->tag_tree = NULL;
@ -535,7 +535,7 @@ void sidebar_add_common_menu_items(GtkMenu *menu)
static void on_openfiles_show_paths_activate(GtkCheckMenuItem *item, gpointer user_data)
{
documents_show_paths = gtk_check_menu_item_get_active(item);
treeviews_openfiles_update_all();
sidebar_openfiles_update_all();
}
@ -636,7 +636,7 @@ static gboolean tree_model_find_node(GtkTreeModel *model, GtkTreePath *path,
}
void treeviews_select_openfiles_item(GeanyDocument *doc)
void sidebar_select_openfiles_item(GeanyDocument *doc)
{
gtk_tree_model_foreach(GTK_TREE_MODEL(store_openfiles), tree_model_find_node, doc);
}
@ -765,7 +765,7 @@ static gboolean on_taglist_tree_selection_changed(GtkTreeSelection *selection)
}
static gboolean treeviews_key_press_cb(GtkWidget *widget, GdkEventKey *event,
static gboolean sidebar_key_press_cb(GtkWidget *widget, GdkEventKey *event,
gpointer user_data)
{
may_steal_focus = FALSE;
@ -787,7 +787,7 @@ static gboolean treeviews_key_press_cb(GtkWidget *widget, GdkEventKey *event,
}
static gboolean treeviews_button_press_cb(GtkWidget *widget, GdkEventButton *event,
static gboolean sidebar_button_press_cb(GtkWidget *widget, GdkEventButton *event,
G_GNUC_UNUSED gpointer user_data)
{
GtkTreeSelection *selection;
@ -895,7 +895,7 @@ static void on_save_settings(void)
}
void treeviews_init(void)
void sidebar_init(void)
{
GeanyPrefGroup *group;
@ -914,7 +914,7 @@ void treeviews_init(void)
#define WIDGET(w) w && GTK_IS_WIDGET(w)
void treeviews_finalize(void)
void sidebar_finalize(void)
{
if (WIDGET(tv.default_tag_tree))
{

View File

@ -1,5 +1,5 @@
/*
* treeviews.h - this file is part of Geany, a fast and lightweight IDE
* sidebar.h - this file is part of Geany, a fast and lightweight IDE
*
* Copyright 2005-2009 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* Copyright 2006-2009 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
@ -23,8 +23,8 @@
#ifndef GEANY_TREEVIEWS_H
#define GEANY_TREEVIEWS_H 1
#ifndef GEANY_SIDEBAR_H
#define GEANY_SIDEBAR_H 1
typedef struct SidebarTreeviews
@ -46,21 +46,21 @@ enum
SYMBOLS_N_COLUMNS
};
void treeviews_init(void);
void sidebar_init(void);
void treeviews_finalize(void);
void sidebar_finalize(void);
void treeviews_update_tag_list(GeanyDocument *doc, gboolean update);
void sidebar_update_tag_list(GeanyDocument *doc, gboolean update);
void treeviews_openfiles_add(GeanyDocument *doc);
void sidebar_openfiles_add(GeanyDocument *doc);
void treeviews_openfiles_update(GeanyDocument *doc);
void sidebar_openfiles_update(GeanyDocument *doc);
void treeviews_openfiles_update_all(void);
void sidebar_openfiles_update_all(void);
void treeviews_select_openfiles_item(GeanyDocument *doc);
void sidebar_select_openfiles_item(GeanyDocument *doc);
void treeviews_remove_document(GeanyDocument *doc);
void sidebar_remove_document(GeanyDocument *doc);
void sidebar_add_common_menu_items(GtkMenu *menu);

View File

@ -44,7 +44,7 @@
#include "documentprivate.h"
#include "support.h"
#include "msgwindow.h"
#include "treeviews.h"
#include "sidebar.h"
#include "main.h"
#include "navqueue.h"
#include "ui_utils.h"

View File

@ -41,7 +41,7 @@
#include "callbacks.h"
#include "encodings.h"
#include "images.c"
#include "treeviews.h"
#include "sidebar.h"
#include "win32.h"
#include "project.h"
#include "editor.h"
@ -1442,7 +1442,7 @@ void ui_update_tab_status(GeanyDocument *doc)
gtk_widget_modify_fg(doc->priv->tab_label, GTK_STATE_NORMAL, color);
gtk_widget_modify_fg(doc->priv->tab_label, GTK_STATE_ACTIVE, color);
treeviews_openfiles_update(doc);
sidebar_openfiles_update(doc);
}

View File

@ -111,7 +111,7 @@ geany_sources = [
'src/plugins.c', 'src/pluginutils.c', 'src/prefix.c', 'src/prefs.c', 'src/printing.c', 'src/project.c',
'src/sciwrappers.c', 'src/search.c', 'src/socket.c', 'src/stash.c',
'src/symbols.c',
'src/templates.c', 'src/toolbar.c', 'src/tools.c', 'src/treeviews.c',
'src/templates.c', 'src/toolbar.c', 'src/tools.c', 'src/sidebar.c',
'src/ui_utils.c', 'src/utils.c' ]