Browse Source

Use USB manufacturer and product strings for names

The devices have their own name, in the form of USB manufacturer and
product string descriptors.  Now we use those in the GUI as the device
names.
Clara Hobbs 7 years ago
parent
commit
27e0c3313c
2 changed files with 6 additions and 3 deletions
  1. 3
    2
      data/pd-buddy-gtk.ui
  2. 3
    1
      pd-buddy-gtk.py

+ 3
- 2
data/pd-buddy-gtk.ui View File

140
                                   <object class="GtkLabel">
140
                                   <object class="GtkLabel">
141
                                     <property name="visible">True</property>
141
                                     <property name="visible">True</property>
142
                                     <property name="can_focus">False</property>
142
                                     <property name="can_focus">False</property>
143
+                                    <property name="halign">start</property>
143
                                     <property name="label" translatable="yes">A</property>
144
                                     <property name="label" translatable="yes">A</property>
144
                                   </object>
145
                                   </object>
145
                                   <packing>
146
                                   <packing>
151
                                   <object class="GtkLabel">
152
                                   <object class="GtkLabel">
152
                                     <property name="visible">True</property>
153
                                     <property name="visible">True</property>
153
                                     <property name="can_focus">False</property>
154
                                     <property name="can_focus">False</property>
155
+                                    <property name="halign">start</property>
154
                                     <property name="label" translatable="yes">V</property>
156
                                     <property name="label" translatable="yes">V</property>
155
                                   </object>
157
                                   </object>
156
                                   <packing>
158
                                   <packing>
196
                                     <property name="visible">True</property>
198
                                     <property name="visible">True</property>
197
                                     <property name="can_focus">False</property>
199
                                     <property name="can_focus">False</property>
198
                                     <property name="halign">start</property>
200
                                     <property name="halign">start</property>
199
-                                    <property name="orientation">vertical</property>
200
-                                    <property name="layout_style">end</property>
201
+                                    <property name="layout_style">expand</property>
201
                                     <child>
202
                                     <child>
202
                                       <object class="GtkToggleButton" id="giveback-toggle">
203
                                       <object class="GtkToggleButton" id="giveback-toggle">
203
                                         <property name="label" translatable="yes">GiveBack</property>
204
                                         <property name="label" translatable="yes">GiveBack</property>

+ 3
- 1
pd-buddy-gtk.py View File

139
         self._builder.connect_signals(self)
139
         self._builder.connect_signals(self)
140
 
140
 
141
         name = self._builder.get_object("name")
141
         name = self._builder.get_object("name")
142
-        name.set_text(self.model.serport.description)
142
+        name.set_text('{} {}'.format(self.model.serport.manufacturer,
143
+                                     self.model.serport.product))
143
 
144
 
144
         device = self._builder.get_object("device")
145
         device = self._builder.get_object("device")
145
         device.set_text(self.model.serport.device)
146
         device.set_text(self.model.serport.device)
224
         # Show the Sink page
225
         # Show the Sink page
225
         hst = self.builder.get_object("header-stack")
226
         hst = self.builder.get_object("header-stack")
226
         hsink = self.builder.get_object("header-sink")
227
         hsink = self.builder.get_object("header-sink")
228
+        hsink.set_title('{} {}'.format(serport.manufacturer, serport.product))
227
         hsink.set_subtitle(serport.device)
229
         hsink.set_subtitle(serport.device)
228
         hst.set_visible_child(hsink)
230
         hst.set_visible_child(hsink)
229
 
231
 

Loading…
Cancel
Save