diff options
author | Britney Fransen <brfransen@gmail.com> | 2013-12-09 23:00:51 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2013-12-09 23:00:51 (GMT) |
commit | 23b63734b90bb8c37d88673383002cbd210cdc99 (patch) | |
tree | 8179ce273843f1527fc515c1fd59df75d0d9c77d /abs/core/mythinstall/MythVantage-app/mythbeselect/installdialog.cpp | |
parent | 9c7a9f742bbe8a69bdf50335e8218a45c3f28721 (diff) | |
download | linhes_pkgbuild-23b63734b90bb8c37d88673383002cbd210cdc99.zip linhes_pkgbuild-23b63734b90bb8c37d88673383002cbd210cdc99.tar.gz linhes_pkgbuild-23b63734b90bb8c37d88673383002cbd210cdc99.tar.bz2 |
mythinstall: pull in MythVantage src to LH tree.
more cleanup to many modules.
access can now disable remotes and screensaver
Diffstat (limited to 'abs/core/mythinstall/MythVantage-app/mythbeselect/installdialog.cpp')
-rwxr-xr-x | abs/core/mythinstall/MythVantage-app/mythbeselect/installdialog.cpp | 216 |
1 files changed, 216 insertions, 0 deletions
diff --git a/abs/core/mythinstall/MythVantage-app/mythbeselect/installdialog.cpp b/abs/core/mythinstall/MythVantage-app/mythbeselect/installdialog.cpp new file mode 100755 index 0000000..6d1920f --- /dev/null +++ b/abs/core/mythinstall/MythVantage-app/mythbeselect/installdialog.cpp @@ -0,0 +1,216 @@ +#include <qapplication.h> +#include <unistd.h> +#include <fstream> +#include <sys/wait.h> // For WIFEXITED on Mac OS X + +#include "mythcontext.h" +#include "mythdbcon.h" +#include "lcddevice.h" +#include "tv.h" +#include "programinfo.h" +#include "uitypes.h" +#include "remoteutil.h" +#include "installdialog.h" +#include "libmyth/dialogbox.h" +#include <qvaluevector.h> +#include <stdlib.h> +#define UPDATE_STATUS_INTERVAL 5000 +#define UPDATE_SCREEN_INTERVAL 5000 +QStringList belist; +BEvector beveclist (100); +QString BECommand; +int retval; +int runstuff(QStringList hostlist,BEvector Bea,QString bcmd ){ +belist=hostlist; +beveclist = Bea; +BECommand=bcmd; + +WelcomeDialog *mythWelcome = new WelcomeDialog(gContext->GetMainWindow(), + "welcome_screen", "bpopup-", + "welcome_screen"); + mythWelcome->exec(); + delete mythWelcome; + return (0); +} + + +WelcomeDialog::WelcomeDialog(MythMainWindow *parent, + QString window_name, + QString theme_filename, + const char* name) +:MythThemedDialog(parent, window_name, theme_filename, name) +{ + gContext->addListener(this); + m_timeFormat = gContext->GetSetting("TimeFormat", "h:mm AP"); + wireUpTheme(); + assignFirstFocus(); + popup = NULL; + showPopup(); +} + + +int WelcomeDialog::exec() +{ + return MythDialog::exec(); +} + + + +void WelcomeDialog::keyPressEvent(QKeyEvent *e) +{ + bool handled = false; + + QStringList actions; + gContext->GetMainWindow()->TranslateKeyPress("Welcome", e, actions); + + for (unsigned int i = 0; i < actions.size() && !handled; i++) + { + QString action = actions[i]; + handled = true; + if (action == "ESCAPE") + { + return; // eat escape key + } + else if (action == "MENU") + { + showPopup(); + } + else if (action == "NEXTVIEW") + { + accept(); + } + else if (action == "SELECT") + { + activateCurrent(); + } + else + handled = false; + } + + if (!handled) + MythThemedDialog::keyPressEvent(e); +} + +UITextType* WelcomeDialog::getTextType(QString name) +{ + UITextType* type = getUITextType(name); + + if (!type) + { + cout << "ERROR: Failed to find '" << name << "' UI element in theme file\n" + << "Bailing out!" << endl; + exit(0); + } + return type; +} + +void WelcomeDialog::wireUpTheme() +{ + m_status_text = getTextType("status_text"); + m_recording_text = getTextType("recording_text"); + m_scheduled_text = getTextType("scheduled_text"); + m_time_text = getTextType("time_text"); + m_date_text = getTextType("date_text"); + m_warning_text = getTextType("conflicts_text"); + m_warning_text->hide(); + buildFocusList(); +} + +void WelcomeDialog::closeDialog() +{ +cout <<"close dialog" <<endl; + done(1); +} + +WelcomeDialog::~WelcomeDialog() +{ + gContext->removeListener(this); + + if (m_updateStatusTimer) + delete m_updateStatusTimer; + + if (m_updateScreenTimer) + delete m_updateScreenTimer; + + if (m_timeTimer) + delete m_timeTimer; +} + +void WelcomeDialog::updateTime(void) +{ + QString s=""; + m_date_text->SetText(s); +} + +void WelcomeDialog::updateStatus(void) +{ + updateStatusMessage(); +} + +void WelcomeDialog::updateScreen(void) +{ + m_recording_text->SetText(recording_text); + m_scheduled_text->SetText(scheduled_text); + m_status_text->SetText(""); + m_updateScreenTimer->start(UPDATE_SCREEN_INTERVAL, true); + +} + +void WelcomeDialog::updateAll(void) +{ + updateRecordingList(); + updateScheduledList(); +} + +bool WelcomeDialog::updateRecordingList() +{ + return true; +} + +bool WelcomeDialog::updateScheduledList() +{ + + + updateStatus(); + updateScreen(); + return true; +} + +void WelcomeDialog::updateStatusMessage(void) +{ + +} + +void WelcomeDialog::showPopup(void) +{ + if (popup) + return; + DialogCode retitem = MythPopupBox::ShowButtonPopup(gContext->GetMainWindow(), + QString("JobQueuePopup"), + QObject::tr("Select Backend to " + BECommand ), + belist,kDialogCodeButton0); + retval = retitem - kDialogCodeListStart; + cout << beveclist[retval] << endl; + cancelPopup(); + dorestart( BECommand , beveclist[retval] ); + } + + + +void WelcomeDialog::cancelPopup(void) +{ + if (!popup) + return; + popup->hide(); + popup->deleteLater(); + popup = NULL; + setActiveWindow(); +} + +void dorestart (QString command , QString behost) +{ +cout << command << behost << endl; +system("/usr/bin/backend_control.sh " + command + " " + behost ); +exit(0); +} + |