diff options
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | data/glade/prefs-dialog.glade | 4 | ||||
-rwxr-xr-x | embed/print-dialog.c | 7 | ||||
-rw-r--r-- | src/prefs-dialog.c | 40 |
4 files changed, 53 insertions, 12 deletions
@@ -1,5 +1,19 @@ 2003-12-09 Christian Persch <chpe@cvs.gnome.org> + * data/glade/prefs-dialog.glade: + * embed/print-dialog.c: (ephy_print_dialog_new): + * src/prefs-dialog.c: (create_language_menu), + (create_download_path_label), (prefs_dialog_init): + + Lockdown: set some buttons insensitive when their + pref key is not writable. + + * src/prefs-dialog.c: (download_path_response_cb): + + Convert filename to utf8 first. + +2003-12-09 Christian Persch <chpe@cvs.gnome.org> + * configure.in: Bump gtk+ and glib dependencies to 2.3.1. diff --git a/data/glade/prefs-dialog.glade b/data/glade/prefs-dialog.glade index 65f2eb942..6bdcd3d06 100644 --- a/data/glade/prefs-dialog.glade +++ b/data/glade/prefs-dialog.glade @@ -205,7 +205,7 @@ <property name="spacing">6</property> <child> - <widget class="GtkButton" id="button1"> + <widget class="GtkButton" id="homepage_current_button"> <property name="visible">True</property> <property name="can_default">True</property> <property name="can_focus">True</property> @@ -218,7 +218,7 @@ </child> <child> - <widget class="GtkButton" id="button9"> + <widget class="GtkButton" id="homepage_blank_button"> <property name="visible">True</property> <property name="can_default">True</property> <property name="can_focus">True</property> diff --git a/embed/print-dialog.c b/embed/print-dialog.c index fed912b78..89306f732 100755 --- a/embed/print-dialog.c +++ b/embed/print-dialog.c @@ -58,6 +58,7 @@ enum PRINTON_PROP, PRINTER_PROP, FILE_PROP, + BROWSE_PROP, ALL_PAGES_PROP, SELECTION_PROP, TO_PROP, @@ -71,6 +72,7 @@ EphyDialogProperty print_props [] = { "printer_radiobutton", CONF_PRINT_PRINTON, PT_AUTOAPPLY, 0 }, { "printer_entry", CONF_PRINT_PRINTER, PT_AUTOAPPLY, 0 }, { "file_entry", CONF_PRINT_FILE, PT_AUTOAPPLY, 0 }, + { "browse_button", NULL, PT_NORMAL, 0 }, { "all_pages_radiobutton", CONF_PRINT_ALL_PAGES, PT_AUTOAPPLY, 0 }, { "selection_radiobutton", NULL, PT_NORMAL, 0 }, { "to_spinbutton", CONF_PRINT_FROM_PAGE, PT_AUTOAPPLY, G_TYPE_INT }, @@ -297,7 +299,7 @@ ephy_print_dialog_new (GtkWidget *parent, gboolean only_collect_info) { EphyDialog *dialog; - GtkWidget *window; + GtkWidget *window, *button; GdkPixbuf *icon; dialog = EPHY_DIALOG (g_object_new (EPHY_TYPE_EMBED_DIALOG, @@ -320,6 +322,9 @@ ephy_print_dialog_new (GtkWidget *parent, gtk_window_set_icon (GTK_WINDOW (window), icon); g_object_unref (icon); + button = ephy_dialog_get_control (dialog, print_props[BROWSE_PROP].id); + gtk_widget_set_sensitive (button, eel_gconf_key_is_writable (CONF_PRINT_FILE)); + g_object_set_data (G_OBJECT (dialog), "only-collect-info", GINT_TO_POINTER (only_collect_info)); diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c index f18f252b5..48e39c754 100644 --- a/src/prefs-dialog.c +++ b/src/prefs-dialog.c @@ -204,6 +204,8 @@ enum /* General */ HOMEPAGE_ENTRY_PROP, + HOMEPAGE_CURRENT_PROP, + HOMEPAGE_BLANK_PROP, AUTO_OPEN_PROP, DOWNLOAD_PATH_BUTTON_PROP, @@ -230,7 +232,8 @@ enum LANGUAGE_PROP, LANGUAGE_LABEL_PROP, DEFAULT_ENCODING_LABEL_PROP, - AUTO_ENCODING_LABEL_PROP + AUTO_ENCODING_LABEL_PROP, + LANGUAGE_MORE_PROP }; static const @@ -241,6 +244,8 @@ EphyDialogProperty properties [] = /* General */ { "homepage_entry", CONF_GENERAL_HOMEPAGE, PT_AUTOAPPLY, G_TYPE_STRING }, + { "homepage_current_button", NULL, PT_NORMAL, 0 }, + { "homepage_blank_button", NULL, PT_NORMAL, 0 }, { "auto_open_downloads_checkbutton", CONF_AUTO_OPEN_DOWNLOADS, PT_AUTOAPPLY, 0 }, { "download_path_button", NULL, PT_NORMAL, 0 }, @@ -268,6 +273,7 @@ EphyDialogProperty properties [] = { "language_label", NULL, PT_NORMAL, 0 }, { "default_encoding_label", NULL, PT_NORMAL, 0 }, { "auto_encoding_label", NULL, PT_NORMAL, 0 }, + { "language_more_button", NULL, PT_NORMAL, 0 }, { NULL } }; @@ -590,16 +596,18 @@ language_combo_changed_cb (GtkComboBox *combo, static void create_language_menu (EphyDialog *dialog) { - GtkComboBox *combo; + GtkWidget *combo, *button; GtkListStore *store; GtkTreeModel *sortmodel; GtkTreeIter iter; GtkCellRenderer *renderer; int i; GSList *list, *l, *ulist = NULL; + gboolean sensitive; /* init value from first element of the list */ list = eel_gconf_get_string_list (CONF_RENDERING_LANGUAGE); + sensitive = eel_gconf_key_is_writable (CONF_RENDERING_LANGUAGE); /* uniquify list */ for (l = list; l != NULL; l = l->next) @@ -617,8 +625,10 @@ create_language_menu (EphyDialog *dialog) list = g_slist_reverse (ulist); eel_gconf_set_string_list (CONF_RENDERING_LANGUAGE, list); - combo = GTK_COMBO_BOX (ephy_dialog_get_control - (dialog, properties[LANGUAGE_PROP].id)); + button = ephy_dialog_get_control (dialog, properties[LANGUAGE_MORE_PROP].id); + gtk_widget_set_sensitive (button, sensitive); + combo = ephy_dialog_get_control (dialog, properties[LANGUAGE_PROP].id); + gtk_widget_set_sensitive (combo, sensitive); store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); @@ -664,7 +674,7 @@ create_language_menu (EphyDialog *dialog) gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sortmodel), COL_LANG_NAME, GTK_SORT_ASCENDING); - gtk_combo_box_set_model (combo, sortmodel); + gtk_combo_box_set_model (GTK_COMBO_BOX (combo), sortmodel); ephy_dialog_set_data_column (dialog, properties[LANGUAGE_PROP].id, COL_LANG_CODE); @@ -735,6 +745,8 @@ create_download_path_label (EphyDialog *dialog) gtk_container_add (GTK_CONTAINER (button), label); g_free (dir); gtk_widget_show (label); + + gtk_widget_set_sensitive (button, eel_gconf_key_is_writable (CONF_STATE_DOWNLOAD_DIR)); } static void @@ -742,10 +754,10 @@ prefs_dialog_init (PrefsDialog *pd) { EphyDialog *dialog = EPHY_DIALOG (pd); EphyEncodings *encodings; - GtkWidget *window; + GtkWidget *window, *button, *combo; GdkPixbuf *icon; GtkCellRenderer *renderer; - GtkWidget *combo; + gboolean sensitive; pd->priv = EPHY_PREFS_DIALOG_GET_PRIVATE (pd); @@ -772,6 +784,13 @@ prefs_dialog_init (PrefsDialog *pd) gtk_window_set_icon (GTK_WINDOW (window), icon); g_object_unref(icon); + /* set homepage button sensitivity */ + sensitive = eel_gconf_key_is_writable (CONF_GENERAL_HOMEPAGE); + button = ephy_dialog_get_control (dialog, properties[HOMEPAGE_CURRENT_PROP].id); + gtk_widget_set_sensitive (button, sensitive); + button = ephy_dialog_get_control (dialog, properties[HOMEPAGE_BLANK_PROP].id); + gtk_widget_set_sensitive (button, sensitive); + combo = ephy_dialog_get_control (dialog, properties[VARIABLE_PROP].id); renderer = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE); @@ -955,14 +974,17 @@ download_path_response_cb (GtkDialog *fc, gint response, EphyDialog *dialog) if (dir != NULL) { GtkWidget *button; - char *label; + char *label, *converted; - eel_gconf_set_string (CONF_STATE_DOWNLOAD_DIR, dir); + converted = g_filename_to_utf8 (dir, -1, NULL, NULL, NULL); + eel_gconf_set_string (CONF_STATE_DOWNLOAD_DIR, converted); button = ephy_dialog_get_control (dialog, properties[DOWNLOAD_PATH_BUTTON_PROP].id); label = get_download_button_label (); ephy_ellipsizing_label_set_text ((EphyEllipsizingLabel*) GTK_BIN (button)->child, label); + + g_free (converted); g_free (dir); g_free (label); } |