Skip to content

Commit

Permalink
Merge branch 'master' into new-logging
Browse files Browse the repository at this point in the history
Conflicts:
	mythtv/libs/libmythtv/playercontext.cpp
  • Loading branch information
Beirdo committed May 10, 2011
2 parents a59be5c + 7bd0b54 commit 0b9625e
Show file tree
Hide file tree
Showing 40 changed files with 435 additions and 218 deletions.
18 changes: 16 additions & 2 deletions mythplugins/mythbrowser/mythbrowser/mythbrowser.cpp
Expand Up @@ -7,13 +7,15 @@
// myth
#include "mythverbose.h"
#include "mythcontext.h"
#include "libmythui/mythmainwindow.h"
#include "mythmainwindow.h"
#include "mythuihelper.h"

// mythbrowser
#include "webpage.h"
#include "bookmarkeditor.h"
#include "mythbrowser.h"


using namespace std;

MythBrowser::MythBrowser(MythScreenStack *parent,
Expand All @@ -22,7 +24,8 @@ MythBrowser::MythBrowser(MythScreenStack *parent,
m_urlList(urlList), m_pageList(NULL),
m_progressBar(NULL), m_titleText(NULL),
m_statusText(NULL), m_currentBrowser(-1),
m_zoom(zoom), m_menuPopup(NULL)
m_zoom(zoom), m_menuPopup(NULL),
m_defaultFavIcon(NULL)
{
}

Expand Down Expand Up @@ -57,6 +60,17 @@ bool MythBrowser::Create(void)
connect(m_pageList, SIGNAL(itemSelected(MythUIButtonListItem*)),
this, SLOT(slotTabSelected(MythUIButtonListItem*)));

// create the default favicon
QString favIcon = "mb_default_favicon.png";
GetMythUI()->FindThemeFile(favIcon);
if (QFile::exists(favIcon))
{
QImage image(favIcon);
m_defaultFavIcon = GetMythPainter()->GetFormatImage();
m_defaultFavIcon->Assign(image);
m_defaultFavIcon->UpRef();
}

// this is the template for all other browser tabs
WebPage *page = new WebPage(this, browser);

Expand Down
3 changes: 3 additions & 0 deletions mythplugins/mythbrowser/mythbrowser/mythbrowser.h
Expand Up @@ -26,6 +26,7 @@ class MythBrowser : public MythScreenType
bool keyPressEvent(QKeyEvent *);

void setDefaultSaveDirectory(const QString saveDir) { m_defaultSaveDir = saveDir; }
MythImage* getDefaultFavIcon(void) { return m_defaultFavIcon; }

public slots:
void slotOpenURL(const QString &url);
Expand Down Expand Up @@ -74,6 +75,8 @@ class MythBrowser : public MythScreenType

MythDialogBox *m_menuPopup;

MythImage *m_defaultFavIcon;

friend class WebPage;
};

Expand Down
40 changes: 20 additions & 20 deletions mythplugins/mythbrowser/mythbrowser/webpage.cpp
Expand Up @@ -38,8 +38,6 @@ WebPage::WebPage(MythBrowser *parent, QRect area, const char* name)
this, SLOT(slotStatusBarMessage(const QString&)));
connect(m_browser, SIGNAL(titleChanged(const QString&)),
this, SLOT(slotTitleChanged(const QString&)));
connect(m_browser, SIGNAL(iconChanged(void)),
this, SLOT(slotIconChanged(void)));
}

WebPage::WebPage(MythBrowser *parent, MythUIWebBrowser *browser)
Expand All @@ -56,9 +54,6 @@ WebPage::WebPage(MythBrowser *parent, MythUIWebBrowser *browser)
this, SLOT(slotLoadFinished(bool)));
connect(m_browser, SIGNAL(titleChanged(const QString&)),
this, SLOT(slotTitleChanged(const QString&)));
connect(m_browser, SIGNAL(iconChanged(void)),
this, SLOT(slotIconChanged(void)));

