Fixed a couple issues with the resource browser and fixed an error in the 32-bit name map

This commit is contained in:
Aruki 2017-07-26 01:29:40 -06:00
parent 18482cbae6
commit 95d0279027
6 changed files with 41 additions and 19 deletions

View File

@ -59644,7 +59644,7 @@
<Asset>
<Key>4026B776</Key>
<Value>
<Name>06_under_intro_save</Name>
<Name>06_under_intro_save_0</Name>
<Directory>Strings/Worlds/OverWorld/</Directory>
<Type>STRG</Type>
<AutoGenName>true</AutoGenName>

View File

@ -45,6 +45,11 @@ CExportGameDialog::CExportGameDialog(const QString& rkIsoPath, const QString& rk
TString IsoName = TO_TSTRING(rkIsoPath).GetFileName();
setWindowTitle(QString("Export Settings - %1").arg( TO_QSTRING(IsoName) ));
}
else
{
delete mpDisc;
mpDisc = nullptr;
}
}
CExportGameDialog::~CExportGameDialog()

View File

@ -40,8 +40,12 @@ CResourceBrowser::CResourceBrowser(QWidget *pParent)
mpRedoAction = new QAction("Redo", this);
mpUndoAction->setShortcut( QKeySequence::Undo );
mpRedoAction->setShortcut( QKeySequence::Redo );
// todo - undo/redo commands are deactivated because they conflict with the World Editor undo/redo commands. fix this
#if 0
addAction(mpUndoAction);
addAction(mpRedoAction);
#endif
connect(mpUndoAction, SIGNAL(triggered(bool)), this, SLOT(Undo()));
connect(mpRedoAction, SIGNAL(triggered(bool)), this, SLOT(Redo()));

View File

@ -25,17 +25,18 @@ CResourceTableContextMenu::CResourceTableContextMenu(CResourceBrowser *pBrowser,
#endif
mpOpenAction = addAction("Open", this, SLOT(Open()));
mpOpenInExternalAppAction = addAction("Open in external application", this, SLOT(OpenInExternalApp()));
mpOpenInExternalAppAction = addAction("Open in External Application", this, SLOT(OpenInExternalApp()));
mpOpenInExplorerAction = addAction(OpenInExplorerString, this, SLOT(OpenInExplorer()));
mpSelectFolderAction = addAction("Select folder", this, SLOT(SelectFolder()));
addSeparator();
mpRenameAction = addAction("Rename", this, SLOT(Rename()));
mpShowReferencersAction = addAction("Show referencers", this, SLOT(ShowReferencers()));
mpShowDependenciesAction = addAction("Show dependencies", this, SLOT(ShowDependencies()));
mpSelectFolderAction = addAction("Select Folder", this, SLOT(SelectFolder()));
mpShowReferencersAction = addAction("Show Referencers", this, SLOT(ShowReferencers()));
mpShowDependenciesAction = addAction("Show Dependencies", this, SLOT(ShowDependencies()));
mpDeleteAction = addAction("Delete", this, SLOT(Delete()));
addSeparator();
mpCopyNameAction = addAction("Copy name", this, SLOT(CopyName()));
mpCopyPathAction = addAction("Copy path", this, SLOT(CopyPath()));
mpCopyIDAction = addAction("Copy asset ID", this, SLOT(CopyID()));
mpCopyNameAction = addAction("Copy Name", this, SLOT(CopyName()));
mpCopyPathAction = addAction("Copy Path", this, SLOT(CopyPath()));
mpCopyIDAction = addAction("Copy Asset ID", this, SLOT(CopyID()));
}
void CResourceTableContextMenu::ShowMenu(const QPoint& rkPos)
@ -55,6 +56,7 @@ void CResourceTableContextMenu::ShowMenu(const QPoint& rkPos)
mpSelectFolderAction->setVisible(mpModel->IsDisplayingAssetList());
mpShowDependenciesAction->setVisible(IsRes);
mpShowReferencersAction->setVisible(IsRes);
mpDeleteAction->setVisible(mpDirectory && mpDirectory->IsEmpty(true));
mpCopyIDAction->setVisible(IsRes);
// Exec menu
@ -93,6 +95,11 @@ void CResourceTableContextMenu::OpenInExplorer()
}
}
void CResourceTableContextMenu::Rename()
{
mpTable->edit(mProxyIndex);
}
void CResourceTableContextMenu::SelectFolder()
{
CVirtualDirectory *pDir = (mpEntry ? mpEntry->Directory() : mpDirectory->Parent());
@ -104,11 +111,6 @@ void CResourceTableContextMenu::SelectFolder()
mpBrowser->SelectDirectory(mpDirectory);
}
void CResourceTableContextMenu::Rename()
{
mpTable->edit(mProxyIndex);
}
void CResourceTableContextMenu::ShowReferencers()
{
ASSERT(mpEntry);
@ -154,6 +156,15 @@ void CResourceTableContextMenu::ShowDependencies()
mpBrowser->ClearFilters();
}
void CResourceTableContextMenu::Delete()
{
ASSERT(mpDirectory && mpDirectory->IsEmpty(true));
QList<CVirtualDirectory*> List;
List << mpDirectory;
mpBrowser->DeleteDirectories(List);
}
void CResourceTableContextMenu::CopyName()
{
if (mpEntry)

View File

@ -30,6 +30,7 @@ class CResourceTableContextMenu : public QMenu
QAction *mpRenameAction;
QAction *mpShowReferencersAction;
QAction *mpShowDependenciesAction;
QAction *mpDeleteAction;
QAction *mpCopyNameAction;
QAction *mpCopyPathAction;
@ -45,10 +46,11 @@ public slots:
void Open();
void OpenInExternalApp();
void OpenInExplorer();
void SelectFolder();
void Rename();
void SelectFolder();
void ShowReferencers();
void ShowDependencies();
void Delete();
void CopyName();
void CopyPath();
void CopyID();

View File

@ -302,12 +302,12 @@ void CResourceTableModel::CheckAddDirectory(CVirtualDirectory *pDir)
void CResourceTableModel::CheckRemoveDirectory(CVirtualDirectory *pDir)
{
if (pDir->Parent() != mpCurrentDir)
{
QModelIndex Index = GetIndexForDirectory(pDir);
int Index = mDirectories.indexOf(pDir);
beginRemoveRows(QModelIndex(), Index.row(), Index.row());
mDirectories.removeAt(Index.row());
if (Index != -1)
{
beginRemoveRows(QModelIndex(), Index, Index);
mDirectories.removeAt(Index);
endRemoveRows();
}
}