aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-10-31 06:58:12 +0800
committerChristian Persch <chpe@src.gnome.org>2005-10-31 06:58:12 +0800
commit362396c2bf69c659b5fcea2eaf3ed17b6ff93b09 (patch)
tree14f36a7f87ca3e938a14e43efa13a0b14d196a4d /embed
parent87e9353728c1115e7f60b1f7bb63e79723888907 (diff)
downloadgsoc2013-epiphany-362396c2bf69c659b5fcea2eaf3ed17b6ff93b09.tar
gsoc2013-epiphany-362396c2bf69c659b5fcea2eaf3ed17b6ff93b09.tar.gz
gsoc2013-epiphany-362396c2bf69c659b5fcea2eaf3ed17b6ff93b09.tar.bz2
gsoc2013-epiphany-362396c2bf69c659b5fcea2eaf3ed17b6ff93b09.tar.lz
gsoc2013-epiphany-362396c2bf69c659b5fcea2eaf3ed17b6ff93b09.tar.xz
gsoc2013-epiphany-362396c2bf69c659b5fcea2eaf3ed17b6ff93b09.tar.zst
gsoc2013-epiphany-362396c2bf69c659b5fcea2eaf3ed17b6ff93b09.zip
Remove glade callbacks, and connect from code instead.
2005-10-30 Christian Persch <chpe@cvs.gnome.org> * data/glade/epiphany.glade: * data/glade/prefs-dialog.glade: * data/glade/print.glade: * embed/downloader-view.c: (update_buttons), (downloader_view_build_ui), (download_dialog_pause), (download_dialog_stop), (download_dialog_response_cb), (download_dialog_delete_event_cb): * embed/print-dialog.c: (ephy_print_setup_dialog_response_cb), (ephy_print_setup_dialog_new): * src/ephy-encoding-dialog.c: (ephy_encoding_dialog_init): * src/pdm-dialog.c: (show_cookies_properties), (cookies_properties_clicked_cb), (pdm_dialog_cookies_construct), (passwords_show_toggled_cb), (pdm_dialog_passwords_construct), (pdm_dialog_response_cb), (pdm_dialog_init), (pdm_dialog_finalize): * src/prefs-dialog.c: (create_language_section), (prefs_dialog_response_cb), (prefs_clear_cache_button_clicked_cb), (set_homepage_entry), (prefs_homepage_current_button_clicked_cb), (prefs_homepage_blank_button_clicked_cb), (prefs_dialog_init): Remove glade callbacks, and connect from code instead.
Diffstat (limited to 'embed')
-rw-r--r--embed/downloader-view.c61
-rwxr-xr-xembed/print-dialog.c32
2 files changed, 57 insertions, 36 deletions
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index 9ac47c3ca..4877f03df 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -105,6 +105,12 @@ EphyDialogProperty properties [] =
{ NULL }
};
+enum
+{
+ RESPONSE_PAUSE = 1,
+ RESPONSE_STOP = 2
+};
+
static void
downloader_view_build_ui (DownloaderView *dv);
static void
@@ -113,15 +119,14 @@ static void
downloader_view_finalize (GObject *object);
static void
downloader_view_init (DownloaderView *dv);
-
-/* Callbacks */
-void
-download_dialog_pause_cb (GtkButton *button, DownloaderView *dv);
-void
-download_dialog_abort_cb (GtkButton *button, DownloaderView *dv);
-gboolean
-download_dialog_delete_cb (GtkWidget *window, GdkEventAny *event,
- DownloaderView *dv);
+static void
+download_dialog_response_cb (GtkWidget *dialog,
+ int response,
+ DownloaderView *dv);
+static gboolean
+download_dialog_delete_event_cb (GtkWidget *window,
+ GdkEventAny *event,
+ DownloaderView *dv);
static GObjectClass *parent_class = NULL;
@@ -365,7 +370,8 @@ update_buttons (DownloaderView *dv)
}
gtk_widget_set_sensitive (dv->priv->pause_button, pause_enabled);
gtk_widget_set_sensitive (dv->priv->abort_button, abort_enabled);
- gtk_button_set_label (GTK_BUTTON (dv->priv->pause_button), label_pause ? _("_Pause") : _("_Resume"));
+ gtk_button_set_label (GTK_BUTTON (dv->priv->pause_button),
+ label_pause ? _("_Pause") : _("_Resume"));
}
static void
@@ -625,6 +631,11 @@ downloader_view_build_ui (DownloaderView *dv)
properties[PROP_ABORT_BUTTON].id, &priv->abort_button,
NULL);
+ g_signal_connect (priv->window, "response",
+ G_CALLBACK (download_dialog_response_cb), dv);
+ g_signal_connect (priv->window, "delete-event",
+ G_CALLBACK (download_dialog_delete_event_cb), dv);
+
gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)),
GTK_SELECTION_BROWSE);
@@ -695,8 +706,8 @@ downloader_view_build_ui (DownloaderView *dv)
g_signal_connect (selection, "changed", G_CALLBACK (selection_changed), dv);
}
-void
-download_dialog_pause_cb (GtkButton *button, DownloaderView *dv)
+static void
+download_dialog_pause (DownloaderView *dv)
{
GtkTreeSelection *selection;
GtkTreeModel *model;
@@ -794,8 +805,8 @@ downloader_view_remove_download (DownloaderView *dv, EphyDownload *download)
}
}
-void
-download_dialog_abort_cb (GtkButton *button, DownloaderView *dv)
+static void
+download_dialog_stop (DownloaderView *dv)
{
GValue val = {0, };
GtkTreeSelection *selection;
@@ -818,9 +829,25 @@ download_dialog_abort_cb (GtkButton *button, DownloaderView *dv)
g_value_unset (&val);
}
-gboolean
-download_dialog_delete_cb (GtkWidget *window, GdkEventAny *event,
- DownloaderView *dv)
+static void
+download_dialog_response_cb (GtkWidget *dialog,
+ int response,
+ DownloaderView *dv)
+{
+ if (response == RESPONSE_PAUSE)
+ {
+ download_dialog_pause (dv);
+ }
+ else if (response == RESPONSE_STOP)
+ {
+ download_dialog_stop (dv);
+ }
+}
+
+static gboolean
+download_dialog_delete_event_cb (GtkWidget *window,
+ GdkEventAny *event,
+ DownloaderView *dv)
{
/* FIXME multi-head */
if (egg_tray_manager_check_running (gdk_screen_get_default ()))
diff --git a/embed/print-dialog.c b/embed/print-dialog.c
index 05b93749e..a2eb47d33 100755
--- a/embed/print-dialog.c
+++ b/embed/print-dialog.c
@@ -80,14 +80,6 @@ EphyDialogProperty setup_props [] =
{ NULL }
};
-void ephy_print_dialog_response_cb (GtkDialog *dialog,
- int response,
- EmbedPrintInfo *info);
-void ephy_print_setup_dialog_close_button_cb (GtkWidget *widget,
- EphyDialog *dialog);
-void ephy_print_setup_dialog_help_button_cb (GtkWidget *widget,
- EphyDialog *dialog);
-
void
ephy_print_info_free (EmbedPrintInfo *info)
{
@@ -346,18 +338,18 @@ ephy_print_do_print_and_free (EmbedPrintInfo *info)
info);
}
-void
-ephy_print_setup_dialog_close_button_cb (GtkWidget *widget,
- EphyDialog *dialog)
+static void
+ephy_print_setup_dialog_response_cb (GtkWidget *widget,
+ int response,
+ EphyDialog *dialog)
{
- g_object_unref (dialog);
-}
+ if (response == GTK_RESPONSE_HELP)
+ {
+ ephy_gui_help (GTK_WINDOW (widget), "epiphany", "using-print-setup");
+ return;
+ }
-void
-ephy_print_setup_dialog_help_button_cb (GtkWidget *widget,
- EphyDialog *dialog)
-{
- ephy_gui_help (GTK_WINDOW (dialog), "epiphany", "using-print-setup");
+ g_object_unref (dialog);
}
static GtkWidget *
@@ -483,7 +475,9 @@ ephy_print_setup_dialog_new (void)
window = ephy_dialog_get_control (dialog, setup_props[SETUP_WINDOW_PROP].id);
gtk_window_set_icon_name (GTK_WINDOW (window), STOCK_PRINT_SETUP);
-
+ g_signal_connect (window, "response",
+ G_CALLBACK (ephy_print_setup_dialog_response_cb), dialog);
+
paper_selector_hbox = ephy_dialog_get_control (dialog,
setup_props[PAPER_SELECTOR_PROP].id);
gtk_box_pack_start_defaults (GTK_BOX (paper_selector_hbox),