GTK4
This commit is contained in:
26
meson.build
26
meson.build
@@ -146,31 +146,15 @@ endif
|
|||||||
|
|
||||||
add_project_arguments(common_flags + compiler_flags, language: 'c')
|
add_project_arguments(common_flags + compiler_flags, language: 'c')
|
||||||
|
|
||||||
glib_dep = dependency('glib-2.0', version: '>= 2.43.4')
|
glib_dep = dependency('glib-2.0', version: '>= 2.66')
|
||||||
gtk_dep = dependency('gtk+-3.0', version: '>= 3.22.0')
|
gtk_dep = dependency('gtk4', version: '>= 4.0.0')
|
||||||
|
libadwaita_dep = dependency('libadwaita-1', version: '>= 1.0.0')
|
||||||
libhandy_dep = dependency('libhandy-0.0', version: '>= 0.0.9', required: false)
|
|
||||||
if not libhandy_dep.found()
|
|
||||||
libhandy = subproject(
|
|
||||||
'libhandy',
|
|
||||||
default_options: [
|
|
||||||
'examples=false',
|
|
||||||
'glade_catalog=disabled',
|
|
||||||
'introspection=disabled',
|
|
||||||
'static=true',
|
|
||||||
'tests=false',
|
|
||||||
'vapi=false',
|
|
||||||
]
|
|
||||||
)
|
|
||||||
libhandy_dep = libhandy.get_variable('libhandy_dep')
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
teleport_deps = [
|
teleport_deps = [
|
||||||
glib_dep,
|
glib_dep,
|
||||||
gtk_dep,
|
gtk_dep,
|
||||||
libhandy_dep,
|
libadwaita_dep,
|
||||||
dependency('gio-2.0', version: '>= 2.43.4'),
|
dependency('gio-2.0', version: '>= 2.66'),
|
||||||
dependency('libsoup-2.4'),
|
dependency('libsoup-2.4'),
|
||||||
dependency('avahi-client'),
|
dependency('avahi-client'),
|
||||||
cc.find_library('m', required: true)
|
cc.find_library('m', required: true)
|
||||||
|
|||||||
@@ -1,53 +1,40 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<!-- interface-requires gtk+ 3.0 -->
|
<requires lib="gtk" version="4.0"/>
|
||||||
<object id="device-settings" class="GtkPopover">
|
<object class="GtkPopover" id="device-settings">
|
||||||
<child>
|
<property name="child">
|
||||||
<object class="GtkGrid">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="margin-start">10</property>
|
||||||
<property name="margin">10</property>
|
<property name="margin-end">10</property>
|
||||||
<property name="column-spacing">6</property>
|
<property name="margin-top">10</property>
|
||||||
|
<property name="margin-bottom">10</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes">Device name</property>
|
<property name="label" translatable="yes">Device name</property>
|
||||||
<property name="halign">GTK_ALIGN_START</property>
|
<property name="halign">start</property>
|
||||||
<property name="margin_bottom">6</property>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkEntry" id="this_device_settings_entry">
|
<object class="GtkEntry" id="this_device_settings_entry">
|
||||||
<property name="visible">True</property>
|
<property name="hexpand">True</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="this_device_settings_button">
|
<object class="GtkButton" id="this_device_settings_button">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes">Rename</property>
|
<property name="label" translatable="yes">Rename</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="suggested-action"/>
|
<class name="suggested-action"/>
|
||||||
</style>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
</interface>
|
</interface>
|
||||||
@@ -16,12 +16,13 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <adwaita.h>
|
||||||
|
|
||||||
#include "teleport-app.h"
|
#include "teleport-app.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
adw_init ();
|
||||||
return g_application_run (G_APPLICATION (teleport_app_new ()), argc, argv);
|
return g_application_run (G_APPLICATION (teleport_app_new ()), argc, argv);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,75 +1,15 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<!-- interface-requires gtk+ 3.0 -->
|
<requires lib="gtk" version="4.0"/>
|
||||||
<template class="TeleportRemoteDevice" parent="GtkFrame">
|
<requires lib="libadwaita" version="1.0"/>
|
||||||
<property name="visible">True</property>
|
<template class="TeleportRemoteDevice" parent="AdwActionRow">
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<property name="shadow_type">none</property>
|
|
||||||
<style>
|
|
||||||
<class name="frame"/>
|
|
||||||
</style>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="selection_mode">none</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBoxRow" id="remote_device_row">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="activatable">True</property>
|
<property name="activatable">True</property>
|
||||||
<property name="selectable">True</property>
|
<property name="selectable">True</property>
|
||||||
<child>
|
|
||||||
<object class="GtkGrid">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="row_spacing">0</property>
|
|
||||||
<property name="column_spacing">32</property>
|
|
||||||
<property name="margin">12</property>
|
|
||||||
<property name="margin_start">16</property>
|
|
||||||
<property name="valign">center</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="device_name">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="valign">end</property>
|
|
||||||
<property name="label" translatable="yes">Jan's Librem</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<style>
|
|
||||||
<class name="device-name"/>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="send_btn">
|
<object class="GtkButton" id="send_btn">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="halign">end</property>
|
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="label" translatable="yes">Send File</property>
|
<property name="label" translatable="yes">Send File</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</template>
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</template>>
|
|
||||||
</interface>
|
</interface>
|
||||||
225
src/settings.ui
225
src/settings.ui
@@ -1,128 +1,73 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.22.1 -->
|
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.16"/>
|
<requires lib="gtk" version="4.0"/>
|
||||||
<object class="GtkPopover" id="settings">
|
<object class="GtkPopover" id="settings">
|
||||||
<property name="can_focus">False</property>
|
<property name="child">
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="margin-start">12</property>
|
||||||
|
<property name="margin-end">12</property>
|
||||||
|
<property name="margin-top">12</property>
|
||||||
|
<property name="margin-bottom">12</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="margin">12</property>
|
<property name="spacing">6</property>
|
||||||
<child>
|
|
||||||
<object class="GtkGrid">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_bottom">6</property>
|
|
||||||
<property name="label" translatable="yes">Save received files in:</property>
|
<property name="label" translatable="yes">Save received files in:</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFileChooserButton" id="settings_download_directory">
|
<object class="GtkButton" id="settings_download_directory">
|
||||||
<property name="visible">True</property>
|
<property name="label" translatable="yes">Choose download dir</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="action">select-folder</property>
|
|
||||||
<property name="title" translatable="yes">Choose download dir</property>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-top">6</property>
|
||||||
<property name="margin_top">18</property>
|
|
||||||
<property name="margin_bottom">6</property>
|
|
||||||
<property name="label" translatable="yes">Automatically enable Teleport on these networks:</property>
|
<property name="label" translatable="yes">Automatically enable Teleport on these networks:</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">2</property>
|
|
||||||
<property name="width">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBox" id="general-listbox">
|
<object class="GtkListBox" id="general-listbox">
|
||||||
<property name="can_focus">False</property>
|
<property name="selection-mode">none</property>
|
||||||
<property name="selection_mode">none</property>
|
<style>
|
||||||
|
<class name="boxed-list"/>
|
||||||
|
</style>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBoxRow" id="primary-button-row-1">
|
<object class="GtkListBoxRow" id="primary-button-row-1">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="activatable">False</property>
|
<property name="activatable">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkGrid" id="primary-button-grid-1">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="margin-start">12</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-end">6</property>
|
||||||
<property name="margin_left">12</property>
|
<property name="margin-top">6</property>
|
||||||
<property name="margin_right">6</property>
|
<property name="margin-bottom">6</property>
|
||||||
<property name="margin_start">12</property>
|
<property name="spacing">12</property>
|
||||||
<property name="margin_end">6</property>
|
|
||||||
<property name="margin_top">6</property>
|
|
||||||
<property name="margin_bottom">6</property>
|
|
||||||
<property name="column_spacing">16</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="device-name-lable-1">
|
<object class="GtkLabel" id="device-name-lable-1">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="label" translatable="yes">o2-WLAN09</property>
|
<property name="label" translatable="yes">o2-WLAN09</property>
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkGrid">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="valign">center</property>
|
|
||||||
<property name="column_homogeneous">True</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="localSettings-1">
|
<object class="GtkButton" id="localSettings-1">
|
||||||
<property name="height_request">35</property>
|
<property name="icon-name">window-close-symbolic</property>
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkImage">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="icon_name">window-close-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="image-button"/>
|
<class name="flat"/>
|
||||||
</style>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<style>
|
|
||||||
<class name="linked"/>
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
@@ -130,128 +75,52 @@
|
|||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBoxRow" id="primary-button-row">
|
<object class="GtkListBoxRow" id="primary-button-row">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="activatable">False</property>
|
<property name="activatable">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkGrid" id="primary-button-grid">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="margin-start">12</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-end">6</property>
|
||||||
<property name="margin_left">12</property>
|
<property name="margin-top">6</property>
|
||||||
<property name="margin_right">6</property>
|
<property name="margin-bottom">6</property>
|
||||||
<property name="margin_start">12</property>
|
<property name="spacing">12</property>
|
||||||
<property name="margin_end">6</property>
|
|
||||||
<property name="margin_top">6</property>
|
|
||||||
<property name="margin_bottom">6</property>
|
|
||||||
<property name="column_spacing">16</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="device-name-lable">
|
<object class="GtkLabel" id="device-name-lable">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="label" translatable="yes">Add Network</property>
|
<property name="label" translatable="yes">Add Network</property>
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkGrid">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="valign">center</property>
|
|
||||||
<property name="column_homogeneous">True</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="localSettings">
|
<object class="GtkButton" id="localSettings">
|
||||||
<property name="height_request">35</property>
|
<property name="icon-name">list-add-symbolic</property>
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkImage">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="icon_name">list-add-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="image-button"/>
|
<class name="flat"/>
|
||||||
</style>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<style>
|
|
||||||
<class name="linked"/>
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">4</property>
|
|
||||||
<property name="width">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSeparator">
|
<object class="GtkSeparator">
|
||||||
<property name="visible">True</property>
|
<property name="margin-top">6</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">6</property>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkModelButton">
|
<object class="GtkButton">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="action_name">app.about</property>
|
<property name="action_name">app.about</property>
|
||||||
<property name="text" translatable="yes">_About Teleport</property>
|
<property name="label" translatable="yes">About Teleport</property>
|
||||||
</object>
|
<style>
|
||||||
<packing>
|
<class name="flat"/>
|
||||||
<property name="expand">False</property>
|
</style>
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
</interface>
|
</interface>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright 2017 Julian Sparber <julian@sparber.com>
|
* Copyright 2017 Julian Sparber <julian@sparber.com>
|
||||||
*
|
*
|
||||||
* Teleport is free software: you can redistribute it and/or modify
|
* Teleport is free software: you can redistribute and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <adwaita.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -84,13 +84,13 @@ typedef struct
|
|||||||
|
|
||||||
|
|
||||||
struct _TeleportApp {
|
struct _TeleportApp {
|
||||||
GtkApplication parent;
|
AdwApplication parent;
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
TeleportAppPrivate *priv;
|
TeleportAppPrivate *priv;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (TeleportApp, teleport_app, GTK_TYPE_APPLICATION);
|
G_DEFINE_TYPE_WITH_PRIVATE (TeleportApp, teleport_app, ADW_TYPE_APPLICATION);
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -231,7 +231,7 @@ open_file_callback (GSimpleAction *simple,
|
|||||||
g_variant_get_string (g_variant_get_child_value (parameter, 3), NULL),
|
g_variant_get_string (g_variant_get_child_value (parameter, 3), NULL),
|
||||||
g_variant_get_string (g_variant_get_child_value (parameter, 2), NULL));
|
g_variant_get_string (g_variant_get_child_value (parameter, 2), NULL));
|
||||||
|
|
||||||
gtk_show_uri_on_window (NULL, g_filename_to_uri(path, NULL, NULL), GDK_CURRENT_TIME, NULL);
|
gtk_show_uri (NULL, g_filename_to_uri(path, NULL, NULL), GDK_CURRENT_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -251,9 +251,6 @@ create_user_notification (const char *file_name, const int file_size, const char
|
|||||||
g_notification_set_priority (notification, G_NOTIFICATION_PRIORITY_HIGH);
|
g_notification_set_priority (notification, G_NOTIFICATION_PRIORITY_HIGH);
|
||||||
g_application_send_notification ((GApplication *) mainApplication, NULL, notification);
|
g_application_send_notification ((GApplication *) mainApplication, NULL, notification);
|
||||||
g_object_unref (notification);
|
g_object_unref (notification);
|
||||||
//the example says I have to unref it but it gives a critival error
|
|
||||||
//https://developer.gnome.org/glib/stable/gvariant-format-strings.html
|
|
||||||
//g_variant_unref (target);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -289,7 +286,6 @@ mainLoopRemovePeerCallback (gpointer peer) {
|
|||||||
GtkWidget *window = priv->window;
|
GtkWidget *window = priv->window;
|
||||||
|
|
||||||
update_remote_device_list_remove((TeleportWindow *) window, (Peer *) peer);
|
update_remote_device_list_remove((TeleportWindow *) window, (Peer *) peer);
|
||||||
//if (teleport_peer_get_number (priv->peerList) == 0)
|
|
||||||
if (teleport_peer_get_number (priv->peerList) == 0)
|
if (teleport_peer_get_number (priv->peerList) == 0)
|
||||||
teleport_show_no_device_message (TELEPORT_WINDOW (window), TRUE);
|
teleport_show_no_device_message (TELEPORT_WINDOW (window), TRUE);
|
||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
@@ -307,7 +303,6 @@ callback_remove_peer (GObject *instance, Peer *peer, gpointer window) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
callback_notify_user (GObject *instance, gchar *name, gpointer window) {
|
callback_notify_user (GObject *instance, gchar *name, gpointer window) {
|
||||||
//create_user_notification("icon.png", 2000, "Mark's laptop");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GSettings *
|
GSettings *
|
||||||
@@ -374,8 +369,8 @@ teleport_app_startup (GApplication *app) {
|
|||||||
/* CSS style */
|
/* CSS style */
|
||||||
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
|
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
|
||||||
gtk_css_provider_load_from_resource (GTK_CSS_PROVIDER (provider),
|
gtk_css_provider_load_from_resource (GTK_CSS_PROVIDER (provider),
|
||||||
"com/frac_tion/teleport/style.css");
|
"/com/frac_tion/teleport/style.css");
|
||||||
gtk_style_context_add_provider_for_screen (gdk_screen_get_default(),
|
gtk_style_context_add_provider_for_display (gdk_display_get_default(),
|
||||||
provider,
|
provider,
|
||||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||||
g_object_unref (provider);
|
g_object_unref (provider);
|
||||||
@@ -398,15 +393,12 @@ teleport_app_activate (GApplication *app) {
|
|||||||
TeleportAppPrivate *priv;
|
TeleportAppPrivate *priv;
|
||||||
priv = mainApplication->priv;
|
priv = mainApplication->priv;
|
||||||
|
|
||||||
gtk_widget_show (priv->window);
|
|
||||||
gtk_window_present (GTK_WINDOW (priv->window));
|
gtk_window_present (GTK_WINDOW (priv->window));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
teleport_app_finalize (GObject *object)
|
teleport_app_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
/*TeleportAppPrivate priv = mainApplication->priv;
|
|
||||||
g_clear_object (&priv->settings);*/
|
|
||||||
G_OBJECT_CLASS (teleport_app_parent_class)->finalize (object);
|
G_OBJECT_CLASS (teleport_app_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,45 +428,39 @@ teleport_app_show_about (GSimpleAction *simple,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
TeleportAppPrivate *priv = TELEPORT_APP (user_data)->priv;
|
TeleportAppPrivate *priv = TELEPORT_APP (user_data)->priv;
|
||||||
char *copyright;
|
g_autofree char *copyright = NULL;
|
||||||
GDateTime *date;
|
g_autoptr(GDateTime) date = g_date_time_new_now_local ();
|
||||||
int created_year = 2017;
|
int created_year = 2017;
|
||||||
|
|
||||||
static const gchar *authors[] = {
|
static const char *developers[] = {
|
||||||
"Julian Sparber <julian@sparber.net>",
|
"Julian Sparber <julian@sparber.net>",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static const gchar *artists[] = {
|
static const char *artists[] = {
|
||||||
"Tobias Bernard <tbernard@gnome.org>",
|
"Tobias Bernard <tbernard@gnome.org>",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
date = g_date_time_new_now_local ();
|
|
||||||
|
|
||||||
if (g_date_time_get_year (date) <= created_year)
|
if (g_date_time_get_year (date) <= created_year)
|
||||||
{
|
{
|
||||||
copyright = g_strdup_printf (("Copyright \xC2\xA9 %d "
|
copyright = g_strdup_printf ("Copyright \xC2\xA9 %d The Teleport authors", created_year);
|
||||||
"The Teleport authors"), created_year);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
copyright = g_strdup_printf (("Copyright \xC2\xA9 %d\xE2\x80\x93%d "
|
copyright = g_strdup_printf ("Copyright \xC2\xA9 %d\xE2\x80\x93%d The Teleport authors", created_year, g_date_time_get_year (date));
|
||||||
"The Telport authors"), created_year, g_date_time_get_year (date));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_show_about_dialog (GTK_WINDOW (priv->window),
|
adw_show_about_dialog (priv->window,
|
||||||
"program-name", ("Teleport"),
|
"application-name", "Teleport",
|
||||||
"version", VERSION,
|
"version", VERSION,
|
||||||
"copyright", copyright,
|
"copyright", copyright,
|
||||||
"license-type", GTK_LICENSE_AGPL_3_0,
|
"license-type", GTK_LICENSE_AGPL_3_0,
|
||||||
"authors", authors,
|
"developers", developers,
|
||||||
"artists", artists,
|
"artists", artists,
|
||||||
"logo-icon-name", "com.frac_tion.teleport",
|
"application-icon", "com.frac_tion.teleport",
|
||||||
"translator-credits", ("translator-credits"),
|
"translator-credits", "translator-credits",
|
||||||
NULL);
|
NULL);
|
||||||
g_free (copyright);
|
|
||||||
g_date_time_unref (date);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -485,7 +471,7 @@ teleport_app_quit (GSimpleAction *simple,
|
|||||||
{
|
{
|
||||||
TeleportAppPrivate *priv = TELEPORT_APP (user_data)->priv;
|
TeleportAppPrivate *priv = TELEPORT_APP (user_data)->priv;
|
||||||
|
|
||||||
gtk_widget_destroy (priv->window);
|
gtk_window_destroy (GTK_WINDOW (priv->window));
|
||||||
}
|
}
|
||||||
|
|
||||||
TeleportApp *
|
TeleportApp *
|
||||||
@@ -505,5 +491,3 @@ teleport_app_init (TeleportApp *app) {
|
|||||||
priv->settings = g_settings_new ("com.frac_tion.teleport");
|
priv->settings = g_settings_new ("com.frac_tion.teleport");
|
||||||
init_settings (priv->settings);
|
init_settings (priv->settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
#ifndef __TELEPORT_APP_H
|
#ifndef __TELEPORT_APP_H
|
||||||
#define __TELEPORT_APP_H
|
#define __TELEPORT_APP_H
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <adwaita.h>
|
||||||
#include "teleport-peer.h"
|
#include "teleport-peer.h"
|
||||||
|
|
||||||
#define TELEPORT_APP_TYPE (teleport_app_get_type ())
|
#define TELEPORT_APP_TYPE (teleport_app_get_type ())
|
||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (TeleportApp, teleport_app, TELEPORT, APP, GtkApplication)
|
G_DECLARE_FINAL_TYPE (TeleportApp, teleport_app, TELEPORT, APP, AdwApplication)
|
||||||
|
|
||||||
|
|
||||||
TeleportApp *teleport_app_new (void);
|
TeleportApp *teleport_app_new (void);
|
||||||
|
|||||||
@@ -16,18 +16,11 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <adwaita.h>
|
||||||
#include "teleport-remote-device.h"
|
#include "teleport-remote-device.h"
|
||||||
#include "teleport-peer.h"
|
#include "teleport-peer.h"
|
||||||
#include "teleport-server.h"
|
#include "teleport-server.h"
|
||||||
|
|
||||||
enum {
|
|
||||||
TARGET_INT32,
|
|
||||||
TARGET_STRING,
|
|
||||||
TARGET_URIS,
|
|
||||||
TARGET_ROOTWIN
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
@@ -35,40 +28,20 @@ enum
|
|||||||
LAST_PROP
|
LAST_PROP
|
||||||
};
|
};
|
||||||
|
|
||||||
/* datatype (string), restrictions on DnD (GtkTargetFlags), datatype (int) */
|
|
||||||
static GtkTargetEntry target_list[] = {
|
|
||||||
//{ "INTEGER", 0, TARGET_INT32 },
|
|
||||||
//{ "STRING", 0, TARGET_STRING },
|
|
||||||
//{ "text/plain", 0, TARGET_STRING },
|
|
||||||
{ "text/uri-list", 0, TARGET_URIS }
|
|
||||||
//{ "application/octet-stream", 0, TARGET_STRING },
|
|
||||||
//{ "application/x-rootwindow-drop", 0, TARGET_ROOTWIN }
|
|
||||||
};
|
|
||||||
|
|
||||||
static guint n_targets = G_N_ELEMENTS (target_list);
|
|
||||||
|
|
||||||
struct _TeleportRemoteDevice
|
struct _TeleportRemoteDevice
|
||||||
{
|
{
|
||||||
GtkFrame parent;
|
AdwActionRow parent;
|
||||||
GtkWidget *remote_device_row;
|
|
||||||
GtkWidget *device_name;
|
|
||||||
GtkWidget *send_btn;
|
GtkWidget *send_btn;
|
||||||
|
|
||||||
/* data */
|
/* data */
|
||||||
Peer *peer;
|
Peer *peer;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (TeleportRemoteDevice, teleport_remote_device, GTK_TYPE_FRAME)
|
G_DEFINE_TYPE (TeleportRemoteDevice, teleport_remote_device, ADW_TYPE_ACTION_ROW)
|
||||||
|
|
||||||
/*
|
|
||||||
* GObject overrides
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
teleport_remote_device_finalize (GObject *object)
|
teleport_remote_device_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
//TeleportRemoteDevice *self = TELEPORT_REMOTE_DEVICE (object);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (teleport_remote_device_parent_class)->finalize (object);
|
G_OBJECT_CLASS (teleport_remote_device_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,11 +100,6 @@ teleport_remote_device_class_init (TeleportRemoteDeviceClass *klass)
|
|||||||
object_class->get_property = teleport_remote_device_get_property;
|
object_class->get_property = teleport_remote_device_get_property;
|
||||||
object_class->set_property = teleport_remote_device_set_property;
|
object_class->set_property = teleport_remote_device_set_property;
|
||||||
|
|
||||||
/**
|
|
||||||
* TeleportRemoteDevice::peer:
|
|
||||||
*
|
|
||||||
* The peer that this row represents, or %NULL.
|
|
||||||
*/
|
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
PROP_PEER,
|
PROP_PEER,
|
||||||
g_param_spec_pointer ("peer",
|
g_param_spec_pointer ("peer",
|
||||||
@@ -139,212 +107,95 @@ teleport_remote_device_class_init (TeleportRemoteDeviceClass *klass)
|
|||||||
"The peer that this row represents",
|
"The peer that this row represents",
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
||||||
|
|
||||||
/*g_param_spec_object ("peer",
|
|
||||||
"Task of the row",
|
|
||||||
"The task that this row represents",
|
|
||||||
(Peer *),
|
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
|
||||||
*/
|
|
||||||
|
|
||||||
gtk_widget_class_set_template_from_resource (widget_class, "/com/frac_tion/teleport/remote_list.ui");
|
gtk_widget_class_set_template_from_resource (widget_class, "/com/frac_tion/teleport/remote_list.ui");
|
||||||
gtk_widget_class_bind_template_child (widget_class, TeleportRemoteDevice, remote_device_row);
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, TeleportRemoteDevice, device_name);
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, TeleportRemoteDevice, send_btn);
|
gtk_widget_class_bind_template_child (widget_class, TeleportRemoteDevice, send_btn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_file_chooser_response (GtkNativeDialog *dialog,
|
||||||
|
int response,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
Peer *device = user_data;
|
||||||
|
|
||||||
|
if (response == GTK_RESPONSE_ACCEPT)
|
||||||
|
{
|
||||||
|
g_autoptr(GFile) file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
|
||||||
|
g_autofree char *filename = g_file_get_path (file);
|
||||||
|
if (filename)
|
||||||
|
{
|
||||||
|
g_print("Chosen file is %s\n", filename);
|
||||||
|
teleport_server_add_route (g_compute_checksum_for_string (G_CHECKSUM_SHA256, filename, -1), g_strdup(filename), device->ip);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g_object_unref (dialog);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
open_file_picker(GtkButton *btn,
|
open_file_picker(GtkButton *btn,
|
||||||
Peer *device) {
|
Peer *device) {
|
||||||
GtkFileChooserNative *dialog;
|
GtkFileChooserNative *dialog;
|
||||||
GtkWidget * window;
|
GtkRoot *root;
|
||||||
GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
|
|
||||||
gint res;
|
|
||||||
g_print("Open file chooser for submitting a file to %s with Address %s\n", device->name, device->ip);
|
g_print("Open file chooser for submitting a file to %s with Address %s\n", device->name, device->ip);
|
||||||
|
|
||||||
window = gtk_widget_get_toplevel (GTK_WIDGET (btn));
|
root = gtk_widget_get_root (GTK_WIDGET (btn));
|
||||||
if (gtk_widget_is_toplevel (window))
|
if (GTK_IS_WINDOW (root))
|
||||||
{
|
{
|
||||||
dialog = gtk_file_chooser_native_new ("Open File",
|
dialog = gtk_file_chooser_native_new ("Open File",
|
||||||
GTK_WINDOW(window),
|
GTK_WINDOW (root),
|
||||||
action,
|
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||||
("_Open"),
|
("_Open"),
|
||||||
("_Cancel"));
|
("_Cancel"));
|
||||||
|
|
||||||
res = gtk_native_dialog_run (GTK_NATIVE_DIALOG (dialog));
|
g_signal_connect (dialog, "response", G_CALLBACK (on_file_chooser_response), device);
|
||||||
if (res == GTK_RESPONSE_ACCEPT)
|
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));
|
||||||
{
|
|
||||||
char *filename;
|
|
||||||
GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog);
|
|
||||||
filename = gtk_file_chooser_get_filename (chooser);
|
|
||||||
g_print("Choosen file is %s\n", filename);
|
|
||||||
g_object_unref (dialog);
|
|
||||||
teleport_server_add_route (g_compute_checksum_for_string (G_CHECKSUM_SHA256, filename, -1), filename, device->ip);
|
|
||||||
g_free (filename);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_object_unref (dialog);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
send_file_to_device (gchar *uri, gpointer data)
|
send_file_to_device (GFile *file, Peer *device)
|
||||||
{
|
{
|
||||||
Peer *device = (Peer *) data;
|
g_autofree gchar *filename = g_file_get_path (file);
|
||||||
GFile *file = g_file_new_for_uri (uri);
|
|
||||||
gchar *filename = NULL;
|
|
||||||
if (g_file_query_exists (file, NULL)) {
|
if (g_file_query_exists (file, NULL)) {
|
||||||
filename = g_file_get_path (file);
|
|
||||||
teleport_server_add_route (g_compute_checksum_for_string (G_CHECKSUM_SHA256, filename, -1), g_strdup(filename), device->ip);
|
teleport_server_add_route (g_compute_checksum_for_string (G_CHECKSUM_SHA256, filename, -1), g_strdup(filename), device->ip);
|
||||||
g_free (filename);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g_print ("File doesn't exist: %s\n", uri);
|
g_print ("File doesn't exist: %s\n", filename);
|
||||||
}
|
|
||||||
g_object_unref(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
drag_data_received_handl
|
|
||||||
(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
|
|
||||||
GtkSelectionData *selection_data, guint target_type, guint time,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
glong *_idata;
|
|
||||||
gchar *_sdata;
|
|
||||||
gchar **uris;
|
|
||||||
|
|
||||||
gboolean dnd_success = FALSE;
|
|
||||||
gboolean delete_selection_data = FALSE;
|
|
||||||
|
|
||||||
/* Deal with what we are given from source */
|
|
||||||
if((selection_data != NULL) && (gtk_selection_data_get_length(selection_data) >= 0))
|
|
||||||
{
|
|
||||||
if (gdk_drag_context_get_suggested_action(context) == GDK_ACTION_ASK)
|
|
||||||
{
|
|
||||||
/* Ask the user to move or copy, then set the context action. */
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gdk_drag_context_get_suggested_action(context) == GDK_ACTION_MOVE)
|
|
||||||
delete_selection_data = TRUE;
|
|
||||||
|
|
||||||
/* Check that we got the format we can use */
|
|
||||||
switch (target_type)
|
|
||||||
{
|
|
||||||
case TARGET_INT32:
|
|
||||||
_idata = (glong*)gtk_selection_data_get_data(selection_data);
|
|
||||||
g_print ("integer: %ld", *_idata);
|
|
||||||
dnd_success = TRUE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TARGET_STRING:
|
|
||||||
_sdata = (gchar*)gtk_selection_data_get_data(selection_data);
|
|
||||||
g_print ("string: %s", _sdata);
|
|
||||||
dnd_success = TRUE;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TARGET_URIS:
|
|
||||||
uris = gtk_selection_data_get_uris(selection_data);
|
|
||||||
if (uris != NULL && uris[1] == NULL) {
|
|
||||||
send_file_to_device (uris[0], data);
|
|
||||||
dnd_success = TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
g_print ("Something bad!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dnd_success == FALSE)
|
|
||||||
{
|
|
||||||
g_print ("DnD data transfer failed!\n");
|
|
||||||
g_print ("You can not drag more then one file!\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_drag_finish (context, dnd_success, delete_selection_data, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Emitted when a drag is over the destination */
|
|
||||||
static gboolean
|
static gboolean
|
||||||
drag_motion_handl
|
on_drop (GtkDropTarget *target,
|
||||||
(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint t,
|
const GValue *value,
|
||||||
|
double x,
|
||||||
|
double y,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
// Fancy stuff here. This signal spams the console something horrible.
|
TeleportRemoteDevice *self = user_data;
|
||||||
//const gchar *name = gtk_widget_get_name (widget);
|
if (G_VALUE_HOLDS (value, GDK_TYPE_FILE_LIST))
|
||||||
//g_print ("%s: drag_motion_handl\n", name);
|
{
|
||||||
|
GSList *list = g_value_get_boxed (value);
|
||||||
|
for (GSList *l = list; l != NULL; l = l->next)
|
||||||
|
{
|
||||||
|
send_file_to_device (G_FILE (l->data), self->peer);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Emitted when a drag leaves the destination */
|
|
||||||
static void
|
|
||||||
drag_leave_handl
|
|
||||||
(GtkWidget *widget, GdkDragContext *context, guint time, gpointer user_data)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Emitted when the user releases (drops) the selection. It should check that
|
|
||||||
* the drop is over a valid part of the widget (if its a complex widget), and
|
|
||||||
* itself to return true if the operation should continue. Next choose the
|
|
||||||
* target type it wishes to ask the source for. Finally call gtk_drag_get_data
|
|
||||||
* which will emit "drag-data-get" on the source. */
|
|
||||||
static gboolean
|
|
||||||
drag_drop_handl
|
|
||||||
(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
gboolean is_valid_drop_site;
|
|
||||||
GdkAtom target_type;
|
|
||||||
|
|
||||||
/* Check to see if (x,y) is a valid drop site within widget */
|
|
||||||
is_valid_drop_site = TRUE;
|
|
||||||
|
|
||||||
/* If the source offers a target */
|
|
||||||
if (gdk_drag_context_list_targets (context))
|
|
||||||
{
|
|
||||||
/* Choose the best target type */
|
|
||||||
target_type = GDK_POINTER_TO_ATOM
|
|
||||||
(g_list_nth_data (gdk_drag_context_list_targets(context), TARGET_INT32));
|
|
||||||
|
|
||||||
|
|
||||||
/* Request the data from the source. */
|
|
||||||
gtk_drag_get_data
|
|
||||||
(
|
|
||||||
widget, /* will receive 'drag-data-received' signal */
|
|
||||||
context, /* represents the current state of the DnD */
|
|
||||||
target_type, /* the target type we want */
|
|
||||||
time /* time stamp */
|
|
||||||
);
|
|
||||||
}
|
|
||||||
/* No target offered by source => error */
|
|
||||||
else
|
|
||||||
{
|
|
||||||
is_valid_drop_site = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return is_valid_drop_site;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
teleport_remote_device_init (TeleportRemoteDevice *self)
|
teleport_remote_device_init (TeleportRemoteDevice *self)
|
||||||
{
|
{
|
||||||
|
GtkDropTarget *target;
|
||||||
|
|
||||||
gtk_widget_init_template (GTK_WIDGET (self));
|
gtk_widget_init_template (GTK_WIDGET (self));
|
||||||
|
|
||||||
/* Make the widget a DnD destination. */
|
target = gtk_drop_target_new (GDK_TYPE_FILE_LIST, GDK_ACTION_COPY);
|
||||||
gtk_drag_dest_set
|
g_signal_connect (target, "drop", G_CALLBACK (on_drop), self);
|
||||||
(
|
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (target));
|
||||||
GTK_WIDGET (self->remote_device_row), /* widget that will accept a drop */
|
|
||||||
GTK_DEST_DEFAULT_MOTION /* default actions for dest on DnD */
|
|
||||||
| GTK_DEST_DEFAULT_HIGHLIGHT,
|
|
||||||
target_list, /* lists of target to support */
|
|
||||||
n_targets, /* size of list */
|
|
||||||
GDK_ACTION_COPY /* what to do with data after dropped */
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget*
|
GtkWidget*
|
||||||
@@ -355,15 +206,6 @@ teleport_remote_device_new (Peer *peer)
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* teleport_remote_device_get_peer:
|
|
||||||
* @row: a #TeleportRemoteDevice
|
|
||||||
*
|
|
||||||
* Retrieves the #Peer that @row manages, or %NULL if none
|
|
||||||
* is set.
|
|
||||||
*
|
|
||||||
* Returns: (transfer none): the internal peer of @row
|
|
||||||
*/
|
|
||||||
Peer *
|
Peer *
|
||||||
teleport_remote_device_get_peer (GtkWidget *widget)
|
teleport_remote_device_get_peer (GtkWidget *widget)
|
||||||
{
|
{
|
||||||
@@ -383,47 +225,14 @@ teleport_remote_device_set_peer (TeleportRemoteDevice *widget,
|
|||||||
g_return_if_fail (TELEPORT_IS_REMOTE_DEVICE (widget));
|
g_return_if_fail (TELEPORT_IS_REMOTE_DEVICE (widget));
|
||||||
widget->peer = peer;
|
widget->peer = peer;
|
||||||
|
|
||||||
/*
|
|
||||||
we need to create a peer object instate of a struct to be able to bind it
|
|
||||||
if (!g_set_object (&widget->peer, peer))
|
|
||||||
return;
|
|
||||||
|
|
||||||
g_object_bind_property (peer,
|
|
||||||
"name",
|
|
||||||
widget->device_name,
|
|
||||||
"label",
|
|
||||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (peer)
|
if (peer)
|
||||||
{
|
{
|
||||||
gtk_label_set_text(GTK_LABEL (widget->device_name), peer->name);
|
adw_preferences_row_set_title (ADW_PREFERENCES_ROW (widget), peer->name);
|
||||||
|
|
||||||
g_signal_connect (widget->send_btn, "clicked", G_CALLBACK (open_file_picker), peer);
|
g_signal_connect (widget->send_btn, "clicked", G_CALLBACK (open_file_picker), peer);
|
||||||
|
|
||||||
|
|
||||||
g_signal_connect (widget, "drag-data-received",
|
|
||||||
G_CALLBACK(drag_data_received_handl), peer);
|
|
||||||
|
|
||||||
g_signal_connect (widget, "drag-leave",
|
|
||||||
G_CALLBACK (drag_leave_handl), peer);
|
|
||||||
|
|
||||||
g_signal_connect (widget, "drag-motion",
|
|
||||||
G_CALLBACK (drag_motion_handl), peer);
|
|
||||||
|
|
||||||
g_signal_connect (widget, "drag-drop",
|
|
||||||
G_CALLBACK (drag_drop_handl), peer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* teleport_remote_device_destroy:
|
|
||||||
* @self: a #TeleportRemoteDevice
|
|
||||||
*
|
|
||||||
* Destroy @self after hiding it.
|
|
||||||
*/
|
|
||||||
void
|
void
|
||||||
teleport_remote_device_destroy (TeleportRemoteDevice *self)
|
teleport_remote_device_destroy (TeleportRemoteDevice *self)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,15 +19,14 @@
|
|||||||
#ifndef TELEPORT_REMOTE_DEVICE_H
|
#ifndef TELEPORT_REMOTE_DEVICE_H
|
||||||
#define TELEPORT_REMOTE_DEVICE_H
|
#define TELEPORT_REMOTE_DEVICE_H
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <adwaita.h>
|
||||||
#include <gtk/gtk.h>
|
|
||||||
#include "teleport-peer.h"
|
#include "teleport-peer.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define TELEPORT_TYPE_REMOTE_DEVICE (teleport_remote_device_get_type())
|
#define TELEPORT_TYPE_REMOTE_DEVICE (teleport_remote_device_get_type())
|
||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (TeleportRemoteDevice, teleport_remote_device, TELEPORT, REMOTE_DEVICE, GtkFrame)
|
G_DECLARE_FINAL_TYPE (TeleportRemoteDevice, teleport_remote_device, TELEPORT, REMOTE_DEVICE, AdwActionRow)
|
||||||
|
|
||||||
GtkWidget * teleport_remote_device_new (Peer * );
|
GtkWidget * teleport_remote_device_new (Peer * );
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,8 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <adwaita.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#define HANDY_USE_UNSTABLE_API
|
|
||||||
#include <handy.h>
|
|
||||||
|
|
||||||
#include "teleport-app.h"
|
#include "teleport-app.h"
|
||||||
#include "teleport-window.h"
|
#include "teleport-window.h"
|
||||||
@@ -29,7 +27,7 @@
|
|||||||
|
|
||||||
struct _TeleportWindow
|
struct _TeleportWindow
|
||||||
{
|
{
|
||||||
GtkApplicationWindow parent;
|
AdwApplicationWindow parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _TeleportWindowPrivate TeleportWindowPrivate;
|
typedef struct _TeleportWindowPrivate TeleportWindowPrivate;
|
||||||
@@ -39,27 +37,51 @@ struct _TeleportWindowPrivate
|
|||||||
GtkWidget *gears;
|
GtkWidget *gears;
|
||||||
GtkWidget *this_device_settings_button;
|
GtkWidget *this_device_settings_button;
|
||||||
GtkWidget *remote_devices_box;
|
GtkWidget *remote_devices_box;
|
||||||
GtkWidget *this_device_name_label;
|
AdwActionRow *this_device_row;
|
||||||
GtkWidget *remote_no_devices;
|
GtkWidget *remote_no_devices;
|
||||||
GtkWidget *remote_no_avahi;
|
GtkWidget *remote_no_avahi;
|
||||||
GtkWidget *this_device_settings_entry;
|
GtkWidget *this_device_settings_entry;
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE(TeleportWindow, teleport_window, GTK_TYPE_APPLICATION_WINDOW);
|
G_DEFINE_TYPE_WITH_PRIVATE(TeleportWindow, teleport_window, ADW_TYPE_APPLICATION_WINDOW);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
change_download_directory_cb (GtkWidget *widget,
|
on_download_dir_response (GtkNativeDialog *dialog,
|
||||||
gpointer user_data) {
|
int response,
|
||||||
GSettings *settings;
|
gpointer user_data)
|
||||||
gchar * newDownloadDir;
|
{
|
||||||
settings = (GSettings *)user_data;
|
GSettings *settings = user_data;
|
||||||
|
|
||||||
newDownloadDir = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
|
if (response == GTK_RESPONSE_ACCEPT)
|
||||||
g_print ("Change download directory\n");
|
{
|
||||||
g_settings_set_string (settings,
|
g_autoptr(GFile) file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
|
||||||
"download-dir",
|
g_autofree char *path = g_file_get_path (file);
|
||||||
newDownloadDir);
|
if (path)
|
||||||
g_free(newDownloadDir);
|
{
|
||||||
|
g_print ("Change download directory to %s\n", path);
|
||||||
|
g_settings_set_string (settings, "download-dir", path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
g_object_unref (dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_choose_download_dir_clicked (GtkButton *btn,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
GSettings *settings = user_data;
|
||||||
|
GtkFileChooserNative *dialog;
|
||||||
|
GtkRoot *root = gtk_widget_get_root (GTK_WIDGET (btn));
|
||||||
|
|
||||||
|
dialog = gtk_file_chooser_native_new ("Choose Download Directory",
|
||||||
|
GTK_WINDOW (root),
|
||||||
|
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
|
||||||
|
"_Select",
|
||||||
|
"_Cancel");
|
||||||
|
|
||||||
|
g_signal_connect (dialog, "response", G_CALLBACK (on_download_dir_response), settings);
|
||||||
|
gtk_native_dialog_show (GTK_NATIVE_DIALOG (dialog));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -71,7 +93,7 @@ valid_device_name (const gchar *name) {
|
|||||||
|
|
||||||
static gchar *
|
static gchar *
|
||||||
get_new_name (GtkWidget *widget) {
|
get_new_name (GtkWidget *widget) {
|
||||||
return g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (widget))));
|
return g_strstrip (g_strdup (gtk_editable_get_text (GTK_EDITABLE (widget))));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -81,16 +103,6 @@ on_new_device_name (GtkWidget *widget,
|
|||||||
gtk_widget_set_sensitive (GTK_WIDGET (data), valid_device_name (name));
|
gtk_widget_set_sensitive (GTK_WIDGET (data), valid_device_name (name));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
update_download_directory (GSettings *settings,
|
|
||||||
gchar *key,
|
|
||||||
gpointer *data) {
|
|
||||||
if (g_strcmp0 (key, "download-dir") == 0) {
|
|
||||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (data),
|
|
||||||
g_settings_get_string(settings, key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_click_this_device_settings_button (GtkWidget *widget,
|
on_click_this_device_settings_button (GtkWidget *widget,
|
||||||
gpointer user_data) {
|
gpointer user_data) {
|
||||||
@@ -108,7 +120,7 @@ static void
|
|||||||
on_show_popover (GtkPopover *widget,
|
on_show_popover (GtkPopover *widget,
|
||||||
gpointer data) {
|
gpointer data) {
|
||||||
TeleportWindowPrivate *priv = (TeleportWindowPrivate *) data;
|
TeleportWindowPrivate *priv = (TeleportWindowPrivate *) data;
|
||||||
gtk_entry_set_text(GTK_ENTRY (priv->this_device_settings_entry),
|
gtk_editable_set_text(GTK_EDITABLE (priv->this_device_settings_entry),
|
||||||
g_settings_get_string(teleport_app_get_settings (),
|
g_settings_get_string(teleport_app_get_settings (),
|
||||||
"device-name"));
|
"device-name"));
|
||||||
}
|
}
|
||||||
@@ -119,31 +131,27 @@ teleport_window_init (TeleportWindow *win)
|
|||||||
TeleportWindowPrivate *priv;
|
TeleportWindowPrivate *priv;
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
GtkWidget *menu;
|
GtkWidget *menu;
|
||||||
GtkFileChooserButton *downloadDir;
|
GtkWidget *downloadDirBtn;
|
||||||
GSettings *settings = teleport_app_get_settings ();
|
GSettings *settings = teleport_app_get_settings ();
|
||||||
|
|
||||||
priv = teleport_window_get_instance_private (win);
|
priv = teleport_window_get_instance_private (win);
|
||||||
|
|
||||||
g_type_ensure (HDY_TYPE_COLUMN);
|
g_type_ensure (ADW_TYPE_CLAMP);
|
||||||
|
g_type_ensure (ADW_TYPE_TOOLBAR_VIEW);
|
||||||
|
g_type_ensure (ADW_TYPE_ACTION_ROW);
|
||||||
gtk_widget_init_template (GTK_WIDGET (win));
|
gtk_widget_init_template (GTK_WIDGET (win));
|
||||||
|
|
||||||
builder = gtk_builder_new_from_resource ("/com/frac_tion/teleport/settings.ui");
|
builder = gtk_builder_new_from_resource ("/com/frac_tion/teleport/settings.ui");
|
||||||
menu = GTK_WIDGET (gtk_builder_get_object (builder, "settings"));
|
menu = GTK_WIDGET (gtk_builder_get_object (builder, "settings"));
|
||||||
downloadDir = GTK_FILE_CHOOSER_BUTTON (gtk_builder_get_object (builder, "settings_download_directory"));
|
downloadDirBtn = GTK_WIDGET (gtk_builder_get_object (builder, "settings_download_directory"));
|
||||||
|
|
||||||
gtk_menu_button_set_popover(GTK_MENU_BUTTON (priv->gears), menu);
|
gtk_menu_button_set_popover(GTK_MENU_BUTTON (priv->gears), menu);
|
||||||
|
|
||||||
|
|
||||||
g_settings_bind (settings, "device-name",
|
g_settings_bind (settings, "device-name",
|
||||||
priv->this_device_name_label, "label",
|
priv->this_device_row, "title",
|
||||||
G_SETTINGS_BIND_GET);
|
G_SETTINGS_BIND_GET);
|
||||||
|
|
||||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (downloadDir),
|
g_signal_connect (downloadDirBtn, "clicked", G_CALLBACK (on_choose_download_dir_clicked), settings);
|
||||||
g_settings_get_string(settings,
|
|
||||||
"download-dir"));
|
|
||||||
|
|
||||||
g_signal_connect (downloadDir, "file-set", G_CALLBACK (change_download_directory_cb), settings);
|
|
||||||
g_signal_connect (settings, "changed", G_CALLBACK (update_download_directory), downloadDir);
|
|
||||||
|
|
||||||
g_object_unref (builder);
|
g_object_unref (builder);
|
||||||
|
|
||||||
@@ -185,24 +193,12 @@ update_remote_device_list(TeleportWindow *win,
|
|||||||
|
|
||||||
priv = teleport_window_get_instance_private (win);
|
priv = teleport_window_get_instance_private (win);
|
||||||
|
|
||||||
gtk_widget_hide (priv->remote_no_devices);
|
gtk_widget_set_visible (priv->remote_no_devices, FALSE);
|
||||||
|
|
||||||
remote_device = teleport_remote_device_new (device);
|
remote_device = teleport_remote_device_new (device);
|
||||||
|
|
||||||
gtk_box_pack_end (GTK_BOX (priv->remote_devices_box),
|
gtk_box_append (GTK_BOX (priv->remote_devices_box),
|
||||||
remote_device,
|
remote_device);
|
||||||
TRUE,
|
|
||||||
TRUE,
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
remove_remote_peer (GtkWidget *widget,
|
|
||||||
gpointer data)
|
|
||||||
{
|
|
||||||
if (TELEPORT_IS_REMOTE_DEVICE (widget) && teleport_remote_device_get_peer(widget) == ((Peer *) data)) {
|
|
||||||
gtk_widget_destroy (widget);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -210,12 +206,18 @@ update_remote_device_list_remove(TeleportWindow *win,
|
|||||||
Peer *device)
|
Peer *device)
|
||||||
{
|
{
|
||||||
TeleportWindowPrivate *priv;
|
TeleportWindowPrivate *priv;
|
||||||
|
GtkWidget *child;
|
||||||
|
|
||||||
priv = teleport_window_get_instance_private (win);
|
priv = teleport_window_get_instance_private (win);
|
||||||
|
|
||||||
gtk_container_foreach (GTK_CONTAINER(priv->remote_devices_box),
|
child = gtk_widget_get_first_child (priv->remote_devices_box);
|
||||||
remove_remote_peer,
|
while (child) {
|
||||||
device);
|
GtkWidget *next = gtk_widget_get_next_sibling (child);
|
||||||
|
if (TELEPORT_IS_REMOTE_DEVICE (child) && teleport_remote_device_get_peer(child) == device) {
|
||||||
|
gtk_box_remove (GTK_BOX (priv->remote_devices_box), child);
|
||||||
|
}
|
||||||
|
child = next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -234,7 +236,7 @@ teleport_window_class_init (TeleportWindowClass *class)
|
|||||||
|
|
||||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, gears);
|
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, gears);
|
||||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, this_device_settings_button);
|
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, this_device_settings_button);
|
||||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, this_device_name_label);
|
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, this_device_row);
|
||||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, remote_no_devices);
|
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, remote_no_devices);
|
||||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, remote_devices_box);
|
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, remote_devices_box);
|
||||||
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, remote_no_avahi);
|
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportWindow, remote_no_avahi);
|
||||||
@@ -251,10 +253,7 @@ teleport_show_no_device_message (TeleportWindow *self, gboolean show)
|
|||||||
{
|
{
|
||||||
TeleportWindowPrivate *priv;
|
TeleportWindowPrivate *priv;
|
||||||
priv = teleport_window_get_instance_private (self);
|
priv = teleport_window_get_instance_private (self);
|
||||||
if (show)
|
gtk_widget_set_visible (priv->remote_no_devices, show);
|
||||||
gtk_widget_show (priv->remote_no_devices);
|
|
||||||
else
|
|
||||||
gtk_widget_hide (priv->remote_no_devices);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -262,16 +261,11 @@ teleport_show_no_avahi_message (TeleportWindow *self, gboolean show)
|
|||||||
{
|
{
|
||||||
TeleportWindowPrivate *priv;
|
TeleportWindowPrivate *priv;
|
||||||
priv = teleport_window_get_instance_private (self);
|
priv = teleport_window_get_instance_private (self);
|
||||||
if (show)
|
gtk_widget_set_visible (priv->remote_no_avahi, show);
|
||||||
gtk_widget_show (priv->remote_no_avahi);
|
|
||||||
else
|
|
||||||
gtk_widget_hide (priv->remote_no_avahi);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
teleport_window_open (TeleportWindow *win,
|
teleport_window_open (TeleportWindow *win,
|
||||||
GFile *file)
|
GFile *file)
|
||||||
{
|
{
|
||||||
//TeleportWindowPrivate *priv;
|
|
||||||
//priv = teleport_window_get_instance_private (win);
|
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
#ifndef __TELEPORT_WINDOW_H
|
#ifndef __TELEPORT_WINDOW_H
|
||||||
#define __TELEPORT_WINDOW_H
|
#define __TELEPORT_WINDOW_H
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <adwaita.h>
|
||||||
#include "teleport-app.h"
|
#include "teleport-app.h"
|
||||||
#include "teleport-peer.h"
|
#include "teleport-peer.h"
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ G_DECLARE_FINAL_TYPE (TeleportWindow,
|
|||||||
teleport_window,
|
teleport_window,
|
||||||
TELEPORT,
|
TELEPORT,
|
||||||
WINDOW,
|
WINDOW,
|
||||||
GtkApplicationWindow)
|
AdwApplicationWindow)
|
||||||
|
|
||||||
TeleportWindow *teleport_window_new (TeleportApp *);
|
TeleportWindow *teleport_window_new (TeleportApp *);
|
||||||
void teleport_window_open (TeleportWindow *,
|
void teleport_window_open (TeleportWindow *,
|
||||||
|
|||||||
334
src/window.ui
334
src/window.ui
@@ -1,318 +1,195 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<!-- interface-requires gtk+ 3.8 -->
|
<requires lib="gtk" version="4.0"/>
|
||||||
<requires lib="libhandy" version="0.0"/>
|
<requires lib="libadwaita" version="1.0"/>
|
||||||
<template class="TeleportWindow" parent="GtkApplicationWindow">
|
<template class="TeleportWindow" parent="AdwApplicationWindow">
|
||||||
<property name="title" translatable="yes">Teleport</property>
|
<property name="title" translatable="yes">Teleport</property>
|
||||||
<property name="default_width">650</property>
|
<property name="default_width">650</property>
|
||||||
<property name="default_height">500</property>
|
<property name="default_height">500</property>
|
||||||
<child>
|
<property name="content">
|
||||||
<object class="GtkAdjustment" id="adjustment1">
|
<object class="AdwToolbarView">
|
||||||
<property name="lower">-1</property>
|
<child type="top">
|
||||||
<property name="upper">1</property>
|
<object class="AdwHeaderBar" id="header">
|
||||||
|
<property name="show-end-title-buttons">True</property>
|
||||||
|
<child type="end">
|
||||||
|
<object class="GtkMenuButton" id="gears">
|
||||||
|
<property name="icon-name">emblem-system-symbolic</property>
|
||||||
|
<property name="tooltip-text" translatable="yes">Settings</property>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkAdjustment" id="adjustment11">
|
</child>
|
||||||
<property name="lower">-1</property>
|
|
||||||
<property name="upper">1</property>
|
|
||||||
</object>
|
|
||||||
<object class="GtkAdjustment" id="adjustment4">
|
|
||||||
<property name="lower">100</property>
|
|
||||||
<property name="upper">1000</property>
|
|
||||||
<property name="value">400</property>
|
|
||||||
<property name="step_increment">100</property>
|
|
||||||
<property name="page_increment">100</property>
|
|
||||||
</object>
|
</object>
|
||||||
|
</child>
|
||||||
|
<property name="content">
|
||||||
<object class="GtkScrolledWindow" id="scrolled-window">
|
<object class="GtkScrolledWindow" id="scrolled-window">
|
||||||
<property name="visible">True</property>
|
<property name="hscrollbar-policy">never</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="child">
|
||||||
<property name="shadow_type">none</property>
|
<object class="AdwClamp">
|
||||||
<property name="hscrollbar_policy">never</property>
|
<property name="maximum-size">600</property>
|
||||||
<child>
|
<property name="child">
|
||||||
<object class="HdyColumn">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="linear-growth-width">600</property>
|
|
||||||
<property name="maximum-width">600</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="general-container">
|
<object class="GtkBox" id="general-container">
|
||||||
<property name="visible">True</property>
|
<property name="margin-top">12</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-bottom">12</property>
|
||||||
<property name="margin_top">12</property>
|
<property name="margin-start">24</property>
|
||||||
<property name="margin_bottom">12</property>
|
<property name="margin-end">24</property>
|
||||||
<property name="margin_left">24</property>
|
|
||||||
<property name="margin_right">24</property>
|
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">24</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="general-frame">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<property name="margin_top">12</property>
|
|
||||||
<property name="margin_bottom">12</property>
|
|
||||||
<property name="shadow_type">none</property>
|
|
||||||
<child type="label">
|
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="this-device-label">
|
<object class="GtkLabel" id="this-device-label">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
<property name="label" translatable="yes">This device</property>
|
<property name="label" translatable="yes">This device</property>
|
||||||
<attributes>
|
<style>
|
||||||
<attribute name="weight" value="bold"/>
|
<class name="heading"/>
|
||||||
</attributes>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
<property name="margin_top">6</property>
|
<property name="margin-top">6</property>
|
||||||
<property name="label" translatable="yes">How your device appears to others</property>
|
<property name="label" translatable="yes">How your device appears to others</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="dim-label"/>
|
<class name="dim-label"/>
|
||||||
|
<class name="caption"/>
|
||||||
</style>
|
</style>
|
||||||
<attributes>
|
|
||||||
<attribute name="scale" value="0.9"/>
|
|
||||||
</attributes>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkFrame" id="general-frame-listbox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">6</property>
|
|
||||||
<property name="margin_bottom">6</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBox" id="this-device-listbox">
|
<object class="GtkListBox" id="this-device-listbox">
|
||||||
<property name="visible">True</property>
|
<property name="selection-mode">none</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="selection_mode">none</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBoxRow" id="this-device-row">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="activatable">false</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkGrid" id="this-device-grid">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="row_spacing">0</property>
|
|
||||||
<property name="column_spacing">16</property>
|
|
||||||
<property name="margin">12</property>
|
|
||||||
<property name="margin_start">16</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="this_device_name_label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="label" translatable="yes">Angela's Thinkpad</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="device-name"/>
|
<class name="boxed-list"/>
|
||||||
</style>
|
</style>
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkGrid">
|
<object class="AdwActionRow" id="this_device_row">
|
||||||
<property name="visible">True</property>
|
<property name="title" translatable="yes">Angela's Thinkpad</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="activatable">False</property>
|
||||||
<property name="valign">center</property>
|
|
||||||
<property name="column_homogeneous">True</property>
|
|
||||||
<style>
|
|
||||||
<class name="linked"/>
|
|
||||||
</style>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuButton" id="this_device_settings_button">
|
<object class="GtkMenuButton" id="this_device_settings_button">
|
||||||
<property name="visible">True</property>
|
<property name="valign">center</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="icon-name">document-edit-symbolic</property>
|
||||||
<property name="use-popover">True</property>
|
|
||||||
<property name="height_request">35</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkImage">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="icon_name">document-edit-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="image-button"/>
|
<class name="flat"/>
|
||||||
</style>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
<property name="width">1</property>
|
|
||||||
<property name="height">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="remote-devices-frame">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_top">12</property>
|
|
||||||
<property name="margin_bottom">12</property>
|
|
||||||
<property name="shadow_type">none</property>
|
|
||||||
<property name="label_yalign">0.45</property>
|
|
||||||
<child type="label">
|
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">12</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox">
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="remote-devices-network-label">
|
<object class="GtkLabel" id="remote-devices-network-label">
|
||||||
<property name="visible">True</property>
|
<property name="halign">start</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes">Other devices on the local network</property>
|
<property name="label" translatable="yes">Other devices on the local network</property>
|
||||||
<attributes>
|
<style>
|
||||||
<attribute name="weight" value="bold"/>
|
<class name="heading"/>
|
||||||
</attributes>
|
</style>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
<property name="margin_top">6</property>
|
<property name="margin-top">6</property>
|
||||||
<property name="label" translatable="yes">Drag and drop files on devices to send them</property>
|
<property name="label" translatable="yes">Drag and drop files on devices to send them</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="dim-label"/>
|
<class name="dim-label"/>
|
||||||
|
<class name="caption"/>
|
||||||
</style>
|
</style>
|
||||||
<attributes>
|
|
||||||
<attribute name="scale" value="0.9"/>
|
|
||||||
</attributes>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="remote_devices_box">
|
<object class="GtkBox" id="remote_devices_box">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="spacing">6</property>
|
<property name="spacing">6</property>
|
||||||
<property name="margin_top">6</property>
|
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="remote_no_avahi">
|
<object class="GtkFrame" id="remote_no_avahi">
|
||||||
<property name="visible">True</property>
|
<property name="child">
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox">
|
<object class="GtkListBox">
|
||||||
<property name="visible">True</property>
|
<property name="selection-mode">none</property>
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="selection_mode">none</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBoxRow">
|
<object class="GtkListBoxRow">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="activatable">False</property>
|
<property name="activatable">False</property>
|
||||||
<property name="selectable">False</property>
|
<property name="selectable">False</property>
|
||||||
<child>
|
<property name="child">
|
||||||
<object class="GtkAlignment">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="top_padding">50</property>
|
|
||||||
<property name="bottom_padding">50</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="margin-top">50</property>
|
||||||
|
<property name="margin-bottom">50</property>
|
||||||
<property name="spacing">20</property>
|
<property name="spacing">20</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="max-width-chars">40</property>
|
<property name="max-width-chars">40</property>
|
||||||
<property name="halign">center</property>
|
<property name="halign">center</property>
|
||||||
<property name="wrap">True</property>
|
<property name="wrap">True</property>
|
||||||
<property name="justify">center</property>
|
<property name="justify">center</property>
|
||||||
<property name="label">The Avahi daemon is not running. You can run this command to start it now:</property>
|
<property name="label" translatable="yes">The Avahi daemon is not running. You can run this command to start it now:</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkEntry">
|
<object class="GtkEntry">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="halign">center</property>
|
<property name="halign">center</property>
|
||||||
<property name="editable">False</property>
|
<property name="editable">False</property>
|
||||||
<property name="text">systemctl start avahi-daemon</property>
|
<property name="text">systemctl start avahi-daemon</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</property>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="remote_no_devices">
|
<object class="GtkFrame" id="remote_no_devices">
|
||||||
<property name="visible">True</property>
|
<property name="child">
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox">
|
<object class="GtkListBox">
|
||||||
<property name="visible">True</property>
|
<property name="selection-mode">none</property>
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="selection_mode">none</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBoxRow">
|
<object class="GtkListBoxRow">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="activatable">False</property>
|
<property name="activatable">False</property>
|
||||||
<property name="selectable">False</property>
|
<property name="selectable">False</property>
|
||||||
<child>
|
<property name="child">
|
||||||
<object class="GtkAlignment">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="top_padding">50</property>
|
|
||||||
<property name="bottom_padding">50</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="margin-top">50</property>
|
||||||
|
<property name="margin-bottom">50</property>
|
||||||
<property name="spacing">20</property>
|
<property name="spacing">20</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
<property name="visible">True</property>
|
<property name="label" translatable="yes">Searching for other devices...</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label">Searching for other devices...</property>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSpinner">
|
<object class="GtkSpinner">
|
||||||
<property name="visible">True</property>
|
<property name="spinning">True</property>
|
||||||
<property name="active">True</property>
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@@ -320,65 +197,12 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</property>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child type="titlebar">
|
|
||||||
<object class="GtkHeaderBar" id="header">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="show_close_button">True</property>
|
|
||||||
<property name="decoration_layout">:close</property>
|
|
||||||
<property name="title" translatable="yes">Teleport</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSwitch" id="visible-on-network-switch">
|
|
||||||
<property name="visible">False</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="visible-on-network-label">
|
|
||||||
<property name="visible">False</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Visible on network</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkMenuButton" id="gears">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="direction">none</property>
|
|
||||||
<property name="use-popover">True</property>
|
|
||||||
<style>
|
|
||||||
<class name="image-button"/>
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="pack-type">end</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</template>
|
</template>
|
||||||
</interface>
|
</interface>
|
||||||
Reference in New Issue
Block a user