Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 7 years ago

Closed 6 years ago

#3334 closed patch (fixed)

Allow mythtv-setup to use the downloadable icons from the new online database

Reported by: anonymous Owned by:
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This feature allows you to access the online database (services.mythtv.org) in order for you to download the icon files.

As far as I'm aware, there is only one problem with it. The code in ImportIcons::initialLoad may be slightly incorrect (no way of testing this with non DVB channels).

The patch file applies from the top
The two importicons.* files live in libmythtv

Attachments (20)

importicons.patch (6.6 KB) - added by anonymous 7 years ago.
importicons.cpp (18.0 KB) - added by anonymous 7 years ago.
importicons.h (6.4 KB) - added by anonymous 7 years ago.
importicons1.patch (32.1 KB) - added by john@… 7 years ago.
Created and added new file (as suggested by stuartm)
iconbacktrace.txt (12.7 KB) - added by stuartm 7 years ago.
Backtrace after 'hang'
importicons-libmyth-29092007.diff (6.0 KB) - added by Matthew Wire <devel@…> 7 years ago.
libmyth changes for import icons
importicons-libmythtv-29092007.diff (33.7 KB) - added by Matthew Wire <devel@…> 7 years ago.
libmythtv changes for import icons
importicons-libmyth-04102007.diff (6.0 KB) - added by Matthew Wire <devel@…> 7 years ago.
Update to set focus to cancel button
importicons-libmythtv-04102007.diff (31.7 KB) - added by Matthew Wire <devel@…> 7 years ago.
Code cleanup
importicons-libmythtv-04102007.2.diff (31.7 KB) - added by Matthew Wire <devel@…> 7 years ago.
Fixed return from dialog
importicons-libmyth-09102007.diff (6.2 KB) - added by Matthew Wire <devel@…> 7 years ago.
Changes to widgets to support icon import dialog
importicons-libmythtv-09102007.diff (36.1 KB) - added by Matthew Wire <devel@…> 7 years ago.
Import Icons patch - ready for full testing
importicons-libmythtv-23102007.diff (36.4 KB) - added by Matthew Wire <devel@…> 6 years ago.
Small fix for importSingleIcon where m_iter was not getting filled
importicons-libmythtv-23102007-2.diff (36.7 KB) - added by Matthew Wire <devel@…> 6 years ago.
More friendly messages about what it's doing
libmyth-importicons-18112007.patch (5.7 KB) - added by devel@… 6 years ago.
Resynced with latest svn
libmythtv-importicons-18112007.patch (35.9 KB) - added by Matthew Wire <devel@…> 6 years ago.
Resynced with latest svn
#3334 libmyth-importicons-18122007.patch (5.7 KB) - added by Matthew Wire <devel@…> 6 years ago.
Update for svn. no changes
#3334 libmythtv-importicons-18122007.patch (35.9 KB) - added by Matthew Wire <devel@…> 6 years ago.
Update for svn. no changes
importicons_windows.diff (999 bytes) - added by stuartm 6 years ago.
Windows compatible?
importicons_windows_2.diff (1.8 KB) - added by Simon Kenyon <simon@…> 6 years ago.
patch which compiles under windows

Download all attachments as: .zip

Change History (42)

Changed 7 years ago by anonymous

Changed 7 years ago by anonymous

Changed 7 years ago by anonymous

comment:1 Changed 7 years ago by john at pullan dot org

The email address should be mine :
john at pullan dot org

comment:2 Changed 7 years ago by stuartm

John, if you use "svn add importicons.cpp importicons.h" before svn diff the two new files will be included in the patch.

comment:3 Changed 7 years ago by john@…

Added new patch (as suggested by stuatm)

Changed 7 years ago by john@…

Created and added new file (as suggested by stuartm)

comment:4 Changed 7 years ago by stuartm

  • Owner changed from ijr to stuartm

comment:5 Changed 7 years ago by stuartm

  • Version changed from unknown to head

comment:6 Changed 7 years ago by stuartm

John, I've just tried the patch. After selecting one of the icon options in the first dialogue (rescan/find missing) nothing happens and when I leave the channel editor, mythtv-setup appears to hang. I killed it after 2 1/2 minutes.

I've attached a backtrace. Looks to me as though it's waiting on a response from the httpcomms, which is not timing out as it should.

Changed 7 years ago by stuartm

Backtrace after 'hang'

comment:7 Changed 7 years ago by stuartm

Sorry, seems I need to change my description of the problem. When I press "Import all icons.." the dialogue doesn't appear immediately (takes upto 30 seconds) - if I hit Escape before it appears we get the above hanging problem.

When the dialogue does appear it's empty. Icons have been imported in the background but there isn't anything telling me that this happened or was happening while I waited for the dialogue.

