Esempio n. 1
0
 def on_oneShotEval_clicked(self):
     expr, ok = QInputDialog.getText(self, 'Evaluate an expression',
                                     'Expression to evaluate:')
     if not ok:
         return
     ret = self.client.eval(expr, stringify=True)
     QMessageBox.information(self, 'Result', ret)
Esempio n. 2
0
 def on_addWatch_clicked(self):
     expr, ok = QInputDialog.getText(self, 'Add watch expression',
                                     'New expression to watch:')
     if not ok:
         return
     newexpr = [expr + ':default']
     self.client.tell('watch', newexpr)
Esempio n. 3
0
 def on_actionFix_triggered(self):
     reason, ok = QInputDialog.getText(
         self, 'Fix',
         'Please enter the reason for fixing %s:' % self.devname)
     if not ok:
         return
     self.device_panel.exec_command('fix(%s, %r)' % (self.devrepr, reason))
Esempio n. 4
0
 def on_actionNewSample_triggered(self):
     name, ok = QInputDialog.getText(self, 'New sample',
                                     'Please enter the new sample name:')
     if not ok or not name:
         return
     self.client.eval('NewSample(%r)' % name)
     self.timer.start(750)
Esempio n. 5
0
 def on_actionFix_triggered(self):
     if self._menu_dev:
         reason, ok = QInputDialog.getText(
             self, 'Fix',
             'Please enter the reason for fixing %s:' % self._menu_dev)
         if not ok:
             return
         self.exec_command('fix(%s, %r)' % (srepr(self._menu_dev), reason))
Esempio n. 6
0
 def on_actionAddRemark_triggered(self):
     remark, ok = QInputDialog.getText(
         self, 'New remark',
         'Please enter the remark.  The remark will be added to the logbook '
         'as a heading and will also appear in the data files.')
     if not ok or not remark:
         return
     self.client.eval('Remark(%r)' % remark)
     self.timer.start(750)
Esempio n. 7
0
 def on_actionUpdate_triggered(self):
     script = self.validateScript()
     if script is None:
         return
     if not self.checkDirty(self.currentEditor, askonly=True):
         return
     reason, ok = QInputDialog.getText(
         self, 'Update reason', 'For the logbook, you can enter a reason '
         'for the update here:', text='no reason specified')
     if not ok:
         return
     self.client.tell('update', script, reason)