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 635992 - Missing files dialog: opening a project with a moved file does not allow saving the project after loading
Missing files dialog: opening a project with a moved file does not allow savi...
Status: VERIFIED FIXED
Product: pitivi
Classification: Other
Component: User interface
Git
Other Linux
: Normal enhancement
: 0.14
Assigned To: Thibault Saunier
Pitivi maintainers
Depends on:
Blocks:
 
 
Reported: 2010-11-28 15:29 UTC by Alex Băluț
Modified: 2010-11-29 16:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes the problem, not sure it is the best way to do it (1.69 KB, patch)
2010-11-29 14:26 UTC, Thibault Saunier
reviewed Details | Review

Description Alex Băluț 2010-11-28 15:29:21 UTC
Steps to reproduce:
- $ ./bin/pitivi
- Import /tmp/clip.mkv
- Ctrl+S, /tmp/1.xptv
- Close PiTiVi.
- $ mv /tmp/clip.mkv /tmp/clip2.mkv
- $ ./bin/pitivi /tmp/1.xptv, notice it asks where the file has moved. Specify the new location, notice the File -> Save menu item is disabled. It should be enabled.
Comment 1 Jean-François Fortin Tam 2010-11-28 19:53:10 UTC
Wasted a ton of time trying to figure why this doesn't work:


diff --git a/pitivi/ui/mainwindow.py b/pitivi/ui/mainwindow.py
index 0227eac..a622729 100644
@@ -975,6 +975,9 @@ class PitiviMainWindow(gtk.Window, Loggable):
             new = chooser.get_uri()
             if new:
                 formatter.addMapping(uri, unquote(new))
+                # FIXME: why won't the two lines below work?
+                self.app.current.setModificationState(True)  # Allow saving
+                self.actiongroup.get_action("SaveProject").set_sensitive(True)
         else:
             self.log("User didn't choose a URI for the missing file")
             # FIXME: not calling addMapping doesn't keep the formatter from


The fact that directly setting the sensitivity of the button doesn't work tells me that something is overriding it all when the project finishes loading... but I can't figure out why.
----------------------
Workaround for users: actually change something in the project after loading it.
Comment 2 Thibault Saunier 2010-11-29 14:26:33 UTC
Created attachment 175466 [details] [review]
Fixes the problem, not sure it is the best way to do it
Comment 3 Brandon Lewis 2010-11-29 14:55:42 UTC
Review of attachment 175466 [details] [review]:

Seems reasonable. Not completely sure I understand how it works.

::: pitivi/ui/mainwindow.py
@@ +801,3 @@
         self._syncDoUndo(self.app.action_log)
 
+        if self._missingUriOnLoading:

I'm guessing that this variable is actually set by line 993 below

@@ +805,3 @@
+            self.actiongroup.get_action("SaveProject").set_sensitive(True)
+            self._missingUriOnLoading = False
+

Is it necessary to clear this?

@@ +991,3 @@
             if new:
                 formatter.addMapping(uri, unquote(new))
+                self._missingUriOnLoading = True

So here, I assume, the formatter detected that files were missing?
Comment 4 Thibault Saunier 2010-11-29 15:22:38 UTC
If we detect that a file is missing, the user is asked, and if he can find it:
    * We set the modification state the project to 'dirty' (so the user will be asked to save it or not if he closes PiTiVi) 
    * We make sure that the user can save it right after it is loaded.
Comment 5 Brandon Lewis 2010-11-29 15:53:02 UTC
commit 38f6362071f7a86c5ad5b0d87c989af16d003fbb
Author: Thibault Saunier <thibault.saunier@collabora.co.uk>
Date:   Mon Nov 29 15:51:19 2010 +0000

    fig bug 635992 Missing files dialog: ...does not allow saving the project after loading
Comment 6 Jean-François Fortin Tam 2010-11-29 16:20:29 UTC
Tested, works as expected with the committed fix in pitivi git.