Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/speechtoolbar.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-10-24 12:08:35 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-10-24 12:21:20 (GMT)
commitf26a04fc580bcf7dc4118bcbf1358e9f56a27b33 (patch)
tree083900fdb8392dc5cb988b0f2ed4748db861d214 /speechtoolbar.py
parentb98e1e9589e1fe8378b52372ded165eebdf16c92 (diff)
Finish port of tts functionality to gtk3 and gst 1.0 - SL #4057
This patch solves SL #3705 too (tts button placement in the toolbar) Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'speechtoolbar.py')
-rw-r--r--speechtoolbar.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/speechtoolbar.py b/speechtoolbar.py
index ef73e81..b01a221 100644
--- a/speechtoolbar.py
+++ b/speechtoolbar.py
@@ -156,7 +156,7 @@ class SpeechToolbar(Gtk.Toolbar):
def reset_buttons_cb(self):
logging.error('reset buttons')
- self.play_btn.set_named_icon('media-playback-start')
+ self.play_btn.set_icon_name('media-playback-start')
self.stop_btn.set_sensitive(False)
self.play_btn.set_active(False)
self.is_paused = False
@@ -164,14 +164,14 @@ class SpeechToolbar(Gtk.Toolbar):
def play_cb(self, widget):
self.stop_btn.set_sensitive(True)
if widget.get_active():
- self.play_btn.set_named_icon('media-playback-pause')
+ self.play_btn.set_icon_name('media-playback-pause')
logging.error('Paused %s', self.is_paused)
if not self.is_paused:
# get the text to speech, if there are a selection,
# play selected text, if not, play all
abi = self._activity.abiword_canvas
selection = abi.get_selection('text/plain')
- if selection[0] is None or selection[1] == 0:
+ if not selection or selection[0] is None or selection[1] == 0:
# nothing selected
abi.select_all()
text = abi.get_selection('text/plain')[0]
@@ -183,13 +183,13 @@ class SpeechToolbar(Gtk.Toolbar):
logging.error('Continue play')
speech.continue_play()
else:
- self.play_btn.set_named_icon('media-playback-start')
+ self.play_btn.set_icon_name('media-playback-start')
self.is_paused = True
speech.pause()
def stop_cb(self, widget):
self.stop_btn.set_sensitive(False)
- self.play_btn.set_named_icon('media-playback-start')
+ self.play_btn.set_icon_name('media-playback-start')
self.play_btn.set_active(False)
self.is_paused = False
speech.stop()