Changed 7 years ago by Matthew Wire <devel@…>

libmyth changes for import icons

Changed 7 years ago by Matthew Wire <devel@…>

libmythtv changes for import icons

comment:8 Changed 7 years ago by Matthew Wire <devel@…>

Updated patches for import icons. This is still not fully working (see below) but I think it fixes all of Stuart's issues except for the hang on exit.

importicons-libmyth-29092007
Suggest this patch could be applied now, as is. It provides supporting changes for the import icons dialog:

  • Adds currentItem() method to MythListBox? to retrieve currently selected item.
  • Adds definition for TransListBoxSetting?()
  • Modifies MythProgressDialog:
    • Allows a cancel button to be displayed on the progress dialog (optional)
    • Adds a new method setLabel() to allow changing the progress dialog text while running. Used in import icons to display current scanned icon, total to scan and number of icons found. Would be useful in any scanning type situation when the user wants additional feedback as well as the progress indicator.


importicons-libmythtv-29092007
This patch contains the actual import icons dialog. It's been changed a little since the initial patch and will download all icons it can find automatically - well worth applying to your tree, just have to manually kill mythtv-setup when it completes...

  • When clicking "Import Icons" in the channel editor a progress dialog "Initialising" appears. This then changes to a progress dialog with cancel button which indicates progress and shows current icon, total icons and number of icons that could not be downloaded.
  • In the current patch the cancel button action has been cancelled out (lines 295,296) because I have more than 1000 channels and it was taking too long to get to the actual dialog for debugging.

Issues with this patch

  • When the dialog exits mythtv-setup hangs. Think this is something to do with the dialog not been properly destroyed or something but can't work out what. Stuart, I don't think this is a http timeout issue.
  • Dialog does not exit when all icons have been skipped over. Controls are greyed out and you have to manually click finish.
  • There is loads of extra debugging in this patch which could probably be removed for the release (enable mythtv-setup -v channel to utilise it).
  • Look for FIXME tag for issues...


This works well enough for me and I've spent a lot of time trying to find the hang on exit so I'm hoping someone else will take a look at this bit...

Changed 7 years ago by Matthew Wire <devel@…>

Update to set focus to cancel button

Changed 7 years ago by Matthew Wire <devel@…>

Code cleanup

comment:9 Changed 7 years ago by Matthew Wire <devel@…>

New patch for libmythtv.
Cleans up code, less changes to channeleditor.cpp, more logical layout in importicons.cpp.

Preparatory work for allowing a single icon to be imported.


