Commits

Steve Borho committed 150a847

run: catch and handle ConfigError as safely as possible (closes #641)

  • Participants
  • Parent commits d8f38e4
  • Branches stable

Comments (0)

Files changed (2)

tortoisehg/hgqt/bugreport.py

         bb = QDialogButtonBox(QDialogButtonBox.Close, centerButtons=True)
         bb.rejected.connect(self.reject)
         self.layout().addWidget(bb)
+        desktopgeom = qApp.desktop().availableGeometry()
+        self.resize(desktopgeom.size() * 0.20)
 
     @pyqtSlot(QString)
     def _openlink(self, ref):
             # A chicken-egg problem here, we need a ui to get your
             # editor in order to repair your ui config file.
             wctxactions.edit(self, ui.ui(), None, [fname], lineno, None)
+        if ref.startswith('#fix:'):
+            from tortoisehg.hgqt import settings
+            errtext = ref[5:].split(' ')[0]
+            sd = settings.SettingsDialog(configrepo=False, focus=errtext,
+                                parent=self, root='')
+            sd.exec_()
 
 def run(ui, *pats, **opts):
     return BugReport(opts)

tortoisehg/hgqt/run.py

         error.RepoLookupError: _('Try refreshing your repository.'),
         error.ParseError: _('Error string "%(arg0)s" at %(arg1)s<br>Please '
                             '<a href="#edit:%(arg1)s">edit</a> your config'),
+        error.ConfigError: _('Configuration Error: "%(arg0)s", please '
+                             '<a href="#fix:%(arg0)s">fix</a> your config'),
         }
 
     def __init__(self):