1998-12-01 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gscreen.c (panel_switch_new_display_mode): Destroy the old widget. Add the list view to the proper table. * glayout.c: Remove the exit menu option. * gtree.c (gtk_dtree_contains): New routine used to avoid duplicate entries in the tree display.
Этот коммит содержится в:
родитель
1de20c8f87
Коммит
a065078165
@ -1,3 +1,13 @@
|
||||
1998-12-01 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* gscreen.c (panel_switch_new_display_mode): Destroy the old
|
||||
widget. Add the list view to the proper table.
|
||||
|
||||
* glayout.c: Remove the exit menu option.
|
||||
|
||||
* gtree.c (gtk_dtree_contains): New routine used to avoid
|
||||
duplicate entries in the tree display.
|
||||
|
||||
1998-11-30 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||
|
||||
* gscreen.c (panel_icon_list_select_icon): Use gpopup_do_popup().
|
||||
|
@ -281,8 +281,10 @@ GnomeUIInfo gnome_panel_file_menu [] = {
|
||||
{ GNOME_APP_UI_ITEM, N_("R_everse selection"), N_("Reverses the list of tagged files"), reverse_selection_cmd },
|
||||
{ GNOME_APP_UI_SEPARATOR },
|
||||
{ GNOME_APP_UI_ITEM, N_("C_lose"), N_("Close this panel"), gnome_close_panel },
|
||||
#if 0
|
||||
{ GNOME_APP_UI_ITEM, N_("E_xit"), N_("Exit program"), gnome_quit_cmd, NULL, NULL,
|
||||
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT },
|
||||
#endif
|
||||
{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
|
||||
};
|
||||
|
||||
|
@ -276,7 +276,6 @@ x_fill_panel (WPanel *panel)
|
||||
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (panel->tree), panel);
|
||||
|
||||
printf ("Solicitando: %s\n", panel->cwd);
|
||||
gtk_dtree_do_select_dir (GTK_DTREE (panel->tree), panel->cwd);
|
||||
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (panel->tree), panel);
|
||||
@ -529,7 +528,6 @@ panel_file_list_select_row (GtkWidget *file_list, int row, int column, GdkEvent
|
||||
break;
|
||||
|
||||
case GDK_2BUTTON_PRESS:
|
||||
printf ("2\n");
|
||||
gtk_clist_unselect_row (CLIST_FROM_SW (panel->list), row, 0);
|
||||
if (event->button.button == 1)
|
||||
do_enter (panel);
|
||||
@ -1389,10 +1387,10 @@ panel_switch_new_display_mode (WPanel *panel)
|
||||
|
||||
if (!old_list)
|
||||
return;
|
||||
|
||||
|
||||
panel->list = panel_create_file_list (panel);
|
||||
gtk_widget_destroy (old_list);
|
||||
gtk_table_attach (GTK_TABLE (panel->table), panel->list, 0, 1, 1, 2,
|
||||
gtk_table_attach (GTK_TABLE (panel->view_table), panel->list, 0, 1, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
||||
0, 0);
|
||||
|
@ -18,7 +18,14 @@
|
||||
#include "dir-open.xpm"
|
||||
#include "dir-close.xpm"
|
||||
|
||||
#define TREE_SPACING 5
|
||||
#ifdef HACK
|
||||
# define mc_opendir opendir
|
||||
# define mc_closedir closedir
|
||||
# define mc_stat stat
|
||||
# define mc_readdir readdir
|
||||
#endif
|
||||
|
||||
#define TREE_SPACING 3
|
||||
|
||||
static GtkCTreeClass *parent_class = NULL;
|
||||
|
||||
@ -59,10 +66,35 @@ gtk_dtree_get_row_path (GtkCTree *ctree, GtkCTreeNode *row, gint column)
|
||||
if (path [l-1] == '/')
|
||||
path [l-1] = 0;
|
||||
}
|
||||
printf ("get: %s\n", path);
|
||||
return path;
|
||||
}
|
||||
|
||||
static GtkCTreeNode *
|
||||
gtk_dtree_contains (GtkDTree *dtree, GtkCTreeNode *parent, char *text)
|
||||
{
|
||||
GtkCTreeNode *node;
|
||||
char *s;
|
||||
|
||||
g_assert (dtree);
|
||||
g_assert (parent);
|
||||
g_assert (text);
|
||||
|
||||
node = GTK_CTREE_ROW (parent)->children;
|
||||
|
||||
for (; node && GTK_CTREE_ROW (node)->parent == parent;){
|
||||
char *s;
|
||||
|
||||
gtk_ctree_node_get_pixtext (GTK_CTREE (dtree), node, 0, &s, NULL, NULL, NULL);
|
||||
|
||||
if (strcmp (s, text) == 0)
|
||||
return node;
|
||||
|
||||
node = GTK_CTREE_ROW (node)->sibling;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_dtree_load_path (GtkDTree *dtree, char *path, GtkCTreeNode *parent, int level)
|
||||
{
|
||||
@ -108,26 +140,31 @@ gtk_dtree_load_path (GtkDTree *dtree, char *path, GtkCTreeNode *parent, int leve
|
||||
|
||||
text [0] = dirent->d_name;
|
||||
|
||||
sibling = gtk_ctree_insert_node (
|
||||
GTK_CTREE (dtree), parent, NULL,
|
||||
text, TREE_SPACING,
|
||||
dtree->pixmap_close,
|
||||
dtree->bitmap_close,
|
||||
dtree->pixmap_open,
|
||||
dtree->bitmap_open,
|
||||
FALSE, FALSE);
|
||||
/* Do not insert duplicates */
|
||||
sibling = gtk_dtree_contains (dtree, parent, text [0]);
|
||||
|
||||
if (sibling == NULL){
|
||||
sibling = gtk_ctree_insert_node (
|
||||
GTK_CTREE (dtree), parent, NULL,
|
||||
text, TREE_SPACING,
|
||||
dtree->pixmap_close,
|
||||
dtree->bitmap_close,
|
||||
dtree->pixmap_open,
|
||||
dtree->bitmap_open,
|
||||
FALSE, FALSE);
|
||||
|
||||
if (level){
|
||||
gtk_dtree_load_path (dtree, full_name, sibling, level-1);
|
||||
}
|
||||
|
||||
if (level)
|
||||
gtk_dtree_load_path (dtree, full_name, sibling, level-1);
|
||||
|
||||
g_free (full_name);
|
||||
|
||||
if (level == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
mc_closedir (dir);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -223,15 +260,13 @@ gtk_dtree_do_select_dir (GtkDTree *dtree, char *path)
|
||||
s++;
|
||||
npath = g_strdup ("/");
|
||||
|
||||
printf ("Original %s\n", s);
|
||||
while ((current = strtok (s, "/")) != NULL){
|
||||
char *comp, *full_path;
|
||||
GtkCTreeNode *node;
|
||||
|
||||
s = NULL;
|
||||
printf ("Attempting component: %p, %s\n", current, current);
|
||||
full_path = g_concat_dir_and_file (npath, current);
|
||||
/* g_free (npath); */
|
||||
g_free (npath);
|
||||
npath = full_path;
|
||||
|
||||
node = gtk_dtree_lookup_dir (dtree, current_node, current);
|
||||
@ -264,6 +299,8 @@ gtk_dtree_do_select_dir (GtkDTree *dtree, char *path)
|
||||
g_free (dtree->requested_path);
|
||||
dtree->requested_path = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -293,6 +330,8 @@ gtk_dtree_select_dir (GtkDTree *dtree, char *path)
|
||||
dtree->requested_path = g_strdup (path);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user