aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-dialog.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-06-16 18:56:04 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-06-16 18:56:04 +0800
commit265c85e8ab0a90f2a7d389f5cd9f750eeadf3e22 (patch)
tree27d5f110e573bdbe64ae0a0d500ddd95fc65c4b0 /lib/ephy-dialog.c
parent3241ea896ff4f8939c038ab65f03948d026ed520 (diff)
downloadgsoc2013-epiphany-265c85e8ab0a90f2a7d389f5cd9f750eeadf3e22.tar
gsoc2013-epiphany-265c85e8ab0a90f2a7d389f5cd9f750eeadf3e22.tar.gz
gsoc2013-epiphany-265c85e8ab0a90f2a7d389f5cd9f750eeadf3e22.tar.bz2
gsoc2013-epiphany-265c85e8ab0a90f2a7d389f5cd9f750eeadf3e22.tar.lz
gsoc2013-epiphany-265c85e8ab0a90f2a7d389f5cd9f750eeadf3e22.tar.xz
gsoc2013-epiphany-265c85e8ab0a90f2a7d389f5cd9f750eeadf3e22.tar.zst
gsoc2013-epiphany-265c85e8ab0a90f2a7d389f5cd9f750eeadf3e22.zip
Merge with popup control, we dont need it for bonobo window anymore.
2003-06-16 Marco Pesenti Gritti <marco@it.gnome.org> * embed/Makefile.am: * embed/ephy-embed-popup-control.c: (ephy_embed_popup_control_get_type), (ephy_embed_popup_control_set_property), (ephy_embed_popup_control_get_property), (ephy_embed_popup_control_class_init), (ephy_embed_popup_control_init), (ephy_embed_popup_control_finalize), (get_popup_path), (ephy_embed_popup_control_show), (setup_element_menu), (setup_document_menu), (ephy_embed_popup_control_set_event), (ephy_embed_popup_control_connect_verbs), (ephy_embed_popup_control_get_event), (embed_popup_copy_location_cmd), (embed_popup_copy_email_cmd), (embed_popup_copy_link_location_cmd), (save_property_url), (embed_popup_open_link_cmd), (embed_popup_download_link_cmd), (embed_popup_save_image_as_cmd), (background_download_completed), (embed_popup_set_image_as_background_cmd), (embed_popup_copy_image_location_cmd), (save_url), (embed_popup_save_page_as_cmd), (embed_popup_save_background_as_cmd), (embed_popup_open_frame_cmd), (embed_popup_reload_frame_cmd), (embed_popup_open_image_cmd), (embed_popup_copy_to_clipboard): * embed/ephy-embed-popup-control.h: Merge with popup control, we dont need it for bonobo window anymore. * embed/mozilla/mozilla-embed-single.cpp: Do not override the UA but set vendor prefs so that mozilla can build it correctly. * lib/ephy-dialog.c: (get_radio_button_active_index), (set_config_from_radiobuttongroup), (set_radiobuttongroup_from_config), (prefs_set_group_sensitivity), (impl_get_value): * lib/ephy-dnd.c: (ephy_dnd_node_list_extract_nodes): * lib/ephy-gui.c: * lib/ephy-gui.h: * lib/ephy-string.c: (ephy_string_shorten), (ephy_string_to_int), (ephy_string_strip_chr), (ephy_string_elide_underscores): * lib/ephy-string.h: * src/ephy-nautilus-view.c: (ephy_nautilus_view_instance_init), (gnv_embed_context_menu_cb), (gnv_embed_location_cb), (gnv_view_from_popup), (gnv_popup_cmd_new_window), (gnv_popup_cmd_image_in_new_window), (gnv_popup_cmd_frame_in_new_window), (gnv_cmd_file_print), (gnv_embed_zoom_change_cb):
Diffstat (limited to 'lib/ephy-dialog.c')
-rw-r--r--lib/ephy-dialog.c68
1 files changed, 59 insertions, 9 deletions
diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c
index 07126f7ce..6e891d3a2 100644
--- a/lib/ephy-dialog.c
+++ b/lib/ephy-dialog.c
@@ -238,13 +238,42 @@ set_config_from_optionmenu (GtkWidget *optionmenu, const char *config_name, GLis
}
}
+static int
+get_radio_button_active_index (GtkWidget *radiobutton)
+{
+ gint index;
+ GtkToggleButton *toggle_button;
+ gint i, length;
+ GSList *list;
+
+ /* get group list */
+ list = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton));
+ length = g_slist_length (list);
+
+ /* iterate over list to find active button */
+ for (i = 0; list != NULL; i++, list = g_slist_next (list))
+ {
+ /* get button and text */
+ toggle_button = GTK_TOGGLE_BUTTON (list->data);
+ if (gtk_toggle_button_get_active (toggle_button))
+ {
+ break;
+ }
+ }
+
+ /* check we didn't run off end */
+ g_assert (list != NULL);
+
+ /* return index (reverse order!) */
+ return index = (length - 1) - i;
+}
+
static void
set_config_from_radiobuttongroup (GtkWidget *radiobutton, const char *config_name, GList *senum)
{
- gint index;
+ int index;
- /* get value from radio button group */
- index = ephy_gui_gtk_radio_button_get (GTK_RADIO_BUTTON (radiobutton));
+ index = get_radio_button_active_index (radiobutton);
if (senum)
{
@@ -394,9 +423,31 @@ set_optionmenu_from_config (GtkWidget *optionmenu, const char *config_name, GLis
static void
set_radiobuttongroup_from_config (GtkWidget *radiobutton, const char *config_name, GList *senum)
{
- /* set it (finds the group for us) */
- ephy_gui_gtk_radio_button_set (GTK_RADIO_BUTTON (radiobutton),
- get_index (config_name, senum));
+ GtkToggleButton *button;
+ GSList *list;
+ gint length;
+ int index;
+
+ index = get_index (config_name, senum);
+
+ /* get the list */
+ list = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton));
+
+ /* check out the length */
+ length = g_slist_length (list);
+
+ /* new buttons are *preppended* to the list, so button added as first
+ * has last position in the list */
+ index = (length - 1) - index;
+
+ /* find the right button */
+ button = GTK_TOGGLE_BUTTON (g_slist_nth_data (list, index));
+
+ /* set it... this will de-activate the others in the group */
+ if (gtk_toggle_button_get_active (button) == FALSE)
+ {
+ gtk_toggle_button_set_active (button, TRUE);
+ }
}
static void
@@ -518,8 +569,7 @@ prefs_set_group_sensitivity (GtkWidget *widget,
if (GTK_IS_RADIO_BUTTON (widget))
{
- group = ephy_gui_gtk_radio_button_get
- (GTK_RADIO_BUTTON(widget));
+ group = get_radio_button_active_index (widget);
}
else if (GTK_IS_TOGGLE_BUTTON (widget))
{
@@ -1103,7 +1153,7 @@ impl_get_value (EphyDialog *dialog,
{
int val;
g_value_init (value, G_TYPE_INT);
- val = ephy_gui_gtk_radio_button_get (GTK_RADIO_BUTTON(widget));
+ val = get_radio_button_active_index (widget);
g_value_set_int (value, val);
}
else if (GTK_IS_TOGGLE_BUTTON (widget))