mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
CHDDMenuHandler: simplify and fix hintbox calls
Hints were not closed after lost scope. Explicit hide() is required.
Origin commit data
------------------
Commit: 74473d0ebe
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-11-20 (Sun, 20 Nov 2016)
This commit is contained in:
@@ -336,8 +336,8 @@ bool CHDDMenuHandler::waitfordev(std::string dev, int maxwait)
|
|||||||
|
|
||||||
void CHDDMenuHandler::showHint(std::string &message)
|
void CHDDMenuHandler::showHint(std::string &message)
|
||||||
{
|
{
|
||||||
CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, message.c_str());
|
CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, message.c_str());
|
||||||
hintBox->paint();
|
hintBox.paint();
|
||||||
|
|
||||||
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(3);
|
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(3);
|
||||||
neutrino_msg_t msg;
|
neutrino_msg_t msg;
|
||||||
@@ -355,7 +355,7 @@ void CHDDMenuHandler::showHint(std::string &message)
|
|||||||
else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all)
|
else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
delete hintBox;
|
hintBox.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHDDMenuHandler::setRecordPath(std::string &dev)
|
void CHDDMenuHandler::setRecordPath(std::string &dev)
|
||||||
@@ -482,8 +482,8 @@ int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey)
|
|||||||
if (actionkey[0] == 'm') {
|
if (actionkey[0] == 'm') {
|
||||||
for (std::vector<hdd_s>::iterator it = hdd_list.begin(); it != hdd_list.end(); ++it) {
|
for (std::vector<hdd_s>::iterator it = hdd_list.begin(); it != hdd_list.end(); ++it) {
|
||||||
if (it->devname == dev) {
|
if (it->devname == dev) {
|
||||||
CHintBox * hintbox = new CHintBox(it->mounted ? LOCALE_HDD_UMOUNT : LOCALE_HDD_MOUNT, it->devname.c_str());
|
CHintBox hintbox(it->mounted ? LOCALE_HDD_UMOUNT : LOCALE_HDD_MOUNT, it->devname.c_str());
|
||||||
hintbox->paint();
|
hintbox.paint();
|
||||||
if (it->mounted)
|
if (it->mounted)
|
||||||
umount_dev(it->devname);
|
umount_dev(it->devname);
|
||||||
else
|
else
|
||||||
@@ -491,7 +491,7 @@ int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey)
|
|||||||
|
|
||||||
it->mounted = is_mounted(it->devname.c_str());
|
it->mounted = is_mounted(it->devname.c_str());
|
||||||
it->cmf->setOption(it->mounted ? umount : mount);
|
it->cmf->setOption(it->mounted ? umount : mount);
|
||||||
delete hintbox;
|
hintbox.hide();
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user