Browse Source

added a spinner to indicate transmission process.. still ugly but that is fixable

unifiedWindowUI
rra 4 years ago
parent
commit
eac95090b9
  1. 18
      dropship.glade
  2. 4
      dropship.py

18
dropship.glade

@ -148,29 +148,39 @@
<property name="can_focus">False</property>
<signal name="button-press-event" handler="add_files" swapped="no"/>
<child>
<object class="GtkBox">
<object class="GtkBox" id="dragActionContainer">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">16</property>
<property name="margin_right">16</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="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="dropLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="label" translatable="yes">Drag a file to send</property>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
<object class="GtkSpinner" id="dropSpinner">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="drop"/>

4
dropship.py

@ -92,6 +92,7 @@ class DropShip:
)
self.drop_box.connect("drag-data-received", self.on_drop)
self.drop_label = self.builder.get_object('dropLabel')
self.drop_spinner = self.builder.get_object('dropSpinner')
# File chooser
self.file_chooser = self.builder.get_object('filePicker')
@ -114,6 +115,8 @@ class DropShip:
print(fpath, type(fpath))
self.schedule(self.wormhole_send(self, fpath))
self.drop_label.set_text("Sending..")
self.drop_spinner.start()
else:
log.info("Multiple file sending coming soon ™")
@ -166,6 +169,7 @@ class DropShip:
self.drop_label.set_selectable(True)
self.drop_label.set_text(code)
self.drop_spinner.stop()
self.clipboard.set_text(code, AUTO_CLIP_COPY_SIZE)

Loading…
Cancel
Save