1999-02-15 Federico Mena Quintero <federico@nuclecu.unam.mx>

* gprefs.c (create_prop_box): Make the preferences dialog modal.
	Also, set the window title and set the window's parent.
	Removed some unused functions.
This commit is contained in:
Miguel de Icaza 1999-02-15 20:14:11 +00:00
parent 2c1f45565b
commit 573cf10675
2 changed files with 18 additions and 27 deletions

View File

@ -1,3 +1,9 @@
1999-02-15 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gprefs.c (create_prop_box): Make the preferences dialog modal.
Also, set the window title and set the window's parent.
Removed some unused functions.
1999-02-14 Federico Mena Quintero <federico@nuclecu.unam.mx> 1999-02-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gdesktop.c (desktop_popup): Handle popup menus for the desktop. * gdesktop.c (desktop_popup): Handle popup menus for the desktop.

View File

@ -72,24 +72,6 @@ typedef struct
typedef GtkWidget* (*CustomCreateFunc) (PrefsDlg *dlg, Property *prop); typedef GtkWidget* (*CustomCreateFunc) (PrefsDlg *dlg, Property *prop);
typedef void (*CustomApplyFunc) (PrefsDlg *dlg, Property *prop); typedef void (*CustomApplyFunc) (PrefsDlg *dlg, Property *prop);
static void
gnome_toggle_show_backup (void)
{
show_backups = !show_backups;
}
static void
gnome_toggle_show_hidden (void)
{
show_dot_files = !show_dot_files;
}
static void
toggle_mix_all_files (void)
{
mix_all_files = !mix_all_files;
}
static Property file_display_props [] = static Property file_display_props [] =
{ {
{ {
@ -135,11 +117,11 @@ static Property confirmation_props [] =
static Property vfs_props [] = static Property vfs_props [] =
{ {
{ {
N_("VFS Timeout :"), PROPERTY_INT, N_("VFS Timeout:"), PROPERTY_INT,
&vfs_timeout, N_("Seconds"), NULL, NULL &vfs_timeout, N_("Seconds"), NULL, NULL
}, },
{ {
N_("Anonymous FTP password :"), PROPERTY_STRING, N_("Anonymous FTP password:"), PROPERTY_STRING,
&ftpfs_anonymous_passwd, NULL, NULL, NULL &ftpfs_anonymous_passwd, NULL, NULL, NULL
}, },
{ {
@ -252,7 +234,7 @@ apply_page_changes (PrefsDlg *dlg, gint pagenum)
while (cur_prop.label != NULL) { while (cur_prop.label != NULL) {
switch (cur_prop.type) { switch (cur_prop.type) {
case PROPERTY_NONE : case PROPERTY_NONE :
g_warning ("Invalid case in gprefs.c:apply_page_changes"); g_warning ("Invalid case in gprefs.c: apply_page_changes");
break; break;
case PROPERTY_BOOL : case PROPERTY_BOOL :
apply_changes_bool (dlg, &cur_prop); apply_changes_bool (dlg, &cur_prop);
@ -411,7 +393,7 @@ create_prop_widget (PrefsDlg *dlg, Property *prop)
{ {
switch (prop->type) { switch (prop->type) {
case PROPERTY_NONE : case PROPERTY_NONE :
g_warning ("Invalid case in gprefs.c - create_prop_widget"); g_warning ("Invalid case in gprefs.c: create_prop_widget");
break; break;
case PROPERTY_BOOL : case PROPERTY_BOOL :
return create_prop_bool (dlg, prop); return create_prop_bool (dlg, prop);
@ -458,8 +440,11 @@ create_prop_box (PrefsDlg *dlg)
{ {
gint i; gint i;
PrefsPage *cur_page; PrefsPage *cur_page;
dlg->prop_box = gnome_property_box_new (); dlg->prop_box = gnome_property_box_new ();
gnome_dialog_set_parent (GNOME_DIALOG (dlg->prop_box), GTK_WINDOW (dlg->panel->xwindow));
gtk_window_set_modal (GTK_WINDOW (dlg->prop_box), TRUE);
gtk_window_set_title (GTK_WINDOW (dlg->prop_box), _("Preferences"));
i = 0; i = 0;
cur_page = &(dlg->prefs_pages [i]); cur_page = &(dlg->prefs_pages [i]);
@ -468,19 +453,19 @@ create_prop_box (PrefsDlg *dlg)
i++; i++;
cur_page = &(dlg->prefs_pages [i]); cur_page = &(dlg->prefs_pages [i]);
} }
gtk_signal_connect (GTK_OBJECT (dlg->prop_box), "apply", gtk_signal_connect (GTK_OBJECT (dlg->prop_box), "apply",
GTK_SIGNAL_FUNC (apply_callback), dlg); GTK_SIGNAL_FUNC (apply_callback), dlg);
} }
void void
gnome_configure_box (GtkWidget *widget, WPanel *panel) gnome_configure_box (GtkWidget *widget, WPanel *panel)
{ {
static PrefsDlg dlg; static PrefsDlg dlg;
dlg.panel = panel; dlg.panel = panel;
dlg.prefs_pages = prefs_pages; dlg.prefs_pages = prefs_pages;
create_prop_box (&dlg); create_prop_box (&dlg);
gtk_widget_show (dlg.prop_box); gtk_widget_show (dlg.prop_box);
} }