After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 333301 - Delete confirmation
Delete confirmation
Status: RESOLVED FIXED
Product: epiphany-extensions
Classification: Deprecated
Component: sidebar
master
Other Linux
: Normal normal
: 2.16.x
Assigned To: epiphany-extensions-maint
epiphany-extensions-maint
Depends on:
Blocks:
 
 
Reported: 2006-03-03 20:07 UTC by Wouter Bolsterlee (uws)
Modified: 2007-07-21 13:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed fix (1.42 KB, patch)
2006-03-03 21:11 UTC, Wouter Bolsterlee (uws)
none Details | Review
Proposed fix using async methods (3.86 KB, patch)
2007-07-20 14:31 UTC, Cosimo Cecchi
reviewed Details | Review
proposed fix using async methods - modified using chpe's suggestions (4.88 KB, patch)
2007-07-21 00:19 UTC, Cosimo Cecchi
reviewed Details | Review
proposed fix (4.90 KB, patch)
2007-07-21 09:01 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
fixed const declaration (4.89 KB, patch)
2007-07-21 09:56 UTC, Cosimo Cecchi
committed Details | Review

Description Wouter Bolsterlee (uws) 2006-03-03 20:07:51 UTC
A confirmation dialog should pop up when deleting an installed sidebar. I don't think it's a problem if this dialog is modal (blocking the rest of the UI).
Comment 1 Christian Persch 2006-03-03 20:22:23 UTC
Should be easy to fix :)
Comment 2 Wouter Bolsterlee (uws) 2006-03-03 21:07:47 UTC
Okay, will fix it.
Comment 3 Wouter Bolsterlee (uws) 2006-03-03 21:11:05 UTC
Created attachment 60601 [details] [review]
Proposed fix

This patch adds a confirmation dialog (discussed with chpe in #epiphany) that is transient for the ephy window.

Note that this patch includes new strings, so it should not be committed before string freeze is over.
Comment 4 Wouter Bolsterlee (uws) 2006-05-15 10:24:09 UTC
chpe, can I commit this patch? I vaguely remember complaints about using gtk_dialog_run(), but personally I don't think it's a problem :)
Comment 5 Christian Persch 2006-05-15 21:01:11 UTC
It shouldn't be too hard to go async, the add-sidebar dialogue already does that. I'd like to stamp out gtk_dialog_run whereever possible! :)
Comment 6 Wouter Bolsterlee (uws) 2006-05-16 22:05:08 UTC
I'm sorry, but my C coding skills are not sufficient to get this done in a clean way, since it involves adding structs (for the g_signal_connect user data that only takes 2 arguments, but we need 2: *extension and *removeNode) and other stuff I don't want to get my hands dirty on.

Rumour has it that chpe is volunteering to fix this bug! :)
Comment 7 Cosimo Cecchi 2007-07-20 14:30:16 UTC
Hi, I made a patch using the async method asked by Christian.
I tested and it works great for me.
Comment 8 Cosimo Cecchi 2007-07-20 14:31:51 UTC
Created attachment 92047 [details] [review]
Proposed fix using async methods
Comment 9 Christian Persch 2007-07-20 19:18:54 UTC
Thanks for the patch!

+struct RemoveCallbackData {
+	EphyNode *removeNode;
+	EphySidebarExtension *extension;
+};

I'd rather store the page_id string (g_strdup'd of course) and get the corresponding EphyNode only when actually removing it. That way we make sure it's not deleted in some other way before, which would cause a crash. 

Otherwise the patch looks good.
Comment 10 Cosimo Cecchi 2007-07-21 00:19:15 UTC
Created attachment 92073 [details] [review]
proposed fix using async methods - modified using chpe's suggestions

Ok, I also think it is better this way. The attached patch is modified following your suggestions!
Comment 11 Christian Persch 2007-07-21 08:25:04 UTC
struct RemoveCallbackData {
	const char *page_id;

|char *page_id|, no |const|.

And in free_remove_data you need to g_free (data->page_id).
Comment 12 Cosimo Cecchi 2007-07-21 09:01:55 UTC
Created attachment 92113 [details] [review]
proposed fix

oops...you're right!
Comment 13 Christian Persch 2007-07-21 09:49:51 UTC
+struct RemoveCallbackData {
+	const char *page_id;

You still need to remove that const. With that fixed, ok to commit; thanks!
Comment 14 Cosimo Cecchi 2007-07-21 09:56:56 UTC
Created attachment 92115 [details] [review]
fixed const declaration

Right, I must have been still half sleepy while doing that and i missed the const :( 
Now it should be finally ok. Thanks for the directions and the help!
Comment 15 Wouter Bolsterlee (uws) 2007-07-21 13:34:21 UTC
2007-07-21  Wouter Bolsterlee  <wbolster@svn.gnome.org>

    * extensions/sidebar/ephy-sidebar-extension.c:
    (remove_dialog_response_cb), (free_remove_data),
    (sidebar_page_remove_requested_cb), (extension_weak_notify_cb),
    (dialog_weak_notify_cb), (ephy_sidebar_extension_add_sidebar_cb):

    Show delete confirmation dialog in sidebar extension.
    Original patch by Wouter Bolsterlee, updated and
    improved by Cosimo Cecchi. Fixes bug #333301.