first attempt
This commit is contained in:
parent
3080d1479f
commit
d26aa4d393
@ -23,7 +23,7 @@ class DropShip:
|
||||
|
||||
def __init__(self, nursery):
|
||||
"""Object initialisation."""
|
||||
self.GLADE_FILE = f"{UI_DIR}/dropship_tabless.ui"
|
||||
self.GLADE_FILE = f"{UI_DIR}/dropship_tabless2.ui"
|
||||
self.CSS_FILE = f"{UI_DIR}/dropship.css"
|
||||
|
||||
self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
|
||||
@ -91,15 +91,24 @@ class DropShip:
|
||||
self.pendingdrop_box.connect("drag-data-received", self.on_drop)
|
||||
|
||||
# Receive UI
|
||||
self.recvReveal = self.builder.get_object("recvReveal")
|
||||
|
||||
# Mouse-over area for revealing code entry
|
||||
self.recv_box = self.builder.get_object("recvBox")
|
||||
self.recv_box.add_events(Gdk.EventMask.POINTER_MOTION_MASK)
|
||||
|
||||
# Code entry revealer
|
||||
self.recv_box = self.builder.get_object("recvBox")
|
||||
# Code entry box
|
||||
self.recv_box = self.builder.get_object("receiveBoxCodeEntry")
|
||||
self.recv_box.connect("activate", self.on_recv)
|
||||
self.recv_code_entry_box = self.builder.get_object("receiveBoxCodeEntry")
|
||||
self.recv_code_entry_box.connect("activate", self.on_recv)
|
||||
|
||||
# Pending Transfers UI
|
||||
self.pending_transfers_list = self.builder.get_object(
|
||||
"pendingTransfersList"
|
||||
)
|
||||
|
||||
|
||||
def on_drop(self, widget, drag_context, x, y, data, info, time):
|
||||
"""Handler for file dropping."""
|
||||
files = data.get_uris()
|
||||
@ -139,6 +148,15 @@ class DropShip:
|
||||
self.drop_spinner.set_vexpand(False)
|
||||
self.drop_spinner.set_visible(False)
|
||||
|
||||
def receive_code_toggle(self, widget, event):
|
||||
"""Reveal or hide the receive code bar."""
|
||||
print('test')
|
||||
if self.recvReveal.get_reveal_child():
|
||||
self.recvReveal.set_reveal_child(False)
|
||||
else:
|
||||
self.recvReveal.set_reveal_child(True)
|
||||
|
||||
|
||||
def _create_pending_transfer(self, fpath, code, scope):
|
||||
"""Create a new pending transfer."""
|
||||
transfer = PendingTransfer(fpath, code, scope)
|
||||
|
249
dropship/ui/dropship_tabless2.ui
Normal file
249
dropship/ui/dropship_tabless2.ui
Normal file
@ -0,0 +1,249 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkApplicationWindow" id="mainWindow">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="default_width">250</property>
|
||||
<property name="default_height">250</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="show_close_button">True</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="sendReceiveStack">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="transition_type">crossfade</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkEventBox" id="dropBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<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="orientation">vertical</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
|
||||
drop it here
|
||||
..and ship it </property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinner" id="dropSpinner">
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<style>
|
||||
<class name="drop"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEventBox" id="recvBox">
|
||||
<property name="height_request">16</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<signal name="enter-notify-event" handler="receive_code_toggle" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="recvReveal">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="transition_type">slide-up</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="receiveBoxCodeEntry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="primary_icon_stock">gtk-paste</property>
|
||||
<property name="placeholder_text" translatable="yes">Transfer Code</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label">gtk-apply</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">dragAndDrop</property>
|
||||
<property name="title" translatable="yes">Send</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEventBox" id="pendingDragDrop">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="pendingBox">
|
||||
<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="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_start">6</property>
|
||||
<property name="margin_end">6</property>
|
||||
<property name="margin_bottom">6</property>
|
||||
<property name="hscrollbar_policy">never</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="pendingTransfersList">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<style>
|
||||
<class name="drop"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">Pending</property>
|
||||
<property name="title" translatable="yes">Pending</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkFileChooserDialog" id="filePicker">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Choose files to ship</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="transient_for">mainWindow</property>
|
||||
<property name="has_resize_grip">True</property>
|
||||
<property name="select_multiple">True</property>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
Loading…
Reference in New Issue
Block a user