implemented saving UI

Implemented the file dialog, save progress dialog, and separate thread to save
in (saving needs to be done in a separate thread so the main/GUI thread doesn't
get blocked).
This commit is contained in:
itsmattkc
2020-01-12 16:26:05 +11:00
parent ca89e2b818
commit 00b5672639
14 changed files with 274 additions and 20 deletions
+19 -6
View File
@@ -75,9 +75,17 @@ Project *ProjectPanel::project()
void ProjectPanel::set_project(Project *p)
{
if (project()) {
disconnect(project(), &Project::NameChanged, this, &ProjectPanel::ProjectNameChanged);
}
explorer_->set_project(p);
Retranslate();
if (project()) {
connect(project(), &Project::NameChanged, this, &ProjectPanel::ProjectNameChanged);
}
ProjectNameChanged();
}
QList<Item *> ProjectPanel::SelectedItems()
@@ -112,11 +120,7 @@ void ProjectPanel::Retranslate()
{
SetTitle(tr("Project"));
if (project() == nullptr) {
SetSubtitle(tr("(none)"));
} else {
SetSubtitle(project()->name());
}
ProjectNameChanged();
}
void ProjectPanel::ItemDoubleClickSlot(Item *item)
@@ -141,3 +145,12 @@ void ProjectPanel::ShowNewMenu()
new_menu.exec(QCursor::pos());
}
void ProjectPanel::ProjectNameChanged()
{
if (project() == nullptr) {
SetSubtitle(tr("(none)"));
} else {
SetSubtitle(project()->name());
}
}