Skip to content

Commit

Permalink
Wizards now are checked/unchecked based on visibility in the Wizards …
Browse files Browse the repository at this point in the history
…menu
  • Loading branch information
malcom2073 committed Nov 22, 2013
1 parent 340f6a3 commit 6de0b95
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,7 @@ void MainWindow::emsCommsConnected()
action->setCheckable(true);
ui.menuWizards->addAction(action);
connect(action,SIGNAL(triggered(bool)),view,SLOT(setVisible(bool)));
connect(view,SIGNAL(visibilityChanged(bool)),action,SLOT(setChecked(bool)));
}
//virtual QList<QString> getConfigList()=0;
for (int i=0;i<emsComms->getConfigList().size();i++)
Expand Down
11 changes: 11 additions & 0 deletions core/src/wizardview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,14 @@ void WizardView::setMemory(unsigned short locationid,unsigned short offset,unsig
}
emscomms->updateBlockInFlash(locationid,offset,length,data);
}
void WizardView::showEvent(QShowEvent *event)
{
Q_UNUSED(event)
emit visibilityChanged(true);
}

void WizardView::hideEvent(QHideEvent *event)
{
Q_UNUSED(event)
emit visibilityChanged(false);
}
4 changes: 4 additions & 0 deletions core/src/wizardview.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ class WizardView : public QDeclarativeView
QVariantMap m_savedPayload;
EmsComms *emscomms;
QList<QString> m_configRequestList;
protected:
void showEvent(QShowEvent *event);
void hideEvent(QHideEvent *event);
signals:
void payloadDecoded(QVariantMap data);
void visibilityChanged(bool visible);
public slots:
void configRecieved(ConfigBlock,QVariant);
void configUpdate();
Expand Down

0 comments on commit 6de0b95

Please sign in to comment.