def __init__(self, frame): TransferList.__init__(self, frame, frame.UploadList) self.myvbox = self.frame.vboxuploads self.frame.UploadList.set_property("rules-hint", True) self.popup_menu2 = popup2 = PopupMenu(frame) popup2.setup( ("#" + _("Clear finished/erred"), self.OnClearFinishedErred, gtk.STOCK_CLEAR), ("#" + _("Clear finished/aborted"), self.OnClearFinishedAborted, gtk.STOCK_CLEAR), ("#" + _("Clear finished"), self.OnClearFinished, gtk.STOCK_CLEAR), ("#" + _("Clear aborted"), self.OnClearAborted, gtk.STOCK_CLEAR), ("#" + _("Clear queued"), self.OnClearQueued, gtk.STOCK_CLEAR), ("#" + _("Clear failed"), self.OnClearFailed, gtk.STOCK_CLEAR), ) self.popup_menu_users = PopupMenu(frame) self.popup_menu = popup = PopupMenu(frame) popup.setup( ("#" + _("Copy _URL"), self.OnCopyURL, gtk.STOCK_COPY), ("#" + _("Copy folder URL"), self.OnCopyDirURL, gtk.STOCK_COPY), ("#" + _("Send to _player"), self.OnPlayFiles, gtk.STOCK_MEDIA_PLAY), ("#" + _("Open Directory"), self.OnOpenDirectory, gtk.STOCK_OPEN), ("#" + _("Search"), self.OnFileSearch, gtk.STOCK_FIND), (1, _("User(s)"), self.popup_menu_users, self.OnPopupMenuUsers), ("", None), ("#" + _("Abor_t"), self.OnAbortTransfer, gtk.STOCK_CANCEL), ("#" + _("_Clear"), self.OnClearTransfer, gtk.STOCK_CLEAR), ("#" + _("_Retry"), self.OnUploadTransfer, gtk.STOCK_REDO), ("", None), (1, _("Clear Groups"), self.popup_menu2, None), ) frame.UploadList.connect("button_press_event", self.OnPopupMenu, "mouse") frame.UploadList.connect("key-press-event", self.on_key_press_event) cols = frame.UploadList.get_columns() for i in range(9): parent = cols[i].get_widget().get_ancestor(gtk.Button) if parent: parent.connect("button_press_event", PressHeader) # Read Show / Hide column settings from last session cols[i].set_visible(self.frame.np.config.sections["columns"]["uploads"][i]) frame.clearUploadFinishedErredButton.connect("clicked", self.OnClearFinishedErred) frame.clearUploadQueueButton.connect("clicked", self.OnTryClearQueued) frame.abortUploadButton.connect("clicked", self.OnAbortTransfer) frame.abortUserUploadButton.connect("clicked", self.OnAbortUser) frame.banUploadButton.connect("clicked", self.OnBan) frame.UploadList.expand_all() self.frame.ToggleAutoclear.set_active(self.frame.np.config.sections["transfers"]["autoclear_uploads"]) frame.ToggleAutoclear.connect("toggled", self.OnToggleAutoclear) self.frame.ToggleTreeUploads.set_active(self.frame.np.config.sections["transfers"]["groupuploads"]) frame.ToggleTreeUploads.connect("toggled", self.OnToggleTree) self.OnToggleTree(None) self.frame.ExpandUploads.set_active(self.frame.np.config.sections["transfers"]["uploadsexpanded"]) frame.ExpandUploads.connect("toggled", self.OnExpandUploads) self.OnExpandUploads(None)
def OnClearFailed(self, widget): TransferList.OnClearFailed(self, widget) self.frame.np.transfers.calcUploadQueueSizes() self.frame.np.transfers.checkUploadQueue() self.update()
def OnClearQueued(self, widget): self.select_transfers() TransferList.OnClearQueued(self, widget) self.frame.np.transfers.calcUploadQueueSizes() self.frame.np.transfers.checkUploadQueue() self.update()
def OnAbortTransfer(self, widget, remove=False, clear=False): self.select_transfers() TransferList.OnAbortTransfer(self, widget, remove, clear) self.frame.np.transfers.calcUploadQueueSizes() self.frame.np.transfers.checkUploadQueue() self.update()
def OnAbortUser(self, widget): self.select_transfers() for user in self.selected_users: for i in self.list[:]: if i.user == user: if i not in self.selected_transfers: self.selected_transfers.append(i) TransferList.OnAbortTransfer(self, widget, False, False) self.frame.np.transfers.calcUploadQueueSizes() self.frame.np.transfers.checkUploadQueue()
def update(self, transfer=None, forced=False): TransferList.update(self, transfer, forced) if transfer is None and self.frame.np.transfers is not None: self.frame.np.transfers.SaveDownloads()
def __init__(self, frame): TransferList.__init__(self, frame, frame.DownloadList, type='downloads') self.myvbox = self.frame.downloadsvbox self.frame.DownloadList.set_property("rules-hint", True) self.accel_group = gtk.AccelGroup() self.popup_menu2 = popup2 = PopupMenu(frame) popup2.setup( ("#" + _("Clear finished/aborted"), self.OnClearFinishedAborted), ("#" + _("Clear finished"), self.OnClearFinished), ("#" + _("Clear aborted"), self.OnClearAborted), ("#" + _("Clear paused"), self.OnClearPaused), ("#" + _("Clear filtered"), self.OnClearFiltered), ("#" + _("Clear queued"), self.OnClearQueued)) self.popup_menu_users = PopupMenu(frame) self.popup_menu = popup = PopupMenu(frame) popup.setup( ("#" + _("Get place in _queue"), self.OnGetPlaceInQueue), ("", None), ("#" + _("Copy _URL"), self.OnCopyURL), ("#" + _("Copy folder URL"), self.OnCopyDirURL), ("#" + _("Send to _player"), self.OnPlayFiles), ("#" + _("View Metadata of file(s)"), self.OnDownloadMeta), ("#" + _("Open Directory"), self.OnOpenDirectory), ("#" + _("Search"), self.OnFileSearch), (1, _("User(s)"), self.popup_menu_users, self.OnPopupMenuUsers), ("", None), ("#" + _("_Retry"), self.OnRetryTransfer), ("", None), ("#" + _("Abor_t"), self.OnAbortTransfer), ("#" + _("Abort & Delete"), self.OnAbortRemoveTransfer), ("#" + _("_Clear"), self.OnClearTransfer), ("", None), (1, _("Clear Groups"), self.popup_menu2, None)) frame.DownloadList.connect("button_press_event", self.OnPopupMenu, "mouse") frame.DownloadList.connect("key-press-event", self.on_key_press_event) cols = frame.DownloadList.get_columns() for i in range(9): parent = cols[i].get_widget().get_ancestor(gtk.Button) if parent: parent.connect("button_press_event", PressHeader) # Read Show / Hide column settings from last session cols[i].set_visible(self.frame.np.config.sections["columns"] ["downloads_columns"][i]) frame.clearFinishedAbortedButton.connect("clicked", self.OnClearFinishedAborted) frame.clearQueuedButton.connect("clicked", self.OnTryClearQueued) frame.retryTransferButton.connect("clicked", self.OnRetryTransfer) frame.abortTransferButton.connect("clicked", self.OnSelectAbortTransfer) frame.deleteTransferButton.connect("clicked", self.OnAbortRemoveTransfer) frame.banDownloadButton.connect("clicked", self.OnBan) frame.DownloadList.expand_all() self.frame.ToggleAutoRetry.set_active( self.frame.np.config.sections["transfers"]["autoretry_downloads"]) frame.ToggleAutoRetry.connect("toggled", self.OnToggleAutoRetry) self.frame.ToggleTreeDownloads.set_active( self.frame.np.config.sections["transfers"]["groupdownloads"]) frame.ToggleTreeDownloads.connect("toggled", self.OnToggleTree) self.OnToggleTree(None) self.frame.ExpandDownloads.set_active( self.frame.np.config.sections["transfers"]["downloadsexpanded"]) frame.ExpandDownloads.connect("toggled", self.OnExpandDownloads) self.OnExpandDownloads(None)
def __init__(self, frame): TransferList.__init__(self, frame, frame.UploadList) self.myvbox = self.frame.vboxuploads self.frame.UploadList.set_property("rules-hint", True) self.popup_menu2 = popup2 = PopupMenu(frame) popup2.setup( ("#" + _("Clear finished/erred"), self.OnClearFinishedErred, gtk.STOCK_CLEAR), ("#" + _("Clear finished/aborted"), self.OnClearFinishedAborted, gtk.STOCK_CLEAR), ("#" + _("Clear finished"), self.OnClearFinished, gtk.STOCK_CLEAR), ("#" + _("Clear aborted"), self.OnClearAborted, gtk.STOCK_CLEAR), ("#" + _("Clear queued"), self.OnClearQueued, gtk.STOCK_CLEAR), ("#" + _("Clear failed"), self.OnClearFailed, gtk.STOCK_CLEAR), ) self.popup_menu_users = PopupMenu(frame) self.popup_menu = popup = PopupMenu(frame) popup.setup( ("#" + _("Copy _URL"), self.OnCopyURL, gtk.STOCK_COPY), ("#" + _("Copy folder URL"), self.OnCopyDirURL, gtk.STOCK_COPY), ("#" + _("Send to _player"), self.OnPlayFiles, gtk.STOCK_MEDIA_PLAY), ("#" + _("Open Directory"), self.OnOpenDirectory, gtk.STOCK_OPEN), ("#" + _("Search"), self.OnFileSearch, gtk.STOCK_FIND), (1, _("User(s)"), self.popup_menu_users, self.OnPopupMenuUsers), ("", None), ("#" + _("Abor_t"), self.OnAbortTransfer, gtk.STOCK_CANCEL), ("#" + _("_Clear"), self.OnClearTransfer, gtk.STOCK_CLEAR), ("#" + _("_Retry"), self.OnUploadTransfer, gtk.STOCK_REDO), ("", None), (1, _("Clear Groups"), self.popup_menu2, None), ) frame.UploadList.connect("button_press_event", self.OnPopupMenu, "mouse") frame.UploadList.connect("key-press-event", self.on_key_press_event) cols = frame.UploadList.get_columns() for i in range(9): parent = cols[i].get_widget().get_ancestor(gtk.Button) if parent: parent.connect('button_press_event', PressHeader) # Read Show / Hide column settings from last session cols[i].set_visible( self.frame.np.config.sections["columns"]["uploads"][i]) frame.clearUploadFinishedErredButton.connect("clicked", self.OnClearFinishedErred) frame.clearUploadQueueButton.connect("clicked", self.OnTryClearQueued) frame.abortUploadButton.connect("clicked", self.OnAbortTransfer) frame.abortUserUploadButton.connect("clicked", self.OnAbortUser) frame.banUploadButton.connect("clicked", self.OnBan) frame.UploadList.expand_all() self.frame.ToggleAutoclear.set_active( self.frame.np.config.sections["transfers"]["autoclear_uploads"]) frame.ToggleAutoclear.connect("toggled", self.OnToggleAutoclear) self.frame.ToggleTreeUploads.set_active( self.frame.np.config.sections["transfers"]["groupuploads"]) frame.ToggleTreeUploads.connect("toggled", self.OnToggleTree) self.OnToggleTree(None) self.frame.ExpandUploads.set_active( self.frame.np.config.sections["transfers"]["uploadsexpanded"]) frame.ExpandUploads.connect("toggled", self.OnExpandUploads) self.OnExpandUploads(None)
def __init__(self, frame): TransferList.__init__(self, frame, frame.DownloadList, type='downloads') self.myvbox = self.frame.downloadsvbox self.frame.DownloadList.set_property("rules-hint", True) self.accel_group = gtk.AccelGroup() self.popup_menu2 = popup2 = PopupMenu(frame) popup2.setup( ("#" + _("Clear finished/aborted"), self.OnClearFinishedAborted), ("#" + _("Clear finished"), self.OnClearFinished), ("#" + _("Clear aborted"), self.OnClearAborted), ("#" + _("Clear paused"), self.OnClearPaused), ("#" + _("Clear filtered"), self.OnClearFiltered), ("#" + _("Clear queued"), self.OnClearQueued) ) self.popup_menu_users = PopupMenu(frame) self.popup_menu = popup = PopupMenu(frame) popup.setup( ("#" + _("Get place in _queue"), self.OnGetPlaceInQueue), ("", None), ("#" + _("Copy _URL"), self.OnCopyURL), ("#" + _("Copy folder URL"), self.OnCopyDirURL), ("#" + _("Send to _player"), self.OnPlayFiles), ("#" + _("View Metadata of file(s)"), self.OnDownloadMeta), ("#" + _("Open Directory"), self.OnOpenDirectory), ("#" + _("Search"), self.OnFileSearch), (1, _("User(s)"), self.popup_menu_users, self.OnPopupMenuUsers), ("", None), ("#" + _("_Retry"), self.OnRetryTransfer), ("", None), ("#" + _("Abor_t"), self.OnAbortTransfer), ("#" + _("Abort & Delete"), self.OnAbortRemoveTransfer), ("#" + _("_Clear"), self.OnClearTransfer), ("", None), (1, _("Clear Groups"), self.popup_menu2, None) ) frame.DownloadList.connect("button_press_event", self.OnPopupMenu, "mouse") frame.DownloadList.connect("key-press-event", self.on_key_press_event) cols = frame.DownloadList.get_columns() for i in range(9): parent = cols[i].get_widget().get_ancestor(gtk.Button) if parent: parent.connect("button_press_event", PressHeader) # Read Show / Hide column settings from last session cols[i].set_visible(self.frame.np.config.sections["columns"]["downloads_columns"][i]) frame.clearFinishedAbortedButton.connect("clicked", self.OnClearFinishedAborted) frame.clearQueuedButton.connect("clicked", self.OnTryClearQueued) frame.retryTransferButton.connect("clicked", self.OnRetryTransfer) frame.abortTransferButton.connect("clicked", self.OnSelectAbortTransfer) frame.deleteTransferButton.connect("clicked", self.OnAbortRemoveTransfer) frame.banDownloadButton.connect("clicked", self.OnBan) frame.DownloadList.expand_all() self.frame.ToggleAutoRetry.set_active(self.frame.np.config.sections["transfers"]["autoretry_downloads"]) frame.ToggleAutoRetry.connect("toggled", self.OnToggleAutoRetry) self.frame.ToggleTreeDownloads.set_active(self.frame.np.config.sections["transfers"]["groupdownloads"]) frame.ToggleTreeDownloads.connect("toggled", self.OnToggleTree) self.OnToggleTree(None) self.frame.ExpandDownloads.set_active(self.frame.np.config.sections["transfers"]["downloadsexpanded"]) frame.ExpandDownloads.connect("toggled", self.OnExpandDownloads) self.OnExpandDownloads(None)