autosave

Bug #507182 reported by Matthieu Bizien
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
perroquet
Fix Committed
Wishlist
Matthieu Bizien

Bug Description

It would be nice to have an autosave. Perroquet would be easier.

*config.py*
class Config(ConfigSingleton):
    def init(self):
        self.properties["autosavePath"]=os.path.join(os.path.expanduser("~"), "autosave.perroquet")

*core.py*
class Core(object):
    def AutoLoad(self):
        path = self.gui.config.Get("autosavePath")
        try:
            self.LoadExercice(path)
        except IOError:
            pass

    def AutoSave(self):
        path = self.gui.config.Get("autosavePath")
        saver = ExerciceSaver()
        saver.SetPath(path)
        saver.SetVideoPath(self.videoPath)
        saver.SetExercicePath(self.exercicePath)
        saver.SetTranslationPath(self.translationPath)
        saver.SetCurrentSequence(self.currentSubId)
        saver.SetRepeatCount(self.repeatCount)
        saver.SetSequenceList(self.sequenceList)
        saver.Save()

*gui.py*
class Gui:
    def SetCore(self, core):
        self.core = core
        self.core.AutoLoad()

    def on_MainWindow_delete_event(self,widget,data=None):
        gtk.main_quit()
        if not self.core.IsAllowQuit():
            self.core.AutoSave()
        return False # returning False makes "destroy-event" be signalled
                     # for the window

moreover we don't need the "do you want to quit" before to quit.

Revision history for this message
Matthieu Bizien (oao2005) wrote :
Revision history for this message
Matthieu Bizien (oao2005) wrote :

The tar.lzma bug...

Revision history for this message
Matthieu Bizien (oao2005) wrote :
Revision history for this message
Matthieu Bizien (oao2005) wrote :
Changed in perroquet:
status: New → Triaged
importance: Undecided → Wishlist
assignee: nobody → Fred Bertolus (fred-bertolus)
milestone: none → 1.1.0
Changed in perroquet:
status: Triaged → Confirmed
importance: Wishlist → High
importance: High → Wishlist
status: Confirmed → Triaged
Changed in perroquet:
assignee: Fred Bertolus (fred-bertolus) → Matthieu Bizien (oao2005)
status: Triaged → In Progress
Changed in perroquet:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.