*** empty log message ***

This commit is contained in:
Miguel de Icaza 1998-03-07 00:05:06 +00:00
parent 5cf9dcb99e
commit 566c79dc42
10 changed files with 114 additions and 48 deletions

View File

@ -1,3 +1,13 @@
Fri Mar 6 14:48:34 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gwidget.c (x_create_radio): Connect to the "toggled" signal to
keep track of the radio button.
* gwidget.c (x_update_input): This can be invoked before the
widget X resources have been allocated. Take care of this.
(x_create_input): update the cursor position as well.
1998-03-06 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gmain.c (get_color): Make it use GdkColorContext correctly.

View File

@ -157,26 +157,23 @@ get_panel_widget (int index)
}
void
gnome_listing_cmd (void)
gnome_listing_cmd (GtkWidget *widget, WPanel *panel)
{
GtkAllocation *alloc = &GTK_WIDGET (panel->list)->allocation;
int view_type, use_msformat;
char *user, *status;
WPanel *p;
int index = 0;
fprintf (stderr, "FIXME: index is hardcoded to 0 now\n");
p = (WPanel *)get_panel_widget (index);
view_type = display_box (p, &user, &status, &use_msformat, index);
view_type = display_box (panel, &user, &status, &use_msformat, index);
if (view_type == -1)
return;
configure_panel_listing (panel, view_type, use_msformat, user, status);
panel_switch_new_display_mode (panel);
}
void configure_box (void);
GnomeUIInfo gnome_panel_filemenu [] = {
{ GNOME_APP_UI_ITEM, "Network link...", NULL, netlink_cmd },
{ GNOME_APP_UI_ITEM, "FTP link...", NULL, ftplink_cmd },
@ -228,15 +225,14 @@ create_container (Dlg_head *h, char *name)
container->splitted = 0;
app = gnome_app_new ("gmc", name);
gtk_widget_set_usize (GTK_WIDGET (app), 400, 200);
panel = panel_new (name);
vbox = gtk_vbox_new (0, 0);
gtk_widget_show (vbox);
gnome_app_set_contents (GNOME_APP (app), vbox);
gnome_app_create_menus (GNOME_APP (app), gnome_panel_menu);
gnome_app_create_menus_with_data (GNOME_APP (app), gnome_panel_menu, panel);
gtk_widget_show (app);
panel = panel_new (name);
gtk_signal_connect (GTK_OBJECT (app),
"enter_notify_event",
GTK_SIGNAL_FUNC (panel_enter_event),

View File

@ -193,7 +193,7 @@ x_adjust_top_file (WPanel *panel)
#define COLUMN_INSET 3
#define CELL_SPACING 1
static void
void
panel_file_list_configure_contents (GtkWidget *file_list, WPanel *panel, int main_width, int height)
{
format_e *format = panel->format;
@ -750,6 +750,21 @@ panel_create_file_list (WPanel *panel)
return file_list;
}
void
panel_switch_new_display_mode (WPanel *panel)
{
GtkWidget *old_list = panel->list;
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_EXPAND | GTK_FILL | GTK_SHRINK,
GTK_EXPAND | GTK_FILL | GTK_SHRINK,
0, 0);
gtk_widget_show (panel->list);
panel_update_contents (panel);
}
static GtkWidget *
panel_create_cwd (WPanel *panel)
{

View File

@ -10,6 +10,7 @@ void x_sort_label_start (WPanel *panel);
void x_reset_sort_labels (WPanel *panel);
WPanel *create_container (Dlg_head *h, char *str);
void panel_file_list_configure_contents (GtkWidget *file_list, WPanel *panel, int main_width, int height);
typedef struct {
int splitted;

View File

@ -76,6 +76,16 @@ x_button_set (WButton *b, char *text)
}
/* Radio buttons */
void
radio_toggle (GtkObject *object, WRadio *r)
{
int idx = (int) gtk_object_get_data (object, "index");
g_return_if_fail (idx != 0);
idx--;
r->sel = idx;
}
int
x_create_radio (Dlg_head *h, widget_data parent, WRadio *r)
{
@ -91,6 +101,8 @@ x_create_radio (Dlg_head *h, widget_data parent, WRadio *r)
} else {
w = gtk_radio_button_new_with_label (group, r->texts [i]);
}
gtk_signal_connect (GTK_OBJECT (w), "toggled", GTK_SIGNAL_FUNC (radio_toggle), r);
gtk_object_set_data (GTK_OBJECT (w), "index", (void *) (i+1));
gtk_box_pack_start_defaults (GTK_BOX (vbox), w);
gtk_widget_show (w);
}
@ -123,6 +135,7 @@ x_create_input (Dlg_head *h, widget_data parent, WInput *in)
gtk_widget_show (entry);
in->widget.wdata = (widget_data) entry;
gtk_entry_set_text (GTK_ENTRY (entry), in->buffer);
gtk_entry_set_position (GTK_ENTRY (entry), in->point);
return 1;
}
@ -130,6 +143,10 @@ void
x_update_input (WInput *in)
{
GtkEntry *entry = GTK_ENTRY (in->widget.wdata);
/* If the widget has not been initialized yet (done by WIDGET_INIT) */
if (!entry)
return;
gtk_entry_set_text (entry, in->buffer);
gtk_entry_set_position (entry, in->point);

View File

@ -1,3 +1,8 @@
Fri Mar 6 14:24:19 1998 Miguel de Icaza <miguel@nuclecu.unam.mx>
* screen.c (string_file_name): In GNOME, the CList widget does the
filename truncation, so we do not do it here.
Thu Mar 5 10:28:40 1998 Norbert Warmuth <k3190@fh-sw.de>
* popt.c (poptParseArgvString): make it compile with the native

View File

@ -1379,6 +1379,47 @@ save_setup_cmd (void)
message (0, " Setup ", " Setup saved to ~/" PROFILE_NAME);
}
void
configure_panel_listing (WPanel *p, int view_type, int use_msformat, char *user, char *status)
{
int err;
p->user_mini_status = use_msformat;
p->list_type = view_type;
if (view_type == list_user || use_msformat){
free (p->user_format);
p->user_format = user;
free (p->user_status_format [view_type]);
p->user_status_format [view_type] = status;
err = set_panel_formats (p);
if (err){
if (err & 0x01){
free (p->user_format);
p->user_format = strdup (DEFAULT_USER_FORMAT);
}
if (err & 0x02){
free (p->user_status_format [view_type]);
p->user_status_format [view_type] = strdup (DEFAULT_USER_FORMAT);
}
}
}
else {
free (user);
free (status);
}
set_panel_formats (p);
paint_panel (p);
do_refresh ();
}
#ifndef HAVE_GNOME
void
info_cmd_no_menu (void)
@ -1422,40 +1463,7 @@ listing_cmd (void)
p = MENU_PANEL_IDX == 0 ? left_panel : right_panel;
p->user_mini_status = use_msformat;
p->list_type = view_type;
if (view_type == list_user || use_msformat){
free (p->user_format);
p->user_format = user;
free (p->user_status_format [view_type]);
p->user_status_format [view_type] = status;
err = set_panel_formats (p);
if (err){
if (err & 0x01){
free (p->user_format);
p->user_format = strdup (DEFAULT_USER_FORMAT);
}
if (err & 0x02){
free (p->user_status_format [view_type]);
p->user_status_format [view_type] = strdup (DEFAULT_USER_FORMAT);
}
}
}
else {
free (user);
free (status);
}
set_panel_formats (p);
paint_panel (p);
do_refresh ();
configure_panel_listing (p, view_type, use_msformat, user, status);
}
void

