Create Makefiles in capplets/desktop-links and
2001-07-16 Richard Hestilow <hestilow@ximian.com> * configure.in: Create Makefiles in capplets/desktop-links and capplets/default-applications. * capplets/desktop-links: Added. * capplets/default-applications: Added.
This commit is contained in:
parent
1a479d0822
commit
856d747ec7
18 changed files with 2194 additions and 1 deletions
|
@ -1,3 +1,12 @@
|
|||
2001-07-16 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* configure.in: Create Makefiles in capplets/desktop-links and
|
||||
capplets/default-applications.
|
||||
|
||||
* capplets/desktop-links: Added.
|
||||
|
||||
* capplets/default-applications: Added.
|
||||
|
||||
2001-07-14 Carlos Perelló Marín <carlos@gnome-db.org>
|
||||
|
||||
* *.directory: Renamed to *.directory.in to be used with
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
always_built_SUBDIRS = \
|
||||
common background keyboard mouse rollback screensaver sound
|
||||
common background keyboard mouse rollback screensaver sound \
|
||||
default-applications desktop-links
|
||||
|
||||
SUBDIRS = $(always_built_SUBDIRS)
|
||||
|
||||
|
|
32
capplets/default-applications/Makefile.am
Normal file
32
capplets/default-applications/Makefile.am
Normal file
|
@ -0,0 +1,32 @@
|
|||
INCLUDES = -I. -I$(srcdir) \
|
||||
-I$(top_srcdir)/intl -I$(top_builddir)/intl \
|
||||
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
|
||||
-I$(includedir) $(GNOME_INCLUDEDIR) \
|
||||
-DGNOMESYSCONFDIR=\""$(sysconfdir)"\" \
|
||||
@CAPPLET_CFLAGS@
|
||||
|
||||
bin_PROGRAMS = default-application-properties-capplet
|
||||
|
||||
default_application_properties_capplet_SOURCES = \
|
||||
default-application-properties.c \
|
||||
interface.c \
|
||||
callbacks.c \
|
||||
support.c
|
||||
|
||||
|
||||
default_application_properties_capplet_LDADD = @CAPPLET_LIBS@
|
||||
|
||||
EXTRA_DIST = \
|
||||
default-application-properties.desktop.in \
|
||||
default-application-properties.desktop \
|
||||
interface.h \
|
||||
callbacks.h \
|
||||
support.h
|
||||
|
||||
sysdir = $(datadir)/control-center/capplets/
|
||||
sys_in_files = default-application-properties.desktop.in
|
||||
sys_DATA = $(sys_in_files:.desktop.in=.desktop)
|
||||
@XML_I18N_MERGE_DESKTOP_RULE@
|
||||
|
||||
install-data-local:
|
||||
$(INSTALL_DATA) $(srcdir)/default-application-properties.desktop $(DESTDIR)$(datadir)/gnome/apps/Settings/Advanced/default-applicaiton-properties.desktop
|
281
capplets/default-applications/callbacks.c
Normal file
281
capplets/default-applications/callbacks.c
Normal file
|
@ -0,0 +1,281 @@
|
|||
/* -*- MODE: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
||||
/* Author: Benjamin Kahn <xkahn@zoned.net>
|
||||
* Based on capplets/gnome-edit-properties/gnome-edit-properties.c.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "callbacks.h"
|
||||
#include "interface.h"
|
||||
#include "support.h"
|
||||
#include "defaults.h"
|
||||
|
||||
extern GtkWidget *capplet;
|
||||
|
||||
extern BrowserDescription bcurrent_info;
|
||||
extern EditorDescription ecurrent_info;
|
||||
extern HelpViewDescription hcurrent_info;
|
||||
extern TerminalDescription tcurrent_info;
|
||||
|
||||
extern void set_selected_terminal( gchar *string );
|
||||
extern void set_selected_help( gchar *string );
|
||||
extern void set_selected_editor( gchar *string );
|
||||
extern void set_selected_browser( gchar *string );
|
||||
|
||||
void
|
||||
on_radiodefeditor_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint a = GTK_TOGGLE_BUTTON (togglebutton)->active;
|
||||
/* Editor Custom */
|
||||
gtk_widget_set_sensitive(gtk_object_get_data (GTK_OBJECT (capplet), "table17"), !a);
|
||||
/* Editor Default */
|
||||
gtk_widget_set_sensitive(gtk_object_get_data (GTK_OBJECT (capplet), "editorselect"), a);
|
||||
|
||||
set_selected_editor (gtk_entry_get_text (gtk_object_get_data (GTK_OBJECT(capplet), "editorselect")));
|
||||
|
||||
ecurrent_info.use_name = a;
|
||||
|
||||
edit_changed (togglebutton, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_combo_editor_changed (GtkEditable *editable,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
set_selected_editor (gtk_entry_get_text (editable));
|
||||
|
||||
edit_changed (editable, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_radiocusteditor_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
edit_changed (togglebutton, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_editorterminal_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
edit_changed (togglebutton, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_editorlineno_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
edit_changed (togglebutton, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_editorcommand_changed (GtkEditable *editable,
|
||||
gpointer user_data)
|
||||
{
|
||||
edit_changed (editable, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_seldefbrowser_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint a = GTK_TOGGLE_BUTTON (togglebutton)->active;
|
||||
/* Browser Custom */
|
||||
gtk_widget_set_sensitive(gtk_object_get_data (GTK_OBJECT (capplet), "table20"), !a);
|
||||
/* Browser Default */
|
||||
gtk_widget_set_sensitive(gtk_object_get_data (GTK_OBJECT (capplet), "browserselect"), a);
|
||||
|
||||
set_selected_browser (gtk_entry_get_text (gtk_object_get_data (GTK_OBJECT(capplet), "browserselect")));
|
||||
|
||||
bcurrent_info.use_name = a;
|
||||
|
||||
edit_changed (togglebutton, user_data);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_combo_browser_changed (GtkEditable *editable,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
set_selected_browser (gtk_entry_get_text (editable));
|
||||
|
||||
edit_changed (editable, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_selcustbrowser_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
edit_changed (togglebutton, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_browserterminal_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
edit_changed (togglebutton, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_browserremote_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
edit_changed (togglebutton, user_data);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_browsercommand_changed (GtkEditable *editable,
|
||||
gpointer user_data)
|
||||
{
|
||||
edit_changed (editable, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_seldefview_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint a = GTK_TOGGLE_BUTTON (togglebutton)->active;
|
||||
/* Help Custom */
|
||||
gtk_widget_set_sensitive(gtk_object_get_data (GTK_OBJECT (capplet), "table23"), !a);
|
||||
/* Help Default */
|
||||
gtk_widget_set_sensitive(gtk_object_get_data (GTK_OBJECT (capplet), "helpselect"), a);
|
||||
|
||||
set_selected_terminal (gtk_entry_get_text (gtk_object_get_data (GTK_OBJECT(capplet), "termselect")));
|
||||
|
||||
hcurrent_info.use_name = a;
|
||||
|
||||
edit_changed (togglebutton, user_data);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_combo_help_changed (GtkEditable *editable,
|
||||
gpointer user_data)
|
||||
{
|
||||
set_selected_terminal (gtk_entry_get_text (editable));
|
||||
|
||||
edit_changed (editable, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_selcustview_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
edit_changed (togglebutton, user_data);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_helpterminal_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
edit_changed (togglebutton, user_data);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_helpurls_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
edit_changed (togglebutton, user_data);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_helpcommand_changed (GtkEditable *editable,
|
||||
gpointer user_data)
|
||||
{
|
||||
edit_changed (editable, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_seldefterm_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
gint a = GTK_TOGGLE_BUTTON (togglebutton)->active;
|
||||
/* Terminal Custom */
|
||||
gtk_widget_set_sensitive(gtk_object_get_data (GTK_OBJECT (capplet), "table26"), !a);
|
||||
/* Terminal Default */
|
||||
gtk_widget_set_sensitive(gtk_object_get_data (GTK_OBJECT (capplet), "termselect"), a);
|
||||
|
||||
set_selected_help (gtk_entry_get_text (gtk_object_get_data (GTK_OBJECT(capplet), "helpselect")));
|
||||
|
||||
tcurrent_info.use_name = a;
|
||||
|
||||
edit_changed (togglebutton, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_combo_term_changed (GtkEditable *editable,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
set_selected_help (gtk_entry_get_text (editable));
|
||||
|
||||
edit_changed (editable, user_data);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_selcustterm_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data)
|
||||
{
|
||||
edit_changed (togglebutton, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_termexec_changed (GtkEditable *editable,
|
||||
gpointer user_data)
|
||||
{
|
||||
edit_changed (editable, user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_termcommand_changed (GtkEditable *editable,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
edit_changed (editable, user_data);
|
||||
}
|
||||
|
94
capplets/default-applications/callbacks.h
Normal file
94
capplets/default-applications/callbacks.h
Normal file
|
@ -0,0 +1,94 @@
|
|||
#include <gnome.h>
|
||||
|
||||
|
||||
void
|
||||
on_radiodefeditor_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_combo_editor_changed (GtkEditable *editable,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_radiocusteditor_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_editorterminal_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_editorlineno_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_editorcommand_changed (GtkEditable *editable,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_seldefbrowser_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_combo_browser_changed (GtkEditable *editable,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_selcustbrowser_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_browserterminal_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_browserremote_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_browsercommand_changed (GtkEditable *editable,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_seldefview_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_combo_help_changed (GtkEditable *editable,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_selcustview_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_helpterminal_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_helpurls_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_helpcommand_changed (GtkEditable *editable,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_seldefterm_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_combo_term_changed (GtkEditable *editable,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_selcustterm_toggled (GtkToggleButton *togglebutton,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_termexec_changed (GtkEditable *editable,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_termcommand_changed (GtkEditable *editable,
|
||||
gpointer user_data);
|
756
capplets/default-applications/default-application-properties.c
Normal file
756
capplets/default-applications/default-application-properties.c
Normal file
|
@ -0,0 +1,756 @@
|
|||
/* -*- MODE: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
||||
/* Author: Benjamin Kahn <xkahn@zoned.net>
|
||||
* Based on capplets/gnome-edit-properties/gnome-edit-properties.c.
|
||||
*/
|
||||
#include <config.h>
|
||||
#include "capplet-widget.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include "gnome.h"
|
||||
#include "defaults.h"
|
||||
#include "interface.h"
|
||||
|
||||
void fill_default_browser (void);
|
||||
void fill_default_terminal (void);
|
||||
void fill_default_help (void);
|
||||
void fill_default_editor (void);
|
||||
|
||||
static void fill_editor_data (EditorDescription *info);
|
||||
static void fill_browser_data (BrowserDescription *info);
|
||||
static void fill_help_data (HelpViewDescription *info);
|
||||
static void fill_term_data (TerminalDescription *info);
|
||||
|
||||
static void set_combo_terminal( gchar *string );
|
||||
static void set_combo_help( gchar *string );
|
||||
static void set_combo_editor( gchar *string );
|
||||
static void set_combo_browser( gchar *string );
|
||||
|
||||
static void revert_all (void);
|
||||
static void write_all (BrowserDescription *bd, EditorDescription *ed, HelpViewDescription *hd, TerminalDescription *td);
|
||||
static void help_all (void);
|
||||
static void apply_all (void);
|
||||
|
||||
void set_selected_terminal( gchar *string );
|
||||
void set_selected_help( gchar *string );
|
||||
void set_selected_editor( gchar *string );
|
||||
void set_selected_browser( gchar *string );
|
||||
|
||||
gboolean ignore_changes = TRUE;
|
||||
|
||||
BrowserDescription boriginal_info = { NULL };
|
||||
EditorDescription eoriginal_info = { NULL };
|
||||
HelpViewDescription horiginal_info = { NULL };
|
||||
TerminalDescription toriginal_info = { NULL };
|
||||
|
||||
BrowserDescription bcurrent_info = { NULL };
|
||||
EditorDescription ecurrent_info = { NULL };
|
||||
HelpViewDescription hcurrent_info = { NULL };
|
||||
TerminalDescription tcurrent_info = { NULL };
|
||||
|
||||
EditorDescription possible_editors[] =
|
||||
{
|
||||
{ "Emacs", "emacs", FALSE, "executable", TRUE },
|
||||
{ "XEmacs", "xemacs", FALSE, "executable", TRUE },
|
||||
{ "vi", "vi", TRUE, "executable", TRUE },
|
||||
{ "Go", "go", FALSE, "executable", FALSE },
|
||||
{ "gEdit", "gedit", FALSE, "executable", FALSE },
|
||||
{ "GWP", "gwp", FALSE, "executable", FALSE },
|
||||
{ "Jed", "jed", TRUE, "executable", TRUE },
|
||||
{ "Joe", "joe", TRUE, "executable", TRUE },
|
||||
{ "Pico", "pico", TRUE, "executable", TRUE },
|
||||
{ "vim", "vim", TRUE, "executable", TRUE },
|
||||
{ "gvim", "gvim", FALSE, "executable", TRUE },
|
||||
{ "ed", "ed", TRUE, "executable", FALSE },
|
||||
{ "GMC/CoolEdit", "gmc -e", FALSE, "mc-internal", FALSE },
|
||||
{ "Nedit", "nedit", FALSE, "executable", FALSE }
|
||||
};
|
||||
|
||||
BrowserDescription possible_browsers[] =
|
||||
{
|
||||
{ "Lynx Text Browser", "lynx", TRUE, FALSE },
|
||||
{ "Links Text Browser" , "links", TRUE, FALSE },
|
||||
{ "Netscape Communicator", "netscape", FALSE, TRUE },
|
||||
{ "Mozilla/Netscape 6", "mozilla", FALSE, TRUE },
|
||||
{ "Galeon", "galeon", FALSE, FALSE },
|
||||
{ "Encompass", "encompass", FALSE, FALSE },
|
||||
{ "Konqueror", "konqueror", FALSE, FALSE }
|
||||
};
|
||||
|
||||
HelpViewDescription possible_helpviewers[] =
|
||||
{
|
||||
{ "Gnome Help Browser", "gnome-help-browser", FALSE, TRUE },
|
||||
{ "Nautilus", "nautilus", FALSE, TRUE }
|
||||
};
|
||||
|
||||
TerminalDescription possible_terminals[] =
|
||||
{
|
||||
{ "Gnome Terminal", "gnome-terminal", "-x" },
|
||||
{ "Standard XTerminal", "xterm", "-e" },
|
||||
{ "NXterm", "nxterm", "-e" },
|
||||
{ "RXVT", "rxvt", "-e" },
|
||||
{ "ETerm", "Eterm", "-e" }
|
||||
};
|
||||
|
||||
|
||||
|
||||
GtkWidget *capplet;
|
||||
GtkWidget *combo = NULL;
|
||||
GtkWidget *checkbox;
|
||||
|
||||
static void
|
||||
edit_read(void)
|
||||
{
|
||||
gint term_argc;
|
||||
gchar **term_argv;
|
||||
gchar *check1, *check2;
|
||||
|
||||
fill_default_help ();
|
||||
fill_default_terminal ();
|
||||
fill_default_browser ();
|
||||
fill_default_editor ();
|
||||
|
||||
check1 = gnome_config_get_string("/editor/Editor/EDITNAME");
|
||||
check2 = gnome_config_get_string("/editor/Editor/EDITOR");
|
||||
if (check1 || !check2) {
|
||||
eoriginal_info.use_name = TRUE;
|
||||
ecurrent_info.use_name = TRUE;
|
||||
} else {
|
||||
eoriginal_info.use_name = FALSE;
|
||||
ecurrent_info.use_name = FALSE;
|
||||
}
|
||||
g_free (check1);
|
||||
g_free (check2);
|
||||
eoriginal_info.name = gnome_config_get_string("/editor/Editor/EDITNAME");
|
||||
eoriginal_info.executable_name = gnome_config_get_string("/editor/Editor/EDITOR");
|
||||
eoriginal_info.needs_term = gnome_config_get_bool_with_default("/editor/Editor/NEEDS_TERM", NULL);
|
||||
eoriginal_info.execution_type = gnome_config_get_string("/editor/Editor/EDITOR_TYPE");
|
||||
eoriginal_info.accepts_lineno = gnome_config_get_bool_with_default("/editor/Editor/ACCEPTS_LINE_NO", NULL);
|
||||
|
||||
ecurrent_info.name = gnome_config_get_string("/editor/Editor/EDITNAME=Emacs");
|
||||
ecurrent_info.executable_name = gnome_config_get_string("/editor/Editor/EDITOR=emacs");
|
||||
ecurrent_info.needs_term = gnome_config_get_bool_with_default("/editor/Editor/NEEDS_TERM=FALSE", NULL);
|
||||
ecurrent_info.execution_type = gnome_config_get_string("/editor/Editor/EDITOR_TYPE=executable");
|
||||
ecurrent_info.accepts_lineno = gnome_config_get_bool_with_default("/editor/Editor/ACCEPTS_LINE_NO=TRUE", NULL);
|
||||
|
||||
check1 = gnome_config_get_string("/gnome-moz-remote/Mozilla/BROWSER");
|
||||
check2 = gnome_config_get_string("/gnome-moz-remote/Mozilla/filename");
|
||||
if (check1 || !check2) {
|
||||
boriginal_info.use_name = TRUE;
|
||||
bcurrent_info.use_name = TRUE;
|
||||
} else {
|
||||
boriginal_info.use_name = FALSE;
|
||||
bcurrent_info.use_name = FALSE;
|
||||
}
|
||||
g_free (check1);
|
||||
g_free (check2);
|
||||
if (gnome_is_program_in_path ("mozilla")) {
|
||||
bcurrent_info.name = gnome_config_get_string("/gnome-moz-remote/Mozilla/BROWSER=Mozilla/Netscape 6");
|
||||
bcurrent_info.executable_name = gnome_config_get_string("/gnome-moz-remote/Mozilla/filename=mozilla");
|
||||
} else {
|
||||
bcurrent_info.name = gnome_config_get_string("/gnome-moz-remote/Mozilla/BROWSER=Netscape Communicator");
|
||||
bcurrent_info.executable_name = gnome_config_get_string("/gnome-moz-remote/Mozilla/filename=netscape");
|
||||
}
|
||||
bcurrent_info.needs_term = gnome_config_get_bool_with_default("/gnome-moz-remote/Mozilla/NEEDS_TERM=FALSE", NULL);
|
||||
bcurrent_info.nremote = gnome_config_get_bool_with_default("/gnome-moz-remote/Mozilla/NREMOTE=TRUE", NULL);
|
||||
|
||||
boriginal_info.name = gnome_config_get_string("/gnome-moz-remote/Mozilla/BROWSER");
|
||||
boriginal_info.executable_name = gnome_config_get_string("/gnome-moz-remote/Mozilla/filename");
|
||||
boriginal_info.needs_term = gnome_config_get_bool_with_default("/gnome-moz-remote/Mozilla/NEEDS_TERM", NULL);
|
||||
boriginal_info.nremote = gnome_config_get_bool_with_default("/gnome-moz-remote/Mozilla/NREMOTE", NULL);
|
||||
|
||||
/* An smarter person would wonder why we are setting values in different places. It's because of the */
|
||||
/* silly way url-properties works. Originally, I was going to replace that applet, but people seem to use it. */
|
||||
/* For simplicity, at first, we will only support the ghelp calls. Not info or man. */
|
||||
check1 = gnome_config_get_string("/Gnome/URL Handler Data/GHELP");
|
||||
check2 = gnome_config_get_string("/Gnome/URL Handlers/ghelp-show");
|
||||
if (check1 || !check2) {
|
||||
horiginal_info.use_name = TRUE;
|
||||
hcurrent_info.use_name = TRUE;
|
||||
} else {
|
||||
horiginal_info.use_name = FALSE;
|
||||
hcurrent_info.use_name = FALSE;
|
||||
}
|
||||
g_free (check1);
|
||||
g_free (check2);
|
||||
if (gnome_is_program_in_path ("nautilus")) {
|
||||
hcurrent_info.name = gnome_config_get_string("/Gnome/URL Handler Data/GHELP=nautilus");
|
||||
hcurrent_info.executable_name = gnome_config_get_string ("/Gnome/URL Handlers/ghelp-show=nautilus");
|
||||
} else {
|
||||
hcurrent_info.name = gnome_config_get_string("/Gnome/URL Handler Data/GHELP=Gnome Help Browser");
|
||||
hcurrent_info.executable_name = gnome_config_get_string ("/Gnome/URL Handlers/ghelp-show=gnome-help-browser");
|
||||
}
|
||||
hcurrent_info.needs_term = gnome_config_get_bool_with_default("/Gnome/URL Handler Data/GHELP_TERM=FALSE", NULL);
|
||||
hcurrent_info.allows_urls = gnome_config_get_bool_with_default("/Gnome/URL Handler Data/GHELP_URLS=TRUE", NULL);
|
||||
|
||||
horiginal_info.name = gnome_config_get_string("/Gnome/URL Handler Data/GHELP");
|
||||
horiginal_info.executable_name = gnome_config_get_string ("/Gnome/URL Handlers/ghelp-show");
|
||||
horiginal_info.needs_term = gnome_config_get_bool_with_default("/Gnome/URL Handler Data/GHELP_TERM", NULL);
|
||||
horiginal_info.allows_urls = gnome_config_get_bool_with_default("/Gnome/URL Handler Data/GHELP_URLS", NULL);
|
||||
|
||||
/* Ugh. This one is really complex. */
|
||||
check1 = gnome_config_get_string("/Gnome/Applications/TERMNAME");
|
||||
check2 = gnome_config_get_string("/Gnome/Applications/Terminal");
|
||||
if (check1 || !check2) {
|
||||
toriginal_info.use_name = TRUE;
|
||||
tcurrent_info.use_name = TRUE;
|
||||
} else {
|
||||
toriginal_info.use_name = FALSE;
|
||||
tcurrent_info.use_name = FALSE;
|
||||
}
|
||||
g_free (check1);
|
||||
g_free (check2);
|
||||
gnome_config_get_vector ("/Gnome/Applications/Terminal",
|
||||
&term_argc, &term_argv);
|
||||
if (term_argv == NULL) {
|
||||
toriginal_info.executable_name = NULL;
|
||||
toriginal_info.exec_app = NULL;
|
||||
|
||||
if (gnome_is_program_in_path ("gnome-terminal")) {
|
||||
tcurrent_info.name = g_strdup ("Gnome Terminal");
|
||||
tcurrent_info.executable_name = g_strdup ("gnome-terminal");
|
||||
tcurrent_info.exec_app = g_strdup ("-x");
|
||||
} else {
|
||||
tcurrent_info.name = g_strdup ("Standard XTerminal");
|
||||
tcurrent_info.executable_name = g_strdup ("xterm");
|
||||
tcurrent_info.exec_app = g_strdup ("-e");
|
||||
}
|
||||
} else {
|
||||
tcurrent_info.name = gnome_config_get_string("/Gnome/Applications/TERMNAME");
|
||||
tcurrent_info.executable_name = term_argv[0];
|
||||
tcurrent_info.exec_app = term_argv[1];
|
||||
|
||||
toriginal_info.executable_name = term_argv[0];
|
||||
toriginal_info.exec_app = term_argv[1];
|
||||
}
|
||||
|
||||
toriginal_info.name = gnome_config_get_string("/Gnome/Applications/TERMNAME");
|
||||
|
||||
/* Set sensitivity. */
|
||||
|
||||
fill_editor_data (&ecurrent_info);
|
||||
fill_browser_data (&bcurrent_info);
|
||||
fill_help_data (&hcurrent_info);
|
||||
fill_term_data (&tcurrent_info);
|
||||
}
|
||||
|
||||
void
|
||||
edit_changed (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
if (!ignore_changes)
|
||||
capplet_widget_state_changed(CAPPLET_WIDGET (capplet), TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
get_all_data ()
|
||||
{
|
||||
ecurrent_info.name = gtk_entry_get_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "combo_editor")));
|
||||
ecurrent_info.executable_name = gtk_entry_get_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "editorcommand")));
|
||||
ecurrent_info.needs_term = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "editorterminal")));
|
||||
ecurrent_info.accepts_lineno = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "editorlineno")));
|
||||
|
||||
bcurrent_info.name = gtk_entry_get_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "combo_browser")));
|
||||
bcurrent_info.executable_name = gtk_entry_get_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "browsercommand")));
|
||||
bcurrent_info.needs_term = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "browserterminal")));
|
||||
bcurrent_info.nremote = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "browserremote")));
|
||||
|
||||
hcurrent_info.name = gtk_entry_get_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "combo_help")));
|
||||
hcurrent_info.executable_name = gtk_entry_get_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "helpcommand")));
|
||||
hcurrent_info.needs_term = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "helpterminal")));
|
||||
hcurrent_info.allows_urls = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "helpurls")));
|
||||
|
||||
tcurrent_info.name = gtk_entry_get_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "combo_term")));
|
||||
tcurrent_info.executable_name = gtk_entry_get_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "termcommand")));
|
||||
tcurrent_info.exec_app = gtk_entry_get_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "termexec")));
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
fill_editor_data (EditorDescription *info)
|
||||
{
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "editorcommand")),
|
||||
info->executable_name);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "editorterminal")),
|
||||
info->needs_term);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "editorlineno")),
|
||||
info->accepts_lineno);
|
||||
|
||||
if (info->use_name) {
|
||||
set_combo_editor (info->name);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
|
||||
(gtk_object_get_data (GTK_OBJECT (capplet), "radiodefeditorm")),
|
||||
TRUE);
|
||||
} else {
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
|
||||
(gtk_object_get_data (GTK_OBJECT (capplet), "radiocusteditor")),
|
||||
TRUE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
fill_browser_data (BrowserDescription *info)
|
||||
{
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "browsercommand")),
|
||||
info->executable_name);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "browserterminal")),
|
||||
info->needs_term);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "browserremote")),
|
||||
info->nremote);
|
||||
|
||||
|
||||
if (info->use_name) {
|
||||
set_combo_browser (info->name);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
|
||||
(gtk_object_get_data (GTK_OBJECT (capplet), "seldefbrowser")),
|
||||
TRUE);
|
||||
} else {
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
|
||||
(gtk_object_get_data (GTK_OBJECT (capplet), "selcustbrowser")),
|
||||
TRUE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
fill_help_data (HelpViewDescription *info)
|
||||
{
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "helpcommand")),
|
||||
info->executable_name);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "helpterminal")),
|
||||
info->needs_term);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "helpurls")),
|
||||
info->allows_urls);
|
||||
|
||||
if (info->use_name) {
|
||||
set_combo_help (info->name);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
|
||||
(gtk_object_get_data (GTK_OBJECT (capplet), "seldefview")),
|
||||
TRUE);
|
||||
} else {
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
|
||||
(gtk_object_get_data (GTK_OBJECT (capplet), "selcustview")),
|
||||
TRUE);
|
||||
}
|
||||
}
|
||||
static void
|
||||
fill_term_data (TerminalDescription *info)
|
||||
{
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "termcommand")),
|
||||
info->executable_name);
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "termexec")),
|
||||
info->exec_app);
|
||||
|
||||
if (info->use_name) {
|
||||
set_combo_terminal (info->name);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
|
||||
(gtk_object_get_data (GTK_OBJECT (capplet), "seldefterm")),
|
||||
TRUE);
|
||||
} else {
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
|
||||
(gtk_object_get_data (GTK_OBJECT (capplet), "selcustterm")),
|
||||
TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
setlocale(LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
switch (gnome_capplet_init ("gnome-browser-properties", VERSION, argc,
|
||||
argv, NULL, 0, NULL)) {
|
||||
|
||||
case -1:
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ignore_changes = TRUE;
|
||||
|
||||
/* Display the application */
|
||||
edit_create ();
|
||||
|
||||
/* Set up the rest of the application. */
|
||||
edit_read ();
|
||||
|
||||
/* Connect the wrapper signals */
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (capplet), "help",
|
||||
GTK_SIGNAL_FUNC (help_all), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (capplet), "try",
|
||||
GTK_SIGNAL_FUNC (apply_all), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (capplet), "revert",
|
||||
GTK_SIGNAL_FUNC (revert_all), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (capplet), "ok",
|
||||
GTK_SIGNAL_FUNC (apply_all), NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (capplet), "cancel",
|
||||
GTK_SIGNAL_FUNC (revert_all), NULL);
|
||||
|
||||
ignore_changes = FALSE;
|
||||
|
||||
capplet_gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
revert_all (void)
|
||||
{
|
||||
ignore_changes = TRUE;
|
||||
write_all (&boriginal_info, &eoriginal_info, &horiginal_info, &toriginal_info);
|
||||
|
||||
edit_read ();
|
||||
|
||||
ignore_changes = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
apply_all (void)
|
||||
{
|
||||
get_all_data();
|
||||
write_all (&bcurrent_info, &ecurrent_info, &hcurrent_info, &tcurrent_info);
|
||||
}
|
||||
|
||||
static void
|
||||
help_all (void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
write_all (BrowserDescription *bd, EditorDescription *ed, HelpViewDescription *hd, TerminalDescription *td)
|
||||
{
|
||||
gchar *av_term[2];
|
||||
|
||||
if (ed->use_name && ed->name) {
|
||||
gnome_config_set_string ("/editor/Editor/EDITNAME", ed->name);
|
||||
} else {
|
||||
gnome_config_clean_key("/editor/Editor/EDITNAME");
|
||||
}
|
||||
if (bd->use_name && bd->name) {
|
||||
gnome_config_set_string ("/gnome-moz-remote/Mozilla/BROWSER", bd->name);
|
||||
} else {
|
||||
gnome_config_clean_key("/gnome-moz-remote/Mozilla/BROWSER");
|
||||
}
|
||||
if (hd->use_name && hd->name) {
|
||||
gnome_config_set_string ("/Gnome/URL Handler Data/GHELP", hd->name);
|
||||
} else {
|
||||
gnome_config_clean_key("/Gnome/URL Handler Data/GHELP");
|
||||
}
|
||||
if (td->use_name && td->name) {
|
||||
gnome_config_set_string ("/Gnome/Applications/TERMNAME", td->name);
|
||||
} else {
|
||||
gnome_config_clean_key("/Gnome/Applications/TERMNAME");
|
||||
}
|
||||
|
||||
if (ed->executable_name)
|
||||
gnome_config_set_string("/editor/Editor/EDITOR", ed->executable_name);
|
||||
else
|
||||
gnome_config_clean_key("/editor/Editor/EDITOR");
|
||||
gnome_config_set_bool("/editor/Editor/NEEDS_TERM", ed->needs_term);
|
||||
if (ed->execution_type)
|
||||
gnome_config_set_string("/editor/Editor/EDITOR_TYPE", ed->execution_type);
|
||||
else
|
||||
gnome_config_clean_key("/editor/Editor/EDITOR_TYPE");
|
||||
gnome_config_set_bool("/editor/Editor/ACCEPTS_LINE_NO", ed->accepts_lineno);
|
||||
|
||||
if (bd->executable_name)
|
||||
gnome_config_set_string("/gnome-moz-remote/Mozilla/filename", bd->executable_name);
|
||||
else
|
||||
gnome_config_clean_key("/gnome-moz-remote/Mozilla/filename");
|
||||
|
||||
if (bd->executable_name) {
|
||||
gnome_config_set_bool("/gnome-moz-remote/Mozilla/NEEDS_TERM", bd->needs_term);
|
||||
gnome_config_set_bool("/gnome-moz-remote/Mozilla/NREMOTE", bd->nremote);
|
||||
} else {
|
||||
gnome_config_clean_key ("/gnome-moz-remote/Mozilla/NEEDS_TERM");
|
||||
gnome_config_clean_key ("/gnome-moz-remote/Mozilla/NREMOTE");
|
||||
}
|
||||
|
||||
if (hd->executable_name)
|
||||
gnome_config_set_string ("/Gnome/URL Handlers/ghelp-show", hd->executable_name);
|
||||
else
|
||||
gnome_config_clean_key("/Gnome/URL Handlers/ghelp-show");
|
||||
gnome_config_set_bool("/Gnome/URL Handler Data/GHELP_TERM", hd->needs_term);
|
||||
gnome_config_set_bool("/Gnome/URL Handler Data/GHELP_URLS", hd->allows_urls);
|
||||
|
||||
av_term[0] = td->executable_name;
|
||||
av_term[1] = td->exec_app;
|
||||
if (td->exec_app && td->executable_name)
|
||||
gnome_config_set_vector ("/Gnome/Applications/Terminal", 2, av_term);
|
||||
else if (td->executable_name)
|
||||
gnome_config_set_string ("/Gnome/Applications/Terminal", td->executable_name);
|
||||
else
|
||||
gnome_config_clean_key("/Gnome/Applications/Terminal");
|
||||
|
||||
gnome_config_sync ();
|
||||
}
|
||||
|
||||
void fill_default_browser ()
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *listitem;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "browserselect");
|
||||
|
||||
/* printf ("%p %p\n", capplet, combo);*/
|
||||
|
||||
for ( i = 0; i < sizeof(possible_browsers) / sizeof(possible_browsers[0]); i++ ) {
|
||||
if (gnome_is_program_in_path (possible_browsers[i].executable_name)) {
|
||||
listitem = gtk_list_item_new_with_label ( possible_browsers[ i ].name );
|
||||
gtk_widget_show( listitem );
|
||||
gtk_container_add( GTK_CONTAINER( GTK_COMBO( combo )->list ), listitem );
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void fill_default_terminal ()
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *listitem;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "termselect");
|
||||
|
||||
for ( i = 0; i < sizeof(possible_terminals) / sizeof(possible_terminals[0]); i++ ) {
|
||||
if (gnome_is_program_in_path (possible_terminals[i].executable_name)) {
|
||||
listitem = gtk_list_item_new_with_label ( possible_terminals[ i ].name );
|
||||
gtk_widget_show( listitem );
|
||||
gtk_container_add( GTK_CONTAINER( GTK_COMBO( combo )->list ), listitem );
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void fill_default_help ()
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *listitem;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "helpselect");
|
||||
|
||||
for ( i = 0; i < sizeof(possible_helpviewers) / sizeof(possible_helpviewers[0]); i++ ) {
|
||||
if (gnome_is_program_in_path (possible_helpviewers[i].executable_name)) {
|
||||
listitem = gtk_list_item_new_with_label ( possible_helpviewers[ i ].name );
|
||||
gtk_widget_show( listitem );
|
||||
gtk_container_add( GTK_CONTAINER( GTK_COMBO( combo )->list ), listitem );
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void fill_default_editor ()
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *listitem;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "editorselect");
|
||||
|
||||
for ( i = 0; i < sizeof(possible_editors) / sizeof(possible_editors[0]); i++ ) {
|
||||
if (gnome_is_program_in_path (possible_editors[i].executable_name)) {
|
||||
listitem = gtk_list_item_new_with_label ( possible_editors[ i ].name );
|
||||
gtk_widget_show( listitem );
|
||||
gtk_container_add( GTK_CONTAINER( GTK_COMBO( combo )->list ), listitem );
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
set_combo_browser( gchar *string )
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "browserselect");
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
for ( i = 0; i < sizeof(possible_browsers) / sizeof(possible_browsers[0]); i++ ) {
|
||||
if ( ! strcmp( possible_browsers[ i ].executable_name, string ) ) {
|
||||
gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo)->entry),
|
||||
possible_browsers[ i ].name );
|
||||
return;
|
||||
}
|
||||
}
|
||||
gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(combo)->entry), string );
|
||||
}
|
||||
|
||||
static void
|
||||
set_combo_editor( gchar *string )
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "editorselect");
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
for ( i = 0; i < sizeof(possible_editors) / sizeof(possible_editors[0]); i++ ) {
|
||||
if ( ! strcmp( possible_editors[ i ].executable_name, string ) ) {
|
||||
gtk_entry_set_text ( GTK_ENTRY(GTK_COMBO(combo)->entry),
|
||||
possible_editors[ i ].name );
|
||||
return;
|
||||
}
|
||||
}
|
||||
gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(combo)->entry), string );
|
||||
}
|
||||
|
||||
static void
|
||||
set_combo_help( gchar *string )
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "helpselect");
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
for ( i = 0;
|
||||
i < sizeof(possible_helpviewers) / sizeof(possible_helpviewers[0]);
|
||||
i++ ) {
|
||||
if ( ! strcmp( possible_helpviewers[ i ].executable_name, string ) )
|
||||
{
|
||||
gtk_entry_set_text
|
||||
( GTK_ENTRY(GTK_COMBO(combo)->entry),
|
||||
possible_helpviewers[ i ].name );
|
||||
return;
|
||||
}
|
||||
}
|
||||
gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(combo)->entry), string );
|
||||
}
|
||||
|
||||
static void
|
||||
set_combo_terminal( gchar *string )
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "termselect");
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
for ( i = 0;
|
||||
i < sizeof(possible_terminals) / sizeof(possible_terminals[0]);
|
||||
i++ ) {
|
||||
if ( ! strcmp( possible_terminals[ i ].executable_name, string ) )
|
||||
{
|
||||
gtk_entry_set_text
|
||||
( GTK_ENTRY(GTK_COMBO(combo)->entry),
|
||||
possible_terminals[ i ].name );
|
||||
return;
|
||||
}
|
||||
}
|
||||
gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(combo)->entry), string );
|
||||
}
|
||||
|
||||
void
|
||||
set_selected_browser( gchar *string )
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "browserselect");
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
for ( i = 0; i < sizeof(possible_browsers) / sizeof(possible_browsers[0]); i++ ) {
|
||||
if ( ! strcmp( possible_browsers[ i ].name, string ) ) {
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "browsercommand")),
|
||||
possible_browsers[ i ].executable_name);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "browserterminal")),
|
||||
possible_browsers[ i ].needs_term);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "browserremote")),
|
||||
possible_browsers[ i ].nremote);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(combo)->entry), string );*/
|
||||
}
|
||||
|
||||
void
|
||||
set_selected_editor( gchar *string )
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "editorselect");
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
for ( i = 0; i < sizeof(possible_editors) / sizeof(possible_editors[0]); i++ ) {
|
||||
if ( ! strcmp( possible_editors[ i ].name, string ) ) {
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "editorcommand")),
|
||||
possible_editors[ i ].executable_name);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "editorterminal")),
|
||||
possible_editors[ i ].needs_term);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "editorlineno")),
|
||||
possible_editors[ i ].accepts_lineno);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(combo)->entry), string ); */
|
||||
}
|
||||
|
||||
void
|
||||
set_selected_help( gchar *string )
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "helpselect");
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
for ( i = 0;
|
||||
i < sizeof(possible_helpviewers) / sizeof(possible_helpviewers[0]);
|
||||
i++ ) {
|
||||
if ( ! strcmp( possible_helpviewers[ i ].name, string ) )
|
||||
{
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "helpcommand")),
|
||||
possible_helpviewers[ i ].executable_name);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "helpterminal")),
|
||||
possible_helpviewers[ i ].needs_term);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (capplet), "helpurls")),
|
||||
possible_helpviewers[ i ].allows_urls);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(combo)->entry), string );*/
|
||||
}
|
||||
|
||||
void
|
||||
set_selected_terminal( gchar *string )
|
||||
{
|
||||
gint i;
|
||||
GtkWidget *combo = gtk_object_get_data (GTK_OBJECT (capplet), "termselect");
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
for ( i = 0;
|
||||
i < sizeof(possible_terminals) / sizeof(possible_terminals[0]);
|
||||
i++ ) {
|
||||
if ( ! strcmp( possible_terminals[ i ].name, string ) )
|
||||
{
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "termcommand")),
|
||||
possible_terminals[ i ].executable_name);
|
||||
gtk_entry_set_text (GTK_ENTRY (gtk_object_get_data (GTK_OBJECT (capplet), "termexec")),
|
||||
possible_terminals[ i ].exec_app);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* gtk_entry_set_text( GTK_ENTRY(GTK_COMBO(combo)->entry), string );*/
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
[Desktop Entry]
|
||||
_Name=Default Applications
|
||||
_Comment=Choose the applications used by default
|
||||
Exec=default-application-properties-capplet
|
||||
Icon=
|
||||
Terminal=0
|
||||
Type=Application
|
43
capplets/default-applications/defaults.h
Normal file
43
capplets/default-applications/defaults.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/* -*- MODE: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
||||
|
||||
typedef struct _BrowserDescription BrowserDescription;
|
||||
typedef struct _EditorDescription EditorDescription;
|
||||
typedef struct _HelpViewDescription HelpViewDescription;
|
||||
typedef struct _TerminalDesciption TerminalDescription;
|
||||
|
||||
struct _EditorDescription
|
||||
{
|
||||
gchar *name;
|
||||
gchar *executable_name;
|
||||
gboolean needs_term;
|
||||
gchar *execution_type;
|
||||
gboolean accepts_lineno;
|
||||
gboolean use_name;
|
||||
};
|
||||
|
||||
struct _BrowserDescription
|
||||
{
|
||||
gchar *name;
|
||||
gchar *executable_name;
|
||||
gboolean needs_term;
|
||||
gboolean nremote;
|
||||
gboolean use_name;
|
||||
};
|
||||
|
||||
struct _HelpViewDescription
|
||||
{
|
||||
gchar *name;
|
||||
gchar *executable_name;
|
||||
gboolean needs_term;
|
||||
gboolean allows_urls;
|
||||
gboolean use_name;
|
||||
};
|
||||
|
||||
struct _TerminalDesciption
|
||||
{
|
||||
gchar *name;
|
||||
gchar *executable_name;
|
||||
gchar *exec_app;
|
||||
gboolean use_name;
|
||||
};
|
||||
|
713
capplets/default-applications/interface.c
Normal file
713
capplets/default-applications/interface.c
Normal file
|
@ -0,0 +1,713 @@
|
|||
/* -*- MODE: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
||||
/* Author: Benjamin Kahn <xkahn@zoned.net>
|
||||
* Based on capplets/gnome-edit-properties/gnome-edit-properties.c.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "capplet-widget.h"
|
||||
#include "callbacks.h"
|
||||
#include "interface.h"
|
||||
#include "support.h"
|
||||
#include "defaults.h"
|
||||
|
||||
extern GtkWidget *capplet;
|
||||
extern gboolean ignore_changes;
|
||||
|
||||
extern EditorDescription *possible_editors;
|
||||
extern BrowserDescription *possible_browsers;
|
||||
extern HelpViewDescription *possible_helpviewers;
|
||||
extern TerminalDescription *possible_terminals;
|
||||
|
||||
void
|
||||
edit_create (void)
|
||||
{
|
||||
GtkWidget *notebook1;
|
||||
GtkWidget *frame1;
|
||||
GtkWidget *table16;
|
||||
GSList *seleditor_group = NULL;
|
||||
GtkWidget *radiodefeditor;
|
||||
GtkWidget *editorselect;
|
||||
GtkWidget *combo_editor;
|
||||
GtkWidget *radiocusteditor;
|
||||
GtkWidget *table17;
|
||||
GtkWidget *editorterminal;
|
||||
GtkWidget *editorlineno;
|
||||
GtkWidget *table18;
|
||||
GtkWidget *label7;
|
||||
GtkWidget *editorcommand;
|
||||
GtkWidget *hseparator5;
|
||||
GtkWidget *label4;
|
||||
GtkWidget *frame2;
|
||||
GtkWidget *table19;
|
||||
GSList *selbrowser_group = NULL;
|
||||
GtkWidget *seldefbrowser;
|
||||
GtkWidget *browserselect;
|
||||
GtkWidget *combo_browser;
|
||||
GtkWidget *selcustbrowser;
|
||||
GtkWidget *table20;
|
||||
GtkWidget *browserterminal;
|
||||
GtkWidget *browserremote;
|
||||
GtkWidget *table21;
|
||||
GtkWidget *label8;
|
||||
GtkWidget *browsercommand;
|
||||
GtkWidget *hseparator6;
|
||||
GtkWidget *label5;
|
||||
GtkWidget *frame3;
|
||||
GtkWidget *table22;
|
||||
GSList *selhelp_group = NULL;
|
||||
GtkWidget *seldefview;
|
||||
GtkWidget *helpselect;
|
||||
GtkWidget *combo_help;
|
||||
GtkWidget *selcustview;
|
||||
GtkWidget *table23;
|
||||
GtkWidget *helpterminal;
|
||||
GtkWidget *helpurls;
|
||||
GtkWidget *table24;
|
||||
GtkWidget *label9;
|
||||
GtkWidget *helpcommand;
|
||||
GtkWidget *hseparator7;
|
||||
GtkWidget *label6;
|
||||
GtkWidget *frame4;
|
||||
GtkWidget *table25;
|
||||
GSList *selterm_group = NULL;
|
||||
GtkWidget *seldefterm;
|
||||
GtkWidget *termselect;
|
||||
GtkWidget *combo_term;
|
||||
GtkWidget *selcustterm;
|
||||
GtkWidget *table26;
|
||||
GtkWidget *table27;
|
||||
GtkWidget *label11;
|
||||
GtkWidget *label12;
|
||||
GtkWidget *termexec;
|
||||
GtkWidget *termcommand;
|
||||
GtkWidget *hseparator8;
|
||||
GtkWidget *label10;
|
||||
GtkTooltips *tooltips;
|
||||
|
||||
tooltips = gtk_tooltips_new ();
|
||||
|
||||
capplet = capplet_widget_new();
|
||||
ignore_changes = TRUE;
|
||||
|
||||
notebook1 = gtk_notebook_new ();
|
||||
gtk_widget_ref (notebook1);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "notebook1", notebook1,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (notebook1);
|
||||
gtk_container_add (GTK_CONTAINER (capplet), notebook1);
|
||||
|
||||
frame1 = gtk_frame_new (_("Gnome Default Editor"));
|
||||
gtk_widget_ref (frame1);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "frame1", frame1,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (frame1);
|
||||
gtk_container_add (GTK_CONTAINER (notebook1), frame1);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame1), 5);
|
||||
|
||||
table16 = gtk_table_new (3, 2, FALSE);
|
||||
gtk_widget_ref (table16);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table16", table16,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table16);
|
||||
gtk_container_add (GTK_CONTAINER (frame1), table16);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table16), 10);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table16), 10);
|
||||
|
||||
radiodefeditor = gtk_radio_button_new_with_label (seleditor_group, _("Select an Editor"));
|
||||
seleditor_group = gtk_radio_button_group (GTK_RADIO_BUTTON (radiodefeditor));
|
||||
gtk_widget_ref (radiodefeditor);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "radiodefeditor", radiodefeditor,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (radiodefeditor);
|
||||
gtk_table_attach (GTK_TABLE (table16), radiodefeditor, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, radiodefeditor, _("With this option, you can select a predefined Editor as your default"), NULL);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiodefeditor), TRUE);
|
||||
|
||||
editorselect = gtk_combo_new ();
|
||||
gtk_widget_ref (editorselect);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "editorselect", editorselect,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (editorselect);
|
||||
gtk_table_attach (GTK_TABLE (table16), editorselect, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_combo_set_value_in_list (GTK_COMBO (editorselect), TRUE, TRUE);
|
||||
|
||||
combo_editor = GTK_COMBO (editorselect)->entry;
|
||||
gtk_widget_ref (combo_editor);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "combo_editor", combo_editor,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (combo_editor);
|
||||
gtk_entry_set_editable (GTK_ENTRY (combo_editor), FALSE);
|
||||
|
||||
radiocusteditor = gtk_radio_button_new_with_label (seleditor_group, _("Custom Editor"));
|
||||
seleditor_group = gtk_radio_button_group (GTK_RADIO_BUTTON (radiocusteditor));
|
||||
gtk_widget_ref (radiocusteditor);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "radiocusteditor", radiocusteditor,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (radiocusteditor);
|
||||
gtk_table_attach (GTK_TABLE (table16), radiocusteditor, 0, 1, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, radiocusteditor, _("With this option you can create your own default editor"), NULL);
|
||||
|
||||
table17 = gtk_table_new (3, 1, FALSE);
|
||||
gtk_widget_ref (table17);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table17", table17,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table17);
|
||||
gtk_table_attach (GTK_TABLE (table16), table17, 1, 2, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_FILL), 0, 0);
|
||||
|
||||
editorterminal = gtk_check_button_new_with_label (_("Start in Terminal"));
|
||||
gtk_widget_ref (editorterminal);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "editorterminal", editorterminal,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (editorterminal);
|
||||
gtk_table_attach (GTK_TABLE (table17), editorterminal, 0, 1, 1, 2,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, editorterminal, _("Does this editor need to start in an xterm?"), NULL);
|
||||
|
||||
editorlineno = gtk_check_button_new_with_label (_("Accepts Line Number"));
|
||||
gtk_widget_ref (editorlineno);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "editorlineno", editorlineno,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (editorlineno);
|
||||
gtk_table_attach (GTK_TABLE (table17), editorlineno, 0, 1, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, editorlineno, _("Does this editor accept line numbers from the command line?"), NULL);
|
||||
|
||||
table18 = gtk_table_new (1, 2, FALSE);
|
||||
gtk_widget_ref (table18);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table18", table18,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table18);
|
||||
gtk_table_attach (GTK_TABLE (table17), table18, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
|
||||
|
||||
label7 = gtk_label_new (_("Command:"));
|
||||
gtk_widget_ref (label7);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "label7", label7,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label7);
|
||||
gtk_table_attach (GTK_TABLE (table18), label7, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);
|
||||
|
||||
editorcommand = gtk_entry_new ();
|
||||
gtk_widget_ref (editorcommand);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "editorcommand", editorcommand,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (editorcommand);
|
||||
gtk_table_attach (GTK_TABLE (table18), editorcommand, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 5, 0);
|
||||
gtk_tooltips_set_tip (tooltips, editorcommand, _("Please enter the command line used to start this editor"), NULL);
|
||||
|
||||
hseparator5 = gtk_hseparator_new ();
|
||||
gtk_widget_ref (hseparator5);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "hseparator5", hseparator5,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (hseparator5);
|
||||
gtk_table_attach (GTK_TABLE (table16), hseparator5, 0, 2, 1, 2,
|
||||
(GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_SHRINK | GTK_FILL), 0, 0);
|
||||
|
||||
label4 = gtk_label_new (_("Text Editor"));
|
||||
gtk_widget_ref (label4);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "label4", label4,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label4);
|
||||
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label4);
|
||||
|
||||
frame2 = gtk_frame_new (_("Gnome Default Web Browser"));
|
||||
gtk_widget_ref (frame2);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "frame2", frame2,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (frame2);
|
||||
gtk_container_add (GTK_CONTAINER (notebook1), frame2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame2), 5);
|
||||
|
||||
table19 = gtk_table_new (3, 2, FALSE);
|
||||
gtk_widget_ref (table19);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table19", table19,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table19);
|
||||
gtk_container_add (GTK_CONTAINER (frame2), table19);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table19), 10);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table19), 10);
|
||||
|
||||
seldefbrowser = gtk_radio_button_new_with_label (selbrowser_group, _("Select a Web Browser"));
|
||||
selbrowser_group = gtk_radio_button_group (GTK_RADIO_BUTTON (seldefbrowser));
|
||||
gtk_widget_ref (seldefbrowser);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "seldefbrowser", seldefbrowser,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (seldefbrowser);
|
||||
gtk_table_attach (GTK_TABLE (table19), seldefbrowser, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, seldefbrowser, _("With this option, you can select a predefined Web Browser as your default"), NULL);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (seldefbrowser), TRUE);
|
||||
|
||||
browserselect = gtk_combo_new ();
|
||||
gtk_widget_ref (browserselect);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "browserselect", browserselect,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (browserselect);
|
||||
gtk_table_attach (GTK_TABLE (table19), browserselect, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_combo_set_value_in_list (GTK_COMBO (browserselect), TRUE, TRUE);
|
||||
|
||||
combo_browser = GTK_COMBO (browserselect)->entry;
|
||||
gtk_widget_ref (combo_browser);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "combo_browser", combo_browser,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (combo_browser);
|
||||
gtk_entry_set_editable (GTK_ENTRY (combo_browser), FALSE);
|
||||
|
||||
selcustbrowser = gtk_radio_button_new_with_label (selbrowser_group, _("Custom Web Browser"));
|
||||
selbrowser_group = gtk_radio_button_group (GTK_RADIO_BUTTON (selcustbrowser));
|
||||
gtk_widget_ref (selcustbrowser);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "selcustbrowser", selcustbrowser,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (selcustbrowser);
|
||||
gtk_table_attach (GTK_TABLE (table19), selcustbrowser, 0, 1, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, selcustbrowser, _("With this option you can create your own default web browser"), NULL);
|
||||
|
||||
table20 = gtk_table_new (3, 1, FALSE);
|
||||
gtk_widget_ref (table20);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table20", table20,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table20);
|
||||
gtk_table_attach (GTK_TABLE (table19), table20, 1, 2, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_FILL), 0, 0);
|
||||
|
||||
browserterminal = gtk_check_button_new_with_label (_("Start in Terminal"));
|
||||
gtk_widget_ref (browserterminal);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "browserterminal", browserterminal,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (browserterminal);
|
||||
gtk_table_attach (GTK_TABLE (table20), browserterminal, 0, 1, 1, 2,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, browserterminal, _("Does this web browser need to display in an xterm?"), NULL);
|
||||
|
||||
browserremote = gtk_check_button_new_with_label (_("Understands Netscape Remote Control"));
|
||||
gtk_widget_ref (browserremote);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "browserremote", browserremote,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (browserremote);
|
||||
gtk_table_attach (GTK_TABLE (table20), browserremote, 0, 1, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, browserremote, _("Does this web browser support the netscape remote control protocol? If in doubt, and this web browser isn't Netscape or Mozilla, it probably doesn't."), NULL);
|
||||
|
||||
table21 = gtk_table_new (1, 2, FALSE);
|
||||
gtk_widget_ref (table21);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table21", table21,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table21);
|
||||
gtk_table_attach (GTK_TABLE (table20), table21, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
|
||||
|
||||
label8 = gtk_label_new (_("Command:"));
|
||||
gtk_widget_ref (label8);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "label8", label8,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label8);
|
||||
gtk_table_attach (GTK_TABLE (table21), label8, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);
|
||||
|
||||
browsercommand = gtk_entry_new ();
|
||||
gtk_widget_ref (browsercommand);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "browsercommand", browsercommand,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (browsercommand);
|
||||
gtk_table_attach (GTK_TABLE (table21), browsercommand, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 5, 0);
|
||||
gtk_tooltips_set_tip (tooltips, browsercommand, _("Please enter the command line used to start this web browser"), NULL);
|
||||
|
||||
hseparator6 = gtk_hseparator_new ();
|
||||
gtk_widget_ref (hseparator6);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "hseparator6", hseparator6,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (hseparator6);
|
||||
gtk_table_attach (GTK_TABLE (table19), hseparator6, 0, 2, 1, 2,
|
||||
(GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_SHRINK | GTK_FILL), 0, 0);
|
||||
|
||||
label5 = gtk_label_new (_("Web Browser"));
|
||||
gtk_widget_ref (label5);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "label5", label5,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label5);
|
||||
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label5);
|
||||
|
||||
frame3 = gtk_frame_new (_("Default Help Viewer"));
|
||||
gtk_widget_ref (frame3);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "frame3", frame3,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (frame3);
|
||||
gtk_container_add (GTK_CONTAINER (notebook1), frame3);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame3), 5);
|
||||
|
||||
table22 = gtk_table_new (3, 2, FALSE);
|
||||
gtk_widget_ref (table22);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table22", table22,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table22);
|
||||
gtk_container_add (GTK_CONTAINER (frame3), table22);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table22), 10);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table22), 10);
|
||||
|
||||
seldefview = gtk_radio_button_new_with_label (selhelp_group, _("Select a Viewer"));
|
||||
selhelp_group = gtk_radio_button_group (GTK_RADIO_BUTTON (seldefview));
|
||||
gtk_widget_ref (seldefview);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "seldefview", seldefview,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (seldefview);
|
||||
gtk_table_attach (GTK_TABLE (table22), seldefview, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, seldefview, _("With this option you can select a predefined help viewer."), NULL);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (seldefview), TRUE);
|
||||
|
||||
helpselect = gtk_combo_new ();
|
||||
gtk_widget_ref (helpselect);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "helpselect", helpselect,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (helpselect);
|
||||
gtk_table_attach (GTK_TABLE (table22), helpselect, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_combo_set_value_in_list (GTK_COMBO (helpselect), TRUE, TRUE);
|
||||
|
||||
combo_help = GTK_COMBO (helpselect)->entry;
|
||||
gtk_widget_ref (combo_help);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "combo_help", combo_help,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (combo_help);
|
||||
gtk_entry_set_editable (GTK_ENTRY (combo_help), FALSE);
|
||||
|
||||
selcustview = gtk_radio_button_new_with_label (selhelp_group, _("Custom Help Viewer"));
|
||||
selhelp_group = gtk_radio_button_group (GTK_RADIO_BUTTON (selcustview));
|
||||
gtk_widget_ref (selcustview);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "selcustview", selcustview,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (selcustview);
|
||||
gtk_table_attach (GTK_TABLE (table22), selcustview, 0, 1, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, selcustview, _("With this option you can create your own help viewer"), NULL);
|
||||
|
||||
table23 = gtk_table_new (3, 1, FALSE);
|
||||
gtk_widget_ref (table23);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table23", table23,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table23);
|
||||
gtk_table_attach (GTK_TABLE (table22), table23, 1, 2, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_FILL), 0, 0);
|
||||
|
||||
helpterminal = gtk_check_button_new_with_label (_("Start in Terminal"));
|
||||
gtk_widget_ref (helpterminal);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "helpterminal", helpterminal,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (helpterminal);
|
||||
gtk_table_attach (GTK_TABLE (table23), helpterminal, 0, 1, 1, 2,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, helpterminal, _("Does this help viewer need an xterm for display?"), NULL);
|
||||
|
||||
helpurls = gtk_check_button_new_with_label (_("Accepts URLs"));
|
||||
gtk_widget_ref (helpurls);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "helpurls", helpurls,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (helpurls);
|
||||
gtk_table_attach (GTK_TABLE (table23), helpurls, 0, 1, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, helpurls, _("Does this help viewer allow URLs for help?"), NULL);
|
||||
|
||||
table24 = gtk_table_new (1, 2, FALSE);
|
||||
gtk_widget_ref (table24);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table24", table24,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table24);
|
||||
gtk_table_attach (GTK_TABLE (table23), table24, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
|
||||
|
||||
label9 = gtk_label_new (_("Command:"));
|
||||
gtk_widget_ref (label9);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "label9", label9,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label9);
|
||||
gtk_table_attach (GTK_TABLE (table24), label9, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (label9), 0, 0.5);
|
||||
|
||||
helpcommand = gtk_entry_new ();
|
||||
gtk_widget_ref (helpcommand);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "helpcommand", helpcommand,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (helpcommand);
|
||||
gtk_table_attach (GTK_TABLE (table24), helpcommand, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 5, 0);
|
||||
gtk_tooltips_set_tip (tooltips, helpcommand, _("Please enter the command line used to start this help viewer"), NULL);
|
||||
|
||||
hseparator7 = gtk_hseparator_new ();
|
||||
gtk_widget_ref (hseparator7);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "hseparator7", hseparator7,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (hseparator7);
|
||||
gtk_table_attach (GTK_TABLE (table22), hseparator7, 0, 2, 1, 2,
|
||||
(GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_SHRINK | GTK_FILL), 0, 0);
|
||||
|
||||
label6 = gtk_label_new (_("Help Viewer"));
|
||||
gtk_widget_ref (label6);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "label6", label6,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label6);
|
||||
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 2), label6);
|
||||
|
||||
frame4 = gtk_frame_new (_("Default Help Viewer"));
|
||||
gtk_widget_ref (frame4);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "frame4", frame4,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (frame4);
|
||||
gtk_container_add (GTK_CONTAINER (notebook1), frame4);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (frame4), 5);
|
||||
|
||||
table25 = gtk_table_new (3, 2, FALSE);
|
||||
gtk_widget_ref (table25);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table25", table25,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table25);
|
||||
gtk_container_add (GTK_CONTAINER (frame4), table25);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table25), 10);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table25), 10);
|
||||
|
||||
seldefterm = gtk_radio_button_new_with_label (selterm_group, _("Select a Terminal"));
|
||||
selterm_group = gtk_radio_button_group (GTK_RADIO_BUTTON (seldefterm));
|
||||
gtk_widget_ref (seldefterm);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "seldefterm", seldefterm,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (seldefterm);
|
||||
gtk_table_attach (GTK_TABLE (table25), seldefterm, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, seldefterm, _("With this option you can select a predefined terminal."), NULL);
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (seldefterm), TRUE);
|
||||
|
||||
termselect = gtk_combo_new ();
|
||||
gtk_widget_ref (termselect);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "termselect", termselect,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (termselect);
|
||||
gtk_table_attach (GTK_TABLE (table25), termselect, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_combo_set_value_in_list (GTK_COMBO (termselect), TRUE, TRUE);
|
||||
|
||||
combo_term = GTK_COMBO (termselect)->entry;
|
||||
gtk_widget_ref (combo_term);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "combo_term", combo_term,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (combo_term);
|
||||
gtk_entry_set_editable (GTK_ENTRY (combo_term), FALSE);
|
||||
|
||||
selcustterm = gtk_radio_button_new_with_label (selterm_group, _("Custom Terminal"));
|
||||
selterm_group = gtk_radio_button_group (GTK_RADIO_BUTTON (selcustterm));
|
||||
gtk_widget_ref (selcustterm);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "selcustterm", selcustterm,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (selcustterm);
|
||||
gtk_table_attach (GTK_TABLE (table25), selcustterm, 0, 1, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, selcustterm, _("With this option you can create your own terminal"), NULL);
|
||||
|
||||
table26 = gtk_table_new (1, 1, FALSE);
|
||||
gtk_widget_ref (table26);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table26", table26,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table26);
|
||||
gtk_table_attach (GTK_TABLE (table25), table26, 1, 2, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_FILL), 0, 0);
|
||||
|
||||
table27 = gtk_table_new (2, 2, FALSE);
|
||||
gtk_widget_ref (table27);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "table27", table27,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (table27);
|
||||
gtk_table_attach (GTK_TABLE (table26), table27, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
|
||||
|
||||
label11 = gtk_label_new (_("Command:"));
|
||||
gtk_widget_ref (label11);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "label11", label11,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label11);
|
||||
gtk_table_attach (GTK_TABLE (table27), label11, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (label11), 0, 0.5);
|
||||
|
||||
label12 = gtk_label_new (_("Exec Flag:"));
|
||||
gtk_widget_ref (label12);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "label12", label12,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label12);
|
||||
gtk_table_attach (GTK_TABLE (table27), label12, 0, 1, 1, 2,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);
|
||||
|
||||
termexec = gtk_entry_new_with_max_length (20);
|
||||
gtk_widget_ref (termexec);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "termexec", termexec,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (termexec);
|
||||
gtk_table_attach (GTK_TABLE (table27), termexec, 1, 2, 1, 2,
|
||||
(GtkAttachOptions) (GTK_EXPAND),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
gtk_tooltips_set_tip (tooltips, termexec, _("Please enter the flag used by this terminal to specify the command to run on startup. For example, in 'xterm' this would be '-e'."), NULL);
|
||||
|
||||
termcommand = gtk_entry_new ();
|
||||
gtk_widget_ref (termcommand);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "termcommand", termcommand,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (termcommand);
|
||||
gtk_table_attach (GTK_TABLE (table27), termcommand, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND),
|
||||
(GtkAttachOptions) (0), 5, 0);
|
||||
gtk_tooltips_set_tip (tooltips, termcommand, _("Please enter the command line used to start this terminal"), NULL);
|
||||
|
||||
hseparator8 = gtk_hseparator_new ();
|
||||
gtk_widget_ref (hseparator8);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "hseparator8", hseparator8,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (hseparator8);
|
||||
gtk_table_attach (GTK_TABLE (table25), hseparator8, 0, 2, 1, 2,
|
||||
(GtkAttachOptions) (GTK_SHRINK | GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_SHRINK | GTK_FILL), 0, 0);
|
||||
|
||||
label10 = gtk_label_new (_("Terminal"));
|
||||
gtk_widget_ref (label10);
|
||||
gtk_object_set_data_full (GTK_OBJECT (capplet), "label10", label10,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label10);
|
||||
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 3), label10);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (radiodefeditor), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_radiodefeditor_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (combo_editor), "changed",
|
||||
GTK_SIGNAL_FUNC (on_combo_editor_changed),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (radiocusteditor), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_radiocusteditor_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (editorterminal), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_editorterminal_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (editorlineno), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_editorlineno_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (editorcommand), "changed",
|
||||
GTK_SIGNAL_FUNC (on_editorcommand_changed),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (seldefbrowser), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_seldefbrowser_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (combo_browser), "changed",
|
||||
GTK_SIGNAL_FUNC (on_combo_browser_changed),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (selcustbrowser), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_selcustbrowser_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (browserterminal), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_browserterminal_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (browserremote), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_browserremote_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (browsercommand), "changed",
|
||||
GTK_SIGNAL_FUNC (on_browsercommand_changed),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (seldefview), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_seldefview_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (combo_help), "changed",
|
||||
GTK_SIGNAL_FUNC (on_combo_help_changed),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (selcustview), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_selcustview_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (helpterminal), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_helpterminal_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (helpurls), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_helpurls_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (helpcommand), "changed",
|
||||
GTK_SIGNAL_FUNC (on_helpcommand_changed),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (seldefterm), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_seldefterm_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (combo_term), "changed",
|
||||
GTK_SIGNAL_FUNC (on_combo_term_changed),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (selcustterm), "toggled",
|
||||
GTK_SIGNAL_FUNC (on_selcustterm_toggled),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (termexec), "changed",
|
||||
GTK_SIGNAL_FUNC (on_termexec_changed),
|
||||
NULL);
|
||||
gtk_signal_connect (GTK_OBJECT (termcommand), "changed",
|
||||
GTK_SIGNAL_FUNC (on_termcommand_changed),
|
||||
NULL);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (capplet), "tooltips", tooltips);
|
||||
|
||||
/* Turn off some sections for initialization. */
|
||||
gtk_widget_set_sensitive(table17, FALSE);
|
||||
gtk_widget_set_sensitive(table20, FALSE);
|
||||
gtk_widget_set_sensitive(table23, FALSE);
|
||||
gtk_widget_set_sensitive(table26, FALSE);
|
||||
|
||||
|
||||
gtk_widget_show_all (capplet);
|
||||
|
||||
}
|
7
capplets/default-applications/interface.h
Normal file
7
capplets/default-applications/interface.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
|
||||
void edit_create (void);
|
||||
|
||||
extern void fill_default_browser (void);
|
||||
extern void fill_default_terminal (void);
|
||||
extern void fill_default_help (void);
|
||||
extern void fill_default_editor (void);
|
146
capplets/default-applications/support.c
Normal file
146
capplets/default-applications/support.c
Normal file
|
@ -0,0 +1,146 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "support.h"
|
||||
|
||||
/* This is an internally used function to create pixmaps. */
|
||||
static GtkWidget* create_dummy_pixmap (GtkWidget *widget,
|
||||
gboolean gnome_pixmap);
|
||||
|
||||
GtkWidget*
|
||||
lookup_widget (GtkWidget *widget,
|
||||
const gchar *widget_name)
|
||||
{
|
||||
GtkWidget *parent, *found_widget;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (GTK_IS_MENU (widget))
|
||||
parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
|
||||
else
|
||||
parent = widget->parent;
|
||||
if (parent == NULL)
|
||||
break;
|
||||
widget = parent;
|
||||
}
|
||||
|
||||
found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget),
|
||||
widget_name);
|
||||
if (!found_widget)
|
||||
g_warning ("Widget not found: %s", widget_name);
|
||||
return found_widget;
|
||||
}
|
||||
|
||||
/* This is a dummy pixmap we use when a pixmap can't be found. */
|
||||
static char *dummy_pixmap_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"1 1 1 1",
|
||||
" c None",
|
||||
/* pixels */
|
||||
" ",
|
||||
" "
|
||||
};
|
||||
|
||||
/* This is an internally used function to create pixmaps. */
|
||||
static GtkWidget*
|
||||
create_dummy_pixmap (GtkWidget *widget,
|
||||
gboolean gnome_pixmap)
|
||||
{
|
||||
GdkColormap *colormap;
|
||||
GdkPixmap *gdkpixmap;
|
||||
GdkBitmap *mask;
|
||||
GtkWidget *pixmap;
|
||||
|
||||
if (gnome_pixmap)
|
||||
{
|
||||
return gnome_pixmap_new_from_xpm_d (dummy_pixmap_xpm);
|
||||
}
|
||||
|
||||
colormap = gtk_widget_get_colormap (widget);
|
||||
gdkpixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask,
|
||||
NULL, dummy_pixmap_xpm);
|
||||
if (gdkpixmap == NULL)
|
||||
g_error ("Couldn't create replacement pixmap.");
|
||||
pixmap = gtk_pixmap_new (gdkpixmap, mask);
|
||||
gdk_pixmap_unref (gdkpixmap);
|
||||
gdk_bitmap_unref (mask);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
/* This is an internally used function to create pixmaps. */
|
||||
GtkWidget*
|
||||
create_pixmap (GtkWidget *widget,
|
||||
const gchar *filename,
|
||||
gboolean gnome_pixmap)
|
||||
{
|
||||
GtkWidget *pixmap;
|
||||
GdkColormap *colormap;
|
||||
GdkPixmap *gdkpixmap;
|
||||
GdkBitmap *mask;
|
||||
gchar *pathname;
|
||||
|
||||
if (!filename || !filename[0])
|
||||
return create_dummy_pixmap (widget, gnome_pixmap);
|
||||
|
||||
pathname = gnome_pixmap_file (filename);
|
||||
if (!pathname)
|
||||
{
|
||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||
return create_dummy_pixmap (widget, gnome_pixmap);
|
||||
}
|
||||
|
||||
if (gnome_pixmap)
|
||||
{
|
||||
pixmap = gnome_pixmap_new_from_file (pathname);
|
||||
g_free (pathname);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
colormap = gtk_widget_get_colormap (widget);
|
||||
gdkpixmap = gdk_pixmap_colormap_create_from_xpm (NULL, colormap, &mask,
|
||||
NULL, pathname);
|
||||
if (gdkpixmap == NULL)
|
||||
{
|
||||
g_warning (_("Couldn't create pixmap from file: %s"), pathname);
|
||||
g_free (pathname);
|
||||
return create_dummy_pixmap (widget, gnome_pixmap);
|
||||
}
|
||||
g_free (pathname);
|
||||
|
||||
pixmap = gtk_pixmap_new (gdkpixmap, mask);
|
||||
gdk_pixmap_unref (gdkpixmap);
|
||||
gdk_bitmap_unref (mask);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
/* This is an internally used function to create imlib images. */
|
||||
GdkImlibImage*
|
||||
create_image (const gchar *filename)
|
||||
{
|
||||
GdkImlibImage *image;
|
||||
gchar *pathname;
|
||||
|
||||
pathname = gnome_pixmap_file (filename);
|
||||
if (!pathname)
|
||||
{
|
||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
image = gdk_imlib_load_image (pathname);
|
||||
g_free (pathname);
|
||||
return image;
|
||||
}
|
||||
|
34
capplets/default-applications/support.h
Normal file
34
capplets/default-applications/support.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
/*
|
||||
* Public Functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This function returns a widget in a component created by Glade.
|
||||
* Call it with the toplevel widget in the component (i.e. a window/dialog),
|
||||
* or alternatively any widget in the component, and the name of the widget
|
||||
* you want returned.
|
||||
*/
|
||||
GtkWidget* lookup_widget (GtkWidget *widget,
|
||||
const gchar *widget_name);
|
||||
|
||||
/* get_widget() is deprecated. Use lookup_widget instead. */
|
||||
#define get_widget lookup_widget
|
||||
|
||||
|
||||
/*
|
||||
* Private Functions.
|
||||
*/
|
||||
|
||||
/* This is used to create the pixmaps in the interface. */
|
||||
GtkWidget* create_pixmap (GtkWidget *widget,
|
||||
const gchar *filename,
|
||||
gboolean gnome_pixmap);
|
||||
|
||||
GdkImlibImage* create_image (const gchar *filename);
|
||||
|
7
capplets/desktop-links/ChangeLog
Normal file
7
capplets/desktop-links/ChangeLog
Normal file
|
@ -0,0 +1,7 @@
|
|||
2001-07-16 Richard Hestilow <hestilow@ximian.com>
|
||||
|
||||
* ChangeLog started.
|
||||
|
||||
* gnome-hint-properties.desktop: Added.
|
||||
* README: Added.
|
||||
* Makefile.am: Added.
|
8
capplets/desktop-links/Makefile.am
Normal file
8
capplets/desktop-links/Makefile.am
Normal file
|
@ -0,0 +1,8 @@
|
|||
ccenterdir = $(datadir)/control-center/capplets
|
||||
|
||||
Desktopdir = $(ccenterdir)
|
||||
Desktop_DATA = \
|
||||
gnome-hint-properties.desktop
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(Desktop_DATA)
|
4
capplets/desktop-links/README
Normal file
4
capplets/desktop-links/README
Normal file
|
@ -0,0 +1,4 @@
|
|||
The following files are here for compatibility reasons and should
|
||||
be removed as their modules correct the capplet install directory:
|
||||
|
||||
* gnome-hint-properties-capplet (package gnome-core)
|
0
capplets/desktop-links/TEST
Normal file
0
capplets/desktop-links/TEST
Normal file
49
capplets/desktop-links/gnome-hint-properties.desktop
Normal file
49
capplets/desktop-links/gnome-hint-properties.desktop
Normal file
|
@ -0,0 +1,49 @@
|
|||
[Desktop Entry]
|
||||
Name=Startup Hint
|
||||
Name[sl]=Zaèetni namig
|
||||
Name[cs]=Pøíhla¹ovací rady
|
||||
Name[da]=Opstartstips
|
||||
Name[de]=Tipps beim Start
|
||||
Name[el]=Õðüäåéîç åêêßíçóçò
|
||||
Name[fi]=Aloitusvihjeet
|
||||
Name[fr]=Astuces de démarrage
|
||||
Name[gl]=Axudas no Inicio
|
||||
Name[hu]=Indítási segédszövegek
|
||||
Name[it]=Suggerimenti
|
||||
Name[ja]=¥¹¥¿¡¼¥È¥¢¥Ã¥×¥Ò¥ó¥È
|
||||
Name[lt]=Patarimø savybës
|
||||
Name[no]=Oppstartstips
|
||||
Name[pl]=Porada GNOME
|
||||
Name[pt_BR]=Dicas de Inicialização
|
||||
Name[ro]=Sugestia de la pornire
|
||||
Name[sk]=Rada pri ¹tarte
|
||||
Name[sv]=Uppstartstips
|
||||
Name[tr]=Baþlangýç yardýmlarý
|
||||
Name[uk]=óÔÁÒÔÏצ ÐÏÒÁÄÉ
|
||||
Name[zh_TW.Big5]=±Ò°Ê´£¥Ü
|
||||
Comment=Options for the startup hint dialog
|
||||
Comment[sl]=Mo¾nosti za zaèetni dialog z namigi
|
||||
Comment[cs]=Nastavení pøíhla¹ovacích rad
|
||||
Comment[da]=Indstillinger for opstartstipsdialogboksen
|
||||
Comment[de]=Optionen für die Anzeige von Tipps beim Start
|
||||
Comment[el]=Õðüäåéîç êáôÜ ôçí åêêßíçóç
|
||||
Comment[fi]=Muuttaa aloitusvihjeiden asetuksia
|
||||
Comment[fr]=Configuration des astuces au démarrage
|
||||
Comment[gl]=Opcións para o diálogo de axudas no inicio
|
||||
Comment[hu]=Segédüzenet-ablak, indításkor megjelenik
|
||||
Comment[it]=Configurazione dei suggerimenti
|
||||
Comment[ja]=¥¹¥¿¡¼¥È¥¢¥Ã¥×¥Ò¥ó¥È¥À¥¤¥¢¥í¥°¤ÎÀßÄê
|
||||
Comment[lt]=Pradþios patarimø pasirinktys
|
||||
Comment[no]=Alternativer for tips ved oppstart
|
||||
Comment[pl]=Opcje okna porad GNOME
|
||||
Comment[pt_BR]=Opções para caixa de diálogo de dicas de inicialização
|
||||
Comment[ro]=Opþiuni pentru dialogul de sugestii de la pornire
|
||||
Comment[sk]=Voµby pre dialóg s radami pri ¹tarte
|
||||
Comment[sv]=Inställningar för uppstartstips-dialogen
|
||||
Comment[tr]=Baþlangýç yardýmlarýnýn seçenekleri
|
||||
Comment[uk]=ðÁÒÁÍÅÔÒÉ Ä¦ÁÌÏÇÕ ÓÔÁÒÔÏ×ÉÈ ÐÏÒÁÄ
|
||||
Comment[zh_TW.Big5]=±Ò°Ê´£¥Ü¹ï¸Üµøµ¡ªº¿ï¶µ
|
||||
Exec=gnome-hint-properties-capplet
|
||||
Icon=gnome-hint.png
|
||||
Terminal=0
|
||||
Type=Application
|
|
@ -139,6 +139,8 @@ control-center/Makefile
|
|||
capplets/Makefile
|
||||
capplets/common/Makefile
|
||||
capplets/background/Makefile
|
||||
capplets/default-applications/Makefile
|
||||
capplets/desktop-links/Makefile
|
||||
capplets/keyboard/Makefile
|
||||
capplets/mouse/Makefile
|
||||
capplets/rollback/Makefile
|
||||
|
|
Loading…
Add table
Reference in a new issue