mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-09 03:57:51 +03:00
track state of OpenMW process and enable/disable run/stop actions accordingly
This commit is contained in:
parent
1b4ab6e130
commit
c88b3a1520
7 changed files with 45 additions and 15 deletions
|
@ -2256,6 +2256,8 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration,
|
|||
connect (
|
||||
&mSaving, SIGNAL (reportMessage (const CSMWorld::UniversalId&, const std::string&, int)),
|
||||
this, SLOT (reportMessage (const CSMWorld::UniversalId&, const std::string&, int)));
|
||||
|
||||
connect (&mRunner, SIGNAL (runStateChanged()), this, SLOT (runStateChanged()));
|
||||
}
|
||||
|
||||
CSMDoc::Document::~Document()
|
||||
|
@ -2277,6 +2279,9 @@ int CSMDoc::Document::getState() const
|
|||
if (mSaving.isRunning())
|
||||
state |= State_Locked | State_Saving | State_Operation;
|
||||
|
||||
if (mRunner.isRunning())
|
||||
state |= State_Locked | State_Running;
|
||||
|
||||
if (int operations = mTools.getRunningOperations())
|
||||
state |= State_Locked | State_Operation | operations;
|
||||
|
||||
|
@ -2378,6 +2383,11 @@ void CSMDoc::Document::stopRunning()
|
|||
mRunner.stop();
|
||||
}
|
||||
|
||||
void CSMDoc::Document::runStateChanged()
|
||||
{
|
||||
emit stateChanged (getState(), this);
|
||||
}
|
||||
|
||||
void CSMDoc::Document::progress (int current, int max, int type)
|
||||
{
|
||||
emit progress (current, max, type, 1, this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue