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