eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigDialog.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8327
666c2b81cbb7
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
12 import contextlib 12 import contextlib
13 13
14 from PyQt6.QtCore import pyqtSlot, Qt, QEvent 14 from PyQt6.QtCore import pyqtSlot, Qt, QEvent
15 from PyQt6.QtWidgets import QDialog, QTreeWidgetItem 15 from PyQt6.QtWidgets import QDialog, QTreeWidgetItem
16 16
17 from E5Gui.E5PathPicker import E5PathPickerModes 17 from E5Gui.EricPathPicker import EricPathPickerModes
18 from E5Gui import E5MessageBox 18 from E5Gui import EricMessageBox
19 19
20 import Globals 20 import Globals
21 21
22 from .HgUtilities import getConfigPath 22 from .HgUtilities import getConfigPath
23 from .HgUserConfigHostFingerprintDialog import ( 23 from .HgUserConfigHostFingerprintDialog import (
54 "tls1.0": self.tr("TLS 1.0"), 54 "tls1.0": self.tr("TLS 1.0"),
55 "tls1.1": self.tr("TLS 1.1"), 55 "tls1.1": self.tr("TLS 1.1"),
56 "tls1.2": self.tr("TLS 1.2"), 56 "tls1.2": self.tr("TLS 1.2"),
57 } 57 }
58 58
59 self.lfUserCachePicker.setMode(E5PathPickerModes.DIRECTORY_MODE) 59 self.lfUserCachePicker.setMode(EricPathPickerModes.DIRECTORY_MODE)
60 if Globals.isLinuxPlatform(): 60 if Globals.isLinuxPlatform():
61 self.lfUserCachePicker.setDefaultDirectory(os.path.expanduser( 61 self.lfUserCachePicker.setDefaultDirectory(os.path.expanduser(
62 "~/.cache/largefiles")) 62 "~/.cache/largefiles"))
63 elif Globals.isMacPlatform(): 63 elif Globals.isMacPlatform():
64 self.lfUserCachePicker.setDefaultDirectory(os.path.expanduser( 64 self.lfUserCachePicker.setDefaultDirectory(os.path.expanduser(
535 Private slot to delete the current fingerprints item. 535 Private slot to delete the current fingerprints item.
536 """ 536 """
537 itm = self.fingerprintsList.currentItem() 537 itm = self.fingerprintsList.currentItem()
538 if itm is not None: 538 if itm is not None:
539 host = itm.text(0) 539 host = itm.text(0)
540 yes = E5MessageBox.yesNo( 540 yes = EricMessageBox.yesNo(
541 self, 541 self,
542 self.tr("Delete Host Fingerprint"), 542 self.tr("Delete Host Fingerprint"),
543 self.tr("""<p>Shall the fingerprint for host <b>{0}</b>""" 543 self.tr("""<p>Shall the fingerprint for host <b>{0}</b>"""
544 """ really be deleted?</p>""").format(host)) 544 """ really be deleted?</p>""").format(host))
545 if yes: 545 if yes:
647 Private slot to delete the current minimum protocol item. 647 Private slot to delete the current minimum protocol item.
648 """ 648 """
649 itm = self.protocolsList.currentItem() 649 itm = self.protocolsList.currentItem()
650 if itm is not None: 650 if itm is not None:
651 host = itm.text(0) 651 host = itm.text(0)
652 yes = E5MessageBox.yesNo( 652 yes = EricMessageBox.yesNo(
653 self, 653 self,
654 self.tr("Delete Host Minimum Protocol"), 654 self.tr("Delete Host Minimum Protocol"),
655 self.tr("""<p>Shall the minimum protocol entry for host""" 655 self.tr("""<p>Shall the minimum protocol entry for host"""
656 """ <b>{0}</b> really be deleted?</p>""").format(host)) 656 """ <b>{0}</b> really be deleted?</p>""").format(host))
657 if yes: 657 if yes:
705 Private slot to open the user configuration file in a text editor. 705 Private slot to open the user configuration file in a text editor.
706 """ 706 """
707 from QScintilla.MiniEditor import MiniEditor 707 from QScintilla.MiniEditor import MiniEditor
708 cfgFile = getConfigPath() 708 cfgFile = getConfigPath()
709 709
710 yes = E5MessageBox.yesNo( 710 yes = EricMessageBox.yesNo(
711 self, 711 self,
712 self.tr("Edit User Configuration"), 712 self.tr("Edit User Configuration"),
713 self.tr("""You will loose all changes made in this dialog.""" 713 self.tr("""You will loose all changes made in this dialog."""
714 """ Shall the data be saved first?"""), 714 """ Shall the data be saved first?"""),
715 icon=E5MessageBox.Warning, 715 icon=EricMessageBox.Warning,
716 yesDefault=True) 716 yesDefault=True)
717 if yes: 717 if yes:
718 self.writeUserConfig() 718 self.writeUserConfig()
719 719
720 self.__editor = MiniEditor(cfgFile, "Properties", self) 720 self.__editor = MiniEditor(cfgFile, "Properties", self)

eric ide

mercurial