48 """ |
48 """ |
49 Public method to support the display of some executable info. |
49 Public method to support the display of some executable info. |
50 |
50 |
51 @return dictionary containing the data to query the presence of |
51 @return dictionary containing the data to query the presence of |
52 the executable |
52 the executable |
|
53 @rtype dict |
53 """ |
54 """ |
54 data = { |
55 data = { |
55 "programEntry": True, |
56 "programEntry": True, |
56 "header": QCoreApplication.translate( |
57 "header": QCoreApplication.translate( |
57 "VcsMercurialPlugin", "Version Control - Mercurial" |
58 "VcsMercurialPlugin", "Version Control - Mercurial" |
70 def getVcsSystemIndicator(): |
71 def getVcsSystemIndicator(): |
71 """ |
72 """ |
72 Public function to get the indicators for this version control system. |
73 Public function to get the indicators for this version control system. |
73 |
74 |
74 @return dictionary with indicator as key and a tuple with the vcs name |
75 @return dictionary with indicator as key and a tuple with the vcs name |
75 (string) and vcs display string (string) |
76 and vcs display string |
76 """ |
77 @rtype dict |
77 ##global __header__ |
78 """ |
78 data = {} |
79 data = {} |
79 exe = getHgExecutable() |
80 exe = getHgExecutable() |
80 if FileSystemUtilities.isinpath(exe): |
81 if FileSystemUtilities.isinpath(exe): |
81 data[".hg"] = (__header__["pluginTypename"], displayString()) |
82 data[".hg"] = (__header__["pluginTypename"], displayString()) |
82 data["_hg"] = (__header__["pluginTypename"], displayString()) |
83 data["_hg"] = (__header__["pluginTypename"], displayString()) |
85 |
86 |
86 def displayString(): |
87 def displayString(): |
87 """ |
88 """ |
88 Public function to get the display string. |
89 Public function to get the display string. |
89 |
90 |
90 @return display string (string) |
91 @return display string |
|
92 @rtype str |
91 """ |
93 """ |
92 exe = getHgExecutable() |
94 exe = getHgExecutable() |
93 if FileSystemUtilities.isinpath(exe): |
95 if FileSystemUtilities.isinpath(exe): |
94 return QCoreApplication.translate("VcsMercurialPlugin", "Mercurial") |
96 return QCoreApplication.translate("VcsMercurialPlugin", "Mercurial") |
95 else: |
97 else: |
101 |
103 |
102 def createConfigurationPage(configDlg): # noqa: U100 |
104 def createConfigurationPage(configDlg): # noqa: U100 |
103 """ |
105 """ |
104 Module function to create the configuration page. |
106 Module function to create the configuration page. |
105 |
107 |
106 @param configDlg reference to the configuration dialog (QDialog) |
108 @param configDlg reference to the configuration dialog |
|
109 @type QDialog |
107 @return reference to the configuration page |
110 @return reference to the configuration page |
|
111 @rtype MercurialPage |
108 """ |
112 """ |
109 from eric7.Plugins.VcsPlugins.vcsMercurial.ConfigurationPage.MercurialPage import ( |
113 from eric7.Plugins.VcsPlugins.vcsMercurial.ConfigurationPage.MercurialPage import ( |
110 MercurialPage, |
114 MercurialPage, |
111 ) |
115 ) |
112 |
116 |
120 |
124 |
121 def getConfigData(): |
125 def getConfigData(): |
122 """ |
126 """ |
123 Module function returning data as required by the configuration dialog. |
127 Module function returning data as required by the configuration dialog. |
124 |
128 |
125 @return dictionary with key "zzz_mercurialPage" containing the relevant |
129 @return dictionary with key "zzz_mercurialPage" containing the relevant data |
126 data |
130 @rtype dict |
127 """ |
131 """ |
128 return { |
132 return { |
129 "zzz_mercurialPage": [ |
133 "zzz_mercurialPage": [ |
130 QCoreApplication.translate("VcsMercurialPlugin", "Mercurial"), |
134 QCoreApplication.translate("VcsMercurialPlugin", "Mercurial"), |
131 os.path.join( |
135 os.path.join( |
211 def getProjectHelper(self): |
216 def getProjectHelper(self): |
212 """ |
217 """ |
213 Public method to get a reference to the project helper object. |
218 Public method to get a reference to the project helper object. |
214 |
219 |
215 @return reference to the project helper object |
220 @return reference to the project helper object |
|
221 @rtype HgProjectHelper |
216 """ |
222 """ |
217 return self.__projectHelperObject |
223 return self.__projectHelperObject |
218 |
224 |
219 def initToolbar(self, ui, toolbarManager): |
225 def initToolbar(self, ui, toolbarManager): |
220 """ |
226 """ |
221 Public slot to initialize the VCS toolbar. |
227 Public slot to initialize the VCS toolbar. |
222 |
228 |
223 @param ui reference to the main window (UserInterface) |
229 @param ui reference to the main window |
|
230 @type UserInterface |
224 @param toolbarManager reference to a toolbar manager object |
231 @param toolbarManager reference to a toolbar manager object |
225 (EricToolBarManager) |
232 @type EricToolBarManager |
226 """ |
233 """ |
227 if self.__projectHelperObject: |
234 if self.__projectHelperObject: |
228 self.__projectHelperObject.initToolbar(ui, toolbarManager) |
235 self.__projectHelperObject.initToolbar(ui, toolbarManager) |
229 |
236 |
230 def activate(self): |
237 def activate(self): |
231 """ |
238 """ |
232 Public method to activate this plugin. |
239 Public method to activate this plugin. |
233 |
240 |
234 @return tuple of reference to instantiated viewmanager and |
241 @return tuple of reference to instantiated viewmanager and |
235 activation status (boolean) |
242 activation status |
|
243 @rtype tuple of (Hg, bool) |
236 """ |
244 """ |
237 from eric7.Plugins.VcsPlugins.vcsMercurial.hg import Hg |
245 from eric7.Plugins.VcsPlugins.vcsMercurial.hg import Hg |
238 |
246 |
239 self.__object = Hg(self, self.__ui) |
247 self.__object = Hg(self, self.__ui) |
240 |
248 |
330 def setPreferences(cls, key, value): |
340 def setPreferences(cls, key, value): |
331 """ |
341 """ |
332 Class method to store the various settings. |
342 Class method to store the various settings. |
333 |
343 |
334 @param key the key of the setting to be set |
344 @param key the key of the setting to be set |
|
345 @type str |
335 @param value the value to be set |
346 @param value the value to be set |
|
347 @type Any |
336 """ |
348 """ |
337 Preferences.getSettings().setValue("Mercurial/" + key, value) |
349 Preferences.getSettings().setValue("Mercurial/" + key, value) |
338 |
350 |
339 def getGlobalOptions(self): |
351 def getGlobalOptions(self): |
340 """ |
352 """ |
341 Public method to build a list of global options. |
353 Public method to build a list of global options. |
342 |
354 |
343 @return list of global options (list of string) |
355 @return list of global options |
|
356 @rtype list of str |
344 """ |
357 """ |
345 args = [] |
358 args = [] |
346 if self.getPreferences("Encoding") != self.MercurialDefaults["Encoding"]: |
359 if self.getPreferences("Encoding") != self.MercurialDefaults["Encoding"]: |
347 args.append("--encoding") |
360 args.append("--encoding") |
348 args.append(self.getPreferences("Encoding")) |
361 args.append(self.getPreferences("Encoding")) |
358 |
371 |
359 def getConfigPath(self): |
372 def getConfigPath(self): |
360 """ |
373 """ |
361 Public method to get the filename of the config file. |
374 Public method to get the filename of the config file. |
362 |
375 |
363 @return filename of the config file (string) |
376 @return filename of the config file |
|
377 @rtype str |
364 """ |
378 """ |
365 return getConfigPath() |
379 return getConfigPath() |
366 |
380 |
367 def prepareUninstall(self): |
381 def prepareUninstall(self): |
368 """ |
382 """ |