From 9b5ae377f655f80525fb73e26fb3bbcd601c9f32 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Thu, 14 Dec 2017 19:32:08 +0000 Subject: LinHES-config: add LH_HELP file for mythinstall and Alt+H shortcut. --- abs/core/LinHES-config/LH_HELP | 14 ++++++++++++++ abs/core/LinHES-config/PKGBUILD | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 abs/core/LinHES-config/LH_HELP diff --git a/abs/core/LinHES-config/LH_HELP b/abs/core/LinHES-config/LH_HELP new file mode 100644 index 0000000..809a4ad --- /dev/null +++ b/abs/core/LinHES-config/LH_HELP @@ -0,0 +1,14 @@ +Visit http://linhes.org for additional help. + +KEYBOARD SHORTCUTS +Alt + h: This Screen +Alt + x: Open New Terminal (xterm) +Alt + m: Open mythfrontend +m in mythfrontend: Display Power/About Menu +Alt + 1: Start Master mythbackend +Alt + 2: Stop Master mythbackend +Alt + 3: Restart Master mythbackend +Alt + s: Open mythtv-setup +Alt + u: Unhide/Hide Mouse Pointer +Alt + w: Open Web Browser (Chrome if installed) +Alt + f: Restart Window Manager diff --git a/abs/core/LinHES-config/PKGBUILD b/abs/core/LinHES-config/PKGBUILD index 86a9c5c..9d8cbc9 100755 --- a/abs/core/LinHES-config/PKGBUILD +++ b/abs/core/LinHES-config/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-config pkgver=8.5.1 -pkgrel=1 +pkgrel=2 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev LinHes-config ) pkgdesc="Install and configure your system" depends=('bc' 'libstatgrab' 'mysql-python' 'expect' 'curl' 'dnsutils' 'parted' @@ -32,6 +32,7 @@ source=(mv_install.py 09_mythvantge_runit_grub udev_link.sh restore_km_db_chroot.sh README + LH_HELP mv_advanced.py mv_common.py mv_ddns.py @@ -118,6 +119,8 @@ package() { #README file displayed on install install -m 0755 README $MVDIR/README + #LH_HELP file displayed with Alt+H shortcut + install -m 0755 LH_HELP $MVDIR/LH_HELP mkdir -p $pkgdir/usr/bin install -m 0755 file_time_offset.py $pkgdir/usr/bin/file_time_offset.py @@ -165,6 +168,7 @@ md5sums=('518c868141fe443e9258144c029ed3f9' 'd3490e93f313bbbcbc6c3693c56b9c17' 'e959df98947eb0d2ea64ff616b61aab5' '2506860a416e1988934225d80d501c2c' + '3ff600acf742700bb55b719dab863d15' 'f57200b66b6cf384f2c784b3e4303503' 'b3505d27b65a4d35e252e2d256909e80' 'b845de3e05c1734cce4b9ac5e8f1baaf' -- cgit v0.12 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 From 13a613f53db93a13464a34ad6622b1c7b60d6d70 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Thu, 14 Dec 2017 22:31:43 +0000 Subject: linhes-theme: update install-ui.xml with new mythui screens for mythinstall --- abs/core/linhes-theme/PKGBUILD | 6 ++-- abs/core/linhes-theme/install-ui.xml | 63 ++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/abs/core/linhes-theme/PKGBUILD b/abs/core/linhes-theme/PKGBUILD index 0420f3e..916e44a 100755 --- a/abs/core/linhes-theme/PKGBUILD +++ b/abs/core/linhes-theme/PKGBUILD @@ -1,6 +1,6 @@ pkgname=linhes-theme -pkgver=8.5 -pkgrel=4 +pkgver=8.5.1 +pkgrel=1 pkgdesc="Default LinHES MythTV theme" arch=('i686' 'x86_64') license=('GPL2') @@ -120,7 +120,7 @@ md5sums=('2dca856c2a4d1f959473512c94e43b60' '81a2706cd36a16a1e0c54d87f3a0857b' '4125880d1739b196a8041ecc3d773ee2' '5a8fb2a5f0e657d52be6f0a6a006ce72' - '36952501471b05395e4f061557447b2f' + '18b8ca8815f083223b70af2807546a49' 'bfc32b9fa5dca3d46dd6f365ecb449b5' '326a71eb795b322a9ea26f116d890c87' '8fcd0acc11f4db33a9442949fb1a293d' diff --git a/abs/core/linhes-theme/install-ui.xml b/abs/core/linhes-theme/install-ui.xml index 4e5f139..f006b05 100644 --- a/abs/core/linhes-theme/install-ui.xml +++ b/abs/core/linhes-theme/install-ui.xml @@ -122,4 +122,67 @@ + + + + + + 115,36,1050,649 + + + + 116,37,1048,647 + + + + 117,38,1046,2 + + + + 117,681,1046,2 + + + + 117,40,2,641 + + + + 1161,40,2,641 + + + + 138,620,1004,2 + + + + + + + + + + + + + + -- cgit v0.12 From 996617b3dfa3b9d328514d13bc7d9878365e9a59 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Fri, 15 Dec 2017 19:02:50 +0000 Subject: zilog-firmware: fix packaging --- abs/core/zilog-firmware/PKGBUILD | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/abs/core/zilog-firmware/PKGBUILD b/abs/core/zilog-firmware/PKGBUILD index c779f78..87cc82b 100644 --- a/abs/core/zilog-firmware/PKGBUILD +++ b/abs/core/zilog-firmware/PKGBUILD @@ -1,14 +1,14 @@ pkgname=zilog-firmware pkgver=1 -pkgrel=2 +pkgrel=3 pkgdesc="Firmware for zilog blaster" -arch=('i586' 'i686' 'x86_64') +arch=('x86_64') url="http://www.blushingpenguin.com/mark/blog/?p=24" source=(http://www.blushingpenguin.com/mark/lmilk/haup-ir-blaster.bin) -build() { - cd $startdir/src/ - mkdir -p $startdir/pkg/lib/firmware - install -m0755 $startdir/src/haup-ir-blaster.bin $startdir/pkg/lib/firmware +package() { + cd $srcdir/ + mkdir -p $pkgdir/usr/lib/firmware + install -m0755 $srcdir/haup-ir-blaster.bin $pkgdir/usr/lib/firmware } md5sums=('1c117d591bbcb733690e1b7b36202490') -- cgit v0.12 From 4f72f3e1acf3f3736387a44725901ad6af13018d Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Fri, 15 Dec 2017 19:10:48 +0000 Subject: nano: update to 2.9.1 --- abs/core/nano/PKGBUILD | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/abs/core/nano/PKGBUILD b/abs/core/nano/PKGBUILD index 0b809b3..07211fd 100644 --- a/abs/core/nano/PKGBUILD +++ b/abs/core/nano/PKGBUILD @@ -3,17 +3,17 @@ # Contributor: Judd pkgname=nano -pkgver=2.8.1 +pkgver=2.9.1 pkgrel=1 pkgdesc="Pico editor clone with enhancements" -arch=('i686' 'x86_64') +arch=('x86_64') license=('GPL') url="http://www.nano-editor.org" groups=('base') depends=('ncurses' 'file' 'sh') backup=('etc/nanorc') -source=(https://www.nano-editor.org/dist/v2.8/${pkgname}-${pkgver}.tar.gz{,.asc}) -sha256sums=('a48650dab5fc069bb953d020721b6c0f650969abf5a34a27dfd6f038215c5910' +source=(https://www.nano-editor.org/dist/v2.9/${pkgname}-${pkgver}.tar.xz{,.asc}) +sha256sums=('6316d52d0d26af3e79a13dcb4db1c7a4aeac61b37fd9381e801a4189a2ecba7c' 'SKIP') validpgpkeys=('8DA6FE7BFA7A418AB3CB2354BCB356DF91009FA7' # "Chris Allegretta " 'A7F6A64A67DA09EF92782DD79DF4862AF1175C5B' # "Benno Schulenberg " -- cgit v0.12 From f0aab56ffb3976db3189ad94aea7c3c7fe341906 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Wed, 20 Dec 2017 16:40:30 +0000 Subject: linhes-theme: update install-ui.xml --- abs/core/linhes-theme/PKGBUILD | 6 +++--- abs/core/linhes-theme/install-ui.xml | 4 ++-- abs/core/linhes-theme/recordings-ui.xml.patch | 21 +++++++++++++++------ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/abs/core/linhes-theme/PKGBUILD b/abs/core/linhes-theme/PKGBUILD index 916e44a..7d12dd6 100755 --- a/abs/core/linhes-theme/PKGBUILD +++ b/abs/core/linhes-theme/PKGBUILD @@ -1,6 +1,6 @@ pkgname=linhes-theme pkgver=8.5.1 -pkgrel=1 +pkgrel=2 pkgdesc="Default LinHES MythTV theme" arch=('i686' 'x86_64') license=('GPL2') @@ -112,7 +112,7 @@ md5sums=('2dca856c2a4d1f959473512c94e43b60' '643e7d548587b8742ed5accb6d736257' 'dd1e013e806efc26049ea89637a51f83' '9fe3371a8b964a7028126405cfaa330b' - '537e12f58ae8da81176d8b982ac9c783' + '958d25f7b932c923cf9f8376063eeb57' 'a0b6733e4a6734a3c24e8dc3b0c14e74' '384871202030f41148536e2e89bb1801' '4d01487b534e45c631734501ec0da501' @@ -120,7 +120,7 @@ md5sums=('2dca856c2a4d1f959473512c94e43b60' '81a2706cd36a16a1e0c54d87f3a0857b' '4125880d1739b196a8041ecc3d773ee2' '5a8fb2a5f0e657d52be6f0a6a006ce72' - '18b8ca8815f083223b70af2807546a49' + '274b6f8cb5cd82c5ce28422decd7754b' 'bfc32b9fa5dca3d46dd6f365ecb449b5' '326a71eb795b322a9ea26f116d890c87' '8fcd0acc11f4db33a9442949fb1a293d' diff --git a/abs/core/linhes-theme/install-ui.xml b/abs/core/linhes-theme/install-ui.xml index f006b05..823b0dc 100644 --- a/abs/core/linhes-theme/install-ui.xml +++ b/abs/core/linhes-theme/install-ui.xml @@ -170,12 +170,12 @@ + + + + @@ -17,7 +25,7 @@ diff --git a/abs/extra/web-on-linhes/wol-custom-cmds.sh b/abs/extra/web-on-linhes/wol-custom-cmds.sh new file mode 100755 index 0000000..2386378 --- /dev/null +++ b/abs/extra/web-on-linhes/wol-custom-cmds.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Launch commands to control a web page +# $@ contains the website that was opened +# The espn example moves the mouse and clicks to make the player active +# Then the f key is pressed to make the video fullscreen + +if [[ $@ == *"espn.com"* ]]; +then + sleep 7 + xdotool mousemove 722 531 click 1 click 1 + xdotool key f +fi -- cgit v0.12 From 5e60e91aca4fdf4e178f999a73e1b197c89795db Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Tue, 9 Jan 2018 15:55:27 +0000 Subject: xdotool: update to 3.20160805.1 --- abs/core/xdotool/PKGBUILD | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/abs/core/xdotool/PKGBUILD b/abs/core/xdotool/PKGBUILD index 0ce58a3..f8f1236 100644 --- a/abs/core/xdotool/PKGBUILD +++ b/abs/core/xdotool/PKGBUILD @@ -1,26 +1,32 @@ -# $Id: PKGBUILD 48265 2011-05-30 19:01:31Z foutrelis $ -# Maintainer: Evangelos Foutras +# $Id$ +# Maintainer: Evangelos Foutras # Contributor: Rttommy pkgname=xdotool -pkgver=2.20110530.1 +pkgver=3.20160805.1 pkgrel=1 pkgdesc="Command-line X11 automation tool" -arch=('i686' 'x86_64') +arch=('x86_64') url="http://www.semicomplete.com/projects/xdotool/" license=('BSD') -depends=('libxtst' 'libxinerama') -source=(http://semicomplete.googlecode.com/files/$pkgname-$pkgver.tar.gz) -sha1sums=('bf8372b2e76e8ee3884763cee6e8b3f66bf29aa6') +depends=('libxtst' 'libxinerama' 'libxkbcommon') +source=(https://github.com/jordansissel/xdotool/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz) +sha256sums=('35be5ff6edf0c620a0e16f09ea5e101d5173280161772fca18657d83f20fcca8') build() { cd "$srcdir/$pkgname-$pkgver" + make WITHOUT_RPATH_FIX=1 +} + +package() { + cd "$srcdir/$pkgname-$pkgver" - make make PREFIX="$pkgdir/usr" INSTALLMAN="$pkgdir/usr/share/man" install - # License - install -Dm644 COPYRIGHT "$pkgdir/usr/share/licenses/xdotool/COPYRIGHT" + # Remove execute bit from header file + chmod -x "$pkgdir/usr/include/xdo.h" + + install -Dm644 COPYRIGHT "$pkgdir/usr/share/licenses/$pkgname/COPYRIGHT" } # vim:set ts=2 sw=2 et: -- cgit v0.12 From 9b78781d4221bc00563906f7d972e1370a0ef6b1 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Tue, 16 Jan 2018 18:18:09 +0000 Subject: mythtv & mythplugins: update to latest fixes add Auto Shutdown menu to System Menu --- abs/core/mythtv/stable-29/git_src/git_hash | 2 +- abs/core/mythtv/stable-29/mythplugins/PKGBUILD | 2 +- abs/core/mythtv/stable-29/mythtv/PKGBUILD | 4 +- .../addEnableDisableAutoShutdownToSystemMenu.patch | 50 ++++++++++++++++++++++ 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 abs/core/mythtv/stable-29/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch diff --git a/abs/core/mythtv/stable-29/git_src/git_hash b/abs/core/mythtv/stable-29/git_src/git_hash index c3edd34..2ce2a78 100644 --- a/abs/core/mythtv/stable-29/git_src/git_hash +++ b/abs/core/mythtv/stable-29/git_src/git_hash @@ -1 +1 @@ -9dbf6706337b72b132f34d6c8e9f305609a44d7e +771115f47d39095652f8f660d3477008a0cbce12 diff --git a/abs/core/mythtv/stable-29/mythplugins/PKGBUILD b/abs/core/mythtv/stable-29/mythplugins/PKGBUILD index 13c6da2..a6132b3 100644 --- a/abs/core/mythtv/stable-29/mythplugins/PKGBUILD +++ b/abs/core/mythtv/stable-29/mythplugins/PKGBUILD @@ -9,7 +9,7 @@ pkgname=('mytharchive' 'mythweather' 'mythzoneminder') pkgver=29 -pkgrel=8 +pkgrel=9 arch=('i686' 'x86_64') url="http://www.mythtv.org" license=('GPL') diff --git a/abs/core/mythtv/stable-29/mythtv/PKGBUILD b/abs/core/mythtv/stable-29/mythtv/PKGBUILD index 3a8faed..cdac547 100644 --- a/abs/core/mythtv/stable-29/mythtv/PKGBUILD +++ b/abs/core/mythtv/stable-29/mythtv/PKGBUILD @@ -1,6 +1,6 @@ pkgname=mythtv pkgver=29 -pkgrel=8 +pkgrel=9 commit_hash=`cat ../git_src/git_hash` pkgdesc="A Homebrew PVR project $commit_hash" arch=('i686' 'x86_64') @@ -31,6 +31,7 @@ patches=( 'searchMetatdataSelectedGrabber.patch' 'addDamagedToProgDetails.patch' 'defaultThemeLinHES.patch' + 'addEnableDisableAutoShutdownToSystemMenu.patch' 'mythfrontend_en_us.ts_Title_Case.patch' '0006-cardutil_show_displayname.patch' '0037-pull103-Add-heuristic-in-TMDB-script-to-detect-movie-release-years.patch' @@ -130,6 +131,7 @@ md5sums=('fb5a87c52a31168a0c8fdde72f27cc45' '0f674b9cad031ba1e03aaf6b5ee1499f' '6add9c16bbb988067e82029327e567b2' 'b0b238320fa78a4928dce2cea7c85071' + '8e4492d1777234a021f368bd6ee964ee' '1164214d9eb41588f8eb3382565cb003' '5f2bd4065b145b7b7ff09dfd6f08276c' '2371cf6e680179c067a6ff7756638128' diff --git a/abs/core/mythtv/stable-29/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch b/abs/core/mythtv/stable-29/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch new file mode 100644 index 0000000..b14e2e0 --- /dev/null +++ b/abs/core/mythtv/stable-29/mythtv/addEnableDisableAutoShutdownToSystemMenu.patch @@ -0,0 +1,50 @@ +diff --git a/mythtv/libs/libmythui/myththemedmenu.cpp b/mythtv/libs/libmythui/myththemedmenu.cpp +index ed2e54c..77aaf73 100644 +--- a/mythtv/libs/libmythui/myththemedmenu.cpp ++++ b/mythtv/libs/libmythui/myththemedmenu.cpp +@@ -308,6 +308,8 @@ void MythThemedMenu::ShowMenu() + return; + + int override_menu = GetMythDB()->GetNumSetting("OverrideExitMenu"); ++ int MythShutdownLock = GetMythDB()->GetNumSetting("MythShutdownLock"); ++ int idleTimeoutSecs = GetMythDB()->GetNumSetting("idleTimeoutSecs"); + QString label = tr("System Menu"); + MythScreenStack* mainStack = GetMythMainWindow()->GetMainStack(); + m_menuPopup = new MythDialogBox(label, mainStack, "menuPopup"); +@@ -325,6 +327,21 @@ void MythThemedMenu::ShowMenu() + if (override_menu != 7) + m_menuPopup->AddButton(tr("Exit application"), QVariant("exit")); + ++ // don't offer to enable/disable auto shutdown if auto shutdown is disabled ++ if (idleTimeoutSecs != 0) ++ { ++ if (MythShutdownLock == 0) ++ { ++ m_menuPopup->AddButton(tr("Disable Auto Shutdown"), ++ QVariant("lockShutdown")); ++ } ++ else ++ { ++ m_menuPopup->AddButton(tr("Enable Auto Shutdown"), ++ QVariant("unlockShutdown")); ++ } ++ } ++ + switch (override_menu) + { + case 2: +@@ -416,6 +433,14 @@ void MythThemedMenu::customEvent(QEvent *event) + QString arg("exiting_app"); + m_state->m_callback(m_state->m_callbackdata, arg); + } ++ else if (action == "lockShutdown") ++ { ++ GetMythDB()->SaveSettingOnHost("MythShutdownLock", "1", NULL); ++ } ++ else if (action == "unlockShutdown") ++ { ++ GetMythDB()->SaveSettingOnHost("MythShutdownLock", "0", NULL); ++ } + } + else if (resultid == "password") + { -- cgit v0.12 From d3bcf5aad566eddc2514d84c148ed1f7d0ee4033 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Tue, 16 Jan 2018 18:22:01 +0000 Subject: supplemental-web: fe_status.py: change get frontend method and add IP address --- abs/core/supplemental-web/PKGBUILD | 4 +-- abs/core/supplemental-web/contents/fe_status.py | 39 +++++++++++++------------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/abs/core/supplemental-web/PKGBUILD b/abs/core/supplemental-web/PKGBUILD index ea70a2e..4fcef9e 100644 --- a/abs/core/supplemental-web/PKGBUILD +++ b/abs/core/supplemental-web/PKGBUILD @@ -1,7 +1,7 @@ pkgbase=supplemental-web pkgname=('supplemental-web' 'supplemental-web-slave') -pkgver=8.4 -pkgrel=3 +pkgver=8.5 +pkgrel=1 arch=('i686' 'x86_64') license=('GPL') backup=('data/srv/httpd/cgi/extra.cfg.txt') diff --git a/abs/core/supplemental-web/contents/fe_status.py b/abs/core/supplemental-web/contents/fe_status.py index 993ef72..439d0c5 100644 --- a/abs/core/supplemental-web/contents/fe_status.py +++ b/abs/core/supplemental-web/contents/fe_status.py @@ -25,7 +25,8 @@ def parse_xml(frontend): tree = ET.parse(xml) root = tree.getroot() except: - msg(" Couldn't connect to %s" %frontend) + #msg(" Couldn't connect to %s" %frontend) + temp_dict['state'] = "offline" return temp_dict lst = root.find("State") @@ -51,23 +52,25 @@ def parse_xml(frontend): def mythfe_status(cursor,mythDB): - frontends=list(Frontend.fromUPNP()) status_dict={} - #try: + try: #frontends = mythDB.getFrontends() #use cursor instead so it doesn't test connection - #cursor.execute("select hostname from settings where value = 'FrontendIdleTimeout'") - #frontends=cursor.fetchall() - #except: - #msg("Excptions") - #return + cursor.execute("select distinct hostname from settings where hostname is not null;") + frontends=cursor.fetchall() + except: + #msg("Exceptions") + return for i in frontends: + i=''.join(i) try: - fe_hostname = socket.gethostbyaddr(i.host)[0] + fe_hostname = socket.gethostbyaddr(i)[0] except: - print "DNS lookup failed for %s" %i.host - fe_hostname = i.host - status_dict[fe_hostname] = parse_xml(i.host) + #print "DNS lookup failed for %s" %i + fe_hostname = socket.gethostbyname(i) + ip_addr = socket.gethostbyname(i) + fe_hostname = "%s (%s)" %(fe_hostname,ip_addr) + status_dict[fe_hostname] = parse_xml(ip_addr) return status_dict @@ -102,12 +105,12 @@ def print_html(status_dict): print "" print '' - print ''' - -''' +# print ''' +# +#''' def main(): -- cgit v0.12