96 @pyqtSlot(QPoint) |
97 @pyqtSlot(QPoint) |
97 def __customContextMenuRequested(self, pos): |
98 def __customContextMenuRequested(self, pos): |
98 """ |
99 """ |
99 Private slot to handle the context menu request for the bookmarks tree. |
100 Private slot to handle the context menu request for the bookmarks tree. |
100 |
101 |
101 @param pos position the context menu was requested (QPoint) |
102 @param pos position the context menu was requested |
|
103 @type QPoint |
102 """ |
104 """ |
103 menu = QMenu() |
105 menu = QMenu() |
104 |
106 |
105 selectedRowsCount = len(self.downloadsView.selectionModel().selectedRows()) |
107 selectedRowsCount = len(self.downloadsView.selectionModel().selectedRows()) |
106 |
108 |
150 |
152 |
151 def activeDownloadsCount(self): |
153 def activeDownloadsCount(self): |
152 """ |
154 """ |
153 Public method to get the number of active downloads. |
155 Public method to get the number of active downloads. |
154 |
156 |
155 @return number of active downloads (integer) |
157 @return number of active downloads |
|
158 @rtype int |
156 """ |
159 """ |
157 count = 0 |
160 count = 0 |
158 |
161 |
159 for download in self.__downloads: |
162 for download in self.__downloads: |
160 if download.downloading(): |
163 if download.downloading(): |
377 |
381 |
378 def removePolicy(self): |
382 def removePolicy(self): |
379 """ |
383 """ |
380 Public method to get the remove policy. |
384 Public method to get the remove policy. |
381 |
385 |
382 @return remove policy (integer) |
386 @return remove policy |
|
387 @rtype int |
383 """ |
388 """ |
384 return Preferences.getWebBrowser("DownloadManagerRemovePolicy") |
389 return Preferences.getWebBrowser("DownloadManagerRemovePolicy") |
385 |
390 |
386 def setRemovePolicy(self, policy): |
391 def setRemovePolicy(self, policy): |
387 """ |
392 """ |
388 Public method to set the remove policy. |
393 Public method to set the remove policy. |
389 |
394 |
390 @param policy policy to be set |
395 @param policy policy to be set |
391 (DownloadManager.RemoveExit, DownloadManager.RemoveNever, |
396 (DownloadManager.RemoveExit, DownloadManager.RemoveNever, |
392 DownloadManager.RemoveSuccessFullDownload) |
397 DownloadManager.RemoveSuccessFullDownload) |
|
398 @type int |
393 """ |
399 """ |
394 if policy in ( |
400 if policy in ( |
395 DownloadManager.RemoveExit, |
401 DownloadManager.RemoveExit, |
396 DownloadManager.RemoveNever, |
402 DownloadManager.RemoveNever, |
397 DownloadManager.RemoveSuccessFullDownload, |
403 DownloadManager.RemoveSuccessFullDownload, |
517 |
523 |
518 def setDownloadDirectory(self, directory): |
524 def setDownloadDirectory(self, directory): |
519 """ |
525 """ |
520 Public method to set the current download directory. |
526 Public method to set the current download directory. |
521 |
527 |
522 @param directory current download directory (string) |
528 @param directory current download directory |
|
529 @type str |
523 """ |
530 """ |
524 self.__downloadDirectory = directory |
531 self.__downloadDirectory = directory |
525 if self.__downloadDirectory != "": |
532 if self.__downloadDirectory != "": |
526 self.__downloadDirectory += "/" |
533 self.__downloadDirectory += "/" |
527 |
534 |
528 def downloadDirectory(self): |
535 def downloadDirectory(self): |
529 """ |
536 """ |
530 Public method to get the current download directory. |
537 Public method to get the current download directory. |
531 |
538 |
532 @return current download directory (string) |
539 @return current download directory |
|
540 @rtype str |
533 """ |
541 """ |
534 return self.__downloadDirectory |
542 return self.__downloadDirectory |
535 |
543 |
536 def downloadsCount(self): |
544 def downloadsCount(self): |
537 """ |
545 """ |
653 |
662 |
654 def __currentItem(self): |
663 def __currentItem(self): |
655 """ |
664 """ |
656 Private method to get a reference to the current item. |
665 Private method to get a reference to the current item. |
657 |
666 |
658 @return reference to the current item (DownloadItem) |
667 @return reference to the current item |
|
668 @rtype DownloadItem |
659 """ |
669 """ |
660 index = self.downloadsView.currentIndex() |
670 index = self.downloadsView.currentIndex() |
661 if index and index.isValid(): |
671 if index and index.isValid(): |
662 row = index.row() |
672 row = index.row() |
663 return self.__downloads[row] |
673 return self.__downloads[row] |