mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-08 08:55:37 -05:00
add different tabs for map list views
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "regionmapeditor.h"
|
||||
#include "mapimageexporter.h"
|
||||
#include "filterchildrenproxymodel.h"
|
||||
#include "maplistmodels.h"
|
||||
#include "newmappopup.h"
|
||||
#include "newtilesetdialog.h"
|
||||
#include "shortcutseditor.h"
|
||||
@@ -257,8 +258,6 @@ private slots:
|
||||
|
||||
void on_actionTileset_Editor_triggered();
|
||||
|
||||
void mapSortOrder_changed(QAction *action);
|
||||
|
||||
void on_lineEdit_filterBox_textChanged(const QString &arg1);
|
||||
|
||||
void moveEvent(QMoveEvent *event);
|
||||
@@ -267,8 +266,14 @@ private slots:
|
||||
void eventTabChanged(int index);
|
||||
|
||||
void on_horizontalSlider_CollisionTransparency_valueChanged(int value);
|
||||
void on_toolButton_ExpandAll_clicked();
|
||||
void on_toolButton_CollapseAll_clicked();
|
||||
|
||||
void on_toolButton_ExpandAll_Groups_clicked();
|
||||
void on_toolButton_CollapseAll_Groups_clicked();
|
||||
void on_toolButton_ExpandAll_Areas_clicked();
|
||||
void on_toolButton_CollapseAll_Areas_clicked();
|
||||
void on_toolButton_ExpandAll_Layouts_clicked();
|
||||
void on_toolButton_CollapseAll_Layouts_clicked();
|
||||
|
||||
void on_actionAbout_Porymap_triggered();
|
||||
void on_actionOpen_Log_File_triggered();
|
||||
void on_actionOpen_Config_Folder_triggered();
|
||||
@@ -302,13 +307,15 @@ private:
|
||||
QPointer<PreferenceEditor> preferenceEditor = nullptr;
|
||||
QPointer<ProjectSettingsEditor> projectSettingsEditor = nullptr;
|
||||
QPointer<CustomScriptsEditor> customScriptsEditor = nullptr;
|
||||
FilterChildrenProxyModel *mapListProxyModel;
|
||||
QStandardItemModel *mapListModel;
|
||||
QList<QStandardItem*> *mapGroupItemsList;
|
||||
QMap<QString, QModelIndex> mapListIndexes;
|
||||
QIcon* mapIcon;
|
||||
QIcon* mapEditedIcon;
|
||||
QIcon* mapOpenedIcon;
|
||||
|
||||
FilterChildrenProxyModel *groupListProxyModel;
|
||||
MapGroupModel *mapGroupModel;
|
||||
// QStandardItemModel *mapListModel;
|
||||
// QList<QStandardItem*> *mapGroupItemsList;
|
||||
// QMap<QString, QModelIndex> mapListIndexes;
|
||||
// QIcon* mapIcon;
|
||||
// QIcon* mapEditedIcon;
|
||||
// QIcon* mapOpenedIcon;
|
||||
|
||||
QAction *undoAction = nullptr;
|
||||
QAction *redoAction = nullptr;
|
||||
@@ -397,10 +404,4 @@ private:
|
||||
int insertTilesetLabel(QStringList * list, QString label);
|
||||
};
|
||||
|
||||
enum MapListUserRoles {
|
||||
GroupRole = Qt::UserRole + 1, // Used to hold the map group number.
|
||||
TypeRole, // Used to differentiate between the different layers of the map list tree view.
|
||||
TypeRole2, // Used for various extra data needed.
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
58
include/ui/maplistmodels.h
Normal file
58
include/ui/maplistmodels.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
#ifndef MAPLISTMODELS_H
|
||||
#define MAPLISTMODELS_H
|
||||
|
||||
#include <QStandardItemModel>
|
||||
#include <QMap>
|
||||
|
||||
|
||||
|
||||
class Project;
|
||||
|
||||
enum MapListRoles {
|
||||
GroupRole = Qt::UserRole + 1, // Used to hold the map group number.
|
||||
TypeRole, // Used to differentiate between the different layers of the map list tree view.
|
||||
TypeRole2, // Used for various extra data needed.
|
||||
};
|
||||
|
||||
// or QStandardItemModel??
|
||||
class MapGroupModel : public QStandardItemModel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MapGroupModel(Project *project, QObject *parent = nullptr);
|
||||
~MapGroupModel() {}
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
|
||||
public:
|
||||
void setMap(QString mapName) { this->openMap = mapName; }
|
||||
|
||||
QStandardItem *createGroupItem(QString groupName, int groupIndex);
|
||||
QStandardItem *createMapItem(QString mapName, int groupIndex, int mapIndex);
|
||||
|
||||
QStandardItem *getItem(const QModelIndex &index) const;
|
||||
QModelIndex indexOfMap(QString mapName);
|
||||
|
||||
void initialize();
|
||||
|
||||
private:
|
||||
Project *project;
|
||||
QStandardItem *root = nullptr;
|
||||
|
||||
QMap<QString, QStandardItem *> groupItems;
|
||||
QMap<QString, QStandardItem *> mapItems;
|
||||
// TODO: if reordering, will the item be the same?
|
||||
|
||||
QString openMap;
|
||||
|
||||
// QIcon *mapIcon = nullptr;
|
||||
// QIcon *mapEditedIcon = nullptr;
|
||||
// QIcon *mapOpenedIcon = nullptr;
|
||||
// QIcon *mapFolderIcon = nullptr;
|
||||
|
||||
signals:
|
||||
void edited();
|
||||
};
|
||||
|
||||
#endif // MAPLISTMODELS_H
|
||||
Reference in New Issue
Block a user