mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-11 00:39:59 +00:00
700d55f1fb
Implemented updating editor application from preferences menu, loading settings when editor loads, adding Record Status Display prefernce. Fixed multiple bugs, made changes to CSM(V)Settings classes to make implementing new prefrences easier. Rewrote CSMSettings::UserSettings to retain last-loaded settings. Adjusted icon position in Record Status column Capitalized status text Added delegate to referenceables table
82 lines
1.9 KiB
C++
82 lines
1.9 KiB
C++
#ifndef CSV_DOC_VIEWMANAGER_H
|
|
#define CSV_DOC_VIEWMANAGER_H
|
|
|
|
#include <vector>
|
|
|
|
#include <QObject>
|
|
|
|
namespace CSMDoc
|
|
{
|
|
class Document;
|
|
class DocumentManager;
|
|
}
|
|
|
|
namespace CSVWorld
|
|
{
|
|
class CommandDelegateFactoryCollection;
|
|
}
|
|
|
|
namespace CSVDoc
|
|
{
|
|
class View;
|
|
|
|
class ViewManager : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
CSMDoc::DocumentManager& mDocumentManager;
|
|
std::vector<View *> mViews;
|
|
CSVWorld::CommandDelegateFactoryCollection *mDelegateFactories;
|
|
bool mExitOnSaveStateChange;
|
|
bool mUserWarned;
|
|
|
|
// not implemented
|
|
ViewManager (const ViewManager&);
|
|
ViewManager& operator= (const ViewManager&);
|
|
|
|
void updateIndices();
|
|
bool notifySaveOnClose (View *view = 0);
|
|
bool showModifiedDocumentMessageBox (View *view);
|
|
bool showSaveInProgressMessageBox (View *view);
|
|
|
|
public:
|
|
|
|
ViewManager (CSMDoc::DocumentManager& documentManager);
|
|
|
|
virtual ~ViewManager();
|
|
|
|
View *addView (CSMDoc::Document *document);
|
|
///< The ownership of the returned view is not transferred.
|
|
|
|
int countViews (const CSMDoc::Document *document) const;
|
|
///< Return number of views for \a document.
|
|
|
|
bool closeRequest (View *view);
|
|
|
|
signals:
|
|
|
|
void newDocumentRequest();
|
|
|
|
void loadDocumentRequest();
|
|
|
|
void closeMessageBox();
|
|
|
|
public slots:
|
|
|
|
void exitApplication (CSVDoc::View *view);
|
|
|
|
private slots:
|
|
|
|
void documentStateChanged (int state, CSMDoc::Document *document);
|
|
|
|
void progress (int current, int max, int type, int threads, CSMDoc::Document *document);
|
|
|
|
void onExitWarningHandler(int state, CSMDoc::Document* document);
|
|
|
|
void slotUpdateEditorSetting (const QString &, const QString &);
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|