17 |
17 |
18 from .Ui_HistoryDialog import Ui_HistoryDialog |
18 from .Ui_HistoryDialog import Ui_HistoryDialog |
19 |
19 |
20 import UI.PixmapCache |
20 import UI.PixmapCache |
21 |
21 |
|
22 |
22 class HistoryDialog(QDialog, Ui_HistoryDialog): |
23 class HistoryDialog(QDialog, Ui_HistoryDialog): |
23 """ |
24 """ |
24 Class implementing a dialog to manage history. |
25 Class implementing a dialog to manage history. |
25 |
26 |
26 @signal openUrl(QUrl, str) emitted to open a URL in the current tab |
27 @signal openUrl(QUrl, str) emitted to open a URL in the current tab |
27 @signal newUrl(QUrl, str) emitted to open a URL in a new tab |
28 @signal newUrl(QUrl, str) emitted to open a URL in a new tab |
28 """ |
29 """ |
29 openUrl = pyqtSignal(QUrl, str) |
30 openUrl = pyqtSignal(QUrl, str) |
30 newUrl = pyqtSignal(QUrl, str) |
31 newUrl = pyqtSignal(QUrl, str) |
31 |
32 |
32 def __init__(self, parent = None, manager = None): |
33 def __init__(self, parent=None, manager=None): |
33 """ |
34 """ |
34 Constructor |
35 Constructor |
35 |
36 |
36 @param parent reference to the parent widget (QWidget |
37 @param parent reference to the parent widget (QWidget |
37 @param manager reference to the history manager object (HistoryManager) |
38 @param manager reference to the history manager object (HistoryManager) |
118 @param newTab flag indicating to open the history entry in a new tab (boolean) |
119 @param newTab flag indicating to open the history entry in a new tab (boolean) |
119 """ |
120 """ |
120 idx = self.historyTree.currentIndex() |
121 idx = self.historyTree.currentIndex() |
121 if newTab: |
122 if newTab: |
122 self.newUrl.emit( |
123 self.newUrl.emit( |
123 idx.data(HistoryModel.UrlRole), |
124 idx.data(HistoryModel.UrlRole), |
124 idx.data(HistoryModel.TitleRole)) |
125 idx.data(HistoryModel.TitleRole)) |
125 else: |
126 else: |
126 self.openUrl.emit( |
127 self.openUrl.emit( |
127 idx.data(HistoryModel.UrlRole), |
128 idx.data(HistoryModel.UrlRole), |
128 idx.data(HistoryModel.TitleRole)) |
129 idx.data(HistoryModel.TitleRole)) |
129 |
130 |
130 def __copyHistory(self): |
131 def __copyHistory(self): |
131 """ |
132 """ |
132 Private slot to copy a history entry's URL to the clipboard. |
133 Private slot to copy a history entry's URL to the clipboard. |