8 """ |
8 """ |
9 |
9 |
10 from PyQt6.QtWidgets import QDialog |
10 from PyQt6.QtWidgets import QDialog |
11 |
11 |
12 from eric7.EricWidgets import EricMessageBox |
12 from eric7.EricWidgets import EricMessageBox |
|
13 from eric7.UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
13 |
14 |
14 from ..HgDialog import HgDialog |
15 from ..HgDialog import HgDialog |
15 from ..HgExtension import HgExtension |
16 from ..HgExtension import HgExtension |
16 |
17 |
17 |
18 |
64 |
65 |
65 @param name directory or file name (string) or list of directory |
66 @param name directory or file name (string) or list of directory |
66 or file names (list of string) |
67 or file names (list of string) |
67 @return flag indicating that the project should be reread (boolean) |
68 @return flag indicating that the project should be reread (boolean) |
68 """ |
69 """ |
|
70 from .HgShelveDataDialog import HgShelveDataDialog |
|
71 |
69 res = False |
72 res = False |
70 from .HgShelveDataDialog import HgShelveDataDialog |
|
71 |
|
72 dlg = HgShelveDataDialog(self.vcs.version) |
73 dlg = HgShelveDataDialog(self.vcs.version) |
73 if dlg.exec() == QDialog.DialogCode.Accepted: |
74 if dlg.exec() == QDialog.DialogCode.Accepted: |
74 shelveName, dateTime, message, addRemove, keep = dlg.getData() |
75 shelveName, dateTime, message, addRemove, keep = dlg.getData() |
75 |
76 |
76 args = self.vcs.initCommand("shelve") |
77 args = self.vcs.initCommand("shelve") |
104 |
105 |
105 def hgShelveBrowser(self): |
106 def hgShelveBrowser(self): |
106 """ |
107 """ |
107 Public method to show the shelve browser dialog. |
108 Public method to show the shelve browser dialog. |
108 """ |
109 """ |
|
110 from .HgShelveBrowserDialog import HgShelveBrowserDialog |
|
111 |
109 if self.__shelveBrowserDialog is None: |
112 if self.__shelveBrowserDialog is None: |
110 from .HgShelveBrowserDialog import HgShelveBrowserDialog |
|
111 |
|
112 self.__shelveBrowserDialog = HgShelveBrowserDialog(self.vcs) |
113 self.__shelveBrowserDialog = HgShelveBrowserDialog(self.vcs) |
113 self.__shelveBrowserDialog.show() |
114 self.__shelveBrowserDialog.show() |
114 self.__shelveBrowserDialog.start() |
115 self.__shelveBrowserDialog.start() |
115 |
116 |
116 def hgUnshelve(self, shelveName=""): |
117 def hgUnshelve(self, shelveName=""): |
118 Public method to restore shelved changes to the project directory. |
119 Public method to restore shelved changes to the project directory. |
119 |
120 |
120 @param shelveName name of the shelve to restore (string) |
121 @param shelveName name of the shelve to restore (string) |
121 @return flag indicating that the project should be reread (boolean) |
122 @return flag indicating that the project should be reread (boolean) |
122 """ |
123 """ |
|
124 from .HgUnshelveDataDialog import HgUnshelveDataDialog |
|
125 |
123 res = False |
126 res = False |
124 from .HgUnshelveDataDialog import HgUnshelveDataDialog |
|
125 |
|
126 dlg = HgUnshelveDataDialog(self.__hgGetShelveNamesList(), shelveName=shelveName) |
127 dlg = HgUnshelveDataDialog(self.__hgGetShelveNamesList(), shelveName=shelveName) |
127 if dlg.exec() == QDialog.DialogCode.Accepted: |
128 if dlg.exec() == QDialog.DialogCode.Accepted: |
128 shelveName, keep = dlg.getData() |
129 shelveName, keep = dlg.getData() |
129 self.__unshelveKeep = keep # store for potential continue |
130 self.__unshelveKeep = keep # store for potential continue |
130 |
131 |
182 """ |
183 """ |
183 Public method to delete named shelves. |
184 Public method to delete named shelves. |
184 |
185 |
185 @param shelveNames name of shelves to delete (list of string) |
186 @param shelveNames name of shelves to delete (list of string) |
186 """ |
187 """ |
|
188 from .HgShelvesSelectionDialog import HgShelvesSelectionDialog |
|
189 |
187 if not shelveNames: |
190 if not shelveNames: |
188 from .HgShelvesSelectionDialog import HgShelvesSelectionDialog |
|
189 |
|
190 dlg = HgShelvesSelectionDialog( |
191 dlg = HgShelvesSelectionDialog( |
191 self.tr("Select the shelves to be deleted:"), |
192 self.tr("Select the shelves to be deleted:"), |
192 self.__hgGetShelveNamesList(), |
193 self.__hgGetShelveNamesList(), |
193 ) |
194 ) |
194 if dlg.exec() == QDialog.DialogCode.Accepted: |
195 if dlg.exec() == QDialog.DialogCode.Accepted: |
195 shelveNames = dlg.getSelectedShelves() |
196 shelveNames = dlg.getSelectedShelves() |
196 else: |
197 else: |
197 return |
198 return |
198 |
|
199 from eric7.UI.DeleteFilesConfirmationDialog import DeleteFilesConfirmationDialog |
|
200 |
199 |
201 dlg = DeleteFilesConfirmationDialog( |
200 dlg = DeleteFilesConfirmationDialog( |
202 None, |
201 None, |
203 self.tr("Delete shelves"), |
202 self.tr("Delete shelves"), |
204 self.tr("Do you really want to delete these shelves?"), |
203 self.tr("Do you really want to delete these shelves?"), |