Steve Borho avatar Steve Borho committed 150a847

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

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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.