Gui:: Application - user initiated restore status bit
===================================================== Add Status bits. Currently only to mark whether an UI operation of restore was initiated by the user (via click in the open dialog or in the hyperlink of the shortcuts of the home page).
This commit is contained in:
committed by
abdullahtahiriyo
parent
727140ab04
commit
907a0a6de9
@@ -198,6 +198,7 @@ struct ApplicationP
|
||||
/// Handles all commands
|
||||
CommandManager commandManager;
|
||||
ViewProviderMap viewproviderMap;
|
||||
std::bitset<32> StatusBits;
|
||||
};
|
||||
|
||||
static PyObject *
|
||||
@@ -2289,6 +2290,16 @@ void Application::runApplication()
|
||||
Base::Console().Log("Finish: Event loop left\n");
|
||||
}
|
||||
|
||||
bool Application::testStatus(Status pos) const
|
||||
{
|
||||
return d->StatusBits.test((size_t)pos);
|
||||
}
|
||||
|
||||
void Application::setStatus(Status pos, bool on)
|
||||
{
|
||||
d->StatusBits.set((size_t)pos, on);
|
||||
}
|
||||
|
||||
void Application::setStyleSheet(const QString& qssFile, bool tiledBackground)
|
||||
{
|
||||
Gui::MainWindow* mw = getMainWindow();
|
||||
|
||||
@@ -54,6 +54,10 @@ class ViewProviderDocumentObject;
|
||||
class GuiExport Application
|
||||
{
|
||||
public:
|
||||
enum Status {
|
||||
UserInitiatedOpenDocument = 0
|
||||
};
|
||||
|
||||
/// construction
|
||||
explicit Application(bool GUIenabled);
|
||||
/// destruction
|
||||
@@ -232,7 +236,12 @@ public:
|
||||
static void runApplication();
|
||||
void tryClose( QCloseEvent * e );
|
||||
//@}
|
||||
|
||||
|
||||
/// return the status bits
|
||||
bool testStatus(Status pos) const;
|
||||
/// set the status bits
|
||||
void setStatus(Status pos, bool on);
|
||||
|
||||
/** @name User edit mode */
|
||||
//@{
|
||||
protected:
|
||||
@@ -320,7 +329,7 @@ public:
|
||||
|
||||
static PyObject* sAddDocObserver (PyObject *self,PyObject *args);
|
||||
static PyObject* sRemoveDocObserver (PyObject *self,PyObject *args);
|
||||
|
||||
|
||||
static PyObject* sListUserEditModes (PyObject *self,PyObject *args);
|
||||
static PyObject* sGetUserEditMode (PyObject *self,PyObject *args);
|
||||
static PyObject* sSetUserEditMode (PyObject *self,PyObject *args);
|
||||
|
||||
Reference in New Issue
Block a user