aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/publish-calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-07-30 00:56:14 +0800
committerMilan Crha <mcrha@redhat.com>2009-07-30 00:56:14 +0800
commitc485a5b5f41802bddb5cd17302b388ab5115aa22 (patch)
tree6c89dd8b0a42ecc478cf2d7146e256e47a355eb9 /plugins/publish-calendar
parenta06d0a65fdd6df0132ec885612e4bff3494ac076 (diff)
downloadgsoc2013-evolution-c485a5b5f41802bddb5cd17302b388ab5115aa22.tar
gsoc2013-evolution-c485a5b5f41802bddb5cd17302b388ab5115aa22.tar.gz
gsoc2013-evolution-c485a5b5f41802bddb5cd17302b388ab5115aa22.tar.bz2
gsoc2013-evolution-c485a5b5f41802bddb5cd17302b388ab5115aa22.tar.lz
gsoc2013-evolution-c485a5b5f41802bddb5cd17302b388ab5115aa22.tar.xz
gsoc2013-evolution-c485a5b5f41802bddb5cd17302b388ab5115aa22.tar.zst
gsoc2013-evolution-c485a5b5f41802bddb5cd17302b388ab5115aa22.zip
Bug #317290 - [Publish-Calendar] Cancel setup should cancel
, not continue
Diffstat (limited to 'plugins/publish-calendar')
-rw-r--r--plugins/publish-calendar/publish-calendar.c42
-rw-r--r--plugins/publish-calendar/url-editor-dialog.c4
-rw-r--r--plugins/publish-calendar/url-editor-dialog.h2
3 files changed, 27 insertions, 21 deletions
diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c
index 27ab11ce3c..e63f4bca4c 100644
--- a/plugins/publish-calendar/publish-calendar.c
+++ b/plugins/publish-calendar/publish-calendar.c
@@ -540,21 +540,22 @@ url_add_clicked (GtkButton *button, PublishUIData *ui)
model = gtk_tree_view_get_model (GTK_TREE_VIEW (ui->treeview));
url_editor = url_editor_dialog_new (model, NULL);
- url_editor_dialog_run ((UrlEditorDialog *) url_editor);
- uri = URL_EDITOR_DIALOG (url_editor)->uri;
- if (uri->location) {
- gtk_list_store_append (GTK_LIST_STORE (model), &iter);
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ if (url_editor_dialog_run ((UrlEditorDialog *) url_editor)) {
+ uri = URL_EDITOR_DIALOG (url_editor)->uri;
+ if (uri->location) {
+ gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
URL_LIST_ENABLED_COLUMN, uri->enabled,
URL_LIST_LOCATION_COLUMN, uri->location,
URL_LIST_URL_COLUMN, uri, -1);
- url_list_changed (ui);
- publish_uris = g_slist_prepend (publish_uris, uri);
- add_timeout (uri);
- publish_uri_async (uri);
- } else {
- g_free (uri);
+ url_list_changed (ui);
+ publish_uris = g_slist_prepend (publish_uris, uri);
+ add_timeout (uri);
+ publish_uri_async (uri);
+ } else {
+ g_free (uri);
+ }
}
gtk_widget_destroy (url_editor);
}
@@ -574,19 +575,22 @@ url_edit_clicked (GtkButton *button, PublishUIData *ui)
gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, 2, &uri, -1);
url_editor = url_editor_dialog_new (model, uri);
- url_editor_dialog_run ((UrlEditorDialog *) url_editor);
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ if (url_editor_dialog_run ((UrlEditorDialog *) url_editor)) {
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
URL_LIST_ENABLED_COLUMN, uri->enabled,
URL_LIST_LOCATION_COLUMN, uri->location,
URL_LIST_URL_COLUMN, uri, -1);
- id = GPOINTER_TO_UINT (g_hash_table_lookup (uri_timeouts, uri));
- if (id)
- g_source_remove (id);
- add_timeout (uri);
- url_list_changed (ui);
- publish_uri_async (uri);
+ id = GPOINTER_TO_UINT (g_hash_table_lookup (uri_timeouts, uri));
+ if (id)
+ g_source_remove (id);
+ add_timeout (uri);
+ url_list_changed (ui);
+ publish_uri_async (uri);
+ }
+
+ gtk_widget_destroy (url_editor);
}
}
diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c
index d4f6666772..c4fad2aba9 100644
--- a/plugins/publish-calendar/url-editor-dialog.c
+++ b/plugins/publish-calendar/url-editor-dialog.c
@@ -544,7 +544,7 @@ url_editor_dialog_get_type (void)
return type;
}
-void
+gboolean
url_editor_dialog_run (UrlEditorDialog *dialog)
{
gint response;
@@ -576,4 +576,6 @@ url_editor_dialog_run (UrlEditorDialog *dialog)
dialog->uri->events = g_slist_append (dialog->uri->events, g_strdup (e_source_peek_uid (p->data)));
}
gtk_widget_hide_all (GTK_WIDGET (dialog));
+
+ return response == GTK_RESPONSE_OK;
}
diff --git a/plugins/publish-calendar/url-editor-dialog.h b/plugins/publish-calendar/url-editor-dialog.h
index 8f45807bd8..2fd7c19a4e 100644
--- a/plugins/publish-calendar/url-editor-dialog.h
+++ b/plugins/publish-calendar/url-editor-dialog.h
@@ -108,7 +108,7 @@ struct _UrlEditorDialogClass {
GtkWidget *url_editor_dialog_new (GtkTreeModel *url_list_model, EPublishUri *uri);
GType url_editor_dialog_get_type (void);
-void url_editor_dialog_run (UrlEditorDialog *dialog);
+gboolean url_editor_dialog_run (UrlEditorDialog *dialog);
G_END_DECLS