eric6/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py

Wed, 30 Dec 2020 11:00:44 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Dec 2020 11:00:44 +0100
branch
maintenance
changeset 7924
8a96736d465e
parent 7780
41420f82c0ac
child 8143
2c730d5fd177
permissions
-rw-r--r--

Updated copyright for 2021.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7924
8a96736d465e Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2002 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2452
diff changeset
7 Module implementing the Subversion Options Dialog for a new project from the
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2452
diff changeset
8 repository.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 import os
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
13 from PyQt5.QtCore import QDir, pyqtSlot
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
14 from PyQt5.QtWidgets import QDialog, QDialogButtonBox
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
16 from E5Gui.E5PathPicker import E5PathPickerModes
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
18 from .Ui_SvnNewProjectOptionsDialog import Ui_SvnNewProjectOptionsDialog
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
19 from .Config import ConfigSvnProtocols
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 import Utilities
1939
eadb2328d7d4 Introduced a "workspace" directory that is used as the default for opening or saving new files or projects (configurable on Multiproject config page).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1878
diff changeset
22 import Preferences
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
23
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
24
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 class SvnNewProjectOptionsDialog(QDialog, Ui_SvnNewProjectOptionsDialog):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
3009
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2452
diff changeset
27 Class implementing the Options Dialog for a new project from the
bf5ae5d7477d Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2452
diff changeset
28 repository.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
30 def __init__(self, vcs, parent=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 @param vcs reference to the version control object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 @param parent parent widget (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2452
diff changeset
37 super(SvnNewProjectOptionsDialog, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.setupUi(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
40 self.vcsProjectDirPicker.setMode(E5PathPickerModes.DirectoryMode)
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
41 self.vcsUrlPicker.setMode(E5PathPickerModes.DirectoryMode)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 self.protocolCombo.addItems(ConfigSvnProtocols)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 hd = Utilities.toNativeSeparators(QDir.homePath())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 hd = os.path.join(hd, 'subversionroot')
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
47 self.vcsUrlPicker.setText(hd)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 self.vcs = vcs
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 self.localPath = hd
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.networkPath = "localhost/"
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 self.localProtocol = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
55 ipath = (
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
56 Preferences.getMultiProject("Workspace") or
3334
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
57 Utilities.getHomeDir()
7260
4cc6f121119a Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
58 )
3334
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
59 self.__initPaths = [
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
60 Utilities.fromNativeSeparators(ipath),
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
61 Utilities.fromNativeSeparators(ipath) + "/",
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
62 ]
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
63 self.vcsProjectDirPicker.setText(self.__initPaths[0])
3334
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
64
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
65 self.resize(self.width(), self.minimumSizeHint().height())
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
66
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
67 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
3366
6084bb3c3911 Made some changes to have a bunch of dialogs with correct sizes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3334
diff changeset
68
6084bb3c3911 Made some changes to have a bunch of dialogs with correct sizes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3334
diff changeset
69 msh = self.minimumSizeHint()
6084bb3c3911 Made some changes to have a bunch of dialogs with correct sizes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3334
diff changeset
70 self.resize(max(self.width(), msh.width()), msh.height())
3334
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
71
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
72 @pyqtSlot(str)
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
73 def on_vcsProjectDirPicker_textChanged(self, txt):
3334
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
74 """
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
75 Private slot to handle a change of the project directory.
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
76
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
77 @param txt name of the project directory (string)
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
78 """
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
79 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
80 bool(txt) and
a75328ebac64 Fixed an issue creating new projects.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
81 Utilities.fromNativeSeparators(txt) not in self.__initPaths)
1939
eadb2328d7d4 Introduced a "workspace" directory that is used as the default for opening or saving new files or projects (configurable on Multiproject config page).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1878
diff changeset
82
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 @pyqtSlot()
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
84 def on_vcsUrlPicker_pickerButtonClicked(self):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 """
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
86 Private slot to display a repository browser dialog.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 """
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
88 from .SvnRepoBrowserDialog import SvnRepoBrowserDialog
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
89 dlg = SvnRepoBrowserDialog(self.vcs, mode="select", parent=self)
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
90 dlg.start(
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
91 self.protocolCombo.currentText() + self.vcsUrlPicker.text())
7759
51aa6c6b66f7 Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
92 if dlg.exec() == QDialog.Accepted:
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
93 url = dlg.getSelectedUrl()
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
94 if url:
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
95 protocol = url.split("://")[0]
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
96 path = url.split("://")[1]
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
97 self.protocolCombo.setCurrentIndex(
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
98 self.protocolCombo.findText(protocol + "://"))
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
99 self.vcsUrlPicker.setText(path)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 def on_layoutCheckBox_toggled(self, checked):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 Private slot to handle the change of the layout checkbox.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 @param checked flag indicating the state of the checkbox (boolean)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 self.vcsTagLabel.setEnabled(checked)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 self.vcsTagEdit.setEnabled(checked)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 if not checked:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 self.vcsTagEdit.clear()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 @pyqtSlot(str)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 def on_protocolCombo_activated(self, protocol):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 Private slot to switch the status of the directory selection button.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 @param protocol name of the selected protocol (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 if protocol == "file://":
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
120 self.networkPath = self.vcsUrlPicker.text()
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
121 self.vcsUrlPicker.setText(self.localPath)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
122 self.vcsUrlLabel.setText(self.tr("Pat&h:"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123 self.localProtocol = True
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
124 self.vcsUrlPicker.setMode(E5PathPickerModes.DirectoryMode)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 if self.localProtocol:
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
127 self.localPath = self.vcsUrlPicker.text()
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
128 self.vcsUrlPicker.setText(self.networkPath)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
129 self.vcsUrlLabel.setText(self.tr("&URL:"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 self.localProtocol = False
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
131 self.vcsUrlPicker.setMode(E5PathPickerModes.CustomMode)
2452
fd1cd8a279db Changed logic of the Subversion options dialogs to disallow entering of the protocol in the URL field.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2406
diff changeset
132
fd1cd8a279db Changed logic of the Subversion options dialogs to disallow entering of the protocol in the URL field.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2406
diff changeset
133 @pyqtSlot(str)
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
134 def on_vcsUrlPicker_textChanged(self, txt):
2452
fd1cd8a279db Changed logic of the Subversion options dialogs to disallow entering of the protocol in the URL field.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2406
diff changeset
135 """
fd1cd8a279db Changed logic of the Subversion options dialogs to disallow entering of the protocol in the URL field.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2406
diff changeset
136 Private slot to handle changes of the URL.
fd1cd8a279db Changed logic of the Subversion options dialogs to disallow entering of the protocol in the URL field.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2406
diff changeset
137
fd1cd8a279db Changed logic of the Subversion options dialogs to disallow entering of the protocol in the URL field.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2406
diff changeset
138 @param txt current text of the line edit (string)
fd1cd8a279db Changed logic of the Subversion options dialogs to disallow entering of the protocol in the URL field.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2406
diff changeset
139 """
fd1cd8a279db Changed logic of the Subversion options dialogs to disallow entering of the protocol in the URL field.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2406
diff changeset
140 enable = "://" not in txt
fd1cd8a279db Changed logic of the Subversion options dialogs to disallow entering of the protocol in the URL field.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2406
diff changeset
141 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 def getData(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 Public slot to retrieve the data entered into the dialog.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147 @return a tuple of a string (project directory) and a dictionary
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 containing the data entered.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 scheme = self.protocolCombo.currentText()
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
151 url = self.vcsUrlPicker.text()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 vcsdatadict = {
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
153 "url": '{0}{1}'.format(scheme, url),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
154 "tag": self.vcsTagEdit.text(),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
155 "standardLayout": self.layoutCheckBox.isChecked(),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156 }
4597
46be8d9c4dd8 Modified more dialogs to use the path picker widgets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
157 return (self.vcsProjectDirPicker.text(), vcsdatadict)

eric ide

mercurial