Example #1
0
    def _add_file_cb(self, widget=None, event=None):
        def on_response(filename):
            self.app.load_torrent(filename)

        GTKUtils.launch_file_selector(on_response,
                                      self.app.settings.torrentFolder,
                                      ("Torrent Files", "*.torrent"))
Example #2
0
 def filename_cb(self, widget, event=None):
   def on_response(filename):
     #ensure that the filter is right:
     if self.fileType not in ("folder", "all files"):
       if not re.compile("^.*\\.%s$" % (self.fileType)).match(filename):
         filename += "." + self.fileType
     if len(filename) > self.filenameEntry.get_width_chars():
       self.filenameEntry.set_width_chars(len(filename) + 10)
     self.filenameEntry.set_text(filename)
   if self.fileType == "all files":
     fileTypeFilter = ("All Files", "*.*")
   elif self.fileType == "folder":
     fileTypeFilter = None
   else:
     fileTypeFilter = ("%s Files" % (self.fileType.upper()), "*.%s" % (self.fileType))      
   GTKUtils.launch_file_selector(on_response, self.filenameEntry.get_text(), fileTypeFilter, True)
Example #3
0
 def _add_file_cb(self, widget=None, event=None):
   def on_response(filename):
     self.app.load_torrent(filename)
   GTKUtils.launch_file_selector(on_response, self.app.settings.torrentFolder, ("Torrent Files", "*.torrent"))
Example #4
0
 def enter_cb(widget):
   GTKUtils.launch_file_selector(self.set_value, unicode(self.entry.get_text()))
Example #5
0
 def enter_cb(widget):
     GTKUtils.launch_file_selector(self.set_value,
                                   unicode(self.entry.get_text()))