Added 16x16 World icon, remove recent projects that no longer exist
This commit is contained in:
parent
bdb753dca2
commit
423613c1c1
|
@ -70,5 +70,6 @@
|
|||
<file>icons/Open_16px.png</file>
|
||||
<file>icons/New_16px.png</file>
|
||||
<file>icons/Disc_16px.png</file>
|
||||
<file>icons/World_16px.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -252,10 +252,6 @@ bool CWorldEditor::CloseWorld()
|
|||
if (mpPoiDialog)
|
||||
mpPoiDialog->close();
|
||||
|
||||
// Clear old area - hack until better world/area loader is implemented
|
||||
if (mpArea)
|
||||
mpArea->ClearScriptLayers();
|
||||
|
||||
mpArea = nullptr;
|
||||
mpWorld = nullptr;
|
||||
|
||||
|
@ -575,13 +571,6 @@ void CWorldEditor::OnActiveProjectChanged(CGameProject *pProj)
|
|||
if (!pProj) return;
|
||||
|
||||
// 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();
|
||||
|
||||
ChangeEditMode(eWEM_EditWorldInfo);
|
||||
|
@ -717,6 +706,26 @@ void CWorldEditor::UpdateOpenRecentActions()
|
|||
QSettings Settings;
|
||||
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++)
|
||||
{
|
||||
QAction *pAction = mRecentProjectsActions[iProj];
|
||||
|
|
|
@ -97,7 +97,7 @@ QVariant CWorldTreeModel::data(const QModelIndex& rkIndex, int Role) const
|
|||
|
||||
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");
|
||||
|
||||
if (rkIndex.column() == 1)
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 349 B |
|
@ -1,8 +1,10 @@
|
|||
#include "CEditorApplication.h"
|
||||
#include "UICommon.h"
|
||||
#include <Common/Log.h>
|
||||
#include <Core/Resource/Factory/CTemplateLoader.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QIcon>
|
||||
#include <QMessageBox>
|
||||
#include <QStyleFactory>
|
||||
#include <QtGlobal>
|
||||
|
|
Loading…
Reference in New Issue