CMsgBox: rework msgbox classes with Window class implementation

Replacing messagebox, hintbox_ext and some derivated parts with
basic class hintbox and derivated class CMsgBox. This should unify
window handling and avoids maintain of multiple classes with quasi
same purpose and adds more functionality.

TODO: fix and optimize details


Origin commit data
------------------
Commit: dde298b1b7
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-04-04 (Mon, 04 Apr 2016)
This commit is contained in:
2016-04-04 21:57:17 +02:00
parent 0897cd1c24
commit 11b3307251
81 changed files with 1981 additions and 1697 deletions

View File

@@ -46,7 +46,7 @@
#include <gui/widget/icons.h>
#include <gui/widget/stringinput.h>
#include <gui/widget/messagebox.h>
#include <gui/widget/msgbox.h>
#include <gui/widget/hintbox.h>
#include <gui/widget/progresswindow.h>
@@ -375,8 +375,8 @@ void CHDDMenuHandler::setRecordPath(std::string &dev)
}
bool old_menu = in_menu;
in_menu = false;
int res = ShowMsg(LOCALE_RECORDINGMENU_DEFDIR, LOCALE_HDD_SET_RECDIR, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo);
if(res == CMessageBox::mbrYes) {
int res = ShowMsg(LOCALE_RECORDINGMENU_DEFDIR, LOCALE_HDD_SET_RECDIR, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo);
if(res == CMsgBox::mbrYes) {
g_settings.network_nfs_recordingdir = newpath;
CRecordManager::getInstance()->SetDirectory(g_settings.network_nfs_recordingdir);
if(g_settings.timeshiftdir.empty())
@@ -426,8 +426,8 @@ int CHDDMenuHandler::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t dat
if (added && !mounted && tmp != "sr") {
std::string message = dev + ": " + g_Locale->getText(LOCALE_HDD_MOUNT_FAILED);
message += std::string(" ") + g_Locale->getText(LOCALE_HDD_FORMAT) + std::string(" ?");
int res = ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo);
if(res == CMessageBox::mbrYes) {
int res = ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo);
if(res == CMsgBox::mbrYes) {
unsigned char * p = new unsigned char[dev.size() + 1];
if (p) {
sprintf((char *)p, "%s", dev.c_str());
@@ -778,7 +778,7 @@ _show_menu:
void CHDDMenuHandler::showError(neutrino_locale_t err)
{
ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(err), CMessageBox::mbrOk, CMessageBox::mbOk);
ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(err), CMsgBox::mbrOk, CMsgBox::mbOk);
}
int CHDDMenuHandler::formatDevice(std::string dev)
@@ -809,8 +809,8 @@ int CHDDMenuHandler::formatDevice(std::string dev)
std::string mkfscmd = devtool->mkfs + " " + devtool->mkfs_options + " " + partname;
printf("mkfs cmd: [%s]\n", mkfscmd.c_str());
res = ShowMsg(LOCALE_HDD_FORMAT, g_Locale->getText(LOCALE_HDD_FORMAT_WARN), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo );
if(res != CMessageBox::mbrYes)
res = ShowMsg(LOCALE_HDD_FORMAT, g_Locale->getText(LOCALE_HDD_FORMAT_WARN), CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo );
if(res != CMsgBox::mbrYes)
return menu_return::RETURN_REPAINT;
bool srun = my_system(3, "killall", "-9", "smbd");