Added 16x16 World icon, remove recent projects that no longer exist

This commit is contained in:
Aruki 2017-02-17 18:04:06 -07:00
parent bdb753dca2
commit 423613c1c1
5 changed files with 24 additions and 12 deletions

View File

@ -70,5 +70,6 @@
<file>icons/Open_16px.png</file> <file>icons/Open_16px.png</file>
<file>icons/New_16px.png</file> <file>icons/New_16px.png</file>
<file>icons/Disc_16px.png</file> <file>icons/Disc_16px.png</file>
<file>icons/World_16px.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -252,10 +252,6 @@ bool CWorldEditor::CloseWorld()
if (mpPoiDialog) if (mpPoiDialog)
mpPoiDialog->close(); mpPoiDialog->close();
// Clear old area - hack until better world/area loader is implemented
if (mpArea)
mpArea->ClearScriptLayers();
mpArea = nullptr; mpArea = nullptr;
mpWorld = nullptr; mpWorld = nullptr;
@ -575,13 +571,6 @@ void CWorldEditor::OnActiveProjectChanged(CGameProject *pProj)
if (!pProj) return; if (!pProj) return;
// Update recent projects list // Update recent projects list
QSettings Settings;
QStringList RecentProjectsList = Settings.value("WorldEditor/RecentProjectsList").toStringList();
QString ProjPath = TO_QSTRING(pProj->ProjectPath());
RecentProjectsList.removeAll(ProjPath);
RecentProjectsList.prepend(ProjPath);
Settings.setValue("WorldEditor/RecentProjectsList", RecentProjectsList);
UpdateOpenRecentActions(); UpdateOpenRecentActions();
ChangeEditMode(eWEM_EditWorldInfo); ChangeEditMode(eWEM_EditWorldInfo);
@ -717,6 +706,26 @@ void CWorldEditor::UpdateOpenRecentActions()
QSettings Settings; QSettings Settings;
QStringList RecentProjectsList = Settings.value("WorldEditor/RecentProjectsList").toStringList(); QStringList RecentProjectsList = Settings.value("WorldEditor/RecentProjectsList").toStringList();
// Bump the current project to the front
CGameProject *pProj = gpEdApp->ActiveProject();
if (pProj)
{
QString ProjPath = TO_QSTRING(pProj->ProjectPath());
RecentProjectsList.removeAll(ProjPath);
RecentProjectsList.prepend(ProjPath);
}
// Remove projects that don't exist anymore
foreach (const QString& rkProj, RecentProjectsList)
{
if (!FileUtil::Exists( TO_TWIDESTRING(rkProj) ))
RecentProjectsList.removeAll(rkProj);
}
Settings.setValue("WorldEditor/RecentProjectsList", RecentProjectsList);
// Set up the menu actions
for (int iProj = 0; iProj < mskMaxRecentProjects; iProj++) for (int iProj = 0; iProj < mskMaxRecentProjects; iProj++)
{ {
QAction *pAction = mRecentProjectsActions[iProj]; QAction *pAction = mRecentProjectsActions[iProj];

View File

@ -97,7 +97,7 @@ QVariant CWorldTreeModel::data(const QModelIndex& rkIndex, int Role) const
else if (Role == Qt::DecorationRole) else if (Role == Qt::DecorationRole)
{ {
static QIcon sWorldIcon = QIcon(":/icons/World.png"); static QIcon sWorldIcon = QIcon(":/icons/World_16px.png");
static QIcon sAreaIcon = QIcon(":/icons/New_16px.png"); static QIcon sAreaIcon = QIcon(":/icons/New_16px.png");
if (rkIndex.column() == 1) if (rkIndex.column() == 1)

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

View File

@ -1,8 +1,10 @@
#include "CEditorApplication.h" #include "CEditorApplication.h"
#include "UICommon.h"
#include <Common/Log.h> #include <Common/Log.h>
#include <Core/Resource/Factory/CTemplateLoader.h> #include <Core/Resource/Factory/CTemplateLoader.h>
#include <QApplication> #include <QApplication>
#include <QIcon>
#include <QMessageBox> #include <QMessageBox>
#include <QStyleFactory> #include <QStyleFactory>
#include <QtGlobal> #include <QtGlobal>