don't remember exactly what I did -- much of this is from before the CVS

machine went down and I went on vacation.  Newer toolbars...  It now
compiles too (gicon.c had some broken code in it)
This commit is contained in:
Jonathan Blandford 1999-01-18 21:25:55 +00:00
parent b37abf7e28
commit 366f5e774b
8 changed files with 107 additions and 37 deletions

View File

@ -1,3 +1,7 @@
1999-01-13 Jonathan Blandford <jrb@redhat.com>
* Make.common.in (gnewdir): new path.
Sun Jan 17 03:19:47 1999 Timur Bakeyev <mc@bat.ru> Sun Jan 17 03:19:47 1999 Timur Bakeyev <mc@bat.ru>
* configure.in: Add comments before "Let" and "the" - typo. Add new * configure.in: Add comments before "Let" and "the" - typo. Add new

View File

@ -22,6 +22,7 @@ corbadir = $(sysconfdir)/CORBA/servers
libdir = $(exec_prefix)/lib/mc libdir = $(exec_prefix)/lib/mc
idldir = $(prefix)/share/idl idldir = $(prefix)/share/idl
suppbindir = $(libdir)/bin suppbindir = $(libdir)/bin
gnewdir = $(prefix)/share/mc/templates
tidir = $(libdir)/term tidir = $(libdir)/term
extfsdir = $(libdir)/extfs extfsdir = $(libdir)/extfs
datadir = @datadir@ datadir = @datadir@

View File

@ -1,3 +1,7 @@
1999-01-18 Jonathan Blandford <jrb@redhat.com>
* gtkdtree.c (gtk_dtree_construct): change ctree_set_reorderable.
1999-01-18 Federico Mena Quintero <federico@nuclecu.unam.mx> 1999-01-18 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop.c (icon_event): Rewrote event handling for icons on the * gdesktop.c (icon_event): Rewrote event handling for icons on the
@ -43,6 +47,8 @@
* glayout.c (create_container): finished the New->menu. Looks * glayout.c (create_container): finished the New->menu. Looks
better now. better now.
(create_container): Moved the statusbar creaton. Now you can get
the hints.
* gcmd.c (gnome_run_new): new function. * gcmd.c (gnome_run_new): new function.

View File

@ -292,10 +292,10 @@ gicon_get_icon_for_file (file_entry *fe)
return gicon_get_icon_for_file_speed (fe, TRUE); return gicon_get_icon_for_file_speed (fe, TRUE);
} }
typedef lookup_name_closure_t { typedef struct lookup_name_closure_t {
char *name; char *name;
void *image; void *image;
}; } lookup_name_closure_t;
void void
search_image (gpointer key, gpointer value, gpointer user_data) search_image (gpointer key, gpointer value, gpointer user_data)
@ -318,7 +318,7 @@ gicon_image_to_name (GdkImlibImage *image)
closure.image = image; closure.image = image;
closure.name = NULL; closure.name = NULL;
g_hash_table_foreach (icon_hash, check_key, &search_image, &closure); g_hash_table_foreach (icon_hash, &search_image, &closure);
if (closure.name == NULL) if (closure.name == NULL)
return g_strdup (ICONDIR "i-regular.png"); return g_strdup (ICONDIR "i-regular.png");

View File

