void WelcomeDialog::showMenu(void) { MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); m_menuPopup = new MythDialogBox("Menu", popupStack, "actionmenu"); if (m_menuPopup->Create()) popupStack->AddScreen(m_menuPopup); m_menuPopup->SetReturnEvent(this, "action"); QString mythshutdown_status = m_installDir + "/bin/mythshutdown --status 0"; QByteArray tmpcmd = mythshutdown_status.toAscii(); int statusCode = system(tmpcmd.constData()); if (WIFEXITED(statusCode)) statusCode = WEXITSTATUS(statusCode); if (statusCode & 16) m_menuPopup->AddButton(tr("Unlock Shutdown"), SLOT(unlockShutdown())); else m_menuPopup->AddButton(tr("Lock Shutdown"), SLOT(lockShutdown())); m_menuPopup->AddButton(tr("Run mythfilldatabase"), SLOT(runEPGGrabber())); m_menuPopup->AddButton(tr("Shutdown Now"), SLOT(shutdownNow())); m_menuPopup->AddButton(tr("Exit"), SLOT(closeDialog())); m_menuPopup->AddButton(tr("Cancel")); }
void ThreadPool::awaitTermination(std::size_t seconds) { { KAA_MUTEX_UNIQUE_DECLARE(waitLock, threadPoolGuard_); if (state_ != State::PENDING_SHUTDOWN) { throw std::logic_error("Do shutdown before"); } onThreadpoolEvent_.wait_for(waitLock, std::chrono::seconds(seconds), [this] { return tasks_.empty(); }); } shutdownNow(); }
void WelcomeDialog::showMenu(void) { MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); m_menuPopup = new MythDialogBox("Menu", popupStack, "actionmenu"); if (m_menuPopup->Create()) popupStack->AddScreen(m_menuPopup); m_menuPopup->SetReturnEvent(this, "action"); QString mythshutdown_status = m_installDir + "/bin/mythshutdown --status 0"; uint statusCode = myth_system(mythshutdown_status + logPropagateArgs); if (!(statusCode & 0xFF00) && statusCode & 16) m_menuPopup->AddButton(tr("Unlock Shutdown"), SLOT(unlockShutdown())); else m_menuPopup->AddButton(tr("Lock Shutdown"), SLOT(lockShutdown())); m_menuPopup->AddButton(tr("Run mythfilldatabase"), SLOT(runEPGGrabber())); m_menuPopup->AddButton(tr("Shutdown Now"), SLOT(shutdownNow())); m_menuPopup->AddButton(tr("Exit"), SLOT(closeDialog())); m_menuPopup->AddButton(tr("Cancel")); }
ThreadPool::~ThreadPool() { shutdownNow(); }