2012-11-22 13:30:02 +01:00
|
|
|
#ifndef CSV_DOC_VIEW_H
|
|
|
|
#define CSV_DOC_VIEW_H
|
|
|
|
|
2012-11-23 00:51:04 +01:00
|
|
|
#include <vector>
|
2012-11-26 12:29:22 +01:00
|
|
|
#include <map>
|
2012-11-23 00:51:04 +01:00
|
|
|
|
2012-11-22 14:49:58 +01:00
|
|
|
#include <QMainWindow>
|
|
|
|
|
2012-12-11 13:22:43 +01:00
|
|
|
#include "subviewfactory.hpp"
|
|
|
|
|
2012-11-22 14:49:58 +01:00
|
|
|
class QAction;
|
2013-02-22 21:53:32 -06:00
|
|
|
class QDockWidget;
|
2015-05-17 20:45:13 +10:00
|
|
|
class QScrollArea;
|
2012-11-22 13:30:02 +01:00
|
|
|
|
|
|
|
namespace CSMDoc
|
|
|
|
{
|
|
|
|
class Document;
|
|
|
|
}
|
|
|
|
|
2012-11-24 13:17:21 +01:00
|
|
|
namespace CSMWorld
|
|
|
|
{
|
|
|
|
class UniversalId;
|
|
|
|
}
|
|
|
|
|
2015-12-15 10:40:00 +01:00
|
|
|
namespace CSMPrefs
|
|
|
|
{
|
|
|
|
class Setting;
|
|
|
|
}
|
|
|
|
|
2012-11-22 13:30:02 +01:00
|
|
|
namespace CSVDoc
|
|
|
|
{
|
2012-11-22 14:10:23 +01:00
|
|
|
class ViewManager;
|
2012-11-23 12:20:35 +01:00
|
|
|
class Operations;
|
2014-09-04 17:45:43 +02:00
|
|
|
class GlobalDebugProfileMenu;
|
2012-11-22 14:10:23 +01:00
|
|
|
|
2012-11-22 14:49:58 +01:00
|
|
|
class View : public QMainWindow
|
2012-11-22 13:30:02 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2012-11-22 14:10:23 +01:00
|
|
|
ViewManager& mViewManager;
|
2012-11-22 13:30:02 +01:00
|
|
|
CSMDoc::Document *mDocument;
|
2012-11-22 15:09:04 +01:00
|
|
|
int mViewIndex;
|
|
|
|
int mViewTotal;
|
2014-09-23 17:01:08 +10:00
|
|
|
QList<SubView *> mSubViews;
|
2012-11-23 00:51:04 +01:00
|
|
|
QAction *mUndo;
|
|
|
|
QAction *mRedo;
|
2012-11-23 10:52:46 +01:00
|
|
|
QAction *mSave;
|
2012-11-23 13:15:45 +01:00
|
|
|
QAction *mVerify;
|
2013-07-25 14:29:56 +02:00
|
|
|
QAction *mShowStatusBar;
|
2014-09-02 11:56:35 +02:00
|
|
|
QAction *mStopDebug;
|
2015-08-06 12:52:10 +02:00
|
|
|
QAction *mMerge;
|
2012-11-23 00:51:04 +01:00
|
|
|
std::vector<QAction *> mEditingActions;
|
2012-11-23 12:20:35 +01:00
|
|
|
Operations *mOperations;
|
2012-12-11 13:22:43 +01:00
|
|
|
SubViewFactoryManager mSubViewFactory;
|
2013-03-06 06:41:33 -06:00
|
|
|
QMainWindow mSubViewWindow;
|
2014-09-04 17:45:43 +02:00
|
|
|
GlobalDebugProfileMenu *mGlobalDebugProfileMenu;
|
2015-05-17 20:45:13 +10:00
|
|
|
QScrollArea *mScroll;
|
|
|
|
bool mScrollbarOnly;
|
2013-03-06 06:41:33 -06:00
|
|
|
|
2012-11-22 13:30:02 +01:00
|
|
|
|
|
|
|
// not implemented
|
|
|
|
View (const View&);
|
|
|
|
View& operator= (const View&);
|
|
|
|
|
2012-11-22 14:10:23 +01:00
|
|
|
private:
|
|
|
|
|
|
|
|
void closeEvent (QCloseEvent *event);
|
|
|
|
|
2012-11-23 00:36:01 +01:00
|
|
|
void setupFileMenu();
|
|
|
|
|
2012-11-22 15:54:31 +01:00
|
|
|
void setupEditMenu();
|
|
|
|
|
|
|
|
void setupViewMenu();
|
|
|
|
|
2012-11-23 13:15:45 +01:00
|
|
|
void setupWorldMenu();
|
|
|
|
|
2013-07-20 13:46:56 +02:00
|
|
|
void setupMechanicsMenu();
|
|
|
|
|
2013-10-21 18:04:40 +02:00
|
|
|
void setupCharacterMenu();
|
|
|
|
|
2013-07-20 13:46:56 +02:00
|
|
|
void setupAssetsMenu();
|
|
|
|
|
2014-08-04 13:36:01 +02:00
|
|
|
void setupDebugMenu();
|
|
|
|
|
2012-11-22 14:49:58 +01:00
|
|
|
void setupUi();
|
|
|
|
|
2016-07-27 00:24:16 -04:00
|
|
|
void setupShortcut(const char* name, QAction* action);
|
|
|
|
|
2012-11-23 00:51:04 +01:00
|
|
|
void updateActions();
|
|
|
|
|
2013-03-12 06:28:13 -05:00
|
|
|
void exitApplication();
|
|
|
|
|
2013-06-20 18:06:25 -05:00
|
|
|
/// User preference function
|
|
|
|
void resizeViewWidth (int width);
|
|
|
|
|
|
|
|
/// User preference function
|
|
|
|
void resizeViewHeight (int height);
|
|
|
|
|
2015-05-17 20:45:13 +10:00
|
|
|
void updateScrollbar();
|
2016-01-27 18:50:53 +01:00
|
|
|
void updateWidth(bool isGrowLimit, int minSubViewWidth);
|
2016-02-01 12:39:24 +01:00
|
|
|
void createScrollArea();
|
2012-11-22 13:30:02 +01:00
|
|
|
public:
|
|
|
|
|
2013-03-02 09:22:44 -06:00
|
|
|
View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews);
|
2013-03-06 06:41:33 -06:00
|
|
|
|
2012-11-22 13:30:02 +01:00
|
|
|
///< The ownership of \a document is not transferred to *this.
|
2012-11-22 14:10:23 +01:00
|
|
|
|
2012-11-26 12:29:22 +01:00
|
|
|
virtual ~View();
|
|
|
|
|
2012-11-22 14:10:23 +01:00
|
|
|
const CSMDoc::Document *getDocument() const;
|
|
|
|
|
|
|
|
CSMDoc::Document *getDocument();
|
2012-11-22 14:49:58 +01:00
|
|
|
|
2012-11-22 15:09:04 +01:00
|
|
|
void setIndex (int viewIndex, int totalViews);
|
|
|
|
|
2012-11-22 23:42:17 +01:00
|
|
|
void updateDocumentState();
|
|
|
|
|
2012-11-23 12:20:35 +01:00
|
|
|
void updateProgress (int current, int max, int type, int threads);
|
2012-11-23 10:25:34 +01:00
|
|
|
|
2014-09-18 16:05:32 +10:00
|
|
|
void toggleStatusBar(bool checked);
|
|
|
|
|
2013-03-06 06:41:33 -06:00
|
|
|
Operations *getOperations() const;
|
2013-02-22 21:53:32 -06:00
|
|
|
|
2012-11-23 14:05:49 +01:00
|
|
|
signals:
|
|
|
|
|
2013-09-08 12:06:28 +02:00
|
|
|
void newGameRequest();
|
|
|
|
|
|
|
|
void newAddonRequest();
|
2012-11-23 14:05:49 +01:00
|
|
|
|
2013-02-02 16:14:58 +01:00
|
|
|
void loadDocumentRequest();
|
|
|
|
|
2013-03-12 06:28:13 -05:00
|
|
|
void exitApplicationRequest (CSVDoc::View *view);
|
2013-03-06 06:41:33 -06:00
|
|
|
|
2013-09-08 09:33:45 +02:00
|
|
|
void editSettingsRequest();
|
|
|
|
|
2015-08-06 12:52:10 +02:00
|
|
|
void mergeDocument (CSMDoc::Document *document);
|
|
|
|
|
2012-12-12 22:36:20 +01:00
|
|
|
public slots:
|
|
|
|
|
2014-03-02 13:29:02 +01:00
|
|
|
void addSubView (const CSMWorld::UniversalId& id, const std::string& hint = "");
|
|
|
|
///< \param hint Suggested view point (e.g. coordinates in a 3D scene or a line number
|
|
|
|
/// in a script).
|
2012-12-12 22:36:20 +01:00
|
|
|
|
2013-03-02 07:57:41 -06:00
|
|
|
void abortOperation (int type);
|
|
|
|
|
2014-10-27 08:57:18 +01:00
|
|
|
void updateTitle();
|
|
|
|
|
2014-10-27 09:51:55 +01:00
|
|
|
// called when subviews are added or removed
|
2016-02-01 12:12:14 +01:00
|
|
|
void updateSubViewIndices (SubView *view = NULL);
|
2014-10-27 09:51:55 +01:00
|
|
|
|
2012-11-22 14:49:58 +01:00
|
|
|
private slots:
|
|
|
|
|
2015-12-15 10:40:00 +01:00
|
|
|
void settingChanged (const CSMPrefs::Setting *setting);
|
|
|
|
|
2012-11-22 14:49:58 +01:00
|
|
|
void newView();
|
2012-11-22 16:00:23 +01:00
|
|
|
|
2012-11-23 00:36:01 +01:00
|
|
|
void save();
|
2012-11-23 13:15:45 +01:00
|
|
|
|
2013-03-12 06:28:13 -05:00
|
|
|
void exit();
|
|
|
|
|
2012-11-23 13:15:45 +01:00
|
|
|
void verify();
|
2012-11-24 13:17:21 +01:00
|
|
|
|
2012-11-26 12:29:22 +01:00
|
|
|
void addGlobalsSubView();
|
2013-02-08 09:58:19 +01:00
|
|
|
|
|
|
|
void addGmstsSubView();
|
2013-02-22 21:53:32 -06:00
|
|
|
|
2013-03-21 14:31:32 +01:00
|
|
|
void addSkillsSubView();
|
2013-03-25 13:22:06 +01:00
|
|
|
|
|
|
|
void addClassesSubView();
|
2013-04-02 12:00:45 +02:00
|
|
|
|
|
|
|
void addFactionsSubView();
|
2013-04-04 14:34:39 +02:00
|
|
|
|
|
|
|
void addRacesSubView();
|
2013-04-06 21:21:10 +02:00
|
|
|
|
|
|
|
void addSoundsSubView();
|
2013-04-07 15:17:35 +02:00
|
|
|
|
|
|
|
void addScriptsSubView();
|
2013-04-07 16:32:06 +02:00
|
|
|
|
|
|
|
void addRegionsSubView();
|
2013-04-07 20:26:39 +02:00
|
|
|
|
|
|
|
void addBirthsignsSubView();
|
2013-04-09 11:40:36 +02:00
|
|
|
|
|
|
|
void addSpellsSubView();
|
2013-04-14 17:04:55 +02:00
|
|
|
|
|
|
|
void addCellsSubView();
|
2013-05-07 20:33:42 -05:00
|
|
|
|
2013-05-11 17:01:16 +02:00
|
|
|
void addReferenceablesSubView();
|
2013-05-19 14:59:01 +02:00
|
|
|
|
2013-07-06 17:03:18 +02:00
|
|
|
void addReferencesSubView();
|
|
|
|
|
2013-07-08 13:12:50 +02:00
|
|
|
void addRegionMapSubView();
|
|
|
|
|
2013-07-22 21:18:47 +02:00
|
|
|
void addFiltersSubView();
|
|
|
|
|
2013-10-20 17:13:31 +02:00
|
|
|
void addTopicsSubView();
|
|
|
|
|
|
|
|
void addJournalsSubView();
|
|
|
|
|
2013-10-29 13:18:22 +01:00
|
|
|
void addTopicInfosSubView();
|
|
|
|
|
|
|
|
void addJournalInfosSubView();
|
|
|
|
|
2014-06-30 20:40:34 +02:00
|
|
|
void addEnchantmentsSubView();
|
|
|
|
|
2014-07-01 12:37:22 +02:00
|
|
|
void addBodyPartsSubView();
|
|
|
|
|
2014-09-23 13:21:54 +02:00
|
|
|
void addSoundGensSubView();
|
|
|
|
|
2014-09-26 13:12:17 +02:00
|
|
|
void addMagicEffectsSubView();
|
|
|
|
|
2014-07-05 15:51:17 +02:00
|
|
|
void addMeshesSubView();
|
|
|
|
|
|
|
|
void addIconsSubView();
|
|
|
|
|
|
|
|
void addMusicsSubView();
|
|
|
|
|
|
|
|
void addSoundsResSubView();
|
|
|
|
|
|
|
|
void addTexturesSubView();
|
|
|
|
|
|
|
|
void addVideosSubView();
|
|
|
|
|
2014-08-04 13:36:01 +02:00
|
|
|
void addDebugProfilesSubView();
|
|
|
|
|
2014-09-05 13:49:34 +02:00
|
|
|
void addRunLogSubView();
|
|
|
|
|
2014-10-02 15:16:19 +02:00
|
|
|
void addPathgridSubView();
|
|
|
|
|
2015-03-03 14:32:12 +01:00
|
|
|
void addStartScriptsSubView();
|
|
|
|
|
2015-03-17 12:30:47 +01:00
|
|
|
void addSearchSubView();
|
|
|
|
|
2015-06-26 16:11:00 +02:00
|
|
|
void addMetaDataSubView();
|
|
|
|
|
2013-07-25 14:29:56 +02:00
|
|
|
void toggleShowStatusBar (bool show);
|
2014-05-10 12:04:36 +02:00
|
|
|
|
|
|
|
void loadErrorLog();
|
2014-09-02 10:21:17 +02:00
|
|
|
|
2014-09-04 17:45:43 +02:00
|
|
|
void run (const std::string& profile, const std::string& startupInstruction = "");
|
2014-09-02 10:21:17 +02:00
|
|
|
|
|
|
|
void stop();
|
2014-10-25 18:13:56 +02:00
|
|
|
|
|
|
|
void closeRequest (SubView *subView);
|
2015-05-29 14:07:41 +10:00
|
|
|
|
|
|
|
void moveScrollBarToEnd(int min, int max);
|
2015-08-06 12:52:10 +02:00
|
|
|
|
|
|
|
void merge();
|
2012-11-22 13:30:02 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-02-22 21:53:32 -06:00
|
|
|
#endif
|