@ -280,7 +280,7 @@ void configure_box (void);
GtkCheckMenuItem *gnome_toggle_snap (void); GtkCheckMenuItem *gnome_toggle_snap (void);
GnomeUIInfo gnome_panel_new_menu [] = { GnomeUIInfo gnome_panel_new_menu [] = {
{ GNOME_APP_UI_ITEM, N_("_Terminal"), N_("Launch a new terminal in the current directory"), NULL}, { GNOME_APP_UI_ITEM, N_("_Terminal"), N_("Launch a new terminal in the current directory"), gnome_open_terminal},
/* If this ever changes, make sure you update create_new_menu accordingly. */ /* If this ever changes, make sure you update create_new_menu accordingly. */
{ GNOME_APP_UI_ITEM, N_("_Directory..."), N_("Creates a new directory"), gnome_mkdir_cmd }, { GNOME_APP_UI_ITEM, N_("_Directory..."), N_("Creates a new directory"), gnome_mkdir_cmd },
{ GNOME_APP_UI_ENDOFINFO, 0, 0 } { GNOME_APP_UI_ENDOFINFO, 0, 0 }
@ -575,6 +575,11 @@ create_container (Dlg_head *h, char *name, char *geometry)
gnome_app_set_contents (GNOME_APP (app), vbox); gnome_app_set_contents (GNOME_APP (app), vbox);
gnome_app_create_menus_with_data (GNOME_APP (app), gnome_panel_menu, panel); gnome_app_create_menus_with_data (GNOME_APP (app), gnome_panel_menu, panel);
create_new_menu (GNOME_APP (app), panel); create_new_menu (GNOME_APP (app), panel);
panel->ministatus = GNOME_APPBAR(gnome_appbar_new(FALSE, TRUE, GNOME_PREFERENCES_NEVER));
gnome_app_set_statusbar(GNOME_APP (app), GTK_WIDGET(panel->ministatus));
gnome_app_install_menu_hints (GNOME_APP (app), gnome_panel_menu);
/* /*
* I am trying to unclutter the screen, so this toolbar is gone now * I am trying to unclutter the screen, so this toolbar is gone now
*/ */

View File

@ -81,6 +81,7 @@ GtkWidget *drag_multiple_ok = NULL;
static void panel_file_list_configure_contents (GtkWidget *sw, WPanel *panel, int main_width, int height); static void panel_file_list_configure_contents (GtkWidget *sw, WPanel *panel, int main_width, int height);
#define CLIST_FROM_SW(panel_list) GTK_CLIST (GTK_BIN (panel_list)->child) #define CLIST_FROM_SW(panel_list) GTK_CLIST (GTK_BIN (panel_list)->child)
@ -2170,6 +2171,42 @@ button_switch_to_custom_listing (WPanel *panel)
{ {
return button_switch_to (listing_custom_xpm, GTK_SIGNAL_FUNC (do_switch_to_custom_listing), panel); return button_switch_to (listing_custom_xpm, GTK_SIGNAL_FUNC (do_switch_to_custom_listing), panel);
} }
static GnomeUIInfo viewbar[] = {
{ GNOME_APP_UI_ITEM, N_("Icon"), N_("Switch view to an Icon view"), button_switch_to_icon, NULL, NULL, \
GNOME_APP_PIXMAP_DATA, listing_iconic_xpm, 0, (GdkModifierType) 0, NULL },
{ GNOME_APP_UI_ITEM, N_("Brief"), N_("Switch view to show just file name and type"), button_switch_to_brief_listing, NULL, NULL, \
GNOME_APP_PIXMAP_DATA, listing_brief_list_xpm, 0, (GdkModifierType) 0, NULL },
{ GNOME_APP_UI_ITEM, N_("Detailed"), N_("Switch view to show detailed file statistics"), button_switch_to_full_listing, NULL, NULL, \
GNOME_APP_PIXMAP_DATA, listing_list_xpm, 0, (GdkModifierType) 0, NULL },
{ GNOME_APP_UI_ITEM, N_("Custom"), N_("Switch view to show custom determined statistics"), button_switch_to_custom_listing, NULL, NULL, \
GNOME_APP_PIXMAP_DATA, listing_custom_xpm, 0, (GdkModifierType) 0, NULL },
GNOMEUIINFO_END
};
static GnomeUIInfo toolbar[] = {
GNOMEUIINFO_ITEM_STOCK (N_("Back"), N_("Go to the previously visited directory"),
panel_back, GNOME_STOCK_PIXMAP_BACK),
GNOMEUIINFO_ITEM_STOCK (N_("Up"), N_("Go up a level in the directory heirarchy"),
panel_up, GNOME_STOCK_PIXMAP_UP),
GNOMEUIINFO_ITEM_STOCK (N_("Forward"), N_("Go to the next directory"),
panel_fwd, GNOME_STOCK_PIXMAP_FORWARD),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_ITEM_STOCK (N_("Home"), N_("Go to your home directory"),
panel_fwd, GNOME_STOCK_PIXMAP_HOME),
GNOMEUIINFO_SEPARATOR,
GNOMEUIINFO_RADIOLIST(viewbar),
GNOMEUIINFO_END
};
static void
do_ui_signal_connect (GnomeUIInfo *uiinfo, gchar *signal_name,
GnomeUIBuilderData *uibdata)
{
if (uiinfo->moreinfo)
gtk_signal_connect (GTK_OBJECT (uiinfo->widget),
signal_name, uiinfo->moreinfo, uibdata->data ?
uibdata->data : uiinfo->user_data);
}
static void static void
tree_size_allocate (GtkWidget *widget, GtkAllocation *allocation, WPanel *panel) tree_size_allocate (GtkWidget *widget, GtkAllocation *allocation, WPanel *panel)
@ -2189,11 +2226,11 @@ void
x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel) x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
{ {
GtkWidget *status_line, *filter, *vbox, *ministatus_box; GtkWidget *status_line, *filter, *vbox, *ministatus_box;
GtkWidget *frame, *cwd, *back_p, *fwd_p, *up_p; GtkWidget *cwd, *back_p, *fwd_p, *up_p;
GtkWidget *hbox, *evbox, *dock, *box; GtkWidget *hbox, *evbox, *dock, *box;
GtkWidget *table_frame; GnomeUIBuilderData uibdata;
int display;
panel->xwindow = gtk_widget_get_toplevel (GTK_WIDGET (panel->widget.wdata)); panel->xwindow = gtk_widget_get_toplevel (GTK_WIDGET (panel->widget.wdata));
panel->table = gtk_table_new (2, 1, 0); panel->table = gtk_table_new (2, 1, 0);
@ -2262,39 +2299,53 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
/* We do not want the focus by default (and the previos add_widget just gave it to us) */ /* We do not want the focus by default (and the previos add_widget just gave it to us) */
h->current = h->current->prev; h->current = h->current->prev;
/* /*
* History buttons, and updir. * We go through a lot of pain, wrestling with gnome_app* and gmc's @#$&*#$ internal structure and
* make the #@$*&@#$ toolbars here...
*/ */
back_p = gnome_stock_pixmap_widget_new (panel->xwindow, GNOME_STOCK_MENU_BACK);
fwd_p = gnome_stock_pixmap_widget_new (panel->xwindow, GNOME_STOCK_MENU_FORWARD); status_line = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
up_p = gnome_stock_pixmap_widget_new (panel->xwindow, GNOME_STOCK_MENU_UP); uibdata.connect_func = do_ui_signal_connect;
panel->up_b = gtk_button_new (); uibdata.data = panel;
panel->back_b = gtk_button_new (); uibdata.is_interp = FALSE;
panel->fwd_b = gtk_button_new (); uibdata.relay_func = NULL;
gtk_container_add (GTK_CONTAINER (panel->back_b), back_p); uibdata.destroy_func = NULL;
gtk_container_add (GTK_CONTAINER (panel->fwd_b), fwd_p);
gtk_container_add (GTK_CONTAINER (panel->up_b), up_p); gnome_app_fill_toolbar_custom (GTK_TOOLBAR (status_line), toolbar, &uibdata, NULL);
gtk_signal_connect (GTK_OBJECT (panel->back_b), "clicked", GTK_SIGNAL_FUNC(panel_back), panel); gnome_app_add_toolbar (GNOME_APP (panel->xwindow),
gtk_signal_connect (GTK_OBJECT (panel->fwd_b), "clicked", GTK_SIGNAL_FUNC(panel_fwd), panel); GTK_TOOLBAR (status_line),
gtk_signal_connect (GTK_OBJECT (panel->up_b), "clicked", GTK_SIGNAL_FUNC(panel_up), panel); "gmc-toolbar0",
GNOME_DOCK_ITEM_BEH_EXCLUSIVE,
GNOME_DOCK_TOP,
2, 0, 0);
panel->back_b = toolbar[0].widget;
panel->up_b = toolbar[1].widget;
panel->fwd_b = toolbar[2].widget;
panel_update_marks (panel); panel_update_marks (panel);
/* /*
* Here we make the toolbars * Here we make the view buttons.
*/ */
status_line = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH); status_line = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gtk_container_set_border_width (GTK_CONTAINER (status_line), 3); gtk_container_set_border_width (GTK_CONTAINER (status_line), 3);
evbox = gtk_event_box_new (); evbox = gtk_event_box_new ();
hbox = gtk_hbox_new (FALSE, 2); hbox = gtk_hbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (evbox), hbox); gtk_container_add (GTK_CONTAINER (evbox), hbox);
gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_("Location:")), FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), cwd, FALSE, FALSE, 0);
gtk_toolbar_append_widget (GTK_TOOLBAR (status_line), gtk_toolbar_append_widget (GTK_TOOLBAR (status_line),
evbox, evbox,
NULL, NULL); NULL, NULL);
gtk_toolbar_append_space (GTK_TOOLBAR (status_line)); gtk_box_pack_start (GTK_BOX (hbox), gtk_label_new (_("Location:")), FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), cwd, FALSE, FALSE, 0);
dock = gnome_dock_item_new ("gmc-toolbar1", GNOME_DOCK_ITEM_BEH_EXCLUSIVE | GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL);
gtk_container_add (GTK_CONTAINER(dock),status_line);
gnome_dock_add_item (GNOME_DOCK(GNOME_APP (panel->xwindow)->dock),
GNOME_DOCK_ITEM (dock), GNOME_DOCK_TOP, 1, 0, 0, FALSE);
gtk_widget_show_all (dock);
#if 0
status_line = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gtk_toolbar_append_widget (GTK_TOOLBAR (status_line), gtk_toolbar_append_widget (GTK_TOOLBAR (status_line),
panel->back_b, panel->back_b,
"Go to the previous directory", NULL); "Go to the previous directory", NULL);
@ -2317,11 +2368,14 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
gtk_toolbar_append_widget (GTK_TOOLBAR (status_line), gtk_toolbar_append_widget (GTK_TOOLBAR (status_line),
button_switch_to_custom_listing (panel), button_switch_to_custom_listing (panel),
"Custom view", NULL); "Custom view", NULL);
dock = gnome_dock_item_new ("gmc-toolbar", GNOME_DOCK_ITEM_BEH_EXCLUSIVE | GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL); gnome_app_add_toolbar (GNOME_APP (panel->xwindow),
gtk_container_add (GTK_CONTAINER(dock),status_line); GTK_TOOLBAR (status_line),
gnome_dock_add_item (GNOME_DOCK(GNOME_APP (panel->xwindow)->dock), "gmc-toolbar2",
GNOME_DOCK_ITEM (dock), GNOME_DOCK_TOP, 1, 0, 0, FALSE); GNOME_DOCK_ITEM_BEH_EXCLUSIVE,
gtk_widget_show_all (dock); GNOME_DOCK_TOP,
2, 0, 0);
gtk_widget_show_all (status_line);
#endif
panel->view_table = gtk_table_new (1, 1, 0); panel->view_table = gtk_table_new (1, 1, 0);
gtk_widget_show (panel->view_table); gtk_widget_show (panel->view_table);
@ -2329,8 +2383,6 @@ x_create_panel (Dlg_head *h, widget_data parent, WPanel *panel)
/* /*
* The status bar. * The status bar.
*/ */
panel->ministatus = GNOME_APPBAR(gnome_appbar_new(FALSE, TRUE, GNOME_PREFERENCES_NEVER));
gnome_app_set_statusbar(GNOME_APP (panel->xwindow), GTK_WIDGET(panel->ministatus));
ministatus_box = gtk_frame_new (NULL); ministatus_box = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME(ministatus_box), GTK_SHADOW_IN); gtk_frame_set_shadow_type (GTK_FRAME(ministatus_box), GTK_SHADOW_IN);

