mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 13:19:40 +00:00
update refresh menu item on stateChanged signal instead of when opening the menu
This commit is contained in:
parent
6fbdbb11d5
commit
69db0179ca
3 changed files with 16 additions and 3 deletions
|
@ -15,7 +15,12 @@ CSVTools::ReportSubView::ReportSubView (const CSMWorld::UniversalId& id, CSMDoc:
|
||||||
SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&)));
|
SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&)));
|
||||||
|
|
||||||
if (mRefreshState==CSMDoc::State_Verifying)
|
if (mRefreshState==CSMDoc::State_Verifying)
|
||||||
|
{
|
||||||
connect (mTable, SIGNAL (refreshRequest()), this, SLOT (refreshRequest()));
|
connect (mTable, SIGNAL (refreshRequest()), this, SLOT (refreshRequest()));
|
||||||
|
|
||||||
|
connect (&document, SIGNAL (stateChanged (int, CSMDoc::Document *)),
|
||||||
|
mTable, SLOT (stateChanged (int, CSMDoc::Document *)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVTools::ReportSubView::setEditLock (bool locked)
|
void CSVTools::ReportSubView::setEditLock (bool locked)
|
||||||
|
|
|
@ -77,10 +77,7 @@ void CSVTools::ReportTable::contextMenuEvent (QContextMenuEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mRefreshAction)
|
if (mRefreshAction)
|
||||||
{
|
|
||||||
mRefreshAction->setEnabled ((mDocument.getState() & mRefreshState)==0);
|
|
||||||
menu.addAction (mRefreshAction);
|
menu.addAction (mRefreshAction);
|
||||||
}
|
|
||||||
|
|
||||||
menu.exec (event->globalPos());
|
menu.exec (event->globalPos());
|
||||||
}
|
}
|
||||||
|
@ -181,6 +178,7 @@ CSVTools::ReportTable::ReportTable (CSMDoc::Document& document,
|
||||||
if (mRefreshState)
|
if (mRefreshState)
|
||||||
{
|
{
|
||||||
mRefreshAction = new QAction (tr ("Refresh"), this);
|
mRefreshAction = new QAction (tr ("Refresh"), this);
|
||||||
|
mRefreshAction->setEnabled (!(mDocument.getState() & mRefreshState));
|
||||||
connect (mRefreshAction, SIGNAL (triggered()), this, SIGNAL (refreshRequest()));
|
connect (mRefreshAction, SIGNAL (triggered()), this, SIGNAL (refreshRequest()));
|
||||||
addAction (mRefreshAction);
|
addAction (mRefreshAction);
|
||||||
}
|
}
|
||||||
|
@ -301,3 +299,9 @@ void CSVTools::ReportTable::clear()
|
||||||
{
|
{
|
||||||
mModel->clear();
|
mModel->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVTools::ReportTable::stateChanged (int state, CSMDoc::Document *document)
|
||||||
|
{
|
||||||
|
if (mRefreshAction)
|
||||||
|
mRefreshAction->setEnabled (!(state & mRefreshState));
|
||||||
|
}
|
||||||
|
|
|
@ -76,6 +76,10 @@ namespace CSVTools
|
||||||
|
|
||||||
void removeSelection();
|
void removeSelection();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
void stateChanged (int state, CSMDoc::Document *document);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void editRequest (const CSMWorld::UniversalId& id, const std::string& hint);
|
void editRequest (const CSMWorld::UniversalId& id, const std::string& hint);
|
||||||
|
|
Loading…
Reference in a new issue