Ticket #4075: backend-autoselect-1.patch

File backend-autoselect-1.patch, 24.2 KB (added by Nigel, 17 years ago)

Initial version. Requires mediarenderer.* and masterselection.* to be moved into libmythupnp

  • libs/libmyth/mythcontext.cpp

     
    3535#include "themeinfo.h"
    3636
    3737#include "libmythui/mythmainwindow.h"
     38#include "libmythupnp/masterselection.h"
    3839
    3940// These defines provide portability for different
    4041// plugin file names.
     
    190191    }
    191192}
    192193
     194class MediaRenderer;
     195
    193196class MythContextPrivate
    194197{
    195198  public:
    196199    MythContextPrivate(MythContext *lparent);
    197200   ~MythContextPrivate();
    198201
    199     bool Init(bool gui, DatabaseParams *pParams = NULL );
     202    bool Init(bool gui, bool promptForBackend);
    200203    bool IsWideMode() const {return (m_baseWidth == 1280);}
    201204    void SetWideMode() {m_baseWidth = 1280; m_baseHeight = 720;}
    202205    bool IsSquareMode() const {return (m_baseWidth == 800);}
     
    221224    int     intResponse(const QString &query, int def);
    222225    bool    PromptForDatabaseParams(QString error);
    223226    QString TestDBconnection(void);
     227    int     ChooseBackend(void);
     228    bool    UPnPconnect(void);
    224229
    225230    MythContext *parent;
    226231
     
    249254    QMutex m_hostnamelock;
    250255    QString m_localhostname;
    251256
     257    MediaRenderer  *m_UPnP;      //< For automatic backend discover
     258    DatabaseParams  m_DBparams;  //< Database details if we succeed
     259
    252260    QMutex serverSockLock;
    253261    bool attemptingToConnect;
    254262
     
    313321      m_xbase(0), m_ybase(0), m_height(0), m_width(0),
    314322      m_baseWidth(800), m_baseHeight(600),
    315323      m_localhostname(QString::null),
     324      m_UPnP(NULL),
    316325      serverSockLock(false),
    317326      attemptingToConnect(false),
    318327      language(""),
     
    451460    }
    452461}
    453462
    454 bool MythContextPrivate::Init(bool gui, DatabaseParams *pParams)
     463bool MythContextPrivate::Init(bool gui, bool promptForBackend)
    455464{
    456465    m_gui = gui;
    457466
     
    460469        screensaver = ScreenSaverControl::get();
    461470
    462471    // ---- database connection stuff ----
     472   
     473    // The user can force the AutoDiscovery chooser by the --prompt argument.
     474    // Otherwise, we attempt to load mysql.txt, and then the UPnP config.xml.
     475    // If either of these fails, we pop up the chooser.
    463476
    464     // Attempts to read DB info from "mysql.txt" from the
    465     // filesystem, or create it if it does not exist.
    466     if (!LoadDatabaseSettings(pParams))
    467         return false;
     477    if (!promptForBackend)            // not forced via command line --prompt
     478    {
     479        // FIXME: Use XmlConfiguration instead?
     480        QFile config(parent->GetConfDir() + "/config.xml");
    468481
     482        if (config.exists())
     483        {
     484            if (!UPnPconnect())               // bad UUID, can't find backend
     485                promptForBackend = true;
     486        }
     487        else
     488        {
     489            if (!LoadSettingsFiles("mysql.txt"))  // missing or bad file
     490                promptForBackend = true;
     491        }
     492    }
     493
     494
     495    // There is currently no backend chooser that will run from the console:
     496    if (!m_gui)
     497        promptForBackend = false;
     498
     499
     500    if (promptForBackend)
     501        switch (ChooseBackend())
     502        {
     503            case -1:   // User cancelled. Exit application
     504                return false;
     505
     506            case 0:    // User selected "Do no connect"
     507                return true;
     508
     509            case 1:    // User selected a backend, so m_DBparams
     510                break; // should now contain the database details
     511
     512            default:   // User asked to configure database manually
     513
     514                if (!PromptForDatabaseParams("")  // Changed their mind?
     515                        || !parent->SaveDatabaseParams(m_DBparams))
     516                    return false;
     517                break;
     518        }
     519    else
     520        if (!LoadDatabaseSettings())
     521            return false;
     522
    469523    // Attempt to connect to the database, get message for user if it failed.
    470524    QString failure = TestDBconnection();
    471525
     
    474528    if (failure.length())
    475529    {
    476530        VERBOSE(VB_IMPORTANT, failure);
    477         if (PromptForDatabaseParams(failure))
     531        if ((promptForBackend && ChooseBackend()) ||
     532            (!promptForBackend && PromptForDatabaseParams(failure)))
    478533        {
    479534            failure = TestDBconnection();
    480535            if (failure.length())
     
    504559{
    505560    imageCache.clear();
    506561
     562    if (m_UPnP)
     563        delete m_UPnP;
    507564    if (m_settings)
    508565        delete m_settings;
    509566    if (m_qtThemeSettings)
     
    9491006    return QString::null;
    9501007}
    9511008
     1009int MythContextPrivate::ChooseBackend(void)
     1010{
     1011    VERBOSE(VB_UPNP, "Putting up the UPnP backend chooser");
    9521012
     1013    TempMainWindow();
     1014
     1015    if (!m_UPnP)
     1016        m_UPnP = new MediaRenderer();
     1017
     1018    int stat = MasterSelection::GetConnectionInfo(m_UPnP, &m_DBparams);
     1019
     1020    parent->SetMainWindow(NULL);
     1021    EndTempWindow();
     1022
     1023    return stat;
     1024}
     1025
     1026/**
     1027 * Get the default backend from config.xml, use UPnP to find it.
     1028 *
     1029 * @return true if we could get the database connection parameters
     1030 *         from the backend (which are stored in m_DBparams)
     1031 */
     1032bool MythContextPrivate::UPnPconnect(void)
     1033{
     1034    if (!m_UPnP)
     1035        m_UPnP = new MediaRenderer();
     1036
     1037    DeviceLocation *pDevLoc = m_UPnP->GetDefaultMaster();
     1038    if (!pDevLoc)
     1039    {
     1040        VERBOSE(VB_UPNP, "No default master backend stored in config.xml ???");
     1041        return false;
     1042    }
     1043
     1044    MythXMLClient  mythXml(pDevLoc->m_sLocation);
     1045    QString        sPin = pDevLoc->m_sSecurityPin;
     1046    QString        sMsg;
     1047
     1048    if (mythXml.GetConnectionInfo(sPin, &m_DBparams, sMsg)
     1049        == UPnPResult_Success)
     1050    {
     1051        VERBOSE(VB_GENERAL, QString("UPnP got database hostname: %1")
     1052                            .arg(m_DBparams.dbHostName));
     1053        return true;
     1054    }
     1055
     1056    // The stored PIN might not be correct, or the backend may not be there.
     1057    // We could prompt for the PIN and try again, but that needs a UI.
     1058    // Easier to fail for now, and put up the full UI selector later
     1059
     1060    return false;
     1061}
     1062
     1063
    9531064MythContext::MythContext(const QString &binversion)
    9541065    : QObject(), d(NULL), app_binary_version(binversion)
    9551066{
     
    9581069    d = new MythContextPrivate(this);
    9591070}
    9601071
    961 bool MythContext::Init(bool gui, DatabaseParams *pParams )
     1072bool MythContext::Init(bool gui, bool promptForBackend)
    9621073{
    9631074    if (app_binary_version != MYTH_BINARY_VERSION)
    9641075    {
     
    9821093        return false;
    9831094    }
    9841095
    985     if (!d->Init(gui, pParams))
     1096    if (!d->Init(gui, promptForBackend))
    9861097        return false;
    9871098
    9881099    ActivateSettingsCache(true);
  • libs/libmyth/mythcontext.h

     
    248248    MythContext(const QString &binversion);
    249249    virtual ~MythContext();
    250250
    251     bool Init(bool gui = true, DatabaseParams *pParams = NULL );
     251    bool Init(bool gui = true, bool promptForBackend = false);
    252252
    253253    QString GetMasterHostPrefix(void);
    254254
  • libs/libmythupnp/libmythupnp.pro

     
    1717
    1818# Input
    1919
    20 HEADERS += httprequest.h upnp.h ssdp.h taskqueue.h 
    21 HEADERS += upnpdevice.h upnptasknotify.h upnptasksearch.h threadpool.h upnputil.h
    22 HEADERS += httpserver.h upnpcds.h upnpcdsobjects.h bufferedsocketdevice.h upnpmsrr.h
    23 HEADERS += eventing.h upnpcmgr.h upnptaskevent.h upnptaskcache.h ssdpcache.h
     20HEADERS += httprequest.h upnp.h ssdp.h taskqueue.h upnputil.h
     21HEADERS += upnpdevice.h upnptasknotify.h upnptasksearch.h threadpool.h
     22HEADERS += httpserver.h upnpcds.h upnpcdsobjects.h
     23HEADERS += bufferedsocketdevice.h upnpmsrr.h eventing.h upnpcmgr.h
     24HEADERS += upnptaskevent.h upnptaskcache.h ssdpcache.h
    2425HEADERS += upnpimpl.h multicast.h broadcast.h configuration.h
    2526HEADERS += soapclient.h mythxmlclient.h
     27HEADERS += mediarenderer.h masterselection.h
    2628
    2729SOURCES += httprequest.cpp upnp.cpp ssdp.cpp taskqueue.cpp upnputil.cpp
    2830SOURCES += upnpdevice.cpp upnptasknotify.cpp upnptasksearch.cpp threadpool.cpp
    29 SOURCES += httpserver.cpp upnpcds.cpp upnpcdsobjects.cpp bufferedsocketdevice.cpp
    30 SOURCES += eventing.cpp upnpcmgr.cpp upnpmsrr.cpp upnptaskevent.cpp ssdpcache.cpp
    31 SOURCES += configuration.cpp soapclient.cpp mythxmlclient.cpp
     31SOURCES += httpserver.cpp upnpcds.cpp upnpcdsobjects.cpp
     32SOURCES += bufferedsocketdevice.cpp upnpmsrr.cpp eventing.cpp upnpcmgr.cpp
     33SOURCES += upnptaskevent.cpp ssdpcache.cpp configuration.cpp
     34SOURCES += soapclient.cpp mythxmlclient.cpp
     35SOURCES += mediarenderer.cpp masterselection.cpp
    3236
    3337INCLUDEPATH += ../libmyth
    34 INCLUDEPATH += ../..
     38INCLUDEPATH += ../.. ..
    3539DEPENDPATH += ../libmythtv ../libmyth ../libavcodec
    3640DEPENDPATH += ../libavformat
    3741
  • programs/mythfrontend/masterselection.cpp

     
    2727#include "lircevent.h"
    2828#endif
    2929
     30#include "mythdialogs.h"
     31
    3032/////////////////////////////////////////////////////////////////////////////
    3133// return values:   -1 = Exit Application
    3234//                   0 = Continue with no Connection Infomation
    3335//                   1 = Connection Information found
    3436/////////////////////////////////////////////////////////////////////////////
    3537
    36 int MasterSelection::GetConnectionInfo( MediaRenderer  *pUPnp,
    37                                         DatabaseParams *pParams,
    38                                         bool            bPromptForBackend )
     38int MasterSelection::GetConnectionInfo(MediaRenderer  *pUPnp,
     39                                       DatabaseParams *pParams)
    3940{
    4041    if ((pUPnp == NULL) || (pParams == NULL))
    4142    {
     
    4445        return -1;
    4546    }
    4647
    47     // ----------------------------------------------------------------------
    48     // Try to get the last selected (default) Master
    49     // ----------------------------------------------------------------------
    50 
    5148    int                    nRetCode         = -1;
    5249    bool                   bExitLoop        = false;
    5350    bool                   bFirstTime       = true;
    5451    bool                   bTryConnectAgain = false;
    5552    QString                sPin             = "";
    56     MasterSelectionWindow *pMasterWindow    = NULL;
     53    MythMainWindow        *pMasterWindow    = gContext->GetMainWindow();
    5754    DeviceLocation        *pDeviceLoc       = NULL;
    5855
    59     if (!bPromptForBackend)
    60         pDeviceLoc = pUPnp->GetDefaultMaster();
     56    if (!pMasterWindow)
     57    {
     58        VERBOSE( VB_UPNP,
     59                 "MasterSelection::GetConnectionInfo - No main window?" );
     60        return -1;
     61    }
     62   
    6163
    62     if (pDeviceLoc != NULL)
    63         sPin = pDeviceLoc->m_sSecurityPin;
    64 
    6564    // ----------------------------------------------------------------------
    6665    // Loop until we have a valid DatabaseParams, or the user cancels
    6766    // ----------------------------------------------------------------------
     
    7473        {
    7574            bFirstTime = true;
    7675
    77             if ( pMasterWindow == NULL)
    78             {
    79                 pMasterWindow = new MasterSelectionWindow();
    80                 pMasterWindow->show();
    81             }
    82 
    8376            MasterSelectionDialog selectionDlg( pMasterWindow );
    8477
    8578            // --------------------------------------------------------------
     
    135128
    136129                case UPnPResult_ActionNotAuthorized:
    137130                {
    138                     if ( pMasterWindow == NULL)
    139                     {
    140                         pMasterWindow = new MasterSelectionWindow();
    141                         pMasterWindow->show();
    142                     }
    143 
    144131                    // Don't show Access Denied Error to user since this
    145132                    // is the first time they will see the pin dialog.
    146133
    147134                    if (bFirstTime)
    148135                    {
    149                         sMsg = "";
     136                        sMsg = "Please enter the backend access PIN";
    150137                        bFirstTime = false;
    151138                    }
    152139
    153140                    // Prompt For Pin and try again...
    154141
    155                     VERBOSE( VB_IMPORTANT, QString( "Access Denied for %1" )
    156                                .arg( pDeviceLoc->GetFriendlyName( true ) ));
     142                    QString sName = pDeviceLoc->GetFriendlyName( true );
     143                    VERBOSE( VB_IMPORTANT, "Access Denied for " + sName);
    157144
    158                     PinDialog *passwordDlg = new PinDialog(pMasterWindow,
    159                                          pDeviceLoc->GetFriendlyName( true ), sMsg);
     145/***********
     146                    PinDialog *passwordDlg = new PinDialog( pMasterWindow,
     147                                                            sName, sMsg );
    160148
    161149                    if ( passwordDlg->exec() == QDialog::Accepted )
    162150                    {
    163151                        sPin = passwordDlg->GetPin();
     152                    }
     153************/
     154                    if (MythPopupBox::showGetTextPopup(pMasterWindow,
     155                                                       sName, sMsg, sPin))
     156                    {
     157VERBOSE(VB_UPNP, "Got a PIN of " + sPin);
    164158                        bTryConnectAgain = true;
    165159                    }
     160else VERBOSE(VB_UPNP, "Got no PIN of " + sPin);
    166161
    167                     delete passwordDlg;
    168 
     162                    //delete passwordDlg;
    169163                    break;
    170164                }
    171165
    172166                default:
    173167                {
    174                     if ( pMasterWindow == NULL)
    175                     {
    176                         pMasterWindow = new MasterSelectionWindow();
    177                         pMasterWindow->show();
    178                     }
    179 
    180168                    // Display Error Msg and have user select different Master.
    181169
    182170                    VERBOSE( VB_IMPORTANT, QString( "Error Retrieving "
     
    213201        }
    214202    }
    215203
    216     if ( pMasterWindow != NULL)
    217     {
    218         pMasterWindow->hide();
    219         delete pMasterWindow;
    220     }
    221 
    222204    return nRetCode;
    223205}
    224206
     
    226208//
    227209/////////////////////////////////////////////////////////////////////////////
    228210
    229 MasterSelectionWindow::MasterSelectionWindow()
    230     : QWidget( NULL, "BackgroundWindow" )
     211PinDialog::PinDialog( MythMainWindow *pParent, QString name, QString sMsg )
     212        : MythDialog( pParent, "Pin Entry", TRUE )
    231213{
    232     QDesktopWidget *pDesktop = QApplication::desktop();
    233 
    234     int nScreenHeight = pDesktop->height();
    235 
    236     float fhMulti = nScreenHeight / (float)600;
    237 
    238     QFont font = QFont("Arial");
    239 
    240     if (!font.exactMatch())
    241         font = QFont();
    242 
    243     font.setStyleHint( QFont::SansSerif, QFont::PreferAntialias );
    244     font.setPointSize((int)floor(14 * fhMulti ));
    245 
    246     QColorGroup colors( QColor( 255, 255, 255 ),    // Foreground
    247                         QColor(   0,  64, 128 ),    // background
    248                         QColor( 196, 196, 196 ),    // light
    249                         QColor(  64,  64,  64 ),    // dark
    250                         QColor( 128, 128, 128 ),    // mid
    251                         QColor( 255, 255, 255 ),    // text
    252                         QColor(   0, 100, 192 ));   // Base
    253 
    254     QApplication::setFont   ( font, TRUE );
    255     QApplication::setPalette( QPalette( colors, colors, colors ), TRUE );
    256 
    257     showFullScreen();
    258 
    259 }
    260 
    261 /*
    262 #ifdef USE_LIRC
    263 
    264     pthread_t lirc_tid;
    265     pthread_attr_t attr;
    266     pthread_attr_init(&attr);
    267     pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
    268     pthread_create(&lirc_tid, &attr, SpawnLirc, this);
    269     pthread_attr_destroy(&attr);
    270 
    271 #endif
    272 
    273 #ifdef USE_JOYSTICK_MENU
    274     pthread_t js_tid;
    275 
    276     pthread_attr_t attr2;
    277     pthread_attr_init(&attr2);
    278     pthread_attr_setdetachstate(&attr2, PTHREAD_CREATE_DETACHED);
    279     pthread_create(&js_tid, &attr2, SpawnJoystickMenu, this);
    280     pthread_attr_destroy(&attr2);
    281 #endif
    282 
    283 #ifdef USING_APPLEREMOTE
    284     pthread_t appleremote_tid;
    285 
    286     pthread_attr_t attr3;
    287     pthread_attr_init(&attr3);
    288     pthread_attr_setdetachstate(&attr3, PTHREAD_CREATE_DETACHED);
    289     pthread_create(&appleremote_tid, &attr3, SpawnAppleRemote, this);
    290     pthread_attr_destroy(&attr3);
    291 #endif
    292 }
    293 
    294 void MasterSelectionWindow::customEvent(QCustomEvent *e)
    295 {
    296 
    297 
    298 #ifdef USE_LIRC
    299 
    300     if (e->type() == kLircKeycodeEventType)
    301     {
    302         LircKeycodeEvent *lke = (LircKeycodeEvent *)e;
    303         int keycode = lke->getKeycode();
    304 
    305         if (keycode)
    306         {
    307             switch (keycode)
    308             {
    309                 case Qt::Key_Left :
    310                 {
    311                     keycode = Qt::Key_BackTab;
    312                     break;
    313                 }
    314                 case Qt::Key_Right :
    315                 {
    316                     keycode = Qt::Key_Tab;
    317                     break;
    318                 }
    319                 default:
    320                     break;
    321             }
    322 
    323             int mod = keycode & MODIFIER_MASK;
    324             int k = keycode & ~MODIFIER_MASK;  // trim off the mod
    325             int ascii = 0;
    326             QString text;
    327 
    328             if (k & UNICODE_ACCEL)
    329             {
    330                 QChar c(k & ~UNICODE_ACCEL);
    331                 ascii = c.latin1();
    332                 text = QString(c);
    333             }
    334 
    335             mod = ((mod & Qt::CTRL) ? Qt::ControlButton : 0) |
    336                 ((mod & Qt::META) ? Qt::MetaButton : 0) |
    337                 ((mod & Qt::ALT) ? Qt::AltButton : 0) |
    338                 ((mod & Qt::SHIFT) ? Qt::ShiftButton : 0);
    339 
    340             QKeyEvent key(lke->isKeyDown() ? QEvent::KeyPress :
    341                         QEvent::KeyRelease, k, ascii, mod, text);
    342 
    343             QObject *key_target = getTarget();
    344             if (!key_target)
    345                 QApplication::sendEvent(this, &key);
    346             else
    347                 QApplication::sendEvent(key_target, &key);
    348         }
    349         else
    350         {
    351             VERBOSE(VB_IMPORTANT, QString("LircClient warning: attempt to "
    352                                   "convert '%1' to a key sequence failed. Fix "
    353                                   "your key mappings.")
    354                                   .arg(lke->getLircText()));
    355         }
    356     }
    357 
    358 #endif
    359 }
    360 
    361 */
    362 
    363 QObject *MasterSelectionWindow::getTarget()
    364 {
    365     QObject *key_target = NULL;
    366 
    367     key_target = QWidget::keyboardGrabber();
    368 
    369     if (!key_target)
    370     {
    371         QWidget *focus_widget = qApp->focusWidget();
    372         if (focus_widget && focus_widget->isEnabled())
    373         {
    374             key_target = focus_widget;
    375         }
    376     }
    377 
    378     if (!key_target)
    379         key_target = this;
    380 
    381     return key_target;
    382 }
    383 
    384 /////////////////////////////////////////////////////////////////////////////
    385 //
    386 /////////////////////////////////////////////////////////////////////////////
    387 
    388 PinDialog::PinDialog( QWidget *pParent, QString name, QString sMsg )
    389         : QDialog( pParent, "Pin Entry", TRUE, WType_Popup )
    390 {
    391214    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    392215
    393216    m_pPassword = new QLineEdit( this );
     
    446269//
    447270/////////////////////////////////////////////////////////////////////////////
    448271
    449 MasterSelectionDialog::MasterSelectionDialog( MasterSelectionWindow *pParent )
    450        : QDialog( pParent, "Master Mediaserver Selection", TRUE,
    451                   WStyle_Customize | WStyle_NoBorder )
     272MasterSelectionDialog::MasterSelectionDialog( MythMainWindow *pParent )
     273       : MythDialog( pParent, "Master Mediaserver Selection", TRUE)
    452274{
    453275    setFocusPolicy(QWidget::NoFocus);
    454276
  • programs/mythfrontend/main.cpp

     
    5050
    5151#include "libmythui/myththemedmenu.h"
    5252#include "libmythui/myththemebase.h"
    53 #include "mediarenderer.h"
    54 #include "masterselection.h"
    5553
    5654#define NO_EXIT  0
    5755#define QUIT     1
     
    6260static MythThemeBase *themeBase;
    6361XBox *xbox = NULL;
    6462
    65 MediaRenderer   *g_pUPnp       = NULL;
    66 
    6763void startGuide(void)
    6864{
    6965    uint chanid = 0;
     
    10081004    }
    10091005
    10101006    gContext = new MythContext(MYTH_BINARY_VERSION);
    1011     g_pUPnp  = new MediaRenderer();
    10121007
    1013     DatabaseParams *pParams = NULL;
    1014 
    1015     if (!bBypassAutoDiscovery)
     1008    if (!gContext->Init( true, bPromptForBackend ))
    10161009    {
    1017         pParams = new DatabaseParams;
    1018 
    1019         int nRetCode = MasterSelection::GetConnectionInfo( g_pUPnp,
    1020                                                            pParams,
    1021                                                            bPromptForBackend );
    1022         switch( nRetCode )
    1023         {
    1024             case -1:    // Exit Application
    1025                 return FRONTEND_EXIT_OK;
    1026 
    1027             case  0:    // Continue with no Connection Infomation
    1028             {
    1029                 delete pParams;
    1030                 pParams = NULL;
    1031 
    1032                 break;
    1033             }
    1034 
    1035             case 1:     // Connection Information found
    1036             default:
    1037                 break;
    1038         }
    1039     }
    1040 
    1041     if (!gContext->Init( true, pParams ))
    1042     {
    10431010        VERBOSE(VB_IMPORTANT, "Failed to init MythContext, exiting.");
    10441011        return FRONTEND_EXIT_NO_MYTHCONTEXT;
    10451012    }
    10461013
    1047     if (pParams != NULL)
    1048     {
    1049         delete pParams;
    1050         pParams = NULL;
    1051     }
    1052 
    10531014    for(int argpos = 1; argpos < a.argc(); ++argpos)
    10541015    {
    10551016        if (!strcmp(a.argv()[argpos],"-l") ||
     
    14451406    DestroyMythMainWindow();
    14461407    delete themeBase;
    14471408    delete gContext;
    1448     delete g_pUPnp;
    14491409
    14501410    return FRONTEND_EXIT_OK;
    14511411}
  • programs/mythfrontend/mythfrontend.pro

     
    2626HEADERS += manualbox.h playbackbox.h viewscheduled.h globalsettings.h
    2727HEADERS += manualschedule.h programrecpriority.h channelrecpriority.h
    2828HEADERS += statusbox.h networkcontrol.h custompriority.h
    29 HEADERS += mediarenderer.h masterselection.h
    3029
    3130SOURCES += main.cpp manualbox.cpp playbackbox.cpp viewscheduled.cpp
    3231SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp
    3332SOURCES += channelrecpriority.cpp statusbox.cpp networkcontrol.cpp
    34 SOURCES += mediarenderer.cpp masterselection.cpp
    3533SOURCES += custompriority.cpp
    3634
    3735macx {
  • programs/mythfrontend/masterselection.h

     
    1717#include <qmap.h>
    1818#include <math.h>
    1919
    20 #include "libmythupnp/upnpdevice.h"
     20#include "mythdialogs.h"
     21#include "upnpdevice.h"
    2122#include "mediarenderer.h"
    2223
    2324#ifndef __MASTERSELECTION_H__
     
    3132{
    3233    public:
    3334
    34         static int GetConnectionInfo( MediaRenderer  *pUPnp,
    35                                       DatabaseParams *pParams,
    36                                       bool            bPromptForBackend );
     35        static int  GetConnectionInfo(MediaRenderer  *pUPnp,
     36                                      DatabaseParams *pParams);
    3737};
    3838
    3939/////////////////////////////////////////////////////////////////////////////
     
    6666//
    6767/////////////////////////////////////////////////////////////////////////////
    6868
    69 class MasterSelectionWindow : public QWidget
     69class MasterSelectionDialog : public MythDialog
    7070{
    71     public:
    72 
    73         MasterSelectionWindow();
    74 
    75     protected:
    76 
    77         //void customEvent(QCustomEvent *e);
    78         QObject *getTarget();
    79 
    80 };
    81 
    82 /////////////////////////////////////////////////////////////////////////////
    83 //
    84 /////////////////////////////////////////////////////////////////////////////
    85 
    86 class MasterSelectionDialog : public QDialog
    87 {
    8871    Q_OBJECT
    8972
    9073    protected:
     
    10891
    10992    public:
    11093
    111                  MasterSelectionDialog( MasterSelectionWindow *pParent );
     94                 MasterSelectionDialog(MythMainWindow *pParent );
    11295        virtual ~MasterSelectionDialog();
    11396
    11497        void     customEvent(QCustomEvent *e);
     
    122105//
    123106/////////////////////////////////////////////////////////////////////////////
    124107
    125 class PinDialog : public QDialog
     108class PinDialog : public MythDialog
    126109{
    127110    Q_OBJECT
    128111
    129112    public:
    130113
    131                  PinDialog( QWidget *pParent, QString name, QString sMsg );
     114                 PinDialog( MythMainWindow *pParent,
     115                            QString name, QString sMsg );
    132116        virtual ~PinDialog();
    133117
    134118        QString  GetPin();