add ui templates for pending transmissions
This commit is contained in:
parent
3b8fb66032
commit
6ed2310537
@ -10,11 +10,15 @@
|
|||||||
</object>
|
</object>
|
||||||
<template class="PendingTransmission" parent="GtkBox">
|
<template class="PendingTransmission" parent="GtkBox">
|
||||||
<property name="name">pendingTransmission</property>
|
<property name="name">pendingTransmission</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="valign">start</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage">
|
<object class="GtkImage">
|
||||||
<property name="width_request">50</property>
|
<property name="width_request">50</property>
|
||||||
@ -36,6 +40,7 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="margin_top">6</property>
|
<property name="margin_top">6</property>
|
||||||
<property name="margin_bottom">6</property>
|
<property name="margin_bottom">6</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
@ -44,10 +49,12 @@
|
|||||||
<property name="spacing">6</property>
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="fileNameLabel">
|
<object class="GtkLabel" id="fileNameLabel">
|
||||||
|
<property name="width_request">70</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="label" translatable="yes">screenshot_01-292.jpg</property>
|
<property name="halign">start</property>
|
||||||
<property name="ellipsize">end</property>
|
<property name="label" translatable="yes">screenshot_lkashdflasjdjasödjlkasjdlaskdlkashd01-292.jpg</property>
|
||||||
|
<property name="ellipsize">middle</property>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="weight" value="bold"/>
|
<attribute name="weight" value="bold"/>
|
||||||
<attribute name="scale" value="1.2"/>
|
<attribute name="scale" value="1.2"/>
|
||||||
@ -63,6 +70,7 @@
|
|||||||
<object class="GtkLabel" id="fileNameMetadata">
|
<object class="GtkLabel" id="fileNameMetadata">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
<property name="label" translatable="yes">336 KB</property>
|
<property name="label" translatable="yes">336 KB</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
@ -84,8 +92,9 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="halign">center</property>
|
<property name="halign">start</property>
|
||||||
<property name="margin_top">6</property>
|
<property name="margin_top">6</property>
|
||||||
|
<signal name="clicked" handler="transfer_button_click" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
@ -110,6 +119,7 @@
|
|||||||
<property name="margin_top">16</property>
|
<property name="margin_top">16</property>
|
||||||
<property name="margin_bottom">16</property>
|
<property name="margin_bottom">16</property>
|
||||||
<property name="image">image1</property>
|
<property name="image">image1</property>
|
||||||
|
<signal name="clicked" handler="cancel_transfer" swapped="no"/>
|
||||||
<style>
|
<style>
|
||||||
<class name="circular"/>
|
<class name="circular"/>
|
||||||
</style>
|
</style>
|
||||||
|
40
ui_templates.py
Normal file
40
ui_templates.py
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import gi
|
||||||
|
gi.require_version('Gtk', '3.0')
|
||||||
|
from gi.repository import Gtk, GLib, Gdk
|
||||||
|
|
||||||
|
@Gtk.Template.from_file('pendingTransmissions.ui')
|
||||||
|
class pendingTransmissions(Gtk.Box):
|
||||||
|
__gtype_name__ = 'PendingTransmission'
|
||||||
|
|
||||||
|
fileNameLabel = Gtk.Template.Child()
|
||||||
|
fileNameMetadata = Gtk.Template.Child()
|
||||||
|
transmissionCodeButton = Gtk.Template.Child()
|
||||||
|
cancelTransmission = Gtk.Template.Child()
|
||||||
|
|
||||||
|
def __init__(self, parent, fileName, transferCode):
|
||||||
|
super(Gtk.Box, self).__init__()
|
||||||
|
#Gtk.Frame.__init__(self)
|
||||||
|
# This must occur *after* you initialize your base
|
||||||
|
self.init_template()
|
||||||
|
#TODO (Roel)
|
||||||
|
self.fileNameLabel.set_ellipsize(2)
|
||||||
|
self.fileNameLabel.set_text(fileName)
|
||||||
|
|
||||||
|
self.transmissionCodeButton.set_label(transferCode)
|
||||||
|
|
||||||
|
@Gtk.Template.Callback()
|
||||||
|
def transfer_button_click(self,widget):
|
||||||
|
'''
|
||||||
|
what to do when we press the button:
|
||||||
|
copy the code again to clipboard
|
||||||
|
'''
|
||||||
|
print('click')
|
||||||
|
|
||||||
|
@Gtk.Template.Callback()
|
||||||
|
def cancel_transfer(self,widget):
|
||||||
|
'''
|
||||||
|
cancel the transfer
|
||||||
|
destroy thread
|
||||||
|
remove the object from the list
|
||||||
|
'''
|
||||||
|
print('poof!')
|
Loading…
Reference in New Issue
Block a user