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 130653 - gnome-sound-recorder doesn't prompt on overwrite
gnome-sound-recorder doesn't prompt on overwrite
Status: RESOLVED FIXED
Product: gnome-media
Classification: Deprecated
Component: Gnome-Sound-Recorder
2.5.x
Other Linux
: High normal
: 2.9.91
Assigned To: gnome media maintainers
gnome media maintainers
: 162303 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-01-06 05:05 UTC by Glynn Foster
Modified: 2005-02-04 08:45 UTC
See Also:
GNOME target: 2.6.next
GNOME version: ---


Attachments
prompt on overwrite (7.28 KB, patch)
2004-01-06 05:06 UTC, Glynn Foster
none Details | Review
Patch applied (5.35 KB, patch)
2004-02-24 07:10 UTC, Ted Gould
none Details | Review
Patch created with the latest sources (4.23 KB, patch)
2004-11-03 12:10 UTC, Archana Shah
accepted-commit_after_freeze Details | Review

Description Glynn Foster 2004-01-06 05:05:44 UTC
Here's a pretty simple JDS patch that should be applied.
Comment 1 Glynn Foster 2004-01-06 05:06:18 UTC
Created attachment 22995 [details] [review]
prompt on overwrite
Comment 2 Ted Gould 2004-02-24 07:10:28 UTC
Created attachment 24713 [details] [review]
Patch applied
Comment 3 Ted Gould 2004-02-24 07:13:32 UTC
Patch applied to head with a small addition to make sure that you're
doing a save as and not just a save.  (Ofcourse a save should already
exist right?)  Thanks for the patch!  Sorry again to the i18n folks.
Comment 4 Glynn Foster 2004-03-02 03:08:25 UTC
Hrm, dont' think you actually applied this, apart from the ChangeLog.
Unfortunately we now have string freeze, so it'll have to wait until
next time.
Comment 5 Elijah Newren 2004-03-11 00:20:36 UTC
I'm adding the BLOCKED_BY_FREEZE keyword.
Comment 6 Ronald Bultje 2004-04-20 14:11:46 UTC
Note that the GStreamer gnomevfssink element also has overwrite-ask
functionalities, we might want to use that... That'd also integrate GSR more
into GNOME, since it'd actually use gnome-vfs then for file saving (it currently
uses the GStreamer filesink element).
Comment 7 Curtis Hovey 2004-05-01 05:46:30 UTC
Comment on attachment 22995 [details] [review]
prompt on overwrite

