1999-04-06 05:00:20 +04:00
|
|
|
/*
|
|
|
|
* Preferences configuration page for the GNU Midnight Commander
|
|
|
|
*
|
|
|
|
* Author:
|
|
|
|
* Jonathan Blandford (jrb@redhat.com)
|
|
|
|
*/
|
1999-01-09 03:24:03 +03:00
|
|
|
#include <config.h>
|
|
|
|
#include "x.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include "dir.h"
|
|
|
|
#include "panel.h"
|
|
|
|
#include "gscreen.h"
|
|
|
|
#include "main.h"
|
|
|
|
#include "gmain.h"
|
|
|
|
#include "cmd.h"
|
|
|
|
#include "boxes.h"
|
|
|
|
#include "profile.h"
|
|
|
|
#include "setup.h"
|
|
|
|
#include "panelize.h"
|
|
|
|
#include "dialog.h"
|
|
|
|
#include "layout.h"
|
1999-02-25 22:13:31 +03:00
|
|
|
#include "gcustom-layout.h"
|
1999-01-09 03:24:03 +03:00
|
|
|
#include "../vfs/vfs.h"
|
|
|
|
#include "gprefs.h"
|
1999-04-06 05:00:20 +04:00
|
|
|
#include "gdesktop.h"
|
1999-01-09 03:24:03 +03:00
|
|
|
|
1999-01-13 00:50:25 +03:00
|
|
|
/* Orphan confirmation options */
|
|
|
|
/* Auto save setup */
|
|
|
|
/* use internal edit */ /* maybe have a mime-type capplet for these */
|
|
|
|
/* use internal view */
|
|
|
|
/* complete: show all */
|
|
|
|
/* Animation??? */
|
|
|
|
/* advanced chown */
|
|
|
|
/* cd follows links */
|
|
|
|
/* safe delete */
|
1999-01-20 01:10:19 +03:00
|
|
|
|
|
|
|
extern int vfs_timeout;
|
|
|
|
extern int ftpfs_always_use_proxy;
|
|
|
|
extern char* ftpfs_anonymous_passwd;
|
|
|
|
extern int file_op_compute_totals;
|
1999-01-28 08:48:02 +03:00
|
|
|
extern int we_can_afford_the_speed;
|
1999-01-20 01:10:19 +03:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
PROPERTY_NONE,
|
|
|
|
PROPERTY_BOOL,
|
|
|
|
PROPERTY_STRING,
|
|
|
|
PROPERTY_INT,
|
|
|
|
PROPERTY_CUSTOM
|
|
|
|
} PropertyType_e;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
gchar *label;
|
|
|
|
PropertyType_e type;
|
|
|
|
gpointer property_variable;
|
|
|
|
gpointer extra_data1;
|
|
|
|
gpointer extra_data2;
|
|
|
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
} Property;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
gchar *title;
|
|
|
|
Property *props;
|
|
|
|
} PrefsPage;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WPanel *panel;
|
|
|
|
GtkWidget *prop_box;
|
|
|
|
PrefsPage *prefs_pages;
|
1999-02-25 22:13:31 +03:00
|
|
|
GCustomLayout *custom_layout;
|
|
|
|
gint custom_layout_page;
|
1999-01-20 01:10:19 +03:00
|
|
|
} PrefsDlg;
|
|
|
|
|
|
|
|
|
|
|
|
#define PROPERTIES_DONE { NULL, PROPERTY_NONE, NULL, NULL, NULL, NULL }
|
|
|
|
#define PREFSPAGES_DONE { NULL, NULL }
|
|
|
|
|
|
|
|
typedef GtkWidget* (*CustomCreateFunc) (PrefsDlg *dlg, Property *prop);
|
|
|
|
typedef void (*CustomApplyFunc) (PrefsDlg *dlg, Property *prop);
|
|
|
|
|
|
|
|
static Property file_display_props [] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
N_("Show backup files"), PROPERTY_BOOL,
|
|
|
|
&show_backups, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Show hidden files"), PROPERTY_BOOL,
|
|
|
|
&show_dot_files, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
1999-01-20 10:15:34 +03:00
|
|
|
N_("Mix files and directories"), PROPERTY_BOOL,
|
1999-01-20 01:10:19 +03:00
|
|
|
&mix_all_files, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Use shell patterns instead of regular expressions"), PROPERTY_BOOL,
|
|
|
|
&easy_patterns, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
PROPERTIES_DONE
|
|
|
|
};
|
|
|
|
|
|
|
|
static Property confirmation_props [] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
N_("Confirm when deleting file"), PROPERTY_BOOL,
|
|
|
|
&confirm_delete, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Confirm when overwriting files"), PROPERTY_BOOL,
|
|
|
|
&confirm_overwrite, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Confirm when executing files"), PROPERTY_BOOL,
|
|
|
|
&confirm_execute, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Show progress while operations are being performed"), PROPERTY_BOOL,
|
|
|
|
&verbose, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
PROPERTIES_DONE
|
|
|
|
};
|
|
|
|
|
|
|
|
static Property vfs_props [] =
|
|
|
|
{
|
|
|
|
{
|
1999-02-15 23:14:11 +03:00
|
|
|
N_("VFS Timeout:"), PROPERTY_INT,
|
1999-01-20 01:10:19 +03:00
|
|
|
&vfs_timeout, N_("Seconds"), NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
1999-02-15 23:14:11 +03:00
|
|
|
N_("Anonymous FTP password:"), PROPERTY_STRING,
|
1999-01-20 01:10:19 +03:00
|
|
|
&ftpfs_anonymous_passwd, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Always use FTP proxy"), PROPERTY_BOOL,
|
|
|
|
&ftpfs_always_use_proxy, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
PROPERTIES_DONE
|
|
|
|
};
|
|
|
|
|
|
|
|
static Property caching_and_optimization_props [] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
N_("Fast directory reload"), PROPERTY_BOOL,
|
|
|
|
&fast_reload, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Compute totals before copying files"), PROPERTY_BOOL,
|
|
|
|
&file_op_compute_totals, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("FTP directory cache timeout :"), PROPERTY_INT,
|
|
|
|
&ftpfs_directory_timeout, N_("Seconds"), NULL, NULL
|
|
|
|
},
|
1999-01-28 08:48:02 +03:00
|
|
|
{
|
1999-02-05 01:20:26 +03:00
|
|
|
N_("Allow customization of icons in icon view"), PROPERTY_BOOL,
|
1999-01-28 08:48:02 +03:00
|
|
|
&we_can_afford_the_speed, NULL, NULL, NULL
|
|
|
|
},
|
1999-01-20 01:10:19 +03:00
|
|
|
PROPERTIES_DONE
|
|
|
|
};
|
|
|
|
|
1999-04-06 05:00:20 +04:00
|
|
|
static Property desktop_props [] = {
|
|
|
|
{
|
|
|
|
N_("Use shaped icons"), PROPERTY_BOOL,
|
|
|
|
&desktop_use_shaped_icons, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Auto place icons"), PROPERTY_BOOL,
|
|
|
|
&desktop_auto_placement, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Snap icons to grid"), PROPERTY_BOOL,
|
|
|
|
&desktop_snap_icons, NULL, NULL, NULL
|
|
|
|
},
|
|
|
|
PROPERTIES_DONE
|
|
|
|
};
|
|
|
|
|
1999-01-20 01:10:19 +03:00
|
|
|
static PrefsPage prefs_pages [] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
N_("File display"),
|
|
|
|
file_display_props
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Confirmation"),
|
|
|
|
confirmation_props
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("VFS"),
|
|
|
|
vfs_props
|
|
|
|
},
|
|
|
|
{
|
|
|
|
N_("Caching"),
|
|
|
|
caching_and_optimization_props
|
|
|
|
},
|
1999-04-06 05:00:20 +04:00
|
|
|
{
|
|
|
|
N_("Desktop"),
|
|
|
|
desktop_props
|
|
|
|
},
|
1999-01-20 01:10:19 +03:00
|
|
|
PREFSPAGES_DONE
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
apply_changes_bool (PrefsDlg *dlg, Property *cur_prop)
|
|
|
|
{
|
|
|
|
GtkWidget *checkbox;
|
|
|
|
|
|
|
|
checkbox = cur_prop->widget;
|
|
|
|
|
|
|
|
if (GTK_TOGGLE_BUTTON (checkbox)->active)
|
|
|
|
*( (int*) cur_prop->property_variable) = TRUE;
|
|
|
|
else
|
|
|
|
*( (int*) cur_prop->property_variable) = FALSE;
|
1999-01-09 03:24:03 +03:00
|
|
|
}
|
1999-01-20 01:10:19 +03:00
|
|
|
|
|
|
|
static void
|
|
|
|
apply_changes_string (PrefsDlg *dlg, Property *cur_prop)
|
|
|
|
{
|
|
|
|
GtkWidget *entry;
|
|
|
|
gchar *text;
|
|
|
|
|
|
|
|
entry = cur_prop->widget;
|
|
|
|
|
|
|
|
text = gtk_entry_get_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))));
|
|
|
|
|
|
|
|
*( (char**) cur_prop->property_variable) = g_strdup (text);
|
1999-01-09 03:24:03 +03:00
|
|
|
}
|
1999-01-20 01:10:19 +03:00
|
|
|
|
|
|
|
static void
|
|
|
|
apply_changes_int (PrefsDlg *dlg, Property *cur_prop)
|
|
|
|
{
|
|
|
|
GtkWidget *entry;
|
|
|
|
gdouble val;
|
|
|
|
gchar *num;
|
|
|
|
|
|
|
|
entry = cur_prop->widget;
|
|
|
|
num = gtk_entry_get_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))));
|
|
|
|
sscanf(num,"%lg",&val);
|
|
|
|
|
|
|
|
*( (int*) cur_prop->property_variable) = (gint) val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
apply_changes_custom (PrefsDlg *dlg, Property *cur_prop)
|
|
|
|
{
|
|
|
|
CustomApplyFunc apply = (CustomApplyFunc) cur_prop->extra_data2;
|
|
|
|
|
|
|
|
apply (dlg, cur_prop);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
apply_page_changes (PrefsDlg *dlg, gint pagenum)
|
|
|
|
{
|
|
|
|
Property *props;
|
|
|
|
Property cur_prop;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
props = dlg->prefs_pages [pagenum].props;
|
|
|
|
i = 0;
|
|
|
|
cur_prop = props [i];
|
|
|
|
while (cur_prop.label != NULL) {
|
|
|
|
switch (cur_prop.type) {
|
|
|
|
case PROPERTY_NONE :
|
1999-02-15 23:14:11 +03:00
|
|
|
g_warning ("Invalid case in gprefs.c: apply_page_changes");
|
1999-01-20 01:10:19 +03:00
|
|
|
break;
|
|
|
|
case PROPERTY_BOOL :
|
|
|
|
apply_changes_bool (dlg, &cur_prop);
|
|
|
|
break;
|
|
|
|
case PROPERTY_STRING :
|
|
|
|
apply_changes_string (dlg, &cur_prop);
|
|
|
|
break;
|
|
|
|
case PROPERTY_INT :
|
|
|
|
apply_changes_int (dlg, &cur_prop);
|
|
|
|
break;
|
|
|
|
case PROPERTY_CUSTOM :
|
|
|
|
apply_changes_custom (dlg, &cur_prop);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
cur_prop = props[++i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
apply_callback (GtkWidget *prop_box, gint pagenum, PrefsDlg *dlg)
|
|
|
|
{
|
1999-02-25 22:13:31 +03:00
|
|
|
if (pagenum == dlg->custom_layout_page) {
|
|
|
|
custom_layout_apply (dlg->custom_layout);
|
|
|
|
} else if (pagenum != -1) {
|
1999-01-20 01:10:19 +03:00
|
|
|
apply_page_changes (dlg, pagenum);
|
|
|
|
} else {
|
1999-01-20 10:15:34 +03:00
|
|
|
/* FIXME: can be optimized. Only if some of the
|
|
|
|
* boolean flags changed this makes sense
|
|
|
|
*/
|
|
|
|
update_panels (UP_RELOAD, UP_KEEPSEL);
|
1999-01-20 01:10:19 +03:00
|
|
|
save_setup ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
changed_callback (GtkWidget *widget, PrefsDlg *dlg)
|
|
|
|
{
|
|
|
|
if (dlg->prop_box)
|
|
|
|
gnome_property_box_changed (GNOME_PROPERTY_BOX (dlg->prop_box));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
|
|
|
create_prop_bool (PrefsDlg *dlg, Property *prop)
|
|
|
|
{
|
|
|
|
GtkWidget *checkbox;
|
|
|
|
|
1999-03-08 08:18:50 +03:00
|
|
|
checkbox = gtk_check_button_new_with_label (_(prop->label));
|
1999-01-20 01:10:19 +03:00
|
|
|
|
|
|
|
if (*((int*) prop->property_variable)) {
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox),
|
|
|
|
TRUE);
|
|
|
|
} else {
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox),
|
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (checkbox), "clicked",
|
|
|
|
changed_callback, (gpointer) dlg);
|
|
|
|
|
|
|
|
prop->widget = checkbox;
|
|
|
|
gtk_widget_show_all (checkbox);
|
|
|
|
return checkbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
|
|
|
create_prop_string (PrefsDlg *dlg, Property *prop)
|
|
|
|
{
|
|
|
|
GtkWidget *entry;
|
|
|
|
GtkWidget *gtk_entry;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
gint max_length;
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
|
|
|
|
|
1999-03-08 08:18:50 +03:00
|
|
|
label = gtk_label_new (_(prop->label));
|
1999-01-20 01:10:19 +03:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
|
1999-03-08 08:18:50 +03:00
|
|
|
entry = gnome_entry_new (_(prop->label));
|
1999-01-20 01:10:19 +03:00
|
|
|
gtk_entry = gnome_entry_gtk_entry (GNOME_ENTRY (entry));
|
|
|
|
|
|
|
|
max_length = (int)prop->extra_data1;
|
|
|
|
if (max_length != 0) {
|
|
|
|
gtk_entry_set_max_length (GTK_ENTRY (gtk_entry),
|
|
|
|
max_length);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (gtk_entry),
|
|
|
|
(gchar*) *( (gchar**) prop->property_variable));
|
|
|
|
gtk_signal_connect_while_alive (GTK_OBJECT (gtk_entry),
|
|
|
|
"changed",
|
|
|
|
GTK_SIGNAL_FUNC (changed_callback),
|
|
|
|
(gpointer) dlg,
|
|
|
|
GTK_OBJECT (dlg->prop_box));
|
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), entry,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
prop->widget = entry;
|
|
|
|
gtk_widget_show_all (hbox);
|
|
|
|
return hbox;
|
1999-01-09 03:24:03 +03:00
|
|
|
}
|
1999-01-20 01:10:19 +03:00
|
|
|
|
|
|
|
static GtkWidget*
|
|
|
|
create_prop_int (PrefsDlg *dlg, Property *prop)
|
1999-01-09 03:24:03 +03:00
|
|
|
{
|
1999-01-20 01:10:19 +03:00
|
|
|
GtkWidget *entry;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
gchar buffer [10];
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL);
|
|
|
|
|
1999-03-08 08:18:50 +03:00
|
|
|
label = gtk_label_new (_(prop->label));
|
1999-01-20 01:10:19 +03:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
|
1999-03-08 08:18:50 +03:00
|
|
|
entry = gnome_entry_new (_(prop->label));
|
1999-01-20 01:10:19 +03:00
|
|
|
|
|
|
|
snprintf (buffer, 9, "%d", *( (int*) prop->property_variable));
|
|
|
|
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))),
|
|
|
|
buffer);
|
|
|
|
|
|
|
|
gtk_signal_connect_while_alive (GTK_OBJECT (gnome_entry_gtk_entry (GNOME_ENTRY (entry))),
|
|
|
|
"changed",
|
|
|
|
GTK_SIGNAL_FUNC (changed_callback),
|
|
|
|
(gpointer) dlg,
|
|
|
|
GTK_OBJECT (dlg->prop_box));
|
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), entry,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
if (prop->extra_data1) {
|
1999-05-29 23:22:51 +04:00
|
|
|
label = gtk_label_new (_((gchar *)prop->extra_data1));
|
1999-01-20 01:10:19 +03:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
prop->widget = entry;
|
|
|
|
gtk_widget_show_all (hbox);
|
|
|
|
return hbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkWidget*
|
|
|
|
create_prop_custom (PrefsDlg *dlg, Property *prop)
|
|
|
|
{
|
|
|
|
CustomCreateFunc create = (CustomCreateFunc) prop->extra_data1;
|
1999-01-20 10:15:34 +03:00
|
|
|
|
|
|
|
if (!create)
|
|
|
|
return create_prop_bool (dlg, prop);
|
|
|
|
|
1999-01-20 01:10:19 +03:00
|
|
|
return create (dlg, prop);
|
1999-01-09 03:24:03 +03:00
|
|
|
}
|
1999-01-20 01:10:19 +03:00
|
|
|
|
|
|
|
static GtkWidget*
|
|
|
|
create_prop_widget (PrefsDlg *dlg, Property *prop)
|
1999-01-09 03:24:03 +03:00
|
|
|
{
|
1999-01-20 01:10:19 +03:00
|
|
|
switch (prop->type) {
|
|
|
|
case PROPERTY_NONE :
|
1999-02-15 23:14:11 +03:00
|
|
|
g_warning ("Invalid case in gprefs.c: create_prop_widget");
|
1999-01-20 01:10:19 +03:00
|
|
|
break;
|
|
|
|
case PROPERTY_BOOL :
|
|
|
|
return create_prop_bool (dlg, prop);
|
|
|
|
case PROPERTY_STRING :
|
|
|
|
return create_prop_string (dlg, prop);
|
|
|
|
case PROPERTY_INT :
|
|
|
|
return create_prop_int (dlg, prop);
|
|
|
|
case PROPERTY_CUSTOM :
|
|
|
|
return create_prop_custom (dlg, prop);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return NULL;
|
1999-01-09 03:24:03 +03:00
|
|
|
}
|
1999-01-20 01:10:19 +03:00
|
|
|
|
|
|
|
static void
|
|
|
|
create_page (PrefsDlg *dlg, PrefsPage *page)
|
|
|
|
{
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *prop_widget;
|
|
|
|
Property *cur_prop;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), GNOME_PAD_SMALL);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
i = 0;
|
|
|
|
cur_prop = &(page->props [i]);
|
|
|
|
while (cur_prop->label != NULL) {
|
|
|
|
cur_prop = &(page->props [i]);
|
|
|
|
prop_widget = create_prop_widget (dlg, cur_prop);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), prop_widget,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
i++;
|
|
|
|
cur_prop = &(page->props [i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
gnome_property_box_append_page (GNOME_PROPERTY_BOX (dlg->prop_box),
|
|
|
|
vbox,
|
1999-03-08 08:18:50 +03:00
|
|
|
gtk_label_new (_(page->title)));
|
1999-01-20 01:10:19 +03:00
|
|
|
}
|
|
|
|
|
1999-08-06 00:58:36 +04:00
|
|
|
/* Help callback for the preferences dialog */
|
|
|
|
static void
|
|
|
|
help_callback (GnomePropertyBox *pb, gint page_num, gpointer data)
|
|
|
|
{
|
|
|
|
static GnomeHelpMenuEntry entry = {
|
|
|
|
"gmc",
|
|
|
|
"gmcprefs.html"
|
|
|
|
};
|
|
|
|
|
|
|
|
gnome_help_display (NULL, &entry);
|
|
|
|
}
|
|
|
|
|
1999-01-20 01:10:19 +03:00
|
|
|
static void
|
|
|
|
create_prop_box (PrefsDlg *dlg)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
PrefsPage *cur_page;
|
1999-02-15 23:14:11 +03:00
|
|
|
|
|
|
|
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"));
|
1999-01-20 01:10:19 +03:00
|
|
|
|
|
|
|
i = 0;
|
|
|
|
cur_page = &(dlg->prefs_pages [i]);
|
|
|
|
while (cur_page->title != NULL) {
|
|
|
|
create_page (dlg, cur_page);
|
|
|
|
i++;
|
|
|
|
cur_page = &(dlg->prefs_pages [i]);
|
|
|
|
}
|
1999-02-15 23:14:11 +03:00
|
|
|
|
1999-02-25 22:13:31 +03:00
|
|
|
dlg->custom_layout = custom_layout_create_page (GNOME_PROPERTY_BOX (dlg->prop_box),
|
|
|
|
dlg->panel);
|
|
|
|
dlg->custom_layout_page = i;
|
|
|
|
|
1999-01-20 01:10:19 +03:00
|
|
|
gtk_signal_connect (GTK_OBJECT (dlg->prop_box), "apply",
|
|
|
|
GTK_SIGNAL_FUNC (apply_callback), dlg);
|
1999-08-06 00:58:36 +04:00
|
|
|
gtk_signal_connect (GTK_OBJECT (dlg->prop_box), "help",
|
|
|
|
GTK_SIGNAL_FUNC (help_callback), dlg);
|
1999-01-20 01:10:19 +03:00
|
|
|
}
|
1999-02-15 23:14:11 +03:00
|
|
|
|
1999-01-09 03:24:03 +03:00
|
|
|
void
|
|
|
|
gnome_configure_box (GtkWidget *widget, WPanel *panel)
|
|
|
|
{
|
1999-02-15 23:14:11 +03:00
|
|
|
static PrefsDlg dlg;
|
1999-01-09 03:24:03 +03:00
|
|
|
|
1999-01-20 01:10:19 +03:00
|
|
|
dlg.panel = panel;
|
|
|
|
dlg.prefs_pages = prefs_pages;
|
1999-01-20 05:16:09 +03:00
|
|
|
|
1999-01-20 01:10:19 +03:00
|
|
|
create_prop_box (&dlg);
|
|
|
|
gtk_widget_show (dlg.prop_box);
|
|
|
|
}
|