[feat] the device name is now stored with gsettings and can be changed throw dconf-editor
This commit is contained in:
@@ -169,7 +169,7 @@ teleport_app_activate (GApplication *app) {
|
|||||||
create_finished_notification ("USER", 2000, "FILENAME", value);
|
create_finished_notification ("USER", 2000, "FILENAME", value);
|
||||||
*/
|
*/
|
||||||
teleport_server_run();
|
teleport_server_run();
|
||||||
teleport_publish_run ((gchar *) g_get_host_name());
|
teleport_publish_run (teleport_get_device_name());
|
||||||
teleport_browser_run_avahi_service(peerList);
|
teleport_browser_run_avahi_service(peerList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,13 @@ teleport_window_init (TeleportWindow *win)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (g_settings_get_user_value (priv->settings, "device-name") == NULL) {
|
||||||
|
g_settings_set_string (priv->settings,
|
||||||
|
"device-name",
|
||||||
|
g_get_host_name());
|
||||||
|
}
|
||||||
|
|
||||||
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");
|
||||||
@@ -58,7 +65,8 @@ teleport_window_init (TeleportWindow *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());
|
gtk_label_set_text (GTK_LABEL (priv->this_device_name_label),
|
||||||
|
g_settings_get_string (priv->settings, "device-name"));
|
||||||
|
|
||||||
g_settings_bind (priv->settings, "download-dir",
|
g_settings_bind (priv->settings, "download-dir",
|
||||||
downloadDir, "text",
|
downloadDir, "text",
|
||||||
@@ -222,6 +230,14 @@ teleport_window_new (TeleportApp *app)
|
|||||||
return g_object_new (TELEPORT_WINDOW_TYPE, "application", app, NULL);
|
return g_object_new (TELEPORT_WINDOW_TYPE, "application", app, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gchar *
|
||||||
|
teleport_get_device_name (void)
|
||||||
|
{
|
||||||
|
TeleportWindowPrivate *priv;
|
||||||
|
priv = teleport_window_get_instance_private (mainWin);
|
||||||
|
|
||||||
|
return g_settings_get_string (priv->settings, "device-name");
|
||||||
|
}
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
teleport_get_download_directory (void)
|
teleport_get_download_directory (void)
|
||||||
@@ -231,6 +247,7 @@ teleport_get_download_directory (void)
|
|||||||
|
|
||||||
return g_settings_get_string (priv->settings, "download-dir");
|
return g_settings_get_string (priv->settings, "download-dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
teleport_window_open (TeleportWindow *win,
|
teleport_window_open (TeleportWindow *win,
|
||||||
GFile *file)
|
GFile *file)
|
||||||
|
|||||||
@@ -21,5 +21,6 @@ void update_remote_device_list_remove (TeleportWindow *,
|
|||||||
Peer *);
|
Peer *);
|
||||||
|
|
||||||
gchar * teleport_get_download_directory (void);
|
gchar * teleport_get_download_directory (void);
|
||||||
|
gchar * teleport_get_device_name (void);
|
||||||
|
|
||||||
#endif /* __TELEPORT_WINDOW_H */
|
#endif /* __TELEPORT_WINDOW_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user