mirror of
https://github.com/isledecomp/SIEdit.git
synced 2025-04-15 06:14:36 -04:00
app: Prevent replacing/extracing when nothing is loaded
This commit is contained in:
parent
420eee4e98
commit
40448d2747
1 changed files with 10 additions and 0 deletions
|
@ -178,6 +178,11 @@ void MainWindow::SetPanel(Panel *panel, si::Object *chunk)
|
|||
|
||||
void MainWindow::ExtractObject(si::Object *obj)
|
||||
{
|
||||
if (!obj) {
|
||||
QMessageBox::critical(this, QString(), tr("Failed to extract file (not initialized)"));
|
||||
return;
|
||||
}
|
||||
|
||||
QString filename = QString::fromStdString(obj->filename());
|
||||
if (filename.isEmpty()) {
|
||||
filename = QString::fromStdString(obj->name());
|
||||
|
@ -206,6 +211,11 @@ void MainWindow::ExtractObject(si::Object *obj)
|
|||
|
||||
void MainWindow::ReplaceObject(si::Object *obj)
|
||||
{
|
||||
if (!obj) {
|
||||
QMessageBox::critical(this, QString(), tr("Failed to replace file (not initialized)"));
|
||||
return;
|
||||
}
|
||||
|
||||
QString s = QFileDialog::getOpenFileName(this, tr("Replace Object"));
|
||||
if (!s.isEmpty()) {
|
||||
if (obj->ReplaceWithFile(
|
||||
|
|
Loading…
Add table
Reference in a new issue