eric6/Plugins/VcsPlugins/vcsMercurial/HgRepoConfigDataDialog.py

Sun, 12 Apr 2020 19:07:49 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 12 Apr 2020 19:07:49 +0200
changeset 7533
88261c96484b
parent 7360
9190402e4505
child 7780
41420f82c0ac
permissions
-rw-r--r--

Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.

3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7360
9190402e4505 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
3 # Copyright (c) 2010 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
4543
2e6a880670e9 Fixed a few code style issues (forgotten future imports, copyrights,...).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
4 #
2e6a880670e9 Fixed a few code style issues (forgotten future imports, copyrights,...).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
5
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing a dialog to enter data needed for the initial creation
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 of a repository configuration file (hgrc).
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3311
diff changeset
11
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
12 from PyQt5.QtCore import pyqtSlot, QUrl
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
13 from PyQt5.QtWidgets import QDialog, QLineEdit
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 from .Ui_HgRepoConfigDataDialog import Ui_HgRepoConfigDataDialog
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 import UI.PixmapCache
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
19 from .LargefilesExtension import getDefaults as getLargefilesDefaults
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
20
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 class HgRepoConfigDataDialog(QDialog, Ui_HgRepoConfigDataDialog):
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 Class implementing a dialog to enter data needed for the initial creation
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 of a repository configuration file (hgrc).
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
27 def __init__(self, withLargefiles=False, largefilesData=None, parent=None):
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 Constructor
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
31 @param withLargefiles flag indicating to configure the largefiles
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
32 section (boolean)
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
33 @param largefilesData dictionary with data for the largefiles
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
34 section (dict)
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @param parent reference to the parent widget (QWidget)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3311
diff changeset
37 super(HgRepoConfigDataDialog, self).__init__(parent)
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.setupUi(self)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.defaultShowPasswordButton.setIcon(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
41 UI.PixmapCache.getIcon("showPassword"))
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 self.defaultPushShowPasswordButton.setIcon(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
43 UI.PixmapCache.getIcon("showPassword"))
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
45 self.__withLargefiles = withLargefiles
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
46 if withLargefiles:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
47 if largefilesData is None:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
48 largefilesData = getLargefilesDefaults()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
49 self.lfFileSizeSpinBox.setValue(largefilesData["minsize"])
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
50 self.lfFilePatternsEdit.setText(
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
51 " ".join(largefilesData["pattern"]))
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
52 else:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
53 self.largefilesGroup.setVisible(False)
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
54
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 self.resize(self.width(), self.minimumSizeHint().height())
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 @pyqtSlot(bool)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 def on_defaultShowPasswordButton_clicked(self, checked):
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 Private slot to switch the default password visibility
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 of the default password.
3246
4cd58a0d6c28 Some code style fixes and renaming of UtilitiesPython2.py2flakes to UtilitiesPython2.pyflakes to make it clear, that it is just a copy of the one in Utilities.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3231
diff changeset
62
4cd58a0d6c28 Some code style fixes and renaming of UtilitiesPython2.py2flakes to UtilitiesPython2.pyflakes to make it clear, that it is just a copy of the one in Utilities.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3231
diff changeset
63 @param checked state of the push button (boolean)
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 if checked:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 self.defaultPasswordEdit.setEchoMode(QLineEdit.Normal)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 else:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 self.defaultPasswordEdit.setEchoMode(QLineEdit.Password)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 @pyqtSlot(bool)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 def on_defaultPushShowPasswordButton_clicked(self, checked):
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 Private slot to switch the default password visibility
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 of the default push password.
3246
4cd58a0d6c28 Some code style fixes and renaming of UtilitiesPython2.py2flakes to UtilitiesPython2.pyflakes to make it clear, that it is just a copy of the one in Utilities.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3231
diff changeset
75
4cd58a0d6c28 Some code style fixes and renaming of UtilitiesPython2.py2flakes to UtilitiesPython2.pyflakes to make it clear, that it is just a copy of the one in Utilities.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3231
diff changeset
76 @param checked state of the push button (boolean)
3231
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 if checked:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 self.defaultPushPasswordEdit.setEchoMode(QLineEdit.Normal)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 else:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 self.defaultPushPasswordEdit.setEchoMode(QLineEdit.Password)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 def getData(self):
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 Public method to get the data entered into the dialog.
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 @return tuple giving the default and default push URLs (tuple of
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 two strings)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 """
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 defaultUrl = QUrl.fromUserInput(self.defaultUrlEdit.text())
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 username = self.defaultUserEdit.text()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 password = self.defaultPasswordEdit.text()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 if username:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 defaultUrl.setUserName(username)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 if password:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 defaultUrl.setPassword(password)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 if not defaultUrl.isValid():
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 defaultUrl = ""
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 else:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 defaultUrl = defaultUrl.toString()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 defaultPushUrl = QUrl.fromUserInput(self.defaultPushUrlEdit.text())
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 username = self.defaultPushUserEdit.text()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 password = self.defaultPushPasswordEdit.text()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 if username:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 defaultPushUrl.setUserName(username)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 if password:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 defaultPushUrl.setPassword(password)
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 if not defaultPushUrl.isValid():
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 defaultPushUrl = ""
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 else:
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 defaultPushUrl = defaultPushUrl.toString()
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113
a7c9914d1c41 Added dialogs to enter the contents for initial .hgrc/mercurial.ini and .hg/hgrc files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 return defaultUrl, defaultPushUrl
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
115
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
116 def getLargefilesData(self):
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
117 """
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
118 Public method to get the data for the largefiles extension.
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
119
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
120 @return tuple with the minimum file size (integer) and file patterns
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
121 (list of string). None as value denote to use the default value.
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
122 """
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
123 if self.__withLargefiles:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
124 lfDefaults = getLargefilesDefaults()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
125 if self.lfFileSizeSpinBox.value() == lfDefaults["minsize"]:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
126 minsize = None
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
127 else:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
128 minsize = self.lfFileSizeSpinBox.value()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
129 patterns = self.lfFilePatternsEdit.text().split()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
130 if set(patterns) == set(lfDefaults["pattern"]):
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
131 patterns = None
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
132
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
133 return minsize, patterns
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
134 else:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
135 return None, None

eric ide

mercurial