Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tuning_toolbar.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-06-19 12:06:52 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-06-19 12:06:52 (GMT)
commit1ef016a9dd2a54a0978d84b92d38dfc5be245611 (patch)
tree1ddf9de9d39752e69c2a637147c965d0bbb697c5 /tuning_toolbar.py
parent1b9af02ca6f952be69048a862b4bfa8f76d5dcaf (diff)
add harmonics UI
Diffstat (limited to 'tuning_toolbar.py')
-rw-r--r--tuning_toolbar.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/tuning_toolbar.py b/tuning_toolbar.py
index e8e1321..35b8c59 100644
--- a/tuning_toolbar.py
+++ b/tuning_toolbar.py
@@ -58,7 +58,8 @@ class TuningToolbar(gtk.Toolbar):
self._freq_entry = gtk.Entry()
self._freq_entry.set_text('0')
if hasattr(self._freq_entry, 'set_tooltip_text'):
- self._freq_entry.set_tooltip_text(_('enter a frequency to display'))
+ self._freq_entry.set_tooltip_text(
+ _('Enter a frequency to display.'))
self._freq_entry.set_width_chars(8)
self._freq_entry.show()
toolitem = gtk.ToolItem()
@@ -69,9 +70,20 @@ class TuningToolbar(gtk.Toolbar):
self._new_tuning_line = ToolButton('tuning-tools')
self._new_tuning_line.show()
self.insert(self._new_tuning_line, -1)
- self._new_tuning_line.set_tooltip(_('Add tuning line'))
+ self._new_tuning_line.set_tooltip(_('Add a tuning line.'))
self._new_tuning_line.connect('clicked', self.tuning_line_cb)
+ if self.activity.has_toolbarbox:
+ separator = gtk.SeparatorToolItem()
+ separator.props.draw = True
+ self.insert(separator, -1)
+
+ self._harmonic = ToolButton('harmonics')
+ self._harmonic.show()
+ self.insert(self._harmonic, -1)
+ self._harmonic.set_tooltip(_('Add harmonics.'))
+ self._harmonic.connect('clicked', self.harmonic_cb)
+
self.show_all()
def update_tuning_control(self, *args):
@@ -79,6 +91,10 @@ class TuningToolbar(gtk.Toolbar):
self.activity.wave.instrument = \
self.tuning[self._tuning_combo.get_active()]
+ def harmonic_cb(self, *args):
+ ''' Callback for harmonics control '''
+ self.activity.wave.harmonics = not self.activity.wave.harmonics
+
def tuning_line_cb(self, *args):
''' Callback for tuning insert '''
freq = self._freq_entry.get_text()