diff --git a/batchprint.pyw b/batchprint.pyw index 76feba5..973d0e5 100755 --- a/batchprint.pyw +++ b/batchprint.pyw @@ -608,6 +608,20 @@ class mainWindow(QMainWindow): writeConfigFile("lastProfile.txt",self.cProfileDropdown.currentText()) windows.remove(self) +def onFocusChanged(old,current): + if type(current) == QLineEdit: + def f(): + try: + current.selectAll() + except: + pass + + global markTimer + markTimer = QTimer() + markTimer.setSingleShot(True) + markTimer.timeout.connect(f) + markTimer.start(0) + windows = [] def main(): if not os.path.isdir(p(configDir,"profiles")): @@ -617,6 +631,7 @@ def main(): saveProfile(defaultProfile,"default") app = QApplication(sys.argv) + app.focusChanged.connect(onFocusChanged) windows.append(mainWindow()) app.exec_() main()