Commits

Steve Borho  committed 1a6ab32 Merge

Merge with stable

  • Participants
  • Parent commits 93d645e, ef73155

Comments (0)

Files changed (6)

File tortoisehg/hgqt/customtools.py

         # Enable drag and drop to reorder the tools
         self.setDragEnabled(True)
         self.setDragDropMode(self.InternalMove)
-        self.setDefaultDropAction(Qt.MoveAction)
+        if PYQT_VERSION >= 0x40700:
+            self.setDefaultDropAction(Qt.MoveAction)
 
     def _guidef2toollist(self, guidef):
         toollist = []

File tortoisehg/hgqt/reporegistry.py

         self.setAcceptDrops(True)
         self.setAutoScroll(True)
         self.setDragDropMode(QAbstractItemView.DragDrop)
-        if PYQT_VERSION_STR.split('.') >= ['4', '7']:
+        if PYQT_VERSION >= 0x40700:
             self.setDefaultDropAction(Qt.MoveAction)
         self.setDropIndicatorShown(True)
         self.setEditTriggers(QAbstractItemView.DoubleClicked

File tortoisehg/hgqt/repotreemodel.py

     xw.writeEndDocument()
 
 def readXml(source, rootElementName):
-    if PYQT_VERSION_STR.split('.') < ['4', '7']:
+    if PYQT_VERSION < 0x40700:
         return
     itemread = None
     xr = QXmlStreamReader(source)

File tortoisehg/hgqt/repoview.py

         self.htmlDelegate = htmldelegate.HTMLDelegate(self)
 
         self.setAcceptDrops(True)
-        if PYQT_VERSION_STR.split('.') >= ['4', '7']:
+        if PYQT_VERSION >= 0x40700:
             self.setDefaultDropAction(Qt.MoveAction)
         self.setDragEnabled(True)
         self.setDropIndicatorShown(True)

File tortoisehg/hgqt/settings.py

 def genIntEditCombo(opts):
     'EditCombo, only allows integer values'
     opts['canedit'] = True
-    opts['validator'] = QIntValidator()
+    opts['validator'] = QIntValidator(None)  # missing parent=None on PyQt4.6
     return SettingsCombo(**opts)
 
 def genLineEditBox(opts):
         tophbox.addWidget(reload)
 
         bothbox = QHBoxLayout()
-        layout.addLayout(bothbox, stretch=8)
+        layout.addLayout(bothbox, 8)
         pageList = QListWidget()
         pageList.setResizeMode(QListView.Fixed)
         stack = QStackedWidget()
 
         desctext = QTextBrowser()
         desctext.setOpenExternalLinks(True)
-        layout.addWidget(desctext, stretch=2)
+        layout.addWidget(desctext, 2)
         self.desctext = desctext
 
         self.settings = QSettings()

File tortoisehg/hgqt/update.py

 
                 dlg = QMessageBox(QMessageBox.Question, _('Confirm Update'),
                                   '', QMessageBox.Cancel, self)
-                buttons = {}
+                buttonnames = {}
                 for name in opts:
                     label, desc = data[name]
                     msg += '\n'
                     msg += desc
-                    buttons[name] = dlg.addButton(label, QMessageBox.ActionRole)
+                    btn = dlg.addButton(label, QMessageBox.ActionRole)
+                    buttonnames[btn] = name
                 dlg.setDefaultButton(QMessageBox.Cancel)
                 dlg.setText(msg)
                 dlg.exec_()
-                return buttons, dlg.clickedButton(), opts
+                clicked = buttonnames.get(dlg.clickedButton())
+                return clicked
 
             # If merge-by-default, we want to merge whenever possible,
             # without prompting user (similar to command-line behavior)
             if clean:
                 cmdline.append('--check')
             elif not (defaultmerge and islocalmerge(cur, node, clean)):
-                buttons, clicked, options = confirmupdate(clean)
-                if buttons['discard'] == clicked:
+                clicked = confirmupdate(clean)
+                if clicked == 'discard':
                     cmdline.append('--clean')
-                elif 'shelve' in options and buttons['shelve'] == clicked:
+                elif clicked == 'shelve':
                     from tortoisehg.hgqt import shelve
                     dlg = shelve.ShelveDialog(self.repo, self)
                     dlg.finished.connect(dlg.deleteLater)
                     dlg.exec_()
                     return
-                elif 'merge' in options and buttons['merge'] == clicked:
+                elif clicked == 'merge':
                     pass # no args
                 else:
                     return