summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainwindow.cc14
-rw-r--r--src/mainwindow.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 0120eab..9f5aa39 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -162,6 +162,8 @@ MainWindow::MainWindow(Settings& settings)
connect(&project, SIGNAL(projectChanged()), this, SLOT(projectChanged()));
updateWindowTitle();
+
+ setWindowEnabled(false);
}
MainWindow::~MainWindow()
@@ -404,6 +406,14 @@ void MainWindow::reset()
channel_list->clear();
project.reset();
+ updateWindowTitle();
+}
+
+void MainWindow::setWindowEnabled(bool enabled)
+{
+ instruments_dock->setEnabled(enabled);
+ channels_dock->setEnabled(enabled);
+ tab_widget->setEnabled(enabled);
}
void MainWindow::loadSettings()
@@ -434,6 +444,8 @@ void MainWindow::newProject()
ProjectDialog dlg(this, project);
dlg.show();
dlg.exec();
+
+ setWindowEnabled(true);
}
void MainWindow::loadProject()
@@ -503,6 +515,8 @@ void MainWindow::loadProject(QString filename)
}
statusBar()->showMessage(tr("Loaded"));
+
+ setWindowEnabled(true);
}
void MainWindow::saveProject()
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 2c12950..e83b6a5 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -80,6 +80,9 @@ private:
//! Reset project and reflect in mainwindow (close tabs and lists)
void reset();
+ //! Controls wether the window components are enabled for the user to use.
+ void setWindowEnabled(bool enabled);
+
void loadSettings();
void saveSettings();