Cleaned up interface a little

1. Changed ID3 data in Track Info to labels vice entry boxes.
2. Made all labels uniform with titles right-justified and ending with a colon, data labels left-justified.
3. Added a hand cursor to the stream info in the Station Info tab to signify they may be clicked.
This commit is contained in:
markjfine 2021-03-31 10:44:30 -04:00 committed by GitHub
parent f03bb10125
commit f6bf5028c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 94 additions and 94 deletions

View File

@ -428,7 +428,7 @@
<property name="can_focus">False</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">Name:</property>
<property name="xalign">0</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
@ -455,7 +455,7 @@
<property name="can_focus">False</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">Slogan:</property>
<property name="xalign">0</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">1</property>
@ -488,7 +488,7 @@
<property name="can_focus">False</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">Message:</property>
<property name="xalign">0</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">2</property>
@ -521,7 +521,7 @@
<property name="can_focus">False</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">Alert:</property>
<property name="xalign">0</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">3</property>
@ -554,7 +554,7 @@
<property name="can_focus">False</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">Bit Rate:</property>
<property name="xalign">0</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">4</property>
@ -586,7 +586,7 @@
<property name="can_focus">False</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">Streams:</property>
<property name="xalign">0</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">5</property>
@ -737,7 +737,7 @@
<property name="can_focus">False</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">Data Svcs:</property>
<property name="xalign">0</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">7</property>
@ -899,7 +899,7 @@
<property name="can_focus">False</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">MER:</property>
<property name="xalign">0</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">10</property>
@ -944,7 +944,7 @@
<property name="can_focus">False</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">BER:</property>
<property name="xalign">0</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">11</property>
@ -1077,8 +1077,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">10</property>
<property name="label" translatable="yes">Gain</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Gain:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
@ -1130,8 +1130,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">10</property>
<property name="label" translatable="yes">PPM Error</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">PPM Error:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">1</property>
@ -1184,8 +1184,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">10</property>
<property name="label" translatable="yes">RTL Device</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">RTL Device:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">2</property>
@ -1252,9 +1252,9 @@
<object class="GtkLabel" id="lblGain3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xalign">1</property>
<property name="xpad">10</property>
<property name="label" translatable="yes">Log to File</property>
<property name="label" translatable="yes">Log to File:</property>
</object>
<packing>
<property name="top_attach">3</property>
@ -1458,8 +1458,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">10</property>
<property name="label" translatable="yes">Title</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Title:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
@ -1471,8 +1471,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">10</property>
<property name="label" translatable="yes">Artist</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Artist:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">1</property>
@ -1486,8 +1486,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">10</property>
<property name="label" translatable="yes">Album</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Album:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">2</property>
@ -1501,8 +1501,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xpad">10</property>
<property name="label" translatable="yes">Genre</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Genre:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="top_attach">3</property>
@ -1512,13 +1512,16 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="txtTitle">
<object class="GtkLabel" id="txtTitle">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="invisible_char">●</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="can_focus">False</property>
<!--property name="editable">False</property-->
<!--property name="invisible_char">●</property-->
<!--property name="primary_icon_activatable">False</property-->
<!--property name="secondary_icon_activatable">False</property-->
<property name="xpad">10</property>
<property name="ypad">10</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
@ -1527,13 +1530,16 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="txtArtist">
<object class="GtkLabel" id="txtArtist">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="invisible_char">●</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="can_focus">False</property>
<!--property name="editable">False</property-->
<!--property name="invisible_char">●</property-->
<!--property name="primary_icon_activatable">False</property-->
<!--property name="secondary_icon_activatable">False</property-->
<property name="xpad">10</property>
<property name="ypad">10</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
@ -1544,13 +1550,16 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="txtAlbum">
<object class="GtkLabel" id="txtAlbum">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="invisible_char">●</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="can_focus">False</property>
<!--property name="editable">False</property-->
<!--property name="invisible_char">●</property-->
<!--property name="primary_icon_activatable">False</property-->
<!--property name="secondary_icon_activatable">False</property-->
<property name="xpad">10</property>
<property name="ypad">10</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>
@ -1561,13 +1570,16 @@
</packing>
</child>
<child>
<object class="GtkEntry" id="txtGenre">
<object class="GtkLabel" id="txtGenre">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="invisible_char">●</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="can_focus">False</property>
<!--property name="editable">False</property-->
<!--property name="invisible_char">●</property-->
<!--property name="primary_icon_activatable">False</property-->
<!--property name="secondary_icon_activatable">False</property-->
<property name="xpad">10</property>
<property name="ypad">10</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">1</property>

View File

