Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

bugreport: fix saving to file

Changeset 77d356899c92

Parent 9650ad98b240

by Steve Borho

Changes to one file · Browse files at 77d356899c92 Showing diff from parent 9650ad98b240 Diff from another changeset...

 
20
21
22
 
 
23
24
25
26
 
27
28
29
 
75
76
77
78
79
 
 
 
 
 
 
 
80
81
82
 
20
21
22
23
24
25
26
27
 
28
29
30
31
 
77
78
79
 
 
80
81
82
83
84
85
86
87
88
89
@@ -20,10 +20,12 @@
  def __init__(self, opts, parent=None):   super(BugReport, self).__init__(parent)   + self.text = self.gettext(opts) +   layout = QtGui.QVBoxLayout()     te = QtGui.QTextEdit() - te.setPlainText(self.gettext(opts)) + te.setPlainText(self.text)   te.setReadOnly(True)   te.setWordWrapMode(QtGui.QTextOption.NoWrap)   layout.addWidget(te) @@ -75,8 +77,13 @@
  def save(self):   try:   fd = QtGui.QFileDialog(self) - open(fd.getOpenFileName()).write(self.text) - except (OSError, IOError), e: + fname = fd.getSaveFileName(self, + _('Save error report to'), + os.path.join(os.getcwd(), 'bugreport.txt'), + _('Text files (*.txt)')) + if fname: + open(fname, 'wb').write(self.text) + except (EnvironmentError), e:   print e    def run(ui, *pats, **opts):