Plugins/VcsPlugins/vcsMercurial/ShelveExtension/HgShelveDataDialog.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3408
b6e6a7062d12
child 3656
441956d8fce5
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2014 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a dialog to enter the data for a shelve operation.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt4.QtCore import QDateTime
13 from PyQt4.QtGui import QDialog
14
15 from .Ui_HgShelveDataDialog import Ui_HgShelveDataDialog
16
17
18 class HgShelveDataDialog(QDialog, Ui_HgShelveDataDialog):
19 """
20 Class implementing a dialog to enter the data for a shelve operation.
21 """
22 def __init__(self, parent=None):
23 """
24 Constructor
25
26 @param parent reference to the parent widget (QWidget)
27 """
28 super(HgShelveDataDialog, self).__init__(parent)
29 self.setupUi(self)
30
31 self.__initialDateTime = QDateTime.currentDateTime()
32 self.dateTimeEdit.setDateTime(self.__initialDateTime)
33
34 msh = self.minimumSizeHint()
35 self.resize(max(self.width(), msh.width()), msh.height())
36
37 def getData(self):
38 """
39 Public method to get the user data.
40
41 @return tuple containing the name (string), date (QDateTime),
42 message (string) and a flag indicating to add/remove
43 new/missing files (boolean)
44 """
45 if self.dateTimeEdit.dateTime() != self.__initialDateTime:
46 dateTime = self.dateTimeEdit.dateTime()
47 else:
48 dateTime = QDateTime()
49 return (
50 self.nameEdit.text().replace(" ", "_"),
51 dateTime,
52 self.messageEdit.text(),
53 self.addRemoveCheckBox.isChecked(),
54 )

eric ide

mercurial