[mythtv] [mythtv-commits] Ticket #8398: MythBrowser start with homepage function
Michael T. Dean
mtdean at thirdcontact.com
Thu Apr 29 21:27:31 UTC 2010
On 04/29/2010 04:34 PM, MythTV wrote:
> #8398: MythBrowser start with homepage function
> ----------------------------------+-----------------------------------------
> Reporter: anonymous | Owner: paulh
> Type: patch | Status: new
> Priority: minor | Milestone: unknown
> Component: Plugin - MythBrowser | Version: Unspecified
> Severity: medium | Mlocked: 0
> ----------------------------------+-----------------------------------------
> Attached is a patch that adds a jumpkey binding to the mythbrowser to
> start it with a customizable homepage. Sometimes its useful to start the
> browser with a homepage instead of calling the bookmarkmanager first.
> In the info_menu.xml file a new menu entry can be created to start the
> browser with the homepage directly. Use the<action>JUMP Homepage</action>
> for that.
>
Robert,
First, note that I am not the one who will make any decisions about
whether to apply this patch or not. Paul Harrison is, and he's the one
to whom you should listen.
That said, as a guy who's currently going through a bunch of settings
that should never have been implemented as settings and reimplementing
them properly, I have a suggestion for an alternate approach for
achieving the desired result without adding another setting.
We already have bookmarks for MythBrowser, so rather than adding a
setting and related setting-specifying GUI code and setting
checking/saving code, it makes sense to take advantage of the
bookmarks. You could change the code such that if the user creates a
bookmark with the (translated) name "Default" (or "Homepage" or
whatever), the bookmark is written with the untranslated name "Default"
(or ...). Then, when MythBrowser is started, if the "Default" bookmark
exists, go to that page; otherwise, go to the bookmarkmanager. Then,
with the jump points you've created, the user could go to the web
browser (and homepage) or to the bookmark manager. The biggest
challenge is just making sure that "Default" is always shown translated
in the UI and is never translated in the DB (but we have a lot of
examples of that in other code in Myth).
Again, you should talk to Paul before implementing things my way--he may
have a whole different plan for MythBrowser.
If you end up using the current approach, though, you should remove the
DB update. The DB update creates a global setting (hostname is NULL)
with the value, "www.mythtv.org". Then, all the code in MythBrowser
that sets the setting value writes it as host-specific settings.
Therefore, you're simply using the global setting as a fallback/default
value for when a host-specific setting doesn't exist. Defaults can be
specified as:
QString homepage = gContext->GetSetting("WebBrowserHomepage",
"http://www.mythtv.org/");
So there's absolutely no need for the global setting value. (Also, it
would be good to be consistent in the use/non-use of the protocol in the
URI--just keep the format consistent everywhere.)
Thanks,
Mike
More information about the mythtv-dev
mailing list