Skip to content

Commit

Permalink
Migrate Screen Setup Wizard to external application.
Browse files Browse the repository at this point in the history
This sidesteps the issue of trying to display the corner arrows outside
the current extents of the UI by starting up an entirely new instance
and forcing it to full screen. The arrows are additionally replaced by
the theme's preview image, to more clearly exhibit the final appearance.

There are some issues and potential usability concerns that still need
to be addressed.
* The preview image repositions, but does not properly scale.
* There may need to be indicators to show what corner is currently used.
* The network control interfaces are not available.

This changeset includes a revision bump, and will require any theme with
a custom appear-ui.xml to be updated.
  • Loading branch information
wagnerrp committed Jan 29, 2013
1 parent d7397f8 commit 690f333
Show file tree
Hide file tree
Showing 16 changed files with 806 additions and 446 deletions.
1 change: 1 addition & 0 deletions mythtv/libs/libmythbase/mythcorecontext.h
Expand Up @@ -29,6 +29,7 @@
#define MYTH_APPNAME_MYTHMETADATALOOKUP "mythmetadatalookup"
#define MYTH_APPNAME_MYTHUTIL "mythutil"
#define MYTH_APPNAME_MYTHLOGSERVER "mythlogserver"
#define MYTH_APPNAME_MYTHSCREENWIZARD "mythscreenwizard"

class MDBManager;
class MythCoreContextPrivate;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythversion.h
Expand Up @@ -12,7 +12,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
/// libmythui class methods used by plug-ins.
#define MYTH_BINARY_VERSION "0.27.20130127-1"
#define MYTH_BINARY_VERSION "0.27.20130129-1"

/** \brief Increment this whenever the MythTV network protocol changes.
*
Expand Down
42 changes: 32 additions & 10 deletions mythtv/programs/mythfrontend/main.cpp
Expand Up @@ -68,7 +68,6 @@ using namespace std;
#include "myththemedmenu.h"
#include "mediarenderer.h"
#include "mythmainwindow.h"
#include "screenwizard.h"
#include "mythcontrols.h"
#include "mythuihelper.h"
#include "mythdirs.h"
Expand Down Expand Up @@ -292,18 +291,41 @@ namespace

static void startAppearWiz(void)
{
MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
int curX = gCoreContext->GetNumSetting("GuiOffsetX", 0);
int curY = gCoreContext->GetNumSetting("GuiOffsetY", 0);
int curW = gCoreContext->GetNumSetting("GuiWidth", 0);
int curH = gCoreContext->GetNumSetting("GuiHeight", 0);

MythSystem *wizard = new MythSystem(
GetInstallPrefix() + "/bin/mythscreenwizard",
QStringList(),
kMSNoRunShell | kMSDisableUDPListener | kMSPropagateLogs);
wizard->Run();

bool reload = false;

if (!wizard->Wait())
{
// no reported errors, check for changed geometry parameters
gCoreContext->ClearSettingsCache("GuiOffsetX");
gCoreContext->ClearSettingsCache("GuiOffsetY");
gCoreContext->ClearSettingsCache("GuiWidth");
gCoreContext->ClearSettingsCache("GuiHeight");

if ((curX != gCoreContext->GetNumSetting("GuiOffsetX", 0)) ||
(curY != gCoreContext->GetNumSetting("GuiOffsetY", 0)) ||
(curW != gCoreContext->GetNumSetting("GuiWidth", 0)) ||
(curH != gCoreContext->GetNumSetting("GuiHeight", 0)))
reload = true;
}

ScreenWizard *screenwizard = new ScreenWizard(mainStack,
"screenwizard");
delete wizard;
wizard = NULL;

if (screenwizard->Create())
mainStack->AddScreen(screenwizard);
else
delete screenwizard;
if (reload)
GetMythMainWindow()->JumpTo("Reload Theme");
}


static void startKeysSetup()
{
MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
Expand Down Expand Up @@ -864,7 +886,7 @@ static void TVMenuCallback(void *data, QString &selection)
}
else if (sel == "screensetupwizard")
{
startAppearWiz();
startAppearWiz();
}
else if (sel == "setup_keys")
{
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythfrontend/mythfrontend.pro
Expand Up @@ -24,7 +24,7 @@ HEADERS += playbackbox.h viewscheduled.h globalsettings.h audiogeneralsettings.h
HEADERS += manualschedule.h programrecpriority.h channelrecpriority.h
HEADERS += statusbox.h networkcontrol.h custompriority.h
HEADERS += mediarenderer.h mythfexml.h playbackboxlistitem.h
HEADERS += screenwizard.h exitprompt.h
HEADERS += exitprompt.h
HEADERS += action.h mythcontrols.h keybindings.h keygrabber.h
HEADERS += progfind.h guidegrid.h customedit.h
HEADERS += schedulecommon.h progdetails.h scheduleeditor.h
Expand All @@ -45,7 +45,7 @@ SOURCES += main.cpp playbackbox.cpp viewscheduled.cpp audiogeneralsettings.cpp
SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp
SOURCES += channelrecpriority.cpp statusbox.cpp networkcontrol.cpp
SOURCES += mediarenderer.cpp mythfexml.cpp playbackboxlistitem.cpp
SOURCES += custompriority.cpp screenwizard.cpp exitprompt.cpp
SOURCES += custompriority.cpp exitprompt.cpp
SOURCES += action.cpp actionset.cpp mythcontrols.cpp keybindings.cpp
SOURCES += keygrabber.cpp progfind.cpp guidegrid.cpp
SOURCES += customedit.cpp schedulecommon.cpp progdetails.cpp scheduleeditor.cpp
Expand Down

0 comments on commit 690f333

Please sign in to comment.