From 482e8af0fbb40abdee780732f4fdca459786ee1b Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Thu, 16 Apr 1998 04:22:56 +0000 Subject: [PATCH] My vain attempts at getting Radio Buttons working properly -mig --- gnome/ChangeLog | 3 +++ gnome/gnome.TODO | 53 ------------------------------------------------ gnome/gwidget.c | 39 +++++++++++++++++++++++++++++++---- 3 files changed, 38 insertions(+), 57 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 2b0e7b51c..3f336f3a5 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,5 +1,8 @@ 1998-04-15 Miguel de Icaza + * gwidget.c (remove_hotkey, x_create_radio): Radio buttons should + not display the special Hotkey specificator. + * gcmd.c (gnome_close_panel): Implement the close-the-panel functionality. diff --git a/gnome/gnome.TODO b/gnome/gnome.TODO index b447fe6c6..16b55650a 100644 --- a/gnome/gnome.TODO +++ b/gnome/gnome.TODO @@ -61,11 +61,6 @@ General Comments I think the thumb should follow in both cases. This is a gtk comment I'm sure. -DONE - some dialogs only had a single entry box (like the ftp link one), -DONE when you hit return in the entrybox it would be nice if that mapped -DONE to hitting 'Ok' so you wouldnt have to hit Ok manually. - - Panel comments --------------- @@ -81,12 +76,6 @@ Panel comments know the string is truncated in that column. I think its a really nice touch, but not a complete show stopper. -> - I take it the shaped-window DnD isnt working, obviously we want to have -> nice looking drag cursor behavior at some point. - -=========> This works on my machine. When you start a drag from a file, -=========> or a group of files it should show a little icon. Same applies -=========> to dragging the desktop icons. - the user needs some feedback that something is happening - for example, on an ftp link, the cursor needs to change or a modal dialog popping @@ -95,30 +84,12 @@ Panel comments - 'Compare panels' doesnt appear to do anything - i didnt see any feedback after I chose the compare method. -> - No matter what the sort mode, the directories seem to always get listed -> first. Maybe this should be personal preference? -======> this is a setting. It is called mix files. If it is set, then you -======> get a mixed directory/file listing, if not, you get the directories first. - - Alt-t didnt seem to change the listing mode. - the pull-downs on the entry boxes under the floating menubar dont seem to do anything. I thought they might act as a history of the last few directories visited or something. -DONE - a toobar with a 'back' type button would be handy - I realize the '..' -DONE folder does the same thing, but in a long file listing its nice to -DONE just have a button to do it. - -DONE - I got several 'sigpipes' when trying to view a ftpfs file, or -DONE when trying to view RPM tags via the rpmfs. -DONE -DONE Open a RPM, then got into the INFO pseudo-dir, the VIEW a RPM tag. It -DONE will sigpipe. - -DONE - is there a way to click and drag and select all the files you drag -DONE over? Sortof a interactive 'select group' option. - - the internal viewer, in hex mode, seems to shove the ASCII side of the view (the rightmost column) off the side of the window. @@ -126,16 +97,6 @@ DONE over? Sortof a interactive 'select group' option. - internal viewer - search should hilight the matching text -DONE - some files when I try to 'Open' them, it just does nothing. I'm -DONE guessing no association existed - if so it should tell me and let -DONE me create an association - -DONE - I couldnt view files inside of a RPM which I was browsing via the ftpfs -DONE is this just cause I'm nuts to try? - -DONE - it might be good to do a rescan after a panel accepts a drag event. Is -DONE that an option? - - I didnt get an error message when I tried to change the file modes on a file I didnt own. @@ -151,15 +112,6 @@ DONE that an option? Configure Options ----------------- -DONE - Buttons at bottom (Ok, Save, Cancel) - Save overlays the Ok button - -DONE - the 'Pause after run' radio buttons - you can select 'on dumb Terminals' -DONE and Never at the same time, etc etc. I only one should be selectable -DONE at a time. I could get several combinations where multiple were selected. - -DONE - no matter if I hit 'Ok' or 'Save', if I immediately reenter the Options -DONE dialog, the check buttons are all reset, ie. it didnt 'keep' my settings. - - need some sort of help for all these options, they aren't too intuitive. We can't assume people are going to read the man page. @@ -179,9 +131,4 @@ VFS Options of feedback while grabbing a ls listing from a ftp server would be cool. -Internal Viewer ---------------- - -DONE - no vertical scrollbar! - diff --git a/gnome/gwidget.c b/gnome/gwidget.c index 1c129029a..268061f02 100644 --- a/gnome/gwidget.c +++ b/gnome/gwidget.c @@ -152,13 +152,27 @@ x_radio_focus_item (WRadio *radio) } } +void +x_radio_toggle (WRadio *radio) +{ + GList *children = GTK_BOX (radio->widget.wdata)->children; + int i; + + for (i = 0; i < radio->count; i++){ + GtkBoxChild *bc = (GtkBoxChild *) children->data; + + if (GTK_TOGGLE_BUTTON (bc->widget)->active) + gtk_toggle_button_toggled + gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (bc->widget), (i == radio->sel) ? 1 : 0); + children = children->next; + } +} + static void radio_toggle (GtkObject *object, WRadio *r) { int idx = (int) gtk_object_get_data (object, "index"); - printf ("WEEEEE RADIO!\n"); - if (!GTK_TOGGLE_BUTTON (object)->active) return; @@ -167,6 +181,18 @@ radio_toggle (GtkObject *object, WRadio *r) r->sel = idx; } +static char * +remove_hotkey (char *text) +{ + char *t = g_strdup (text); + char *p = strchr (t,'&'); + + if (p) + strcpy (p, p+1); + + return t; +} + int x_create_radio (Dlg_head *h, widget_data parent, WRadio *r) { @@ -176,12 +202,16 @@ x_create_radio (Dlg_head *h, widget_data parent, WRadio *r) vbox = gtk_vbox_new (0, 0); for (i = 0; i < r->count; i++){ + char *text = remove_hotkey (_(r->texts [i])); + if (i == 0){ - w = gtk_radio_button_new_with_label (NULL, r->texts [i]); + w = gtk_radio_button_new_with_label (NULL, text); group = gtk_radio_button_group (GTK_RADIO_BUTTON (w)); + r->first_gtk_radio = w; } else { - w = gtk_radio_button_new_with_label (group, r->texts [i]); + w = gtk_radio_button_new_with_label (group, text); } + g_free (text); gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (w), (i == r->sel)); gtk_signal_connect (GTK_OBJECT (w), "toggled", GTK_SIGNAL_FUNC (radio_toggle), r); gtk_object_set_data (GTK_OBJECT (w), "index", (void *) (i+1)); @@ -190,6 +220,7 @@ x_create_radio (Dlg_head *h, widget_data parent, WRadio *r) gtk_widget_show_all (vbox); r->widget.wdata = (widget_data) vbox; + return 1; }