From 617a3af08e1baa921cda93e0077121f22a9447d9 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Thu, 14 Dec 2017 22:29:56 +0000 Subject: mythinstall: port question, readme and help screens to MythUI eliminate some compiler warnings by checking for system call outputs. --- .../MythVantage-app/mythinstall/installdialog.cpp | 53 +++-- .../MythVantage-app/mythinstall/main.cpp | 222 +++++++++------------ .../MythVantage-app/mythinstall/mythinstall.pro | 4 +- .../MythVantage-app/mythinstall/questionnotice.cpp | 136 +++++++++++++ .../MythVantage-app/mythinstall/questionnotice.h | 43 ++++ .../MythVantage-app/mythinstall/xorgsettings.h | 1 - abs/core/mythinstall/PKGBUILD | 8 +- abs/core/mythinstall/install-ui.xml | 40 ++++ 8 files changed, 349 insertions(+), 158 deletions(-) create mode 100755 abs/core/mythinstall/MythVantage-app/mythinstall/questionnotice.cpp create mode 100755 abs/core/mythinstall/MythVantage-app/mythinstall/questionnotice.h diff --git a/abs/core/mythinstall/MythVantage-app/mythinstall/installdialog.cpp b/abs/core/mythinstall/MythVantage-app/mythinstall/installdialog.cpp index 6f4252f..a067f98 100755 --- a/abs/core/mythinstall/MythVantage-app/mythinstall/installdialog.cpp +++ b/abs/core/mythinstall/MythVantage-app/mythinstall/installdialog.cpp @@ -23,10 +23,9 @@ WelcomeDialog::WelcomeDialog(MythScreenStack *parent, const char *name) - :MythScreenType(parent, name), - m_status_text(NULL), m_recording_text(NULL), m_scheduled_text(NULL), - m_time_text(NULL), m_date_text(NULL), - m_menuPopup(NULL), m_mv_text(NULL) + :MythScreenType(parent, name), m_menuPopup(NULL), + m_status_text(NULL),m_recording_text(NULL), m_scheduled_text(NULL), + m_mv_text(NULL), m_time_text(NULL), m_date_text(NULL) { // system("rm -f /tmp/.install_state"); @@ -104,9 +103,11 @@ void WelcomeDialog::shutdownNow(int rc) // system("rm -f /tmp/.install_percent"); // system("rm -f /tmp/.install_error"); if (rc == 1) - system("/sbin/halt"); + if(!system("/sbin/halt")) + LOG(VB_GENERAL, LOG_ERR, "Error running halt"); else - system("/sbin/reboot"); + if(!system("/sbin/reboot")) + LOG(VB_GENERAL, LOG_ERR, "Error running reboot"); } void WelcomeDialog::runLIVECD(void) @@ -159,7 +160,8 @@ bool WelcomeDialog::keyPressEvent(QKeyEvent *event) // QByteArray tmp = cmd.toAscii(); // QByteArray tmp = cmd; // system(tmp); - system(qPrintable(cmd)); + if(!system(qPrintable(cmd))) + LOG(VB_GENERAL, LOG_ERR, "Error running MythShutdownXTermCMD"); } } else @@ -174,7 +176,6 @@ bool WelcomeDialog::keyPressEvent(QKeyEvent *event) void WelcomeDialog::closeDialog() { Close(); - exit(0); } @@ -229,7 +230,8 @@ void WelcomeDialog::updateScreen(void) QString cmdtxt; cmdtxt=MV_ROOT ; cmdtxt.append("bin/install_proxy.sh " ); - system(qPrintable(cmdtxt)); + if(!system(qPrintable(cmdtxt))) + LOG(VB_GENERAL, LOG_ERR, "Error running install_proxy.sh"); recording_text="Press MENU for Options"; mythvantage_text=" "; error_text=" "; @@ -522,7 +524,7 @@ QString WelcomeDialog::findinstallsouce(void) { getline (mountfile,line); if ( line.empty() ) - line = "oops didn't find andthing"; + line = "oops didn't find anything"; currentitem= ( QString::fromStdString( line ) ); @@ -867,7 +869,8 @@ void WelcomeDialog::install_generic(void) QString cmdtxt; cmdtxt=MV_ROOT ; cmdtxt.append("bin/install_proxy.sh find_update " + install_drive +" &"); - system(qPrintable(cmdtxt)); + if(!system(qPrintable(cmdtxt))) + LOG(VB_GENERAL, LOG_ERR, "Could not run install_proxy.sh find update"); busy_find_oldsettings(); bool flag = false; QString line; @@ -1000,14 +1003,14 @@ int WelcomeDialog::ask_validate_network(void) QString cmdtxt; cmdtxt=MV_ROOT ; cmdtxt.append("bin/install_proxy.sh network_check_it setup_network &"); - retval = system(qPrintable(cmdtxt)); + retval = system(qPrintable(cmdtxt)); busy_network(); if (network_check) { network_check->setProgress(2); cmdtxt=MV_ROOT ; cmdtxt.append("bin/install_proxy.sh network_check_it check_self"); - retval = system(qPrintable(cmdtxt)); + retval = system(qPrintable(cmdtxt)); if ( retval != 0 ) { network_check->Close(); @@ -1020,7 +1023,7 @@ int WelcomeDialog::ask_validate_network(void) network_check->setProgress(3); cmdtxt=MV_ROOT ; cmdtxt.append("bin/install_proxy.sh network_check_it check_gw"); - retval = system(qPrintable(cmdtxt)); + retval = system(qPrintable(cmdtxt)); if ( retval != 0 ) { network_check->Close(); @@ -1033,7 +1036,7 @@ int WelcomeDialog::ask_validate_network(void) network_check->setProgress(4); cmdtxt=MV_ROOT ; cmdtxt.append("bin/install_proxy.sh network_check_it check_ns"); - retval = system(qPrintable(cmdtxt)); + retval = system(qPrintable(cmdtxt)); if ( retval != 0 ) { network_check->Close(); @@ -1046,7 +1049,7 @@ int WelcomeDialog::ask_validate_network(void) network_check->setProgress(5); cmdtxt=MV_ROOT ; cmdtxt.append("bin/install_proxy.sh network_check_it check_names"); - retval = system(qPrintable(cmdtxt)); + retval = system(qPrintable(cmdtxt)); if ( retval != 0 ) { network_check->Close(); @@ -1059,7 +1062,7 @@ int WelcomeDialog::ask_validate_network(void) network_check->setProgress(6); cmdtxt=MV_ROOT ; cmdtxt.append("bin/install_proxy.sh network_check_it host_names"); - retval = system(qPrintable(cmdtxt)); + retval = system(qPrintable(cmdtxt)); if ( retval != 0 ) { network_check->Close(); @@ -1154,14 +1157,18 @@ void WelcomeDialog::install_it(void) QString cmdtxt=MV_ROOT ; //cmdtxt.append("bin/install_proxy.sh full_install_it " + install_drive + " " + rootfs + " " + rootsize + " " + datafs + " " + datasize + " " + swapsize + "&"); cmdtxt.append("bin/install_proxy.sh full_install_it &"); - system(qPrintable(cmdtxt)); + if(!system(qPrintable(cmdtxt))) + LOG(VB_GENERAL, LOG_ERR, "Error running install_proxy.sh full_install_it"); + } else if ( installtype == "Upgrade" ) { QString cmdtxt=MV_ROOT ; //cmdtxt.append("bin/install_proxy.sh upgrade_it " + install_drive + " " + uprootfs + "&"); cmdtxt.append("bin/install_proxy.sh upgrade_it &"); - system(qPrintable(cmdtxt)); + if(!system(qPrintable(cmdtxt))) + LOG(VB_GENERAL, LOG_ERR, "Error running install_proxy.sh upgrade_it"); + } else if (installtype=="NET") { @@ -1178,11 +1185,15 @@ void WelcomeDialog::install_it(void) QString h; h=localhostname; cmdtxt.append("bin/restore_default_settings.sh -c save -t syssettings -d 127.0.0.1 -h " + h); - system(qPrintable(cmdtxt)); + if(!system(qPrintable(cmdtxt))) + LOG(VB_GENERAL, LOG_ERR, "Error running restore_default_settings.sh"); + cmdtxt=MV_ROOT ; //cmdtxt.append("bin/install_proxy.sh NETBOOT " + install_drive + " &"); cmdtxt.append("bin/install_proxy.sh NETBOOT &"); - system(qPrintable(cmdtxt)); + if(!system(qPrintable(cmdtxt))) + LOG(VB_GENERAL, LOG_ERR, "Error running install_proxy.sh NETBOOT"); + } WORKING_ON_INSTALL = true; diff --git a/abs/core/mythinstall/MythVantage-app/mythinstall/main.cpp b/abs/core/mythinstall/MythVantage-app/mythinstall/main.cpp index b6e66cd..51cce48 100755 --- a/abs/core/mythinstall/MythVantage-app/mythinstall/main.cpp +++ b/abs/core/mythinstall/MythVantage-app/mythinstall/main.cpp @@ -5,9 +5,7 @@ #include "password_manage.h" #include "autocard.h" #include "settemplate.h" - - - +#include "questionnotice.h" // Qt #include @@ -15,15 +13,12 @@ #include #include - #include #include #include #include -#include - - - +#include // for milliseconds +#include // for sleep_for #include @@ -39,13 +34,12 @@ #include "commandlineparser.h" #include "mythlogging.h" #include "dialogbox.h" - +#include "signalhandling.h" // libmythui #include "mythmainwindow.h" #include "mythuihelper.h" - //?? #include "myththemebase.h" @@ -254,9 +248,8 @@ int main(int argc, char **argv) bShowHelp = true; if (cmdline.toBool("readme")) - { bShowReadme = true; - } + if (cmdline.toBool("question")) { bShowquestion = true; @@ -267,11 +260,11 @@ int main(int argc, char **argv) bRunSetup = true; if (cmdline.toBool("show_lang")) - showLang = true; + showLang = true; LCD::SetupLCD(); if (class LCD *lcd = LCD::Get()) - lcd->switchToTime(); + lcd->switchToTime(); MythTranslation::load("mythfrontend"); @@ -300,14 +293,16 @@ int main(int argc, char **argv) gCoreContext->ActivateSettingsCache(false); gCoreContext->ClearSettingsCache(); bool runconfig = false; - system("cp -f /etc/systemconfig /tmp/systemconfig.bak"); + if (!system("cp -f /etc/systemconfig /tmp/systemconfig.bak")) + LOG(VB_GENERAL, LOG_ERR, "Could not backup /etc/systemconfig."); QString olddb = gCoreContext->GetSetting("HostMysqlserver"); QString oldhostype = gCoreContext->GetSetting("HostSystemType"); //sync db with pacman if (bShowplugins || bShowsoftware) { - system("pacman -Q > /tmp/pacman_installed"); + if (!system("pacman -Q > /tmp/pacman_installed")) + LOG(VB_GENERAL, LOG_ERR, "Could not create /tmp/pacman_installed."); QString progPacmanNamesArray[] = { "mythappletrailers", "mytharchive", "mythbrowser", @@ -370,7 +365,7 @@ int main(int argc, char **argv) QByteArray PacName = progPacmanNamesArray[i].toLocal8Bit(); const char *PacNameChar = PacName.data(); sprintf(cmd, "grep -q '%s ' /tmp/pacman_installed", PacNameChar); - + //LOG(VB_GENERAL, LOG_INFO, QString(progPacmanNamesArray[i])); //LOG(VB_GENERAL, LOG_INFO, QString(progDBNamesArray[i])); QString currDBValue = gCoreContext->GetSetting(progDBNamesArray[i]); @@ -389,7 +384,8 @@ int main(int argc, char **argv) runconfig = true; } } - system("rm -f /tmp/pacman_installed"); + if (!system("rm -f /tmp/pacman_installed")) + LOG(VB_GENERAL, LOG_ERR, "Could not remove /tmp/pacman_installed."); } //DONE sync db with pacman @@ -401,7 +397,8 @@ int main(int argc, char **argv) //save my settings in case db switches QString cmdtxt=MV_ROOT; cmdtxt.append("bin/myth_settings_wrapper.sh -c save -t syssettings -d " + olddb); - system(qPrintable(cmdtxt)); + if (!system(qPrintable(cmdtxt))) + LOG(VB_GENERAL, LOG_ERR, "Could not save settings"); if ( status != 0 ) { @@ -416,7 +413,8 @@ int main(int argc, char **argv) QString cmdtxt; cmdtxt=MV_ROOT; cmdtxt.append("bin/myth_settings_wrapper.sh -c save -t syssettings -d " + olddb ) ; - system(qPrintable(cmdtxt)); + if (!system(qPrintable(cmdtxt))) + LOG(VB_GENERAL, LOG_ERR, "Could not save settings"); } if ( runconfig ) @@ -437,7 +435,9 @@ int main(int argc, char **argv) } - system("rm -f /tmp/systemconfig.bak"); + if (!system("rm -f /tmp/systemconfig.bak")) + LOG(VB_GENERAL, LOG_ERR, "Could not remove /tmp/systemconfig.bak."); + gCoreContext->ActivateSettingsCache(false); gCoreContext->ClearSettingsCache(); if ( restart ) @@ -450,14 +450,16 @@ int main(int argc, char **argv) problems->append("\n"); dia = new DialogBox(mainWindow, problems->append("\n" )); dia->AddButton(QObject::tr("OK")); - int returncode = 0; - returncode = dia->exec(); + //int returncode = 0; + //returncode = dia->exec(); + dia->exec(); dia->deleteLater(); //cout << "restarting" << endl; QString cmdtxt; cmdtxt=MV_ROOT ; cmdtxt.append("bin/systemconfig.sh reloadfe" ); - system(qPrintable(cmdtxt)); + if (!system(qPrintable(cmdtxt))) + LOG(VB_GENERAL, LOG_ERR, "Could not reload frontend."); } gCoreContext->ActivateSettingsCache(false); gCoreContext->ClearSettingsCache(); @@ -530,66 +532,42 @@ int main(int argc, char **argv) else if (bShowHelp) { - DialogBox *dia = NULL; - QString prompt; - QString *problems = new QString("LinHES Help"); - problems->append("\n"); - problems->append("Visit http://linhes.org for additional help."); - problems->append("\n"); - problems->append("\n"); - problems->append("------Keyboard Shortcuts---------------------------------"); - problems->append("\n"); - problems->append("Alt + h: This Screen"); - problems->append("\n"); -#ifdef __MVAPP__ - problems->append("F2: Open/Close Terminal"); - problems->append("\n"); - problems->append("Shift + Return: Open New Terminal (xterm)"); - problems->append("\n"); - problems->append("Alt + F2: Show 2nd desktop Alt + F1 To Go Back"); - problems->append("\n"); - problems->append("Alt + c: Capture Myth Screenshot"); - problems->append("\n"); -#else - problems->append("Alt + x: Open New Terminal (xterm)"); - problems->append("\n"); - problems->append("Alt + m: Open mythfrontend"); - problems->append("\n"); - problems->append("m in mythfrontend: Display Power/About Menu"); - problems->append("\n"); -#endif - problems->append("Alt + 1: Start Master mythbackend"); - problems->append("\n"); - problems->append("Alt + 2: Stop Master mythbackend"); - problems->append("\n"); - problems->append("Alt + 3: Restart Master mythbackend"); - problems->append("\n"); - problems->append("Alt + s: Open mythtv-setup"); - problems->append("\n"); - problems->append("Alt + u: Unhide/Hide Mouse Pointer"); - problems->append("\n"); - problems->append("Alt + w: Open Web Browser (Chrome if installed)"); - problems->append("\n"); - problems->append("Alt + f: Restart Window Manager"); - problems->append("\n"); + QString line; + QString LH_HelpText; + QFile file("/usr/MythVantage/LH_HELP"); + if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) + { + QTextStream t( &file ); // use a text stream + while ( !t.atEnd() ) + { + line = t.readLine(); + LH_HelpText.append(line); + LH_HelpText.append("\n"); + } + file.close(); + } + else + LH_HelpText.append("Couldn't open /usr/MythVantage/LH_HELP"); + MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); + QuestionNoticeDialog *questionNotice = new QuestionNoticeDialog(mainStack, + "Notice"); + if (questionNotice->Create("notice", "LinHES Help", LH_HelpText)) + mainStack->AddScreen(questionNotice, true); + else + return -1; + + do + { + qApp->processEvents(); + std::this_thread::sleep_for(std::chrono::milliseconds(5)); + } while (mainStack->TotalScreens() > 0); - dia = new DialogBox(mainWindow, problems->append("\n" )); - dia->AddButton(QObject::tr("OK")); - int returncode = 0; - returncode = dia->exec(); - dia->deleteLater(); - DestroyMythMainWindow(); - delete gContext; - return returncode; } else if (bShowReadme) { - DialogBox *dia = NULL; - QString prompt; QString line; - QString *problems = new QString(""); - problems->append("\n"); + QString readmeText; QFile file("/usr/MythVantage/README"); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { @@ -597,88 +575,72 @@ int main(int argc, char **argv) while ( !t.atEnd() ) { line = t.readLine(); - problems->append(line); - problems->append("\n"); + readmeText.append(line); + readmeText.append("\n"); } file.close(); } else - problems->append("Couldn't open file"); - dia = new DialogBox(mainWindow, problems->append("\n" )); - dia->AddButton(QObject::tr("OK")); - int returncode = 0; - returncode = dia->exec(); - dia->deleteLater(); - DestroyMythMainWindow(); - delete gContext; - return returncode; - } + readmeText.append("Couldn't open /usr/MythVantage/README"); + MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); + QuestionNoticeDialog *questionNotice = new QuestionNoticeDialog(mainStack, + "Notice"); + if (questionNotice->Create("notice", "Welcome to LinHES!", readmeText)) + mainStack->AddScreen(questionNotice, true); + else + return -1; + + do + { + qApp->processEvents(); + std::this_thread::sleep_for(std::chrono::milliseconds(5)); + } while (mainStack->TotalScreens() > 0); + } else if (bShowquestion) { //LOG(VB_GENERAL, LOG_INFO, QString(question)); - DialogBox *dia = NULL; - QString prompt; - QString *problems = new QString(""); - problems->append("\n"); - problems->append("\n"); - problems->append(question); - dia = new DialogBox(mainWindow, problems->append("\n" )); - dia->AddButton(QObject::tr("Yes")); - dia->AddButton(QObject::tr("No")); - int returncode = 0; + extern int questionReturnCode; //as extern to be set in questionnotice.cpp - returncode = dia->exec(); - dia->deleteLater(); - DestroyMythMainWindow(); - delete gContext; + MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); + QuestionNoticeDialog *questionNotice = new QuestionNoticeDialog(mainStack, + "Question"); + if (questionNotice->Create("question", "Question", question)) + mainStack->AddScreen(questionNotice, true); + else + return -1; - return returncode; + do + { + qApp->processEvents(); + std::this_thread::sleep_for(std::chrono::milliseconds(5)); + } while (mainStack->TotalScreens() > 0); + retval = questionReturnCode; } else { - if (LanguageSelection::prompt(showLang)){ + if (LanguageSelection::prompt(showLang)) + { //taken from reloadTheme mythtv-setup MythTranslation::reload(); GetMythMainWindow()->ReinitDone(); - } MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); WelcomeDialog *welcome = new WelcomeDialog(mainStack, "Welcome"); if (welcome->Create()) - { mainStack->AddScreen(welcome, true); - } else return -1; do { - qApp->processEvents(); - usleep(5000); + std::this_thread::sleep_for(std::chrono::milliseconds(5)); } while (mainStack->TotalScreens() > 0); - - - // DestroyMythMainWindow(); - // delete gContext; - // gContext = NULL; - // delete qApp; - } DestroyMythMainWindow(); - - //gCoreContext->GetSetting("MasterServerIP"); - //gCoreContext->GetSetting("BackendServerIP"); - - - delete gContext; - gContext = NULL ; - //delete qApp; - - return 0; + SignalHandler::Done(); + return retval; } - - diff --git a/abs/core/mythinstall/MythVantage-app/mythinstall/mythinstall.pro b/abs/core/mythinstall/MythVantage-app/mythinstall/mythinstall.pro index f517c43..8dd6855 100755 --- a/abs/core/mythinstall/MythVantage-app/mythinstall/mythinstall.pro +++ b/abs/core/mythinstall/MythVantage-app/mythinstall/mythinstall.pro @@ -41,7 +41,7 @@ QMAKE_CLEAN += $(TARGET) //HEADERS += commandlineparser.h //SOURCES += main.cpp commandlineparser.cpp -HEADERS += installdialog.h commandlineparser.h installsettings.h settemplate.h installationtype.h autocard.h xorgsettings.h password_manage.h misc_settings.h mv_common.h infrared.h compat-mv.h supplemental.h vnc.h fileshare.h -SOURCES += main.cpp commandlineparser.cpp installdialog.cpp installsettings.cpp settemplate.cpp installationtype.cpp autocard.cpp xorgsettings.cpp password_manage.cpp misc_settings.cpp infrared.cpp compat-mv.cpp supplemental.cpp vnc.cpp fileshare.cpp +HEADERS += installdialog.h commandlineparser.h installsettings.h settemplate.h installationtype.h autocard.h xorgsettings.h password_manage.h misc_settings.h mv_common.h infrared.h compat-mv.h supplemental.h vnc.h fileshare.h questionnotice.h +SOURCES += main.cpp commandlineparser.cpp installdialog.cpp installsettings.cpp settemplate.cpp installationtype.cpp autocard.cpp xorgsettings.cpp password_manage.cpp misc_settings.cpp infrared.cpp compat-mv.cpp supplemental.cpp vnc.cpp fileshare.cpp questionnotice.cpp QT += sql xml network widgets diff --git a/abs/core/mythinstall/MythVantage-app/mythinstall/questionnotice.cpp b/abs/core/mythinstall/MythVantage-app/mythinstall/questionnotice.cpp new file mode 100755 index 0000000..529be89 --- /dev/null +++ b/abs/core/mythinstall/MythVantage-app/mythinstall/questionnotice.cpp @@ -0,0 +1,136 @@ +// ANSI C +#include + +// POSIX +#include + +// qt +#include +#include +#include +#include + +// myth +#include "exitcodes.h" +#include "mythcontext.h" +#include "signalhandling.h" +#include "questionnotice.h" + +int questionReturnCode; + +QuestionNoticeDialog::QuestionNoticeDialog(MythScreenStack *parent, + const char *name) + :MythScreenType(parent, name), + m_title_text(NULL), m_notice_text(NULL), m_question_text(NULL) +{ + gCoreContext->addListener(this); +} + +bool QuestionNoticeDialog::Create(QString questionORnotice, QString title, + QString displayText) +{ + bool foundtheme = false; + + // Load the theme for this screen + foundtheme = LoadWindowFromXML("install-ui.xml", + "questionnotice_screen", this); + + if (!foundtheme) + return false; + + bool err = false; + + UIUtilE::Assign(this, m_title_text, "title", &err); + UIUtilE::Assign(this, m_notice_text, "notice_text", &err); + UIUtilE::Assign(this, m_ok_button, "ok_button", &err); + UIUtilE::Assign(this, m_question_text, "question_text", &err); + UIUtilE::Assign(this, m_yes_button, "yes_button", &err); + UIUtilE::Assign(this, m_no_button, "no_button", &err); + + if (err) + { + LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'questionnotice_screen'"); + return false; + } + + m_title_text->SetVisible(true); + m_title_text->SetText(title); + + //LOG(VB_GENERAL, LOG_INFO, QString(questionORnotice)); + //LOG(VB_GENERAL, LOG_INFO, QString(displayText)); + + //show the correct text and buttons depending on questionORnotice + if (questionORnotice.contains("notice")) + { + m_notice_text->SetVisible(true); + m_notice_text->SetText(displayText); + m_ok_button->SetVisible(true); + m_question_text->SetVisible(false); + m_yes_button->SetVisible(false); + m_no_button->SetVisible(false); + } + else + { + m_notice_text->SetVisible(false); + m_ok_button->SetVisible(false); + m_question_text->SetVisible(true); + m_question_text->SetText(displayText); + m_yes_button->SetVisible(true); + m_no_button->SetVisible(true); + } + + m_ok_button->SetText(tr("OK")); + connect(m_ok_button, SIGNAL(Clicked()), + this, SLOT(okButtonClick())); + m_yes_button->SetText(tr("Yes")); + connect(m_yes_button, SIGNAL(Clicked()), + this, SLOT(yesButtonClick())); + m_no_button->SetText(tr("No")); + connect(m_no_button, SIGNAL(Clicked()), + this, SLOT(noButtonClick())); + + BuildFocusList(); + + return true; +} + +void QuestionNoticeDialog::okButtonClick(void) +{ + // this makes sure the button appears to click properly + QTimer::singleShot(500, this, SLOT(okButton())); +} + +void QuestionNoticeDialog::okButton(void) +{ + questionReturnCode = 0; + Close(); +} + +void QuestionNoticeDialog::yesButtonClick(void) +{ + // this makes sure the button appears to click properly + QTimer::singleShot(500, this, SLOT(yesButton())); +} + +void QuestionNoticeDialog::yesButton(void) +{ + questionReturnCode = 16; + Close(); +} + +void QuestionNoticeDialog::noButtonClick(void) +{ + // this makes sure the button appears to click properly + QTimer::singleShot(500, this, SLOT(noButton())); +} + +void QuestionNoticeDialog::noButton(void) +{ + questionReturnCode = 17; + Close(); +} + +QuestionNoticeDialog::~QuestionNoticeDialog() +{ + gCoreContext->removeListener(this); +} diff --git a/abs/core/mythinstall/MythVantage-app/mythinstall/questionnotice.h b/abs/core/mythinstall/MythVantage-app/mythinstall/questionnotice.h new file mode 100755 index 0000000..a2c2c79 --- /dev/null +++ b/abs/core/mythinstall/MythVantage-app/mythinstall/questionnotice.h @@ -0,0 +1,43 @@ +#ifndef QUESIONNOTICEDIALOG_H_ +#define QUESIONNOTICEDIALOG_H_ + +// qt +#include + +// libmythui +#include "mythscreentype.h" +#include "mythuibutton.h" +#include "mythuitext.h" +#include "mythdialogbox.h" + +class QuestionNoticeDialog : public MythScreenType +{ + + Q_OBJECT + +public: + QuestionNoticeDialog(MythScreenStack *parent, const char *name); + ~QuestionNoticeDialog(); + + bool Create(QString questionORnotice, QString title, QString displayText); + +protected slots: + void yesButton(void); + void yesButtonClick(void); + void noButton(void); + void noButtonClick(void); + void okButton(void); + void okButtonClick(void); + +private: + // GUI stuff + MythUIText *m_title_text; + MythUIText *m_notice_text; + MythUIButton *m_ok_button; + + MythUIText *m_question_text; + MythUIButton *m_yes_button; + MythUIButton *m_no_button; +}; + +#endif diff --git a/abs/core/mythinstall/MythVantage-app/mythinstall/xorgsettings.h b/abs/core/mythinstall/MythVantage-app/mythinstall/xorgsettings.h index 88f202c..ad62564 100755 --- a/abs/core/mythinstall/MythVantage-app/mythinstall/xorgsettings.h +++ b/abs/core/mythinstall/MythVantage-app/mythinstall/xorgsettings.h @@ -109,7 +109,6 @@ static HostComboBox *HostXres() gc->addSelection("Auto") ; gc->setHelpText(QObject::tr("")); system ("print_xorg_res.py"); - QFile file("/tmp/modelines"); QString line; if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) diff --git a/abs/core/mythinstall/PKGBUILD b/abs/core/mythinstall/PKGBUILD index 73c44fe..c51cbe5 100644 --- a/abs/core/mythinstall/PKGBUILD +++ b/abs/core/mythinstall/PKGBUILD @@ -1,10 +1,10 @@ # Maintainer: Jams pkgname=mythinstall -pkgver=8.5 -pkgrel=2 +pkgver=8.5.1 +pkgrel=1 pkgdesc="LinHES installer/systemconfig GUI." arch=('i686' 'x86_64') -depends=('mythtv>=29') +depends=('mythtv>=29' 'LinHES-config') makedepends=('mythtv>=29') logofiles=`ls logo*.png` source=('install-ui.xml' $logofiles) @@ -33,7 +33,7 @@ package() { done } -md5sums=('39d6b7bd1ee305c5523a3cf66d4c2338' +md5sums=('4e587d53e64cb9cda12b0133a1fe1831' 'c4c26977b723a4b5d6435ede73051d1b' '27ce7f89a83864dfc5abe23c61964c0c' '3291ad55fe6d7884fc732313f1cc2924' diff --git a/abs/core/mythinstall/install-ui.xml b/abs/core/mythinstall/install-ui.xml index 45b5404..4c51ce9 100755 --- a/abs/core/mythinstall/install-ui.xml +++ b/abs/core/mythinstall/install-ui.xml @@ -147,4 +147,44 @@ + + + + + + + + + + + + + + + + + -- cgit v0.12