~martijnbraam/pyatem

826e859ae973f6c3a8ccb4ab923e2f6f76495a0e — Martijn Braam a month ago 93ebdb3
Implement firmware warning page
2 files changed, 50 insertions(+), 112 deletions(-)

M gtk_switcher/atemwindow.py
M gtk_switcher/ui/mixer.glade
M gtk_switcher/atemwindow.py => gtk_switcher/atemwindow.py +9 -1
@@ 244,8 244,10 @@ class AtemWindow(SwitcherPage, MediaPage, AudioPage, CameraPage):
        self.connectionstack.set_visible_child_name("disconnected")
        print("Disconnected from mixer")

    def on_change(self, field, data):
    def on_bypass_firmware_clicked(self, widget, *args):
        self.connectionstack.set_visible_child_name("connected")

    def on_change(self, field, data):
        global _callbacks
        if self.args.dump is not None and field in self.args.dump:
            if isinstance(data, bytes):


@@ 261,6 263,12 @@ class AtemWindow(SwitcherPage, MediaPage, AudioPage, CameraPage):

        if field == 'firmware-version':
            self.firmware_version = data
            if data.major < 2:
                self.connectionstack.set_visible_child_name("firmware")
            elif data.minor < 28:
                self.connectionstack.set_visible_child_name("firmware")
            else:
                self.connectionstack.set_visible_child_name("connected")
            print("Firmware: {}".format(data.version))
        elif field == 'input-properties':
            self.on_input_layout_change(data)

M gtk_switcher/ui/mixer.glade => gtk_switcher/ui/mixer.glade +41 -111
@@ 2,7 2,7 @@
<!-- Generated with glade 3.38.2 -->
<interface>
  <requires lib="gtk+" version="3.24"/>
  <requires lib="libhandy" version="1.0"/>
  <requires lib="libhandy" version="1.2"/>
  <object class="GtkImage" id="image1">
    <property name="visible">True</property>
    <property name="can-focus">False</property>


@@ 2431,128 2431,58 @@
              </packing>
            </child>
            <child>
              <!-- n-columns=3 n-rows=3 -->
              <object class="GtkGrid" id="disconnected_page">
              <object class="HdyStatusPage" id="disconnected_page">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="hexpand">True</property>
                <property name="vexpand">True</property>
                <child>
                  <object class="GtkBox">
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <property name="orientation">vertical</property>
                    <child>
                      <object class="GtkImage">
                        <property name="visible">True</property>
                        <property name="can-focus">False</property>
                        <property name="margin-start">16</property>
                        <property name="margin-end">16</property>
                        <property name="margin-top">16</property>
                        <property name="margin-bottom">16</property>
                        <property name="resource">/nl/brixit/switcher/icons/openswitcher.svg</property>
                      </object>
                      <packing>
                        <property name="expand">False</property>
                        <property name="fill">True</property>
                        <property name="position">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkLabel">
                        <property name="visible">True</property>
                        <property name="can-focus">False</property>
                        <property name="margin-start">16</property>
                        <property name="margin-end">16</property>
                        <property name="margin-top">16</property>
                        <property name="margin-bottom">16</property>
                        <property name="label" translatable="yes">Not connected</property>
                        <style>
                          <class name="heading"/>
                        </style>
                      </object>
                      <packing>
                        <property name="expand">False</property>
                        <property name="fill">True</property>
                        <property name="position">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkLabel">
                        <property name="visible">True</property>
                        <property name="can-focus">False</property>
                        <property name="margin-start">16</property>
                        <property name="margin-end">16</property>
                        <property name="margin-top">16</property>
                        <property name="margin-bottom">16</property>
                        <property name="label" translatable="yes">There is no connection to the hardware. The connection might be interrupted or a new connection needs to be made in the Preferences window</property>
                        <property name="wrap">True</property>
                      </object>
                      <packing>
                        <property name="expand">False</property>
                        <property name="fill">True</property>
                        <property name="position">2</property>
                      </packing>
                    </child>
                  </object>
                  <packing>
                    <property name="left-attach">1</property>
                    <property name="top-attach">1</property>
                  </packing>
                </child>
                <property name="icon-name">nl.brixit.Switcher</property>
                <property name="title" translatable="yes">Not connected</property>
                <property name="description" translatable="yes">There is no connection to the hardware. The connection might be interrupted or a new connection needs to be made in the Preferences window</property>
                <child>
                  <object class="GtkEventBox">
                  <object class="GtkButton">
                    <property name="label" translatable="yes">Open preferences</property>
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <property name="hexpand">True</property>
                    <property name="vexpand">True</property>
                    <child>
                      <placeholder/>
                    </child>
                    <property name="can-focus">True</property>
                    <property name="receives-default">True</property>
                    <property name="halign">center</property>
                    <signal name="clicked" handler="on_preferences_button_clicked" swapped="no"/>
                    <style>
                      <class name="suggested-action"/>
                    </style>
                  </object>
                  <packing>
                    <property name="left-attach">0</property>
                    <property name="top-attach">0</property>
                  </packing>
                </child>
              </object>
              <packing>
                <property name="name">disconnected</property>
                <property name="title" translatable="yes">Disconnected</property>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <placeholder/>
            </child>
            <child>
              <object class="HdyStatusPage" id="firmware_page">
                <property name="visible">True</property>
                <property name="can-focus">False</property>
                <property name="icon-name">nl.brixit.Switcher</property>
                <property name="title" translatable="yes">Firmware outdated</property>
                <property name="description" translatable="yes">The firmware on the connected device is not new enough for this application.
OpenSwitcher requires at least firmware 8.0+ to correctly function with most hardware.</property>
                <child>
                  <object class="GtkEventBox">
                  <object class="GtkButton" id="bypass_firmware">
                    <property name="label" translatable="yes">Continue anyway</property>
                    <property name="visible">True</property>
                    <property name="can-focus">False</property>
                    <property name="hexpand">True</property>
                    <property name="vexpand">True</property>
                    <child>
                      <placeholder/>
                    </child>
                    <property name="can-focus">True</property>
                    <property name="receives-default">True</property>
                    <property name="halign">center</property>
                    <signal name="clicked" handler="on_bypass_firmware_clicked" swapped="no"/>
                  </object>
                  <packing>
                    <property name="left-attach">2</property>
                    <property name="top-attach">2</property>
                  </packing>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
                <child>
                  <placeholder/>
                </child>
              </object>
              <packing>
                <property name="name">disconnected</property>
                <property name="title" translatable="yes">page1</property>
                <property name="position">1</property>
                <property name="name">firmware</property>
                <property name="title" translatable="yes">firmware</property>
                <property name="position">3</property>
              </packing>
            </child>
          </object>