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>
|
1998-11-30 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
* gscreen.c (panel_icon_list_select_icon): Use gpopup_do_popup().
|
* 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_ITEM, N_("R_everse selection"), N_("Reverses the list of tagged files"), reverse_selection_cmd },
|
||||||
{ GNOME_APP_UI_SEPARATOR },
|
{ GNOME_APP_UI_SEPARATOR },
|
||||||
{ GNOME_APP_UI_ITEM, N_("C_lose"), N_("Close this panel"), gnome_close_panel },
|
{ 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_UI_ITEM, N_("E_xit"), N_("Exit program"), gnome_quit_cmd, NULL, NULL,
|
||||||
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT },
|
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT },
|
||||||
|
#endif
|
||||||
{ GNOME_APP_UI_ENDOFINFO, 0, 0 }
|
{ 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);
|
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_dtree_do_select_dir (GTK_DTREE (panel->tree), panel->cwd);
|
||||||
|
|
||||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (panel->tree), panel);
|
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;
|
break;
|
||||||
|
|
||||||
case GDK_2BUTTON_PRESS:
|
case GDK_2BUTTON_PRESS:
|
||||||
printf ("2\n");
|
|
||||||
gtk_clist_unselect_row (CLIST_FROM_SW (panel->list), row, 0);
|
gtk_clist_unselect_row (CLIST_FROM_SW (panel->list), row, 0);
|
||||||
if (event->button.button == 1)
|
if (event->button.button == 1)
|
||||||
do_enter (panel);
|
do_enter (panel);
|
||||||
@ -1392,7 +1390,7 @@ panel_switch_new_display_mode (WPanel *panel)
|
|||||||
|
|
||||||
panel->list = panel_create_file_list (panel);
|
panel->list = panel_create_file_list (panel);
|
||||||
gtk_widget_destroy (old_list);
|
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,
|
||||||
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
|
||||||
0, 0);
|
0, 0);
|
||||||
|
@ -18,7 +18,14 @@
|
|||||||
#include "dir-open.xpm"
|
#include "dir-open.xpm"
|
||||||
#include "dir-close.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;
|
static GtkCTreeClass *parent_class = NULL;
|
||||||
|
|
||||||
@ -59,10 +66,35 @@ gtk_dtree_get_row_path (GtkCTree *ctree, GtkCTreeNode *row, gint column)
|
|||||||
if (path [l-1] == '/')
|
if (path [l-1] == '/')
|
||||||
path [l-1] = 0;
|
path [l-1] = 0;
|
||||||
}
|
}
|
||||||
printf ("get: %s\n", path);
|
|
||||||
return 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
|
static gboolean
|
||||||
gtk_dtree_load_path (GtkDTree *dtree, char *path, GtkCTreeNode *parent, int level)
|
gtk_dtree_load_path (GtkDTree *dtree, char *path, GtkCTreeNode *parent, int level)
|
||||||
{
|
{
|
||||||
@ -108,6 +140,10 @@ gtk_dtree_load_path (GtkDTree *dtree, char *path, GtkCTreeNode *parent, int leve
|
|||||||
|
|
||||||
text [0] = dirent->d_name;
|
text [0] = dirent->d_name;
|
||||||
|
|
||||||
|
/* Do not insert duplicates */
|
||||||
|
sibling = gtk_dtree_contains (dtree, parent, text [0]);
|
||||||
|
|
||||||
|
if (sibling == NULL){
|
||||||
sibling = gtk_ctree_insert_node (
|
sibling = gtk_ctree_insert_node (
|
||||||
GTK_CTREE (dtree), parent, NULL,
|
GTK_CTREE (dtree), parent, NULL,
|
||||||
text, TREE_SPACING,
|
text, TREE_SPACING,
|
||||||
@ -117,17 +153,18 @@ gtk_dtree_load_path (GtkDTree *dtree, char *path, GtkCTreeNode *parent, int leve
|
|||||||
dtree->bitmap_open,
|
dtree->bitmap_open,
|
||||||
FALSE, FALSE);
|
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);
|
g_free (full_name);
|
||||||
|
|
||||||
if (level == 0)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mc_closedir (dir);
|
mc_closedir (dir);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -223,15 +260,13 @@ gtk_dtree_do_select_dir (GtkDTree *dtree, char *path)
|
|||||||
s++;
|
s++;
|
||||||
npath = g_strdup ("/");
|
npath = g_strdup ("/");
|
||||||
|
|
||||||
printf ("Original %s\n", s);
|
|
||||||
while ((current = strtok (s, "/")) != NULL){
|
while ((current = strtok (s, "/")) != NULL){
|
||||||
char *comp, *full_path;
|
char *comp, *full_path;
|
||||||
GtkCTreeNode *node;
|
GtkCTreeNode *node;
|
||||||
|
|
||||||
s = NULL;
|
s = NULL;
|
||||||
printf ("Attempting component: %p, %s\n", current, current);
|
|
||||||
full_path = g_concat_dir_and_file (npath, current);
|
full_path = g_concat_dir_and_file (npath, current);
|
||||||
/* g_free (npath); */
|
g_free (npath);
|
||||||
npath = full_path;
|
npath = full_path;
|
||||||
|
|
||||||
node = gtk_dtree_lookup_dir (dtree, current_node, current);
|
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);
|
g_free (dtree->requested_path);
|
||||||
dtree->requested_path = NULL;
|
dtree->requested_path = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -293,6 +330,8 @@ gtk_dtree_select_dir (GtkDTree *dtree, char *path)
|
|||||||
dtree->requested_path = g_strdup (path);
|
dtree->requested_path = g_strdup (path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user