@ -178,51 +178,24 @@ class NRSC5_DUI(object):
76 : "Special Reading Services"
}
self.pointer_cursor = Gdk.Cursor(Gdk.CursorType.LEFT_PTR)
self.hand_cursor = Gdk.Cursor(Gdk.CursorType.HAND2)
# set events on info labels
self.btnAudioPrgs0.set_property("name","btn_prg0")
self.btnAudioPrgs0.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.btnAudioPrgs0.connect("button-press-event", self.on_program_select)
self.btnAudioPrgs1.set_property("name","btn_prg1")
self.btnAudioPrgs1.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.btnAudioPrgs1.connect("button-press-event", self.on_program_select)
self.btnAudioPrgs2.set_property("name","btn_prg2")
self.btnAudioPrgs2.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.btnAudioPrgs2.connect("button-press-event", self.on_program_select)
self.btnAudioPrgs3.set_property("name","btn_prg3")
self.btnAudioPrgs3.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.btnAudioPrgs3.connect("button-press-event", self.on_program_select)
self.lblAudioPrgs0.set_property("name","prg0")
self.lblAudioPrgs0.set_has_window(True)
self.lblAudioPrgs0.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.lblAudioPrgs0.connect("button-press-event", self.on_program_select)
self.lblAudioPrgs1.set_property("name","prg1")
self.lblAudioPrgs1.set_has_window(True)
self.lblAudioPrgs1.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.lblAudioPrgs1.connect("button-press-event", self.on_program_select)
self.lblAudioPrgs2.set_property("name","prg2")
self.lblAudioPrgs2.set_has_window(True)
self.lblAudioPrgs2.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.lblAudioPrgs2.connect("button-press-event", self.on_program_select)
self.lblAudioPrgs3.set_property("name","prg3")
self.lblAudioPrgs3.set_has_window(True)
self.lblAudioPrgs3.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.lblAudioPrgs3.connect("button-press-event", self.on_program_select)
self.lblAudioSvcs0.set_property("name","svc0")
self.lblAudioSvcs0.set_has_window(True)
self.lblAudioSvcs0.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.lblAudioSvcs0.connect("button-press-event", self.on_program_select)
self.lblAudioSvcs1.set_property("name","svc1")
self.lblAudioSvcs1.set_has_window(True)
self.lblAudioSvcs1.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.lblAudioSvcs1.connect("button-press-event", self.on_program_select)
self.lblAudioSvcs2.set_property("name","svc2")
self.lblAudioSvcs2.set_has_window(True)
self.lblAudioSvcs2.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.lblAudioSvcs2.connect("button-press-event", self.on_program_select)
self.lblAudioSvcs3.set_property("name","svc3")
self.lblAudioSvcs3.set_has_window(True)
self.lblAudioSvcs3.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.lblAudioSvcs3.connect("button-press-event", self.on_program_select)
self.set_tuning_actions(self.btnAudioPrgs0, "btn_prg0", False, False)
self.set_tuning_actions(self.btnAudioPrgs1, "btn_prg1", False, False)
self.set_tuning_actions(self.btnAudioPrgs2, "btn_prg2", False, False)
self.set_tuning_actions(self.btnAudioPrgs3, "btn_prg3", False, False)
self.set_tuning_actions(self.lblAudioPrgs0, "prg0", True, True)
self.set_tuning_actions(self.lblAudioPrgs1, "prg1", True, True)
self.set_tuning_actions(self.lblAudioPrgs2, "prg2", True, True)
self.set_tuning_actions(self.lblAudioPrgs3, "prg3", True, True)
self.set_tuning_actions(self.lblAudioSvcs0, "svc0", True, True)
self.set_tuning_actions(self.lblAudioSvcs1, "svc1", True, True)
self.set_tuning_actions(self.lblAudioSvcs2, "svc2", True, True)
self.set_tuning_actions(self.lblAudioSvcs3, "svc3", True, True)
# setup bookmarks listview
nameRenderer = Gtk.CellRendererText()
@ -288,6 +261,20 @@ class NRSC5_DUI(object):
# set up pty
self.nrsc5master,self.nrsc5slave = pty.openpty()
def set_tuning_actions(self, widget, name, has_win, set_curs):
widget.set_property("name",name)
if has_win:
widget.set_has_window(True)
widget.set_events(Gdk.EventMask.BUTTON_PRESS_MASK)
widget.connect("button-press-event", self.on_program_select)
if set_curs:
widget.add_events(Gdk.EventMask.ENTER_NOTIFY_MASK)
widget.connect("enter-notify-event", self.on_enter_set_cursor)
def on_enter_set_cursor(self, widget, event):
if (widget.get_label() != ""):
widget.get_window().set_cursor(self.hand_cursor)
def img_to_pixbuf(self,img):
"""convert PIL.Image to GdkPixbuf.Pixbuf"""
data = GLib.Bytes.new(img.tobytes())
@ -604,7 +591,8 @@ class NRSC5_DUI(object):
def on_program_select(self, _label, evt):
stream_num = int(_label.get_property("name")[-1])
self.update_btns = not (_label.get_property("name")[0] == "b")
is_lbl = _label.get_property("name")[0] != "b"
self.update_btns = is_lbl
self.streamNum = stream_num
self.on_stream_changed()