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

Rework file transfer windows

parent 328ceedd
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.1 -->
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<requires lib="gtk+" version="3.20"/>
<object class="GtkAccelGroup" id="accelgroup1"/>
<object class="GtkMenu" id="file_transfers_menu">
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem" id="remove_menuitem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Remove</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_remove_menuitem_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="continue_menuitem">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">Con_tinue</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_continue_menuitem_activate" swapped="no"/>
<signal name="activate" handler="_on_remove_menuitem_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="pause_menuitem">
<object class="GtkMenuItem" id="pause_resume_menuitem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Pause</property>
<property name="label" translatable="yes">Pa_use/Resume</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_pause_menuitem_activate" swapped="no"/>
<signal name="activate" handler="_on_pause_resume_menuitem_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="cancel_menuitem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Cancel</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_cancel_menuitem_activate" swapped="no"/>
<signal name="activate" handler="_on_cancel_menuitem_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separator11">
<object class="GtkSeparatorMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="open_folder_menuitem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Open Containing Folder</property>
<property name="label" translatable="yes">_Open Folder</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_open_folder_menuitem_activate" swapped="no"/>
<signal name="activate" handler="_on_open_folder_menuitem_activate" swapped="no"/>
</object>
</child>
</object>
<object class="GtkWindow" id="file_transfers_window">
<property name="width_request">500</property>
<property name="height_request">350</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="border_width">18</property>
<property name="title" translatable="yes">File Transfers</property>
<property name="window_position">center-always</property>
<property name="default_width">450</property>
<property name="default_height">350</property>
<property name="type_hint">dialog</property>
<signal name="delete-event" handler="on_file_transfers_dialog_delete_event" swapped="no"/>
<signal name="key-press-event" handler="on_file_transfers_window_key_press_event" swapped="no"/>
<signal name="delete-event" handler="_on_file_transfers_dialog_delete_event" swapped="no"/>
<signal name="key-press-event" handler="_on_file_transfers_window_key_press_event" swapped="no"/>
<child type="titlebar">
<placeholder/>
</child>
<child>
<object class="GtkBox" id="vbox1">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_bottom">6</property>
<property name="spacing">12</property>
<child>
<object class="GtkSwitch" id="notify_ft_complete">
<property name="visible">True</property>
<property name="can_focus">True</property>
<signal name="notify::active" handler="_on_notify_ft_complete_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</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="label" translatable="yes">_Show notification when file transfer is complete</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">notify_ft_complete</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="transfers_scrolledwindow">
<property name="width_request">460</property>
<property name="height_request">150</property>
<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="GtkTreeView" id="transfers_list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="enable_search">False</property>
<signal name="button-press-event" handler="on_transfers_list_button_press_event" swapped="no"/>
<signal name="button-release-event" handler="on_transfers_list_button_release_event" swapped="no"/>
<signal name="key-press-event" handler="on_transfers_list_key_press_event" swapped="no"/>
<signal name="row-activated" handler="on_transfers_list_row_activated" swapped="no"/>
<signal name="button-press-event" handler="_on_transfers_list_button_press_event" swapped="no"/>
<signal name="button-release-event" handler="_on_transfers_list_button_release_event" swapped="no"/>
<signal name="key-press-event" handler="_on_transfers_list_key_press_event" swapped="no"/>
<signal name="row-activated" handler="_on_transfers_list_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
<object class="GtkTreeSelection"/>
</child>
<child internal-child="accessible">
<object class="AtkObject" id="transfers_list-atkobject">
......@@ -97,132 +141,69 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox" id="hbuttonbox1">
<object class="GtkToolbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="layout_style">end</property>
<property name="show_arrow">False</property>
<property name="icon_size">1</property>
<child>
<object class="GtkButton" id="cleanup_button">
<property name="label" translatable="yes">Clean _up</property>
<object class="GtkToolButton" id="cleanup_button">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Remove completed, cancelled and failed file transfers from the list</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_cleanup_button_clicked" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="cleanup_button-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Remove file transfer from the list.</property>
<property name="AtkObject::accessible-description" translatable="yes">This action removes single file transfer from the list. If the transfer is active, it is first stopped and then removed</property>
</object>
</child>
<property name="label" translatable="yes">toolbutton</property>
<property name="icon_name">edit-clear-all-symbolic</property>
<signal name="clicked" handler="_on_cleanup_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="homogeneous">False</property>
</packing>
</child>
<child>
<object class="GtkButton" id="pause_restore_button">
<property name="label" translatable="yes">_Pause</property>
<object class="GtkToolButton" id="pause_resume_button">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Pause or resume file transfer</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_pause_restore_button_clicked" swapped="no"/>
<property name="icon_name">media-playback-pause-symbolic</property>
<signal name="clicked" handler="_on_pause_resume_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
<property name="homogeneous">False</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">_Cancel</property>
<object class="GtkToolButton" id="cancel_button">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Cancel the selected file transfer and remove incomplete files</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="cancel_button-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Cancel file transfer</property>
<property name="AtkObject::accessible-description" translatable="yes">Cancels the selected file transfer</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Hide the window</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_close_button_clicked" swapped="no"/>
<property name="icon_name">process-stop-symbolic</property>
<signal name="clicked" handler="_on_cancel_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
<property name="homogeneous">False</property>
</packing>
</child>
<style>
<class name="inline-toolbar"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="notify_ft_complete_checkbox">
<property name="label" translatable="yes">_Notify me when a file transfer is complete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_notify_ft_complete_checkbox_toggled" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="notify_ft_complete_checkbox-atkobject">
<property name="AtkObject::accessible-description" translatable="yes">When a file transfer is complete show a popup notification</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<placeholder/>
</child>
<child internal-child="accessible">
<object class="AtkObject" id="file_transfers_window-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">File Transfers</property>
......
......@@ -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: