[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/src prefs.c,1.22,1.23
From: |
Philip S Tellis <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/src prefs.c,1.22,1.23 |
Date: |
Wed, 22 Jan 2003 02:26:38 -0500 |
Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv21847/src
Modified Files:
prefs.c
Log Message:
added a browse button for alternate browser
Index: prefs.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- prefs.c 21 Jan 2003 20:13:55 -0000 1.22
+++ prefs.c 22 Jan 2003 07:26:35 -0000 1.23
@@ -220,7 +220,10 @@
static GtkWidget *length_contact_window_entry = NULL;
static GtkWidget *font_size_entry = NULL;
static GtkWidget *alternate_browser_entry = NULL;
+static GtkWidget *g_browser_browse_button = NULL;
+#ifdef HAVE_ISPELL
static GtkWidget *dictionary_entry = NULL;
+#endif
static const gint length_contact_window_default = 256;
static const gint width_contact_window_default = 150;
@@ -251,11 +254,38 @@
static gint use_alternate_browser = 0;
static gint use_alternate_browser_old = 0;
-static void set_use_alternate_browser(GtkWidget * w, int * data);
#ifdef HAVE_ISPELL
static void set_use_spell(GtkWidget * w, int * data);
#endif
+static void set_browser_path(char * selected_filename, gpointer data)
+{
+ if(!selected_filename)
+ return;
+ gtk_entry_set_text(GTK_ENTRY(alternate_browser_entry),
selected_filename);
+}
+
+static void get_alt_browser_path (GtkWidget * t_browser_browse_button,
gpointer userdata)
+{
+ eb_debug(DBG_CORE, "Just entered get_alt_browser_path\n");
+
eb_do_file_selector(gtk_entry_get_text(GTK_ENTRY(alternate_browser_entry)),
+ _("Select your browser"), set_browser_path, NULL);
+}
+
+static void set_use_alternate_browser(GtkWidget * w, int * data)
+{
+ if(use_alternate_browser == 0)
+ {
+ gtk_widget_set_sensitive(alternate_browser_entry, FALSE);
+ gtk_widget_set_sensitive(g_browser_browse_button, FALSE);
+ }
+ else
+ {
+ gtk_widget_set_sensitive(alternate_browser_entry, TRUE);
+ gtk_widget_set_sensitive(g_browser_browse_button, TRUE);
+ }
+}
+
static void build_general_prefs(GtkWidget *prefs_note) {
GtkWidget *vbox;
GtkWidget *brbutton;
@@ -334,7 +364,7 @@
brbutton = eb_button(_("Use alternate browser"), &use_alternate_browser,
vbox);
gtk_signal_connect(GTK_OBJECT(brbutton), "clicked",
- GTK_SIGNAL_FUNC(set_use_alternate_browser), (gpointer)brbutton);
+ GTK_SIGNAL_FUNC(set_use_alternate_browser), NULL);
hbox = gtk_hbox_new(FALSE, 0);
label = gtk_label_new(_("Full path to alternate browser:"));
@@ -346,11 +376,18 @@
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show(hbox);
+ g_browser_browse_button = gtk_button_new_with_label (_("Browse"));
+ gtk_signal_connect(GTK_OBJECT(g_browser_browse_button), "clicked",
+ GTK_SIGNAL_FUNC(get_alt_browser_path), NULL);
+ gtk_box_pack_start(GTK_BOX(hbox), g_browser_browse_button, FALSE, FALSE,
5);
+ gtk_widget_show (g_browser_browse_button);
+
gtk_widget_show(vbox);
if(use_alternate_browser == 0)
{
gtk_widget_set_sensitive(alternate_browser_entry, FALSE);
+ gtk_widget_set_sensitive(g_browser_browse_button, FALSE);
}
gtk_notebook_append_page(GTK_NOTEBOOK(prefs_note), vbox,
@@ -422,18 +459,6 @@
}
}
-static void set_use_alternate_browser(GtkWidget * w, int * data)
-{
- if(use_alternate_browser == 0)
- {
- gtk_widget_set_sensitive(alternate_browser_entry, FALSE);
- }
- else
- {
- gtk_widget_set_sensitive(alternate_browser_entry, TRUE);
- }
-}
-
#ifdef HAVE_ISPELL
static void set_use_spell(GtkWidget * w, int * data)
{
@@ -450,17 +475,24 @@
static void destroy_general_prefs()
{
- if(alternate_browser_entry==NULL) return;
- cSetLocalPref("alternate_browser",
gtk_entry_get_text(GTK_ENTRY(alternate_browser_entry)));
+ if(alternate_browser_entry) {
+ cSetLocalPref("alternate_browser",
gtk_entry_get_text(GTK_ENTRY(alternate_browser_entry)));
+ gtk_widget_destroy(alternate_browser_entry);
+ gtk_widget_destroy(g_browser_browse_button);
+ alternate_browser_entry = NULL;
+ g_browser_browse_button = NULL;
+ }
#ifdef HAVE_ISPELL
- cSetLocalPref("spell_dictionary",
gtk_entry_get_text(GTK_ENTRY(dictionary_entry)));
- gtk_widget_destroy(dictionary_entry);
- dictionary_entry = NULL;
+ if(dictionary_entry) {
+ cSetLocalPref("spell_dictionary",
gtk_entry_get_text(GTK_ENTRY(dictionary_entry)));
+ gtk_widget_destroy(dictionary_entry);
+ dictionary_entry = NULL;
+ }
#endif
- gtk_widget_destroy(length_contact_window_entry);
- gtk_widget_destroy(alternate_browser_entry);
- length_contact_window_entry = NULL;
- alternate_browser_entry = NULL;
+ if(length_contact_window_entry) {
+ gtk_widget_destroy(length_contact_window_entry);
+ length_contact_window_entry = NULL;
+ }
}
@@ -2083,10 +2115,7 @@
gtk_entry_set_text (GTK_ENTRY (firstmsgsoundentry),
cGetLocalPref("FirstMsgFilename"));
}
-static void setsoundfilename(char * filename, gpointer data);
-//static void setsoundfilename(GtkWidget * fileselector, int userdata);
static void getsoundfile (GtkWidget * sendf_button, gpointer userdata);
-/*static void soundfile_entry_changed(GtkEntry * entry, int userdata);*/
static void testsoundfile (GtkWidget * sendf_button, int userdata);
static void soundvolume_changed(GtkAdjustment * adjust, int userdata);
@@ -2164,14 +2193,6 @@
}
-static void getsoundfile (GtkWidget * sendf_button, gpointer userdata)
-{
-// GtkWidget *file_selector;
- eb_debug(DBG_CORE, "Just entered getsoundfile\n");
- eb_do_file_selector(NULL, _("Select a file to use"), setsoundfilename,
- userdata);
-}
-
/*static void soundfile_entry_changed(GtkEntry * entry, int userdata)
{
char *ptr=NULL;
@@ -2225,7 +2246,6 @@
static void setsoundfilename(char * selected_filename, gpointer data)
-//static void setsoundfilename(GtkWidget * fileselector, int userdata)
{
int userdata = (int)data;
@@ -2264,6 +2284,13 @@
selected_filename);
break;
}
+}
+
+static void getsoundfile (GtkWidget * sendf_button, gpointer userdata)
+{
+ eb_debug(DBG_CORE, "Just entered getsoundfile\n");
+ eb_do_file_selector(NULL, _("Select a file to use"), setsoundfilename,
+ userdata);
}
static void testsoundfile (GtkWidget * sendf_button, int userdata)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/src prefs.c,1.22,1.23,
Philip S Tellis <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm configure.in,1.175,1.176 ChangeLog,1.179,1.180
- Next by Date:
[Ayttm-commits] CVS: ayttm/pixmaps ayttm.png,1.1,1.2 ayttm.xpm,1.1,1.2
- Previous by thread:
[Ayttm-commits] CVS: ayttm configure.in,1.175,1.176 ChangeLog,1.179,1.180
- Next by thread:
[Ayttm-commits] CVS: ayttm/pixmaps ayttm.png,1.1,1.2 ayttm.xpm,1.1,1.2
- Index(es):