View File

@ -62,4 +62,5 @@ void quick_cmd_no_menu (void);
void info_cmd_no_menu (void);
void quick_view_cmd (void);
void toggle_listing_cmd (void);
void configure_panel_listing (WPanel *p, int view_type, int use_msformat, char *user, char *status);
#endif /* __CMD_H */

View File

@ -2874,7 +2874,9 @@ int main (int argc, char *argv [])
load_setup ();
#ifndef HAVE_GNOME
#ifdef HAVE_GNOME
init_colors ();
#else
init_curses ();
#endif

View File

@ -315,6 +315,14 @@ string_file_ctime (file_entry *fe, int len)
return file_date (fe->buf.st_ctime);
}
#ifdef HAVE_GNOME
/* In GNOME, the CList truncates the names */
char *
string_file_name (file_entry *fe, int len)
{
return fe->fname;
}
#else
char *
string_file_name (file_entry *fe, int len)
{
@ -323,6 +331,7 @@ string_file_name (file_entry *fe, int len)
else
return fe->fname;
}
#endif
char *
string_space (file_entry *fe, int len)
@ -2030,7 +2039,9 @@ static key_map panel_keymap [] = {
{ XCTRL('t'), mark_file },
{ ALT('o'), chdir_other_panel },
{ ALT('l'), chdir_to_readlink },
#ifndef HAVE_X
{ KEY_DC, delete_cmd},
#endif
{ 0, 0 }
};