[feat] add reale device name to main window

This commit is contained in:
Julian Sparber
2017-09-18 17:08:31 +02:00
parent 8967c37e60
commit 9a22453d73
2 changed files with 5 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ struct _TeleportAppWindowPrivate
GSettings *settings; GSettings *settings;
GtkWidget *gears; GtkWidget *gears;
GtkWidget *remote_devices_list; GtkWidget *remote_devices_list;
GtkWidget *this_device_name_label;
}; };
G_DEFINE_TYPE_WITH_PRIVATE(TeleportAppWindow, teleport_app_window, GTK_TYPE_APPLICATION_WINDOW); G_DEFINE_TYPE_WITH_PRIVATE(TeleportAppWindow, teleport_app_window, GTK_TYPE_APPLICATION_WINDOW);
@@ -41,6 +42,8 @@ teleport_app_window_init (TeleportAppWindow *win)
gtk_menu_button_set_popover(GTK_MENU_BUTTON (priv->gears), menu); gtk_menu_button_set_popover(GTK_MENU_BUTTON (priv->gears), menu);
gtk_label_set_text(GTK_LABEL (priv->this_device_name_label), g_get_host_name());
g_object_unref (builder); g_object_unref (builder);
} }
@@ -174,8 +177,8 @@ teleport_app_window_class_init (TeleportAppWindowClass *class)
"/org/gtk/teleportapp/window.ui"); "/org/gtk/teleportapp/window.ui");
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportAppWindow, gears); gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportAppWindow, gears);
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportAppWindow, this_device_name_label);
gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportAppWindow, remote_devices_list); gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportAppWindow, remote_devices_list);
} }
TeleportAppWindow * TeleportAppWindow *

View File

@@ -83,7 +83,7 @@
<property name="margin_top">6</property> <property name="margin_top">6</property>
<property name="margin_bottom">6</property> <property name="margin_bottom">6</property>
<child> <child>
<object class="GtkLabel" id="this-device-name-label"> <object class="GtkLabel" id="this_device_name_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>