connect(m_browser, SIGNAL(loadProgress(int)),
this, SLOT(slotLoadProgress(int)));
connect(m_browser, SIGNAL(statusBarMessage(const QString&)),
Expand Down Expand Up @@ -99,26 +94,23 @@ void WebPage::SetActive(bool active)

void WebPage::slotIconChanged(void)
{
if (!m_listItem)
return;

QIcon icon = m_browser->GetIcon();

if (icon.isNull())
{
//FIXME use a default icon here?
m_listItem->SetImage("", "favicon");
}
m_listItem->setImage(m_parent->getDefaultFavIcon(), "favicon");
else
{
if (m_listItem)
{
QPixmap pixmap = icon.pixmap(32, 32);
QImage image = pixmap.toImage();
image = image.scaled(
QSize(32,32), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
MythImage *mimage = GetMythPainter()->GetFormatImage();
mimage->Assign(image);

m_listItem->setImage(mimage, "favicon");
}
QPixmap pixmap = icon.pixmap(32, 32);
QImage image = pixmap.toImage();
image = image.scaled(
QSize(32,32), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
MythImage *mimage = GetMythPainter()->GetFormatImage();
mimage->Assign(image);

m_listItem->setImage(mimage, "favicon");
}

m_parent->m_pageList->Refresh();
Expand All @@ -127,16 +119,24 @@ void WebPage::slotIconChanged(void)
void WebPage::slotLoadStarted(void)
{
m_listItem->SetText(tr("Loading..."));
m_listItem->DisplayState("loading", "loadingstate");
m_listItem->setImage(NULL, "favicon");
m_listItem->SetImage("", "favicon");

m_parent->m_pageList->Update();
}

void WebPage::slotLoadFinished(bool OK)
{
(void) OK;

m_listItem->DisplayState("off", "loadingstate");

slotLoadProgress(0);

slotIconChanged();

m_listItem->SetText(m_browser->GetTitle());
}

void WebPage::slotLoadProgress(int progress)
Expand Down
6 changes: 3 additions & 3 deletions mythplugins/mythbrowser/mythbrowser/webpage.h
Expand Up @@ -43,10 +43,10 @@ class WebPage : public QObject
protected:

private:
bool m_active;
bool m_active;

MythBrowser *m_parent;
MythUIWebBrowser *m_browser;
MythBrowser *m_parent;
MythUIWebBrowser *m_browser;
MythUIButtonListItem *m_listItem;
};

Expand Down
11 changes: 10 additions & 1 deletion mythplugins/mythbrowser/theme/default-wide/browser-ui.xml
Expand Up @@ -11,8 +11,17 @@
<area>0,0,610,44</area>
<imagetype name="favicon">
<area>6,6,32,32</area>
<filename>shared/grid_noimage.png</filename>
</imagetype>
<statetype name="loadingstate">
<position>9,9</position>
<state name="loading">
<imagetype name="animation">
<position>0,0</position>
<filepattern low="1" high="8">mb_loading_%1.png</filepattern>
<delay>160</delay>
</imagetype>
</state>
</statetype>
<textarea name="buttontext">
<area>40,2,568,40</area>
<align>allcenter</align>
Expand Down
40 changes: 39 additions & 1 deletion mythplugins/mythbrowser/theme/default/browser-ui.xml
Expand Up @@ -4,7 +4,45 @@

<window name="browser">
<buttonlist name="pagelist" from="baseselector">
<area>20,10,760,45</area>
<area>20,10,760,44</area>
<buttonarea>0,0,742,44</buttonarea>
<statetype name="buttonitem">
<state name="active">
<area>0,0,742,44</area>
<imagetype name="favicon">
<area>6,6,32,32</area>
</imagetype>
<statetype name="loadingstate">
<position>9,9</position>
<state name="loading">
<imagetype name="animation">
<position>0,0</position>
<filepattern low="1" high="8">mb_loading_%1.png</filepattern>
<delay>160</delay>
</imagetype>
</state>
</statetype>
<textarea name="buttontext">
<area>40,2,700,40</area>
<align>allcenter</align>
</textarea>
</state>
<state name="selectedactive" from="active">
<shape name="background" from="baseselectedwidgetshape" />
</state>
<state name="selectedinactive" from="active">
<shape name="background" from="baseinactivewidgetshape" />
<textarea name="buttontext">
<font>basesmallpurple</font>
</textarea>
</state>
</statetype>
<statetype name="downscrollarrow">
<position>746,2</position>
</statetype>
<statetype name="upscrollarrow">
<position>746,22</position>
</statetype>
</buttonlist>

<webbrowser name="webbrowser">
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mythplugins/mythbrowser/theme/theme.pro
@@ -1,6 +1,6 @@
include ( ../../mythconfig.mak )
include ( ../../settings.pro )

QMAKE_STRIP = echo

TARGET = themenop
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythbase/util.cpp
Expand Up @@ -540,7 +540,6 @@ QDateTime MythUTCToLocal(const QDateTime &utc)

/** \fn getUptime(time_t&)
* \brief Returns uptime statistics.
* \todo Update Statistics are not supported (by MythTV) on NT or DOS.
* \return true if successful, false otherwise.
*/
bool getUptime(time_t &uptime)
Expand Down
23 changes: 0 additions & 23 deletions mythtv/libs/libmythtv/decoderbase.cpp
Expand Up @@ -840,29 +840,6 @@ bool DecoderBase::GetWaitForChange(void) const
return waitingForChange;
}

void DecoderBase::ChangeDVDTrack(bool ffw)
{
if (!ringBuffer->IsDVD())
return;

bool result = true;

if (ffw)
result = ringBuffer->DVD()->nextTrack();
else
ringBuffer->DVD()->prevTrack();

if (result)
{
uint elapsed = ringBuffer->DVD()->GetCellStart();

UpdateDVDFramesPlayed();

if (elapsed == 0)
SeekReset(framesPlayed, 0, true, true);
}
}

long long DecoderBase::DVDFindPosition(long long desiredFrame)
{
if (!ringBuffer->IsDVD())
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/decoderbase.h
Expand Up @@ -169,7 +169,6 @@ class DecoderBase
void SetReadAdjust(long long adjust);

// DVD public stuff
void ChangeDVDTrack(bool ffw);
long long DVDFindPosition(long long desiredFrame);
void UpdateDVDFramesPlayed(void);

Expand Down

0 comments on commit 0b9625e

Please sign in to comment.