22 from E5Gui import E5MessageBox |
22 from E5Gui import E5MessageBox |
23 |
23 |
24 from .Ui_HgBookmarksListDialog import Ui_HgBookmarksListDialog |
24 from .Ui_HgBookmarksListDialog import Ui_HgBookmarksListDialog |
25 |
25 |
26 |
26 |
|
27 # TODO: Add context menu with these actions |
|
28 # - Delete Bookmark |
|
29 # - Rename Bookmark |
|
30 # - Push Bookmark |
27 class HgBookmarksListDialog(QDialog, Ui_HgBookmarksListDialog): |
31 class HgBookmarksListDialog(QDialog, Ui_HgBookmarksListDialog): |
28 """ |
32 """ |
29 Class implementing a dialog to show a list of bookmarks. |
33 Class implementing a dialog to show a list of bookmarks. |
30 """ |
34 """ |
31 def __init__(self, vcs, parent=None): |
35 def __init__(self, vcs, parent=None): |
50 self.process = QProcess() |
54 self.process = QProcess() |
51 self.vcs = vcs |
55 self.vcs = vcs |
52 self.__bookmarksList = None |
56 self.__bookmarksList = None |
53 self.__path = None |
57 self.__path = None |
54 self.__hgClient = vcs.getClient() |
58 self.__hgClient = vcs.getClient() |
|
59 self.__bookmarksDefined = False |
55 |
60 |
56 self.bookmarksList.headerItem().setText( |
61 self.bookmarksList.headerItem().setText( |
57 self.bookmarksList.columnCount(), "") |
62 self.bookmarksList.columnCount(), "") |
58 self.bookmarksList.header().setSortIndicator(3, Qt.AscendingOrder) |
63 self.bookmarksList.header().setSortIndicator(3, Qt.AscendingOrder) |
59 |
64 |
89 @param path name of directory to be listed (string) |
94 @param path name of directory to be listed (string) |
90 @param bookmarksList reference to string list receiving the bookmarks |
95 @param bookmarksList reference to string list receiving the bookmarks |
91 (list of strings) |
96 (list of strings) |
92 """ |
97 """ |
93 self.bookmarksList.clear() |
98 self.bookmarksList.clear() |
|
99 self.__bookmarksDefined = False |
94 |
100 |
95 self.errorGroup.hide() |
101 self.errorGroup.hide() |
96 |
102 |
97 self.intercept = False |
103 self.intercept = False |
98 self.activateWindow() |
104 self.activateWindow() |
174 |
180 |
175 if self.bookmarksList.topLevelItemCount() == 0: |
181 if self.bookmarksList.topLevelItemCount() == 0: |
176 # no bookmarks defined |
182 # no bookmarks defined |
177 self.__generateItem( |
183 self.__generateItem( |
178 self.tr("no bookmarks defined"), "", "", "") |
184 self.tr("no bookmarks defined"), "", "", "") |
|
185 self.__bookmarksDefined = False |
|
186 else: |
|
187 self.__bookmarksDefined = True |
|
188 |
179 self.__resizeColumns() |
189 self.__resizeColumns() |
180 self.__resort() |
190 self.__resort() |
181 |
191 |
182 def on_buttonBox_clicked(self, button): |
192 def on_buttonBox_clicked(self, button): |
183 """ |
193 """ |