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

cmdui: now Dialog can show/hide command output

Since cmdui.Dialog should be resizable, we cannot use
`setSizeConstraint(QLayout.SetFixedSize)`, described at
http://doc.qt.nokia.com/4.5/dialogs-extension.html

Instead, it uses adjustSize() for every visibility change.

Changeset ff1cfb77b931

Parent 3729ac795497

by Yuya Nishihara

Changes to one file · Browse files at ff1cfb77b931 Showing diff from parent 3729ac795497 Diff from another changeset...

 
272
273
274
 
 
 
 
 
 
275
276
277
 
284
285
286
 
 
 
 
 
 
 
 
 
 
287
288
289
 
272
273
274
275
276
277
278
279
280
281
282
283
 
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
@@ -272,6 +272,12 @@
  self.cancel_btn.clicked.connect(self.cancel_clicked)   self.close_btn = buttons.addButton(QDialogButtonBox.Close)   self.close_btn.clicked.connect(self.reject) + self.detail_btn = buttons.addButton(_('Detail'), + QDialogButtonBox.ResetRole) + self.detail_btn.setAutoDefault(False) + self.detail_btn.setCheckable(True) + self.detail_btn.setChecked(True) + self.detail_btn.toggled.connect(self.show_output)   grid.addWidget(buttons, 7, 0)     self.setLayout(grid) @@ -284,6 +290,16 @@
  # start command   self.core.run(cmdline)   + def show_output(self, visible): + """show/hide command output""" + self.core.output_text.setVisible(visible) + self.detail_btn.setChecked(visible) + + # workaround to adjust only window height + self.setMinimumWidth(self.width()) + self.adjustSize() + self.setMinimumWidth(0) +   ### Private Method ###     def reject(self):