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 337959 - Save as on read-only open project
Save as on read-only open project
Status: RESOLVED FIXED
Product: glade
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Glade 3 Maintainers
Glade 3 Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-10 15:27 UTC by Tristan Van Berkom
Modified: 2006-06-03 21:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This patch should fix the bug (8.42 KB, patch)
2006-05-27 13:43 UTC, Vincent Geddes
none Details | Review
a patch (4.63 KB, patch)
2006-06-03 20:49 UTC, Vincent Geddes
none Details | Review

Description Tristan Van Berkom 2006-04-10 15:27:01 UTC
If I hit "Save As" on a read-only project and not modify the project name,
I should get a "Read only bla bla.." error, instead I get an "project is
already open" error.
Comment 1 Vincent Geddes 2006-05-27 13:43:28 UTC
Created attachment 66333 [details] [review]
This patch should fix the bug

2006-05-27  Vincent Geddes <vgeddes@metroweb.co.za>

        * src/glade-project-window.c, src/glade-app.[ch],
          src/glade-utils.[ch]: Fix for bug 337959.

        * src/main.c, glade-editor-property.c: Fixed memory leaks.
Comment 2 Tristan Van Berkom 2006-05-27 17:30:52 UTC
Hey hey, thanks for the patch !

A few comments on this one:

    o glade_app_get_loaded_project () should probably call
      glade_util_canonical_path() before comparing with project->path.

    o Strings shown in the UI must always be marked for translation:
      - "Could not save project to file %s"
      + _("Could not save project to file %s")

    o glade_util_ui_alert(): is there a good reason to have two
      different flexable functions to display a simple error in the UI ?

      Maybe what we're looking for here is a glade_util_ui_message like this:

      gboolean
      glade_util_ui_message (GtkWidget           *parent, 
	                     GladeUIMessageType   type,
                             const gchar         *secondary_text,
                             const gchar         *format,
                             ...);

      IMO this is also quite undesirable, because it leaves the caller with
      the responsability of formatting the secondary_text argument :(

      The caller should be able to put up a message completely in one
      function call, I suppose it would be ok to make an exception for
      corner cases where 'secondary_text' argument is not left NULL.
Comment 3 Vincent Geddes 2006-05-30 14:15:10 UTC
Sure, I was a bit hasty with this patch. 

I was trying to beautify (in accordance with the GNOME HIG) the error dialogs that Glade pops up. It would have been impossible to implement the recommended guidelines using glade_util_ui_message(). 

Somehow, it would be nice to show a dialog that has a primary message and a secondary message. I suppose we can leave this for after glade-3's release, as it is of rather low priority.

Anyway, I will resubmit the patch without the glade_util_ui_alert() code.
Comment 4 Vincent Geddes 2006-06-03 20:49:43 UTC
Created attachment 66714 [details] [review]
a patch

2006-06-03  Vincent Geddes <vgeddes@metroweb.co.za>

        * src/glade-app.[ch], src/glade-project-window.c:
          fix for bug 337959.

        * src/main.c, src/glade-editor-property: plug some memory leaks.
Comment 5 Tristan Van Berkom 2006-06-03 21:32:35 UTC
applied, thanks.