added download button to episode info window

git-svn-id: svn://svn.berlios.de/gpodder/trunk@131 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
Thomas Perl 2006-07-14 20:30:30 +00:00
parent 90cace9d88
commit ce63f4b634
4 changed files with 112 additions and 2 deletions

View File

@ -11,6 +11,10 @@ Fri, 14 Jul 2006 21:07:56 +0200 <thp@perli.net>
* gPodderChannelReader now accepts an optional callback
parameter for download status indication (see above)
* Fixed multiple selection for downloaded item info box
* Added direct download button to episode info when
opened from "available podcasts" tab; now you can
double-click, read description, download if you like
or dismiss the dialog; should speed things up for ya!
Fri, 07 Jul 2006 14:21:59 +0200 <thp@perli.net>
* Added workarounds to libopmlreader to support

View File

@ -2712,7 +2712,7 @@ you can use the usual format of the environment variables:
<widget class="GtkHBox" id="hbox7">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<property name="spacing">5</property>
<child>
<placeholder/>
@ -2735,6 +2735,85 @@ you can use the usual format of the environment variables:
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="btnDownload">
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_btnDownload_clicked" last_modification_time="Fri, 14 Jul 2006 20:22:20 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment4">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox9">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image397">
<property name="visible">True</property>
<property name="stock">gtk-goto-bottom</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label43">
<property name="visible">True</property>
<property name="label" translatable="yes">_Download</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>

View File

@ -416,7 +416,10 @@ class Gpodder(SimpleGladeApp):
current_podcast = current_channel[self.active_item]
filename = current_channel.getPodcastFilename( current_podcast.url)
if widget != None and widget.get_name() == "treeAvailable":
Gpodderepisode().set_episode( current_podcast, current_channel)
gpe = Gpodderepisode()
gpe.set_episode( current_podcast, current_channel)
# to download, the dialog calls this function again but without widget param (widget = None)
gpe.set_download_callback( lambda: self.download_podcast_by_url( url, want_message_dialog, None))
return
if os.path.exists( filename) == False and self.download_status_manager.is_download_in_progress( current_podcast.url) == False:
@ -1033,6 +1036,13 @@ class Gpodderepisode(SimpleGladeApp):
if episode.link == '' and channel != None:
self.entryLink.set_text( channel.link)
self.labelPubDate.set_markup( '<b>%s</b>' % ( episode.pubDate ))
self.download_callback = None
def set_download_callback( self, callback = None):
self.download_callback = callback
if callback != None:
# show the button if we have a callback!
self.btnDownload.show_all()
#-- Gpodderepisode custom methods }
#-- Gpodderepisode.on_btnCloseWindow_clicked {
@ -1042,6 +1052,18 @@ class Gpodderepisode(SimpleGladeApp):
self.gPodderEpisode.destroy()
#-- Gpodderepisode.on_btnCloseWindow_clicked }
#-- Gpodderepisode.on_btnDownload_clicked {
def on_btnDownload_clicked(self, widget, *args):
if libgpodder.isDebugging():
print "on_btnDownload_clicked called with self.%s" % widget.get_name()
# if we have a callback, .. well.. call it back! ;)
if self.download_callback != None:
self.download_callback()
self.gPodderEpisode.destroy()
#-- Gpodderepisode.on_btnDownload_clicked }
class Gpoddersync(SimpleGladeApp):

View File

@ -254,6 +254,11 @@ class Gpodderepisode(SimpleGladeApp):
print "on_btnCloseWindow_clicked called with self.%s" % widget.get_name()
#-- Gpodderepisode.on_btnCloseWindow_clicked }
#-- Gpodderepisode.on_btnDownload_clicked {
def on_btnDownload_clicked(self, widget, *args):
print "on_btnDownload_clicked called with self.%s" % widget.get_name()
#-- Gpodderepisode.on_btnDownload_clicked }
class Gpoddersync(SimpleGladeApp):