Still doesn't enable channeleditor dialog when importiconswizard closes. It's not an http issue because it happens even if I remove all reference to http stuff from the code. :(

Changed 7 years ago by Matthew Wire <devel@…>

Fixed return from dialog

comment:10 Changed 7 years ago by Matthew Wire <devel@…>

As if by prophecy I just fixed the hang on return from the dialog. Seems I fixed the original problem ages ago and introduced my own with the progressdialogs. Just needed to call progressDialog->deleteLater() on them both and it's fine[[BR]]

Issues

  • Should exit the dialog after submitting data / reaching end of missing icon list.
  • Should exit / not start dialog if cancel button is pressed on progress dialog.

Changed 7 years ago by Matthew Wire <devel@…>

Changes to widgets to support icon import dialog

Changed 7 years ago by Matthew Wire <devel@…>

Import Icons patch - ready for full testing

comment:11 Changed 7 years ago by Matthew Wire <devel@…>

The latest versions of these patches should now be fully working.

  • There's now an additional feature such that you can import an icon for a single channel by selecting it in the list and clicking "Icon Import".
  • Patch http://svn.mythtv.org/trac/ticket/4045 for videosource filter is included.
  • Another additional feature is that the channel selection dialog now remembers the last selected channel so you don't have to scroll up/down each time. This has appeared on the feature requests a few times.

I think all of the bugs are now fixed and this is ready for testing with a view to merging.

Changed 6 years ago by Matthew Wire <devel@…>

Small fix for importSingleIcon where m_iter was not getting filled

Changed 6 years ago by Matthew Wire <devel@…>

More friendly messages about what it's doing

Changed 6 years ago by devel@…

Resynced with latest svn

Changed 6 years ago by Matthew Wire <devel@…>

Resynced with latest svn

Changed 6 years ago by Matthew Wire <devel@…>

Update for svn. no changes

Changed 6 years ago by Matthew Wire <devel@…>

Update for svn. no changes

comment:12 Changed 6 years ago by stuartm

  • Status changed from new to accepted

comment:13 Changed 6 years ago by stuartm

  • Status changed from accepted to started

comment:14 Changed 6 years ago by stuartm

(In [15254]) The libmyth portion of the patches by Matthew Wire and John Pullan to add
services.mythtv.org icon support to mythtv-setup.

This just adds the supporting functions for the main patch. Requires a
MAKE CLEAN.

Refs #3334

comment:15 Changed 6 years ago by stuartm

  • Resolution set to fixed
  • Status changed from started to closed

(In [15308]) Adds an integrated channel icon downloader to mythtv-setup which uses
the services.mythtv.org facility created by Chris Petersen.

Patches by Matthew Wire and John Pullan with a few bug fixes and
tweaks by me.

Closes #3334

comment:16 Changed 6 years ago by Simon Kenyon

  • Resolution fixed deleted
  • Status changed from closed to new

I think that this needs to be tweaked to use QDir so that it will compile under Windows.

g++ -c -march=k8 -g -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -Wno-non-virtual-dtor -DSTDC_CONSTANT_MACROS -I/mingw/include/freetype2 -I/mingw/include -mthreads -fexceptions -frtti -DUSING_MINGW -DUSING_WINAUDIO -DUSING_D3D -DUSING_DIRECTX -DMMX -Di386 -DUSING_DIRECTX -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DPREFIX=\"/usr\" -DLIBDIR=\"/usr/lib\" -D_LARGEFILE_SOURCE -DUSING_H264TOOLS -DUSING_OPENGL -DUSING_FRONTEND -DUSING_BACKEND -DUSING_D3D -DQT_DLL -DQT_THREAD_SUPPORT -I"/usr/include" -I"../.." -I".." -I"." -I"../libmyth" -I"../libavcodec" -I"../libavutil" -I"../libmythmpeg2" -I"dvbdev" -I"mpeg" -I"iptv" -I"../libmythlivemedia/BasicUsageEnvironment/include" -I"../libmythlivemedia/groupsock/include" -I"../libmythlivemedia/liveMedia/include" -I"../libmythlivemedia/UsageEnvironment/include" -I"/qt-3.3.x-p8/include" -I"C:/msys/1.0/qt-3.3.x-p8/mkspecs/win32-g++" -o importicons.o importicons.cpp
In file included from C:/msys/1.0/qt-3.3.x-p8/include/qiconset.h:43,

from C:/msys/1.0/qt-3.3.x-p8/include/qpushbutton.h:43,
from ../libmyth/mythwidgets.h:10,
from ../libmyth/mythwizard.h:41,
from importicons.cpp:7:

C:/msys/1.0/qt-3.3.x-p8/include/qpixmap.h:249: warning: 'void bitBlt(QPaintDevice*, int, int, const QPaintDevice*, int, int, int, int, Qt::RasterOp?, bool)' redeclared without dllimport attribute after being referenced with dllimport linkage
importicons.cpp: In member function `int ImportIconsWizard::exec()':
importicons.cpp:33: error: `mkdir' was not declared in this scope

comment:17 Changed 6 years ago by stuartm

  • Owner changed from stuartm to ijr
  • Status changed from new to assigned

Changed 6 years ago by stuartm

Windows compatible?

comment:18 Changed 6 years ago by stuartm

  • Owner ijr deleted
  • Status changed from assigned to new

Simon, try the patch I've just attached. It's untested and at least if it doesn't work you've got a starting point for a working patch of your own.

Changed 6 years ago by Simon Kenyon <simon@…>

patch which compiles under windows

comment:19 Changed 6 years ago by stuartm

Simon, glad you noticed and fixed my deliberate mistakes (qdir variables undefined).

Can you confirm that the patch works as intended under windows and not just that it compiles? You might need to move/delete the directories if they already exist.

comment:20 Changed 6 years ago by David Bussenschutt (aka buzz) <davidbuzz@…>

As per your instructions, the channel downloader is now tested and works well on win32 with this latest patch. Icons were created here:
"C:\Documents and Settings\buzz\.mythtv\channels\"
It was unable to download all icons, but some of them clearly worked because the Icon field was populated when it wasnt previously. My guess is that the other icons just don't exist in the services.mythtv.org database?
Here's the text emited when it doesnt find the icon:
2008-01-10 17:49:46.890 Error from findmissing : #
2008-01-10 17:49:47.796 Error from findmissing : #
2008-01-10 17:49:48.703 Error from findmissing : #

comment:21 Changed 6 years ago by David Bussenschutt (aka buzz) <davidbuzz@…>

changeset http://svn.mythtv.org/trac/changeset/15554 is supposed to have closed this trac, as it applied the last patch importicons_windows_2.diff. I don't know wht it didn't close it?

comment:22 Changed 6 years ago by stuartm

  • Resolution set to fixed
  • Status changed from new to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.