aboutsummaryrefslogtreecommitdiffstats
path: root/src/pdm-dialog.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-11-30 22:08:32 +0800
committerChristian Persch <chpe@src.gnome.org>2003-11-30 22:08:32 +0800
commit1aa5a63dad335d4f05b65915bb553fb28192ab02 (patch)
treef2572a0a3c6395b029ebb94a1c0797d4a14e858e /src/pdm-dialog.c
parent2a4417e4222ce7ce938c5848d43fdbe27089141b (diff)
downloadgsoc2013-epiphany-1aa5a63dad335d4f05b65915bb553fb28192ab02.tar
gsoc2013-epiphany-1aa5a63dad335d4f05b65915bb553fb28192ab02.tar.gz
gsoc2013-epiphany-1aa5a63dad335d4f05b65915bb553fb28192ab02.tar.bz2
gsoc2013-epiphany-1aa5a63dad335d4f05b65915bb553fb28192ab02.tar.lz
gsoc2013-epiphany-1aa5a63dad335d4f05b65915bb553fb28192ab02.tar.xz
gsoc2013-epiphany-1aa5a63dad335d4f05b65915bb553fb28192ab02.tar.zst
gsoc2013-epiphany-1aa5a63dad335d4f05b65915bb553fb28192ab02.zip
Improved API and implementation of EphyDialog. Add support for new combo
2003-11-30 Christian Persch <chpe@cvs.gnome.org> * configure.in: * data/glade/epiphany.glade: * data/glade/prefs-dialog.glade: * embed/downloader-view.c: (downloader_view_build_ui): * embed/ephy-embed-dialog.c: (ephy_embed_dialog_new_with_parent): * embed/ephy-encodings.c: (ephy_encodings_get_detectors): * embed/ephy-encodings.h: * embed/find-dialog.c: (update_navigation_controls), (set_properties), (impl_show), (find_dialog_class_init), (find_dialog_init), (find_dialog_new_with_parent): * embed/print-dialog.c: (impl_show), (print_dialog_init), (print_dialog_new_with_parent), (print_get_info): * lib/ephy-dialog.c: (ephy_dialog_get_type), (lookup_info), (set_sensitivity), (set_value_from_pref), (set_pref_from_value), (set_value_from_editable), (set_value_from_optionmenu), (set_value_from_combobox), (get_radio_button_active_index), (set_value_from_radiobuttongroup), (set_value_from_spin_button), (set_value_from_togglebutton), (set_value_from_info), (set_editable_from_value), (get_index_from_value), (set_optionmenu_from_value), (compare_values), (set_combo_box_from_value), (set_radiobuttongroup_from_value), (set_spin_button_from_value), (set_togglebutton_from_value), (set_info_from_value), (set_pref_from_info), (togglebutton_clicked_cb), (radiobutton_clicked_cb), (spinbutton_timeout_cb), (spinbutton_changed_cb), (changed_cb), (set_info_from_pref), (connect_signals), (disconnect_signals), (init_props), (load_info), (save_info), (setup_default_size), (dialog_destroy_cb), (impl_construct), (impl_show), (ephy_dialog_set_modal), (ephy_dialog_add_enum), (ephy_dialog_set_data_column), (ephy_dialog_set_pref), (ephy_dialog_set_size_group), (ephy_dialog_construct), (ephy_dialog_show), (ephy_dialog_run), (ephy_dialog_get_control), (ephy_dialog_get_value), (ephy_dialog_set_value), (free_prop_info), (ephy_dialog_init), (ephy_dialog_dispose), (ephy_dialog_finalize), (ephy_dialog_set_parent), (ephy_dialog_set_property), (ephy_dialog_get_property), (ephy_dialog_class_init), (ephy_dialog_new), (ephy_dialog_new_with_parent): * lib/ephy-dialog.h: * lib/ephy-file-chooser.c: (ephy_file_chooser_new): * src/ephy-encoding-dialog.c: (sync_embed_cb), (sync_parent_window_cb), (activate_choice), (view_node_selected_cb), (view_node_activated_cb), (ephy_encoding_dialog_init), (ephy_encoding_dialog_new): * src/ephy-shell.c: (ephy_shell_finalize), (ephy_shell_get_pdm_dialog), (ephy_shell_get_prefs_dialog): * src/ephy-shell.h: * src/language-editor.c: (language_editor_get_type), (language_editor_class_init), (language_editor_update_pref), (language_editor_add_button_clicked_cb), (language_editor_set_view), (language_editor_init), (language_editor_new), (language_editor_set_model), (language_editor_add): * src/language-editor.h: * src/pdm-dialog.c: (pdm_dialog_show_help), (action_treeview_selection_changed_cb), (setup_action), (cookies_treeview_selection_changed_cb), (pdm_dialog_cookies_construct), (pdm_dialog_passwords_construct), (pdm_dialog_init), (show_cookies_properties): * src/prefs-dialog.c: (prefs_dialog_get_type), (prefs_dialog_class_init), (prefs_dialog_show_help), (setup_font_combo), (fonts_language_combo_changed_cb), (create_fonts_language_menu), (create_node_combo), (language_combo_changed_cb), (create_language_menu), (get_download_button_label), (create_download_path_label), (prefs_dialog_init), (prefs_dialog_response_cb), (set_homepage_entry), (prefs_homepage_current_button_clicked_cb), (prefs_homepage_blank_button_clicked_cb), (language_dialog_changed_cb), (prefs_language_more_button_clicked_cb), (download_path_response_cb), (prefs_download_path_button_clicked_cb): * src/prefs-dialog.h: * src/window-commands.c: (window_cmd_edit_prefs): Improved API and implementation of EphyDialog. Add support for new combo box, and removed optionmenu. Port all dialogues to new API and use combobox instead of optionmenus.
Diffstat (limited to 'src/pdm-dialog.c')
-rwxr-xr-xsrc/pdm-dialog.c81
1 files changed, 40 insertions, 41 deletions
diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c
index d1534de15..ecd7a73b7 100755
--- a/src/pdm-dialog.c
+++ b/src/pdm-dialog.c
@@ -74,18 +74,6 @@ struct PdmDialogPrivate
enum
{
- PROP_WINDOW,
- PROP_NOTEBOOK,
- PROP_COOKIES_TREEVIEW,
- PROP_COOKIES_REMOVE,
- PROP_PASSWORDS_TREEVIEW,
- PROP_PASSWORDS_REMOVE,
- PROP_DIALOG,
- PROP_COOKIES_PROPERTIES
-};
-
-enum
-{
COL_COOKIES_HOST,
COL_COOKIES_NAME,
COL_COOKIES_PATH,
@@ -99,21 +87,40 @@ enum
COL_PASSWORDS_DATA
};
+enum
+{
+ PROP_WINDOW,
+ PROP_NOTEBOOK,
+ PROP_COOKIES_TREEVIEW,
+ PROP_COOKIES_REMOVE,
+ PROP_COOKIES_PROPERTIES,
+ PROP_PASSWORDS_TREEVIEW,
+ PROP_PASSWORDS_REMOVE
+};
+
static const
EphyDialogProperty properties [] =
{
- { PROP_WINDOW, "pdm_dialog", NULL, PT_NORMAL, NULL },
- { PROP_NOTEBOOK, "pdm_notebook", NULL, PT_NORMAL, NULL },
+ { "pdm_dialog", NULL, PT_NORMAL, 0 },
+ { "pdm_notebook", NULL, PT_NORMAL, 0 },
+
+ { "cookies_treeview", NULL, PT_NORMAL, 0 },
+ { "cookies_remove_button", NULL, PT_NORMAL, 0 },
+ { "cookies_properties_button", NULL, PT_NORMAL, 0 },
+ { "passwords_treeview", NULL, PT_NORMAL, 0 },
+ { "passwords_remove_button", NULL, PT_NORMAL, 0 },
- { PROP_COOKIES_TREEVIEW, "cookies_treeview", NULL, PT_NORMAL, NULL },
- { PROP_COOKIES_REMOVE, "cookies_remove_button", NULL, PT_NORMAL, NULL },
- { PROP_PASSWORDS_TREEVIEW, "passwords_treeview", NULL, PT_NORMAL, NULL },
- { PROP_PASSWORDS_REMOVE, "passwords_remove_button", NULL, PT_NORMAL, NULL },
- { PROP_DIALOG, "pdm_dialog", NULL, PT_NORMAL, NULL },
- { PROP_COOKIES_PROPERTIES, "cookies_properties_button", NULL, PT_NORMAL, NULL },
+ { NULL }
+};
- { -1, NULL, NULL }
+static const
+char *size_group [] =
+{
+ "cookies_remove_button",
+ "cookies_properties_button",
+ "passwords_remove_button"
};
+const guint n_size_group = G_N_ELEMENTS (size_group);
static void pdm_dialog_class_init (PdmDialogClass *klass);
static void pdm_dialog_init (PdmDialog *dialog);
@@ -178,20 +185,20 @@ static void
pdm_dialog_show_help (PdmDialog *pd)
{
GtkWidget *notebook, *window;
- gint id;
+ int id;
/* FIXME: Once we actually have documentation we
* should point these at the correct links.
*/
- gchar *help_preferences[] = {
+ char *help_preferences[] = {
"pdm",
"pdm"
};
- window = ephy_dialog_get_control (EPHY_DIALOG (pd), PROP_WINDOW);
+ window = ephy_dialog_get_control (EPHY_DIALOG (pd), properties[PROP_WINDOW].id);
g_return_if_fail (GTK_IS_WINDOW (window));
- notebook = ephy_dialog_get_control (EPHY_DIALOG (pd), PROP_NOTEBOOK);
+ notebook = ephy_dialog_get_control (EPHY_DIALOG (pd), properties[PROP_NOTEBOOK].id);
g_return_if_fail (notebook != NULL);
id = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
@@ -210,7 +217,7 @@ action_treeview_selection_changed_cb (GtkTreeSelection *selection,
has_selection = gtk_tree_selection_count_selected_rows (selection) > 0;
- widget = ephy_dialog_get_control (d, action->remove_id);
+ widget = ephy_dialog_get_control (d, properties[action->remove_id].id);
gtk_widget_set_sensitive (widget, has_selection);
}
@@ -332,7 +339,7 @@ setup_action (PdmActionInfo *action)
GtkTreeSelection *selection;
widget = ephy_dialog_get_control (EPHY_DIALOG(action->dialog),
- action->remove_id);
+ properties[action->remove_id].id);
g_signal_connect (widget, "clicked",
G_CALLBACK (pdm_dialog_remove_button_clicked_cb),
action);
@@ -361,7 +368,7 @@ cookies_treeview_selection_changed_cb (GtkTreeSelection *selection,
has_selection = gtk_tree_selection_count_selected_rows (selection) == 1;
- widget = ephy_dialog_get_control (d, PROP_COOKIES_PROPERTIES);
+ widget = ephy_dialog_get_control (d, properties[PROP_COOKIES_PROPERTIES].id);
gtk_widget_set_sensitive (widget, has_selection);
}
@@ -378,7 +385,7 @@ pdm_dialog_cookies_construct (PdmActionInfo *info)
LOG ("pdm_dialog_cookies_construct")
treeview = GTK_TREE_VIEW (ephy_dialog_get_control
- (EPHY_DIALOG (dialog), PROP_COOKIES_TREEVIEW));
+ (EPHY_DIALOG (dialog), properties[PROP_COOKIES_TREEVIEW].id));
/* set tree model */
liststore = gtk_list_store_new (4,
@@ -636,7 +643,7 @@ pdm_dialog_passwords_construct (PdmActionInfo *info)
LOG ("pdm_dialog_passwords_construct")
treeview = GTK_TREE_VIEW (ephy_dialog_get_control
- (EPHY_DIALOG(dialog), PROP_PASSWORDS_TREEVIEW));
+ (EPHY_DIALOG(dialog), properties[PROP_PASSWORDS_TREEVIEW].id));
/* set tree model */
liststore = gtk_list_store_new (3,
@@ -775,14 +782,6 @@ pdm_dialog_init (PdmDialog *dialog)
PdmActionInfo *cookies, *passwords;
GtkWidget *notebook;
- const int props[] =
- {
- PROP_COOKIES_REMOVE,
- PROP_COOKIES_PROPERTIES,
- PROP_PASSWORDS_REMOVE
- };
- const guint n_props = G_N_ELEMENTS (props);
-
dialog->priv = EPHY_PDM_DIALOG_GET_PRIVATE (dialog);
dialog->priv->cookies = NULL;
@@ -798,7 +797,7 @@ pdm_dialog_init (PdmDialog *dialog)
* avoid the little jerk you get otherwise when switching pages because
* one set of buttons is wider than another.
*/
- ephy_dialog_set_size_group (EPHY_DIALOG (dialog), (int*) props, n_props);
+ ephy_dialog_set_size_group (EPHY_DIALOG (dialog), size_group, n_size_group);
cookies = g_new0 (PdmActionInfo, 1);
cookies->construct = pdm_dialog_cookies_construct;
@@ -830,7 +829,7 @@ pdm_dialog_init (PdmDialog *dialog)
cookies->construct (cookies);
passwords->construct (passwords);
- notebook = ephy_dialog_get_control (EPHY_DIALOG (dialog), PROP_NOTEBOOK);
+ notebook = ephy_dialog_get_control (EPHY_DIALOG (dialog), properties[PROP_NOTEBOOK].id);
sync_notebook_tab (notebook, NULL, 0, dialog);
g_signal_connect (G_OBJECT (notebook), "switch_page",
G_CALLBACK (sync_notebook_tab), dialog);
@@ -862,7 +861,7 @@ show_cookies_properties (PdmDialog *dialog,
char *str;
parent = ephy_dialog_get_control (EPHY_DIALOG(dialog),
- PROP_DIALOG);
+ properties[PROP_WINDOW].id);
gdialog = gtk_dialog_new_with_buttons
(_("Cookie Properties"),