1999-01-03 Miguel de Icaza <miguel@nuclecu.unam.mx>

* main.c (update_one_panel_widget): GNOME version does the panel
	update here (this is an optimization, as we do not want do_refresh
	to do anything.

	* dialog.c (do_refresh): Remove this optimization as it was
	disabling the repainting of the screen contents.

	* hotlist.c (done_hotlist): The hotlist might not be loaded
	anymore.

1999-01-02  Miguel de Icaza  <miguel@nuclecu.unam.mx> 1999-01-03  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* gtools.c (query_dialog): Simplified.
This commit is contained in:
Miguel de Icaza 1999-01-03 18:34:40 +00:00
parent 4c94e8bdf4
commit b862fdfd8a
8 changed files with 74 additions and 36 deletions

View File

@ -1,3 +1,7 @@
1999-01-03 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gtools.c (query_dialog): Simplified.
1999-01-02 Jonathan Blandford <jrb@redhat.com>
* gcmd.c (gnome_sort_cmd): pretified
@ -6,7 +10,6 @@
* glayout.c: rearrange the edit menu some.
* gscreen.c (x_create_panel): new icon view icons -- brief and
custom.

View File

@ -19,6 +19,7 @@
#include "dialog.h"
#include "color.h"
#include "gmain.h"
#include "gwidget.h"
Dlg_head *last_query_dlg;
static int sel_pos;
@ -38,34 +39,35 @@ pack_button (WButton *button, GtkBox *box)
int query_dialog (char *header, char *text, int flags, int count, ...)
{
va_list ap;
Dlg_head *h;
WLabel *label;
GtkWidget *dialog;
int i, result = -1;
gchar **buttons;
char *stock;
if (header == MSG_ERROR)
header = _("Error");
h = create_dlg (0, 0, 0, 0, dialog_colors, default_dlg_callback, "[QueryBox]", "query",
DLG_NO_TED | DLG_NO_TOPLEVEL);
/* extract the buttons from the args */
buttons = g_malloc (sizeof (gchar[flags + 1]));
va_start (ap, count);
for (i = 0; i < count; i++)
buttons[i] = va_arg (ap, char *);
for (i = 0; i < count; i++){
char *text;
text = va_arg (ap, char *);
stock = stock_from_text (text);
if (stock)
buttons [i] = stock;
else
buttons [i] = text;
}
va_end (ap);
buttons[i] = NULL;
dialog = gnome_message_box_newv (text, header, buttons);
switch (gnome_dialog_run_and_close (GNOME_DIALOG (dialog))){
case B_CANCEL:
break;
default:
result = h->ret_value - B_USER;
}
result = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
return result;
}

View File

@ -82,6 +82,29 @@ gbutton_callback (GtkWidget *w, void *data)
}
}
char *
stock_from_text (char *text)
{
char *stock;
if (strcasecmp (text, _("ok")) == 0)
stock = GNOME_STOCK_BUTTON_OK;
else if (strcasecmp (text, _("cancel")) == 0)
stock = GNOME_STOCK_BUTTON_CANCEL;
else if (strcasecmp (text, _("help")) == 0)
stock = GNOME_STOCK_BUTTON_HELP;
else if (strcasecmp (text, _("yes")) == 0)
stock = GNOME_STOCK_BUTTON_YES;
else if (strcasecmp (text, _("no")) == 0)
stock = GNOME_STOCK_BUTTON_NO;
else if (strcasecmp (text, _("exit")) == 0)
stock = GNOME_STOCK_BUTTON_CLOSE;
else if (strcasecmp (text, _("abort")) == 0)
stock = GNOME_STOCK_BUTTON_CANCEL;
else
stock = 0;
}
int
x_create_button (Dlg_head *h, widget_data parent, WButton *b)
{
@ -89,22 +112,7 @@ x_create_button (Dlg_head *h, widget_data parent, WButton *b)
char *stock;
int tag;
if (strcasecmp (b->text, _("ok")) == 0)
stock = GNOME_STOCK_BUTTON_OK;
else if (strcasecmp (b->text, _("cancel")) == 0)
stock = GNOME_STOCK_BUTTON_CANCEL;
else if (strcasecmp (b->text, _("help")) == 0)
stock = GNOME_STOCK_BUTTON_HELP;
else if (strcasecmp (b->text, _("yes")) == 0)
stock = GNOME_STOCK_BUTTON_YES;
else if (strcasecmp (b->text, _("no")) == 0)
stock = GNOME_STOCK_BUTTON_NO;
else if (strcasecmp (b->text, _("exit")) == 0)
stock = GNOME_STOCK_BUTTON_CLOSE;
else if (strcasecmp (b->text, _("abort")) == 0)
stock = GNOME_STOCK_BUTTON_CANCEL;
else
stock = 0;
stock = stock_from_text (b->text);
if (stock){
button = gnome_stock_button (stock);

View File

@ -1,4 +1,6 @@
#ifndef __GWIDGET_H
#define __GWIDGET_H
char *stock_from_text (char *text);
#endif /* __GWIDGET_H */

View File

@ -1,3 +1,15 @@
1999-01-03 Miguel de Icaza <miguel@nuclecu.unam.mx>
* main.c (update_one_panel_widget): GNOME version does the panel
update here (this is an optimization, as we do not want do_refresh
to do anything.
* dialog.c (do_refresh): Remove this optimization as it was
disabling the repainting of the screen contents.
* hotlist.c (done_hotlist): The hotlist might not be loaded
anymore.
1999-01-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* widget.c (listbox_new): Under GNOME, height of the listbox might

View File

@ -1600,13 +1600,18 @@ int save_hotlist (void)
void done_hotlist (void)
{
remove_group (hotlist);
if (hotlist)
remove_group (hotlist);
hotlist_state.loaded = 0;
if (hotlist->label)
free (hotlist->label);
if (hotlist->directory)
free (hotlist->directory);
free (hotlist);
if (hotlist){
if (hotlist->label)
free (hotlist->label);
if (hotlist->directory)
free (hotlist->directory);
free (hotlist);
}
if (hotlist_file_name)
free (hotlist_file_name);
hotlist_file_name = 0;

View File

@ -446,6 +446,11 @@ update_one_panel_widget (WPanel *panel, int force_update, char *current_file)
if (free_pointer)
free (current_file);
#ifdef HAVE_X
paint_panel (panel);
panel->dirty = 0;
#endif
}
#ifndef PORT_HAS_UPDATE_PANELS

View File

@ -1065,6 +1065,7 @@ panel_reload (WPanel *panel)
panel->count = do_reload_dir (&panel->dir, panel->sort_type, panel->count,
panel->reverse, panel->case_sensitive, panel->filter);
panel->dirty = 1;
if (panel->selected >= panel->count)
do_select (panel, panel->count-1);