>--- gnome-media-2.2.2/grecord/src/gsr-window.c	2003-06-09 02:50:10.000000000 -0700
>+++ gnome-media-2.2.2-hacked/grecord/src/gsr-window.c	2003-08-06 08:34:09.000000000 -0700
>@@ -468,6 +468,118 @@
> 			       GST_STATE_NULL);
> }
> 
>+GtkWidget*
>+gsr_button_new_with_stock_image (const gchar* text, const gchar* stock_id)
>+{
>+        GtkWidget *button;
>+        GtkStockItem item;
>+        GtkWidget *label;
>+        GtkWidget *image;
>+        GtkWidget *hbox;
>+        GtkWidget *align;
>+                                                                                                                             
>+        button = gtk_button_new ();
>+                                                                                                                             
>+        if (GTK_BIN (button)->child)
>+                gtk_container_remove (GTK_CONTAINER (button),
>+                                      GTK_BIN (button)->child);
>+                                                                                                                             
>+        if (gtk_stock_lookup (stock_id, &item))
>+        {
>+                label = gtk_label_new_with_mnemonic (text);
>+                                                                                                                             
>+                gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (button));
>+                                                                                                                             
>+                image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
>+                hbox = gtk_hbox_new (FALSE, 2);
>+                                                                                                                             
>+                align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
>+                                                                                                                             
>+                gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
>+                gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
>+                                                                                                                             
>+                gtk_container_add (GTK_CONTAINER (button), align);
>+                gtk_container_add (GTK_CONTAINER (align), hbox);
>+                gtk_widget_show_all (align);
>+                                                                                                                             
>+                return button;
>+        }
>+        label = gtk_label_new_with_mnemonic (text);
>+        gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (button));
>+                                                                                                                             
>+        gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
>+                                                                                                                             
>+        gtk_widget_show (label);
>+        gtk_container_add (GTK_CONTAINER (button), label);
>+                                                                                                                             
>+        return button;
>+}
>+
>+GtkWidget*
>+gsr_dialog_add_button (GtkDialog *dialog, const gchar* text, const gchar* stock_id,
>+                       gint response_id)
>+{
>+        GtkWidget *button;
>+                                                                                                                             
>+        g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
>+        g_return_val_if_fail (text != NULL, NULL);
>+        g_return_val_if_fail (stock_id != NULL, NULL);
>+ 
>+        button = gsr_button_new_with_stock_image (text, stock_id);
>+        g_return_val_if_fail (button != NULL, NULL);
>+                                                                                                                             
>+        GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
>+                                                                                                                             
>+        gtk_widget_show (button);
>+                                                                                                                             
>+        gtk_dialog_add_action_widget (dialog, button, response_id);
>+                                                                                                                             
>+        return button;
>+}
>+
>+static gboolean
>+replace_dialog (GtkWindow *parent, const gchar *message, const gchar *file_name)
>+{
>+        GtkWidget *msgbox;
>+        gint ret; 
>+
>+	g_return_val_if_fail (file_name != NULL, FALSE); 
>+	msgbox = gtk_message_dialog_new (parent,
>+                                         GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
>+                                         GTK_MESSAGE_QUESTION,
>+                                         GTK_BUTTONS_NONE,
>+                                         message,
>+                                         file_name);
>+                                                                                                                             
>+        /* Add Cancel button */
>+        gtk_dialog_add_button (GTK_DIALOG (msgbox),
>+                        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
>+                                                                                                                             
>+        /* Add Replace button */
>+        gsr_dialog_add_button (GTK_DIALOG (msgbox),
>+                               _("_Replace"), GTK_STOCK_REFRESH, GTK_RESPONSE_YES);
>+                                                                                                                             
>+        gtk_dialog_set_default_response (GTK_DIALOG (msgbox), GTK_RESPONSE_CANCEL);
>+                                                                                                                             
>+        gtk_window_set_resizable (GTK_WINDOW (msgbox), FALSE);
>+                                                                                                                             
>+        ret = gtk_dialog_run (GTK_DIALOG (msgbox));
>+                                                                                                                             
>+        gtk_widget_destroy (msgbox);
>+                                                                                                                             
>+        return (ret == GTK_RESPONSE_YES);
>+}
>+
>+static gboolean
>+replace_existing_file (GtkWindow *parent, const gchar* file_name)
>+{
>+        return replace_dialog (parent,
>+                               _("A file named \"%s\" already exists.\n"
>+                                 "Do you want to replace it with the "
>+                                 "one you are saving?"),
>+                               file_name);
>+}
>+
> static void
> do_save_file (GSRWindow *window,
> 	      const char *name)
>@@ -478,6 +590,11 @@
> 	GstElement *pipeline, *src, *encoder, *spider, *sink;
> 	GdkCursor *cursor;
> 
>+	if (g_file_test (name, G_FILE_TEST_EXISTS)) {
>+		if (!replace_existing_file (GTK_WINDOW (window), name))
>+                	return;
>+	}
>+
> 	ext = strrchr (name, '.');
> 	if (ext == NULL || *ext == 0) {
> 		mime = MIME_TYPE_WAV;
Comment 8 Thomas Vander Stichele 2004-06-01 10:35:17 UTC
Curtis, are you sure this patch still applies to gnome 2.6 and higher ? I don't
understand why you based yourself on an old version.  Let me know so I can verify.
Comment 9 Archana Shah 2004-11-03 12:05:04 UTC
Attaching a patch created with the latest sources. It is created on top of the
patch submitted in #155088 "gnome-sound-recorder does not save files".

Ronald has approved that patch and will be checking in.

Please let me know if anything else is to be done.
Comment 10 Archana Shah 2004-11-03 12:10:28 UTC
Created attachment 33382 [details] [review]
Patch created with the latest sources
Comment 11 Archana Shah 2004-12-20 09:55:12 UTC
Hey, 
Just a ping :-)
Please have a look at the patch.
Comment 12 Balamurali Viswanathan 2004-12-27 13:14:09 UTC
*** Bug 162303 has been marked as a duplicate of this bug. ***
Comment 13 Sebastien Bacher 2005-01-15 15:08:56 UTC
reopening this bug is probably not waiting for new informations
Comment 14 Ronald Bultje 2005-02-03 23:09:44 UTC
Comment on attachment 33382 [details] [review]
Patch created with the latest sources

Hi, I've requested the release team to break the UI freeze, I'm convinced we
should apply this. If we don't get permission, we'll apply after the next UI
round.
Comment 15 Ronald Bultje 2005-02-04 08:45:24 UTC
pong, applied, thanks for the kick.