eric6/Plugins/VcsPlugins/vcsMercurial/HgRepoConfigDataDialog.py

Tue, 02 Mar 2021 17:17:09 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 02 Mar 2021 17:17:09 +0100
changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
permissions
-rw-r--r--

Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.

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
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2010 - 2021 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
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
11 from PyQt5.QtCore import pyqtSlot, QUrl
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
12 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
13
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 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
15
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 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
17
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
18 from .LargefilesExtension import getDefaults as getLargefilesDefaults
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
19
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
20
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 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
22 """
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 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
24 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
25 """
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
26 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
27 """
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 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
29
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
30 @param withLargefiles flag indicating to configure the largefiles
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
31 section (boolean)
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
32 @param largefilesData dictionary with data for the largefiles
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
33 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
34 @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
35 """
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3311
diff changeset
36 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
37 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
38
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 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
40 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
41 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
42 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
43
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
44 self.__withLargefiles = withLargefiles
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
45 if withLargefiles:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
46 if largefilesData is None:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
47 largefilesData = getLargefilesDefaults()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
48 self.lfFileSizeSpinBox.setValue(largefilesData["minsize"])
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
49 self.lfFilePatternsEdit.setText(
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
50 " ".join(largefilesData["pattern"]))
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
51 else:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
52 self.largefilesGroup.setVisible(False)
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
53
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
54 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
55
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 @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
57 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
58 """
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 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
60 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
61
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 @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
63 """
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 if checked:
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
65 self.defaultPasswordEdit.setEchoMode(QLineEdit.EchoMode.Normal)
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
66 else:
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
67 self.defaultPasswordEdit.setEchoMode(QLineEdit.EchoMode.Password)
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
68
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 @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
70 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
71 """
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 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
73 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
74
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 @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
76 """
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 if checked:
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
78 self.defaultPushPasswordEdit.setEchoMode(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
79 QLineEdit.EchoMode.Normal)
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
80 else:
8143
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
81 self.defaultPushPasswordEdit.setEchoMode(
2c730d5fd177 Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
82 QLineEdit.EchoMode.Password)
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
83
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 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
85 """
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 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
87
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 @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
89 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
90 """
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 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
92 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
93 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
94 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
95 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
96 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
97 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
98 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
99 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
100 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
101 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
102
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 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
104 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
105 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
106 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
107 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
108 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
109 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
110 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
111 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
112 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
113 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
114
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
115 return defaultUrl, defaultPushUrl
3311
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
116
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
117 def getLargefilesData(self):
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
118 """
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
119 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
120
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
121 @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
122 (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
123 """
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
124 if self.__withLargefiles:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
125 lfDefaults = getLargefilesDefaults()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
126 if self.lfFileSizeSpinBox.value() == lfDefaults["minsize"]:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
127 minsize = None
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
128 else:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
129 minsize = self.lfFileSizeSpinBox.value()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
130 patterns = self.lfFilePatternsEdit.text().split()
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
131 if set(patterns) == set(lfDefaults["pattern"]):
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
132 patterns = None
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
133
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
134 return minsize, patterns
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
135 else:
b4775920f5b8 Continued implementing Mercurial lfconvert functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3246
diff changeset
136 return None, None

eric ide

mercurial