Example #1
0
 def ShowFiles(self, path, refresh=False):
     mw=self.mainwindow
     if path == self.path and not refresh:
         return
     self.path=None
     mw.MakeCall( gui.Request(mw.wt.getfileonlylist, path),
                  gui.Callback(self.OnShowFilesResults, path) )
Example #2
0
 def GetFullFS(self):
     mw = self.mainwindow
     mw.OnBusyStart()
     mw.GetStatusBar().progressminor(0, 100,
                                     'Reading Phone File System ...')
     mw.MakeCall(gui.Request(mw.wt.fulldirlisting),
                 gui.Callback(self.OnFullDirListingResults))
Example #3
0
 def OnFileOverwrite(self,_):
     path=self.itemtopath(self.GetFirstSelected())
     with guihelper.WXDialogWrapper(wx.FileDialog(self, style=wx.OPEN|wx.HIDE_READONLY|wx.CHANGE_DIR),
                                    True) as (dlg, retcode):
         if retcode==wx.ID_OK:
             infile=dlg.GetPath()
             contents=open(infile, "rb").read()
             mw=self.mainwindow
             mw.MakeCall( gui.Request(mw.wt.writefile, path, contents),
                          gui.Callback(self.OnFileOverwriteResults, guihelper.dirname(path)) )
Example #4
0
 def OnDataSendPhoneGotFundamentals(self, data, todo, exception, results):
     if exception != None:
         if not self.silent:
             self.mw.HandleException(exception)
         self.log("Auto Sync: Failed, Exception getting phone fundementals")
         self.mw.OnBusyEnd()
         return
     data.update(results)
     # Now scribble to phone
     self.log("Auto Sync: Sending results to phone")
     self.mw.MakeCall(gui.Request(self.mw.wt.senddata, data, todo),
                      gui.Callback(self.OnDataSendCalenderResults))
Example #5
0
 def sendcalendertophone(self):
     res = 1
     data = {}
     todo = []
     data['calendar_version'] = self.mw.phoneprofile.BP_Calendar_Version
     self.mw.GetActiveCalendarWidget().getdata(data)
     todo.append((self.mw.wt.writecalendar, "Calendar", False))
     todo.append((self.mw.wt.rebootcheck, "Phone Reboot"))
     self.mw.MakeCall(
         gui.Request(self.mw.wt.getfundamentals),
         gui.Callback(self.OnDataSendPhoneGotFundamentals, data, todo))
     return res
Example #6
0
    def OnRestoreOK(self, zipf, names, parentdir):
        if len(names)==0:
            wx.MessageBox("You didn't select any files to restore!", "No files selected",
                         wx.OK|wx.ICON_EXCLAMATION)
            return
        l=[]
        for zipname, fsname in names:
            l.append( (fsname, zipf.read(zipname)) )

        mw=self.mainwindow
        mw.MakeCall( gui.Request(mw.wt.restorefiles, l),
                     gui.Callback(self.OnRestoreResults, parentdir) )
Example #7
0
 def OnNewSubdir(self, _):
     with guihelper.WXDialogWrapper(wx.TextEntryDialog(self, "Subdirectory name?", "Create Subdirectory", "newfolder"),
                                    True) as (dlg, retcode):
         if retcode==wx.ID_OK:
             item=self.GetSelection()
             parent=self.itemtopath(item)
             if len(parent):
                 path=parent+"/"+dlg.GetValue()
             else:
                 path=dlg.GetValue()
             mw=self.mainwindow
             mw.MakeCall( gui.Request(mw.wt.mkdir, path),
                          gui.Callback(self.OnNewSubdirResults, path) )
Example #8
0
 def OnNewFile(self,_):
     with guihelper.WXDialogWrapper(wx.FileDialog(self, style=wx.OPEN|wx.HIDE_READONLY|wx.CHANGE_DIR),
                                    True) as (dlg, retcode):
         if retcode==wx.ID_OK:
             infile=dlg.GetPath()
             contents=open(infile, "rb").read()
             if len(self.path):
                 path=self.path+"/"+os.path.basename(dlg.GetPath())
             else:
                 path=os.path.basename(dlg.GetPath()) # you can't create files in root but I won't stop you
             mw=self.mainwindow
             mw.MakeCall( gui.Request(mw.wt.writefile, path, contents),
                          gui.Callback(self.parent.OnNewFileResults, self.path) )
Example #9
0
 def OnAddFiles(self):
     mw=self.mainwindow
     if not len(self.add_files):
         return
     for file in self.add_files:
         if file is None:
             continue
         if len(self.add_target):
             path=self.add_target+"/"+os.path.basename(file)
         else:
             path=os.path.basename(file) # you can't create files in root but I won't stop you
         contents=open(file, "rb").read()
         mw.MakeCall( gui.Request(mw.wt.writefile, path, contents),
                      gui.Callback(self.OnAddFilesResults, self.add_target) )
         self.add_files.remove(file)
         # can only add one file at a time
         break
Example #10
0
 def OnDirListing(self, path):
     mw=self.mainwindow
     mw.MakeCall( gui.Request(mw.wt.singledirlisting, path),
                  gui.Callback(self.OnDirListingResults, path) )
Example #11
0
 def OnPhoneOffline(self,_):
     mw=self.mainwindow
     mw.MakeCall( gui.Request(mw.wt.phoneofflinerequest),
                  gui.Callback(self.OnPhoneOfflineResults) )
Example #12
0
 def OnPhoneReboot(self,_):
     mw=self.mainwindow
     mw.MakeCall( gui.Request(mw.wt.phonerebootrequest),
                  gui.Callback(self.OnPhoneRebootResults) )
Example #13
0
 def OnBackup(self, recurse=0):
     path=self.itemtopath(self.GetSelection())
     mw=self.mainwindow
     mw.MakeCall( gui.Request(mw.wt.getbackup, path, recurse),
                  gui.Callback(self.OnBackupResults, path) )
Example #14
0
 def OnDirDelete(self, _):
     path=self.itemtopath(self.GetSelection())
     mw=self.mainwindow
     mw.MakeCall( gui.Request(mw.wt.rmdirs, path),
                  gui.Callback(self.OnDirDeleteResults, path) )
Example #15
0
 def OnModemMode(self,_):
     mw=self.mainwindow
     mw.MakeCall( gui.Request(mw.wt.modemmoderequest),
                  gui.Callback(self.OnModemModeResults) )
Example #16
0
 def OnHexView(self, _):
     path=self.itemtopath(self.GetFirstSelected())
     mw=self.mainwindow
     mw.MakeCall( gui.Request(mw.wt.getfile, path),
                  gui.Callback(self.OnHexViewResults, path) )
Example #17
0
 def OnFileDelete(self, _):
     path=self.itemtopath(self.GetFirstSelected())
     mw=self.mainwindow
     mw.MakeCall( gui.Request(mw.wt.rmfile, path),
                  gui.Callback(self.OnFileDeleteResults, guihelper.dirname(path)) )