View File

@ -532,7 +532,7 @@ gtk_dtree_construct (GtkDTree *dtree)
gtk_clist_columns_autosize (clist); gtk_clist_columns_autosize (clist);
gtk_ctree_set_line_style (ctree, GTK_CTREE_LINES_DOTTED); gtk_ctree_set_line_style (ctree, GTK_CTREE_LINES_DOTTED);
gtk_ctree_set_reorderable (ctree, FALSE); gtk_clist_set_reorderable (GTK_CLIST (ctree), FALSE);
gdk_dtree_load_pixmaps (dtree); gdk_dtree_load_pixmaps (dtree);
gtk_dtree_load_root_tree (dtree); gtk_dtree_load_root_tree (dtree);

View File

@ -29,6 +29,7 @@
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> /* For chdir(), readlink() and getwd()/getcwd() */ # include <unistd.h> /* For chdir(), readlink() and getwd()/getcwd() */
#endif #endif
/*#include "mc.h"*/
#include "mem.h" #include "mem.h"
#include "mad.h" #include "mad.h"
@ -2563,7 +2564,8 @@ panel_re_sort (WPanel *panel)
char *filename; char *filename;
int i; int i;
g_return_if_fail (panel != NULL); if (panel == NULL)
return;
filename = strdup (selection (panel)->fname); filename = strdup (selection (panel)->fname);
unselect_item (panel); unselect_item (panel);