Commit 93057ab6 authored by Daniel Brötzmann's avatar Daniel Brötzmann Committed by Philipp Hörist

Rework file transfer windows

parent 328ceedd
This diff is collapsed.
......@@ -5,43 +5,18 @@
<object class="GtkGrid" id="send_file_grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">18</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</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="listbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="selection_mode">none</property>
<property name="activate_on_single_click">False</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">2</property>
</packing>
</child>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Description:</property>
<property name="label" translatable="yes">Description</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
......@@ -51,10 +26,9 @@
</child>
<child>
<object class="GtkScrolledWindow">
<property name="height_request">40</property>
<property name="height_request">70</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
......@@ -62,6 +36,10 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="wrap_mode">word-char</property>
<property name="left_margin">6</property>
<property name="right_margin">6</property>
<property name="top_margin">6</property>
<property name="bottom_margin">6</property>
</object>
</child>
</object>
......@@ -73,42 +51,123 @@
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Select Files</property>
<property name="label" translatable="yes">_Send Files</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">start</property>
<signal name="clicked" handler="_select_files" swapped="no"/>
<property name="tooltip_text" translatable="yes">Send</property>
<property name="halign">center</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="_send" swapped="no"/>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Send</property>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
<signal name="clicked" handler="_send" swapped="no"/>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Files to send</property>
<property name="xalign">0</property>
<style>
<class name="dim-label"/>
</style>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Files:</property>
<property name="xalign">0</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</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="listbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="selection_mode">multiple</property>
<property name="activate_on_single_click">False</property>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToolbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_arrow">False</property>
<property name="icon_size">1</property>
<child>
<object class="GtkToolButton">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Add Files</property>
<property name="use_underline">True</property>
<property name="icon_name">list-add-symbolic</property>
<signal name="clicked" handler="_select_files" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">False</property>
</packing>
</child>
<child>
<object class="GtkToolButton">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Remove Files</property>
<property name="use_underline">True</property>
<property name="icon_name">list-remove-symbolic</property>
<signal name="clicked" handler="_remove_files" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<style>
<class name="inline-toolbar"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="top_attach">1</property>
<property name="width">2</property>
</packing>
</child>
......
......@@ -114,6 +114,9 @@ list.settings > row > box {
margin: 6px 18px;
}
/*SendFileDialog*/
#SendFileDialog grid list > row { padding: 10px 20px 10px 10px; }
/* Preferences Window */
.PreferencesWindow { background-color: @theme_base_color; }
.PreferencesStack { background-color: @theme_bg_color; }
......@@ -231,10 +234,6 @@ button.flat.link { padding: 0; border: 0; }
/*MessageWindow Notebook*/
.notebook-tab-label {min-width: 80px}
/*SendFileDialog*/
#SendFileDialog grid {padding: 12px}
#SendFileDialog grid list { background-color: @theme_bg_color}
/*Icon colors*/
.success-color { color: @success_color; }
.error-color { color: @error_color; }
......
This diff is collapsed.
......@@ -549,16 +549,19 @@ def get_tooltip(self, file_props, sid):
return False, self.widget
def _create_tooltip(self, file_props, _sid):
ft_table = Gtk.Table(2, 1)
ft_table.set_property('column-spacing', 2)
current_row = 1
ft_grid = Gtk.Grid.new()
ft_grid.insert_column(0)
ft_grid.set_row_spacing(6)
ft_grid.set_column_spacing(12)
current_row = 0
properties = []
name = file_props.name
if file_props.type_ == 'r':
file_name = os.path.split(file_props.file_name)[1]
else:
file_name = file_props.name
properties.append((_('Name: '), GLib.markup_escape_text(file_name)))
properties.append((_('File Name: '),
GLib.markup_escape_text(file_name)))
if file_props.type_ == 'r':
type_ = Q_('?Noun:Download')
actor = _('Sender: ')
......@@ -573,58 +576,55 @@ def _create_tooltip(self, file_props, _sid):
name = receiver.get_shown_name()
else:
name = receiver.split('/')[0]
properties.append((_('Type: '), type_))
properties.append((Q_('?transfer type:Type: '), type_))
properties.append((actor, GLib.markup_escape_text(name)))
transfered_len = file_props.received_len
if not transfered_len:
transfered_len = 0
properties.append((_('Transferred: '), helpers.convert_bytes(transfered_len)))
properties.append((Q_('?transfer status:Transferred: '),
helpers.convert_bytes(transfered_len)))
status = self._get_current_status(file_props)
properties.append((_('Status: '), status))
properties.append((Q_('?transfer status:Status: '), status))
file_desc = file_props.desc or ''
properties.append((_('Description: '), GLib.markup_escape_text(
file_desc)))
properties.append((_('Description: '),
GLib.markup_escape_text(file_desc)))
while properties:
property_ = properties.pop(0)
current_row += 1
label = Gtk.Label()
label.set_halign(Gtk.Align.START)
label.set_valign(Gtk.Align.START)
label.set_halign(Gtk.Align.END)
label.set_valign(Gtk.Align.CENTER)
label.set_markup(property_[0])
ft_table.attach(
label, 1, 2, current_row, current_row + 1,
Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL, 0, 0)
ft_grid.attach(label, 0, current_row, 1, 1)
label = Gtk.Label()
label.set_halign(Gtk.Align.START)
label.set_valign(Gtk.Align.START)
label.set_line_wrap(True)
label.set_markup(property_[1])
ft_table.attach(
label, 2, 3, current_row, current_row + 1,
Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL,
Gtk.AttachOptions.FILL, 0, 0)
ft_grid.attach(label, 1, current_row, 1, 1)
current_row += 1
ft_table.show_all()
return ft_table
ft_grid.show_all()
return ft_grid
@staticmethod
def _get_current_status(file_props):
if file_props.stopped:
return _('Aborted')
return Q_('?transfer status:Aborted')
if file_props.completed:
return _('Completed')
return Q_('?transfer status:Completed')
if file_props.paused:
return Q_('?transfer status:Paused')
if file_props.stalled:
# stalled is not paused. it is like 'frozen' it stopped alone
return _('Stalled')
return Q_('?transfer status:Stalled')
if file_props.connected:
if file_props.started:
return _('Transferring')
return _('Not started')
return _('Not started')
return Q_('?transfer status:Transferring')
return Q_('?transfer status:Not started')
return Q_('?transfer status:Not started')
def colorize_status(status):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment