Sun, 02 May 2010 15:44:42 +0000
Added files forgotten in previous commits.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Plugins.VcsPlugins.vcsMercurial.HgBackoutDialog.html Sun May 02 15:44:42 2010 +0000 @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' +'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> +<html><head> +<title>eric5.Plugins.VcsPlugins.vcsMercurial.HgBackoutDialog</title> +<style> +body { + background:white; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #4FA4FF; } +h2 { color: white; background: #4FA4FF; } +h3 { color: white; background: #00557F; } +h4 { color: white; background: #00557F; } + +a { color: #AA5500; } + +</style> +</head> +<body><a NAME="top" ID="top"></a> +<h1>eric5.Plugins.VcsPlugins.vcsMercurial.HgBackoutDialog</h1> +<p> +Module implementing a dialog to enter the data for a backout operation. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#HgBackoutDialog">HgBackoutDialog</a></td> +<td>Class implementing a dialog to enter the data for a backout operation.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> +<hr /><hr /> +<a NAME="HgBackoutDialog" ID="HgBackoutDialog"></a> +<h2>HgBackoutDialog</h2> +<p> + Class implementing a dialog to enter the data for a backout operation. +</p> +<h3>Derived from</h3> +QDialog, Ui_HgBackoutDialog +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#HgBackoutDialog.__init__">HgBackoutDialog</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#HgBackoutDialog.getParameters">getParameters</a></td> +<td>Public method to retrieve the backout data.</td> +</tr><tr> +<td><a href="#HgBackoutDialog.on_noneButton_toggled">on_noneButton_toggled</a></td> +<td>Private slot to handle the toggling of the None revision button.</td> +</tr> +</table> +<a NAME="HgBackoutDialog.__init__" ID="HgBackoutDialog.__init__"></a> +<h4>HgBackoutDialog (Constructor)</h4> +<b>HgBackoutDialog</b>(<i>tagsList, branchesList, parent = None</i>) +<p> + Constructor +</p><dl> +<dt><i>tagsList</i></dt> +<dd> +list of tags (list of strings) +</dd><dt><i>branchesList</i></dt> +<dd> +list of branches (list of strings) +</dd><dt><i>parent</i></dt> +<dd> +parent widget (QWidget) +</dd> +</dl><a NAME="HgBackoutDialog.getParameters" ID="HgBackoutDialog.getParameters"></a> +<h4>HgBackoutDialog.getParameters</h4> +<b>getParameters</b>(<i></i>) +<p> + Public method to retrieve the backout data. +</p><dl> +<dt>Returns:</dt> +<dd> +tuple naming the revision, a flag indicating a + merge, the commit date, the commit user and a commit message + (string, boolean, string, string, string) +</dd> +</dl><a NAME="HgBackoutDialog.on_noneButton_toggled" ID="HgBackoutDialog.on_noneButton_toggled"></a> +<h4>HgBackoutDialog.on_noneButton_toggled</h4> +<b>on_noneButton_toggled</b>(<i>checked</i>) +<p> + Private slot to handle the toggling of the None revision button. +</p><dl> +<dt><i>checked</i></dt> +<dd> +flag indicating the checked state (boolean) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/VcsPlugins/vcsMercurial/HgBackoutDialog.py Sun May 02 15:44:42 2010 +0000 @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2010 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing a dialog to enter the data for a backout operation. +""" + +from PyQt4.QtCore import pyqtSlot, QDateTime +from PyQt4.QtGui import QDialog, QDialogButtonBox + +from .Ui_HgBackoutDialog import Ui_HgBackoutDialog + +class HgBackoutDialog(QDialog, Ui_HgBackoutDialog): + """ + Class implementing a dialog to enter the data for a backout operation. + """ + def __init__(self, tagsList, branchesList, parent = None): + """ + Constructor + + @param tagsList list of tags (list of strings) + @param branchesList list of branches (list of strings) + @param parent parent widget (QWidget) + """ + QDialog.__init__(self, parent) + self.setupUi(self) + + self.tagCombo.addItems(list(sorted(tagsList))) + self.branchCombo.addItems(list(sorted(["default"] + branchesList))) + + self.okButton = self.buttonBox.button(QDialogButtonBox.Ok) + self.okButton.setEnabled(False) + + self.__initDateTime = QDateTime.currentDateTime() + self.dateEdit.setDateTime(self.__initDateTime) + + @pyqtSlot(bool) + def on_noneButton_toggled(self, checked): + """ + Private slot to handle the toggling of the None revision button. + + @param checked flag indicating the checked state (boolean) + """ + self.okButton.setEnabled(not checked) + + def getParameters(self): + """ + Public method to retrieve the backout data. + + @return tuple naming the revision, a flag indicating a + merge, the commit date, the commit user and a commit message + (string, boolean, string, string, string) + """ + if self.numberButton.isChecked(): + rev = str(self.numberSpinBox.value()) + elif self.idButton.isChecked(): + rev = self.idEdit.text() + elif self.tagButton.isChecked(): + rev = self.tagCombo.currentText() + elif self.branchButton.isChecked(): + rev = self.branchCombo.currentText() + else: + rev = "" + + if self.dateEdit.dateTime() != self.__initDateTime: + date = self.dateEdit.dateTime().toString("yyyy-MM-dd hh:mm") + else: + date = "" + + if self.messageEdit.toPlainText(): + msg = self.messageEdit.toPlainText() + else: + msg = self.trUtf8("Backed out changeset <{0}>.").format(rev) + + return (rev, + self.mergeCheckBox.isChecked, + date, + self.userEdit.text(), + msg + )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/VcsPlugins/vcsMercurial/HgBackoutDialog.ui Sun May 02 15:44:42 2010 +0000 @@ -0,0 +1,363 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>HgBackoutDialog</class> + <widget class="QDialog" name="HgBackoutDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>372</width> + <height>492</height> + </rect> + </property> + <property name="windowTitle"> + <string>Mercurial Revision</string> + </property> + <property name="sizeGripEnabled"> + <bool>true</bool> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QGroupBox" name="revisionGroup"> + <property name="title"> + <string>Revision</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QRadioButton" name="numberButton"> + <property name="toolTip"> + <string>Select to specify a revision by number</string> + </property> + <property name="text"> + <string>Number</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QSpinBox" name="numberSpinBox"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string>Enter a revision number</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight</set> + </property> + <property name="minimum"> + <number>1</number> + </property> + <property name="maximum"> + <number>999999999</number> + </property> + </widget> + </item> + <item row="0" column="2"> + <spacer name="spacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>158</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="0"> + <widget class="QRadioButton" name="idButton"> + <property name="toolTip"> + <string>Select to specify a revision by changeset id</string> + </property> + <property name="text"> + <string>Id:</string> + </property> + </widget> + </item> + <item row="1" column="1" colspan="2"> + <widget class="QLineEdit" name="idEdit"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="toolTip"> + <string>Enter a changeset id</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QRadioButton" name="tagButton"> + <property name="toolTip"> + <string>Select to specify a revision by a tag</string> + </property> + <property name="text"> + <string>Tag:</string> + </property> + </widget> + </item> + <item row="2" column="1" colspan="2"> + <widget class="QComboBox" name="tagCombo"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Enter a tag name</string> + </property> + <property name="editable"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QRadioButton" name="branchButton"> + <property name="toolTip"> + <string>Select to specify a revision by a branch</string> + </property> + <property name="text"> + <string>Branch:</string> + </property> + </widget> + </item> + <item row="3" column="1" colspan="2"> + <widget class="QComboBox" name="branchCombo"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="toolTip"> + <string>Enter a branch name</string> + </property> + <property name="editable"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="4" column="0" colspan="3"> + <widget class="QRadioButton" name="noneButton"> + <property name="toolTip"> + <string>Select to not specify a specific revision</string> + </property> + <property name="text"> + <string>No revision selected</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2"> + <property name="title"> + <string>Commit data</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Commit message:</string> + </property> + </widget> + </item> + <item> + <widget class="QPlainTextEdit" name="messageEdit"> + <property name="toolTip"> + <string>Enter the commit message or leave empty to use the default one</string> + </property> + <property name="tabChangesFocus"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Commit Date:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QDateTimeEdit" name="dateEdit"> + <property name="toolTip"> + <string>Enter optional date for the commit</string> + </property> + <property name="displayFormat"> + <string notr="true">yyyy-MM-dd HH:mm</string> + </property> + <property name="calendarPopup"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Commit User:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLineEdit" name="userEdit"> + <property name="toolTip"> + <string>Enter optional user for the commit</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QCheckBox" name="mergeCheckBox"> + <property name="toolTip"> + <string>Select to merge with parent of the project directory</string> + </property> + <property name="text"> + <string>Merge with current parent</string> + </property> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <tabstops> + <tabstop>numberButton</tabstop> + <tabstop>numberSpinBox</tabstop> + <tabstop>idButton</tabstop> + <tabstop>idEdit</tabstop> + <tabstop>tagButton</tabstop> + <tabstop>tagCombo</tabstop> + <tabstop>branchButton</tabstop> + <tabstop>branchCombo</tabstop> + <tabstop>noneButton</tabstop> + <tabstop>messageEdit</tabstop> + <tabstop>dateEdit</tabstop> + <tabstop>userEdit</tabstop> + <tabstop>mergeCheckBox</tabstop> + <tabstop>buttonBox</tabstop> + </tabstops> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>HgBackoutDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>257</x> + <y>215</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>224</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>HgBackoutDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>325</x> + <y>215</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>224</y> + </hint> + </hints> + </connection> + <connection> + <sender>numberButton</sender> + <signal>toggled(bool)</signal> + <receiver>numberSpinBox</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>48</x> + <y>42</y> + </hint> + <hint type="destinationlabel"> + <x>113</x> + <y>43</y> + </hint> + </hints> + </connection> + <connection> + <sender>idButton</sender> + <signal>toggled(bool)</signal> + <receiver>idEdit</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>38</x> + <y>76</y> + </hint> + <hint type="destinationlabel"> + <x>125</x> + <y>75</y> + </hint> + </hints> + </connection> + <connection> + <sender>tagButton</sender> + <signal>toggled(bool)</signal> + <receiver>tagCombo</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>52</x> + <y>104</y> + </hint> + <hint type="destinationlabel"> + <x>124</x> + <y>99</y> + </hint> + </hints> + </connection> + <connection> + <sender>branchButton</sender> + <signal>toggled(bool)</signal> + <receiver>branchCombo</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>71</x> + <y>127</y> + </hint> + <hint type="destinationlabel"> + <x>123</x> + <y>130</y> + </hint> + </hints> + </connection> + </connections> +</ui>