|
|
|
@ -35,6 +35,7 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
|
QMainWindow(parent), |
|
|
|
|
_typing(false), |
|
|
|
|
_inEventFilter(false) { |
|
|
|
|
setWindowTitle("[*]"); |
|
|
|
|
setupUi(this); |
|
|
|
|
menuViews->addAction(_scriptDock->toggleViewAction()); |
|
|
|
|
menuViews->addAction(_setupScriptDock->toggleViewAction()); |
|
|
|
@ -118,6 +119,8 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
|
+char(out.status()+48)+")"); |
|
|
|
|
_actionSave->setEnabled(true); |
|
|
|
|
_actionRevertToSaved->setEnabled(true); |
|
|
|
|
setWindowModified(false); |
|
|
|
|
setWindowTitle(_filename+"[*]"); |
|
|
|
|
} catch(const std::exception& x) { |
|
|
|
|
QMessageBox::critical(this, tr("Save Failed"), |
|
|
|
|
tr("Saving test script failed, %2. " |
|
|
|
@ -127,11 +130,18 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
|
_status->setCurrentIndex(STATUS_NONE); |
|
|
|
|
} |
|
|
|
|
void on__actionClear_triggered() { |
|
|
|
|
if (isWindowModified() && |
|
|
|
|
QMessageBox::question(this, tr("Changes Not Saved"), |
|
|
|
|
tr("Clear script without saving changes?")) |
|
|
|
|
!= QMessageBox::Yes) |
|
|
|
|
return; |
|
|
|
|
_testscript->clear(); |
|
|
|
|
_log->clear(); |
|
|
|
|
_filename.clear(); |
|
|
|
|
_actionSave->setEnabled(false); |
|
|
|
|
_actionRevertToSaved->setEnabled(false); |
|
|
|
|
setWindowTitle("[*]"); |
|
|
|
|
setWindowModified(false); |
|
|
|
|
_status->setCurrentIndex(STATUS_NONE); |
|
|
|
|
} |
|
|
|
|
void on__run_clicked() { |
|
|
|
@ -332,6 +342,13 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
|
QSettings settings("mrw", "webtester"); |
|
|
|
|
settings.setValue("geometry", saveGeometry()); |
|
|
|
|
settings.setValue("windowstate", saveState()); |
|
|
|
|
if (isWindowModified() && |
|
|
|
|
QMessageBox::question(this, tr("Changes Not Saved"), |
|
|
|
|
tr("Leave without saving changes?")) |
|
|
|
|
!= QMessageBox::Yes) { |
|
|
|
|
event->ignore(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
QMainWindow::closeEvent(event); |
|
|
|
|
} |
|
|
|
|
bool eventFilter(QObject*, QEvent* event) { |
|
|
|
@ -442,6 +459,8 @@ class TestGUI: public QMainWindow, protected Ui::TestGUI { |
|
|
|
|
_filename = name; |
|
|
|
|
_actionSave->setEnabled(true); |
|
|
|
|
_actionRevertToSaved->setEnabled(true); |
|
|
|
|
setWindowTitle(name+"[*]"); |
|
|
|
|
setWindowModified(false); |
|
|
|
|
} catch(const std::exception& x) { |
|
|
|
|
QMessageBox::critical(this, tr("Open Failed"), |
|
|
|
|
tr("Reading test script failed, %2. " |
|
|
|
|