mirror of
https://github.com/isledecomp/SIEdit.git
synced 2024-11-27 09:35:45 -05:00
app: show filename in siviewdialog
This commit is contained in:
parent
339da8aa6d
commit
cbf6492177
3 changed files with 16 additions and 2 deletions
|
@ -326,6 +326,7 @@ void MainWindow::ViewSIFile()
|
|||
std::unique_ptr<Interleaf> temp = std::make_unique<Interleaf>();
|
||||
if (OpenInterleafFileInternal(this, temp.get(), s)) {
|
||||
SIViewDialog *v = new SIViewDialog(temp->GetInformation(), this);
|
||||
v->SetSubtitle(QFileInfo(s).fileName());
|
||||
v->temp = std::move(temp);
|
||||
v->setAttribute(Qt::WA_DeleteOnClose);
|
||||
v->show();
|
||||
|
|
|
@ -13,8 +13,6 @@ SIViewDialog::SIViewDialog(Info *riff, QWidget *parent) :
|
|||
root_(riff),
|
||||
last_set_data_(nullptr)
|
||||
{
|
||||
setWindowTitle(tr("View SI File"));
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
|
||||
auto splitter = new QSplitter();
|
||||
|
@ -35,6 +33,19 @@ SIViewDialog::SIViewDialog(Info *riff, QWidget *parent) :
|
|||
config_stack_->addWidget(panel_);
|
||||
|
||||
splitter->setSizes({99999, 99999});
|
||||
|
||||
SetSubtitle(QString());
|
||||
}
|
||||
|
||||
void SIViewDialog::SetSubtitle(const QString &s)
|
||||
{
|
||||
QString t;
|
||||
if (s.isEmpty()) {
|
||||
t = tr("View SI File");
|
||||
} else {
|
||||
t = tr("View SI File: %1").arg(s);
|
||||
}
|
||||
setWindowTitle(t);
|
||||
}
|
||||
|
||||
void SIViewDialog::SelectionChanged(const QModelIndex &index)
|
||||
|
|
|
@ -14,6 +14,8 @@ class SIViewDialog : public QWidget
|
|||
public:
|
||||
SIViewDialog(si::Info *info, QWidget *parent = nullptr);
|
||||
|
||||
void SetSubtitle(const QString &s);
|
||||
|
||||
std::unique_ptr<si::Interleaf> temp;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue