Commit 97ea6115 authored by Tobias Bernard's avatar Tobias Bernard

Merge branch 'master' of github.com:frac-tion/teleport

parents b2bf2842 f5c5581a
......@@ -215,6 +215,9 @@ mainLoopRemovePeerCallback (gpointer peer) {
GtkWidget *window = priv->window;
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)
teleport_show_no_device_message (TELEPORT_WINDOW (window));
return G_SOURCE_REMOVE;
}
......
......@@ -112,7 +112,8 @@ void teleport_peer_remove_peer (TeleportPeer *self, Peer *device)
g_signal_emit (self, signalIds[REMOVE], 0, device);
}
void teleport_peer_remove_peer_by_name (TeleportPeer *self, const gchar *name)
void
teleport_peer_remove_peer_by_name (TeleportPeer *self, const gchar *name)
{
Peer *element = NULL;
gboolean found = FALSE;
......@@ -142,3 +143,8 @@ teleport_peer_get_name_by_addr (TeleportPeer *self, const gchar *addr)
}
return name;
}
int
teleport_peer_get_number (TeleportPeer *self)
{
return (self->list->len);
}
......@@ -20,5 +20,6 @@ void teleport_peer_add_peer (TeleportPeer *self, gchar * name, gchar * ip, gint
void teleport_peer_remove_peer (TeleportPeer *, Peer *);
void teleport_peer_remove_peer_by_name (TeleportPeer *, const gchar *);
gchar * teleport_peer_get_name_by_addr (TeleportPeer *, const gchar *);
int teleport_peer_get_number (TeleportPeer *self);
#endif /* __TELEPORT_PEER_H */
......@@ -192,6 +192,14 @@ teleport_get_download_directory (void)
return g_settings_get_string (priv->settings, "download-dir");
}
void
teleport_show_no_device_message (TeleportWindow *self)
{
TeleportWindowPrivate *priv;
priv = teleport_window_get_instance_private (self);
gtk_widget_show (priv->remote_no_devices);
}
void
teleport_window_open (TeleportWindow *win,
GFile *file)
......
......@@ -22,5 +22,6 @@ void update_remote_device_list_remove (TeleportWindow *,
gchar * teleport_get_download_directory (void);
gchar * teleport_get_device_name (void);
void teleport_show_no_device_message (TeleportWindow *);
#endif /* __TELEPORT_WINDOW_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment