mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-04 01:57:54 +00:00
Provides user feedback upon improper command-line usage.
This commit is contained in:
parent
7c05b1788e
commit
71c3f58c99
@ -45,7 +45,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||||||
|
|
||||||
MainWindow::MainWindow(const QString &fileName) {
|
MainWindow::MainWindow(const QString &fileName) {
|
||||||
init();
|
init();
|
||||||
launchFile(fileName);
|
if(!launchFile(fileName)) {
|
||||||
|
setUIPhase(UIPhase::SelectingMachine);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::deleteMachine() {
|
void MainWindow::deleteMachine() {
|
||||||
@ -210,11 +212,17 @@ void MainWindow::insertFile(const QString &fileName) {
|
|||||||
mediaTarget->insert_media(media);
|
mediaTarget->insert_media(media);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::launchFile(const QString &fileName) {
|
bool MainWindow::launchFile(const QString &fileName) {
|
||||||
targets = Analyser::Static::GetTargets(fileName.toStdString());
|
targets = Analyser::Static::GetTargets(fileName.toStdString());
|
||||||
if(!targets.empty()) {
|
if(!targets.empty()) {
|
||||||
openFileName = QFileInfo(fileName).fileName();
|
openFileName = QFileInfo(fileName).fileName();
|
||||||
launchMachine();
|
launchMachine();
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
QMessageBox msgBox;
|
||||||
|
msgBox.setText("Unable to open file: " + fileName);
|
||||||
|
msgBox.exec();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ class MainWindow : public QMainWindow, public Outputs::Speaker::Speaker::Delegat
|
|||||||
QAction *insertAction = nullptr;
|
QAction *insertAction = nullptr;
|
||||||
void insertFile(const QString &fileName);
|
void insertFile(const QString &fileName);
|
||||||
|
|
||||||
void launchFile(const QString &fileName);
|
bool launchFile(const QString &fileName);
|
||||||
void launchTarget(std::unique_ptr<Analyser::Static::Target> &&);
|
void launchTarget(std::unique_ptr<Analyser::Static::Target> &&);
|
||||||
|
|
||||||
void restoreSelections();
|
void restoreSelections();
|
||||||
|
Loading…
Reference in New Issue
Block a user