[style] fix intentation and spaces befor and after *
This commit is contained in:
@@ -23,7 +23,7 @@ struct _TeleportApp
|
|||||||
G_DEFINE_TYPE(TeleportApp, teleport_app, GTK_TYPE_APPLICATION);
|
G_DEFINE_TYPE(TeleportApp, teleport_app, GTK_TYPE_APPLICATION);
|
||||||
|
|
||||||
|
|
||||||
static void create_user_notification (const char *file_name, const int file_size, const char * origin_device)
|
static void create_user_notification (const char *file_name, const int file_size, const char *origin_device)
|
||||||
{
|
{
|
||||||
GNotification *notification = g_notification_new ("Teleport");
|
GNotification *notification = g_notification_new ("Teleport");
|
||||||
g_notification_set_body (notification, g_strdup_printf("%s is sending %s (%d Byte)", origin_device, file_name, file_size));
|
g_notification_set_body (notification, g_strdup_printf("%s is sending %s (%d Byte)", origin_device, file_name, file_size));
|
||||||
@@ -36,7 +36,7 @@ static void create_user_notification (const char *file_name, const int file_size
|
|||||||
g_object_unref (notification);
|
g_object_unref (notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_finished_notification (const char *file_name, const int file_size, const char * origin_device)
|
static void create_finished_notification (const char *file_name, const int file_size, const char *origin_device)
|
||||||
{
|
{
|
||||||
GNotification *notification = g_notification_new ("Teleport");
|
GNotification *notification = g_notification_new ("Teleport");
|
||||||
g_notification_set_body (notification, g_strdup_printf("Transfer %s from %s is complete)", file_name, origin_device));
|
g_notification_set_body (notification, g_strdup_printf("Transfer %s from %s is complete)", file_name, origin_device));
|
||||||
@@ -50,24 +50,24 @@ static void create_finished_notification (const char *file_name, const int file_
|
|||||||
|
|
||||||
|
|
||||||
gboolean mainLoopAddPeerCallback (gpointer name) {
|
gboolean mainLoopAddPeerCallback (gpointer name) {
|
||||||
update_remote_device_list(win, (char*)name);
|
update_remote_device_list(win, (char *)name);
|
||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean mainLoopRemovePeerCallback (gpointer name) {
|
gboolean mainLoopRemovePeerCallback (gpointer name) {
|
||||||
update_remote_device_list_remove(win, (char*)name);
|
update_remote_device_list_remove(win, (char *)name);
|
||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void callback_add_peer(GObject * instance, char * name, TeleportAppWindow * win ) {
|
void callback_add_peer(GObject *instance, char *name, TeleportAppWindow *win ) {
|
||||||
g_idle_add(mainLoopAddPeerCallback, g_strdup(name));
|
g_idle_add(mainLoopAddPeerCallback, g_strdup(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
void callback_remove_peer(GObject * instance, char * name, TeleportAppWindow * win ) {
|
void callback_remove_peer(GObject *instance, char *name, TeleportAppWindow *win ) {
|
||||||
g_idle_add(mainLoopRemovePeerCallback, g_strdup(name));
|
g_idle_add(mainLoopRemovePeerCallback, g_strdup(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
void callback_notify_user(GObject * instance, char * name, TeleportAppWindow * win ) {
|
void callback_notify_user(GObject *instance, char *name, TeleportAppWindow *win ) {
|
||||||
create_user_notification("icon.png", 2000, "Mark's laptop");
|
create_user_notification("icon.png", 2000, "Mark's laptop");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,5 +149,3 @@ teleport_app_new (void)
|
|||||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
#include "server.h"
|
#include "server.h"
|
||||||
|
|
||||||
|
|
||||||
GtkWidget* find_child(GtkWidget* , const gchar* );
|
GtkWidget *find_child(GtkWidget *, const gchar *);
|
||||||
TeleportAppWindow* mainWin;
|
TeleportAppWindow *mainWin;
|
||||||
|
|
||||||
struct _TeleportAppWindow
|
struct _TeleportAppWindow
|
||||||
{
|
{
|
||||||
@@ -45,7 +45,7 @@ teleport_app_window_init (TeleportAppWindow *win)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
open_file_picker(GtkButton * btn, GString* deviceName) {
|
open_file_picker(GtkButton *btn, GString *deviceName) {
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
|
GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
|
||||||
gint res;
|
gint res;
|
||||||
@@ -75,7 +75,7 @@ open_file_picker(GtkButton * btn, GString* deviceName) {
|
|||||||
gtk_widget_destroy (dialog);
|
gtk_widget_destroy (dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void update_remote_device_list(TeleportAppWindow *win, char * name) {
|
void update_remote_device_list(TeleportAppWindow *win, char *name) {
|
||||||
TeleportAppWindowPrivate *priv;
|
TeleportAppWindowPrivate *priv;
|
||||||
GtkBuilder *builder_remote_list;
|
GtkBuilder *builder_remote_list;
|
||||||
GtkWidget *row;
|
GtkWidget *row;
|
||||||
@@ -100,7 +100,7 @@ void update_remote_device_list(TeleportAppWindow *win, char * name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void update_remote_device_list_remove(TeleportAppWindow *win, char * name) {
|
void update_remote_device_list_remove(TeleportAppWindow *win, char *name) {
|
||||||
TeleportAppWindowPrivate *priv;
|
TeleportAppWindowPrivate *priv;
|
||||||
GtkWidget *box;
|
GtkWidget *box;
|
||||||
GtkListBoxRow *remote_row;
|
GtkListBoxRow *remote_row;
|
||||||
@@ -123,10 +123,10 @@ void update_remote_device_list_remove(TeleportAppWindow *win, char * name) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget*
|
GtkWidget *
|
||||||
find_child(GtkWidget* parent, const gchar* name)
|
find_child(GtkWidget *parent, const gchar *name)
|
||||||
{
|
{
|
||||||
if (g_strcmp0(gtk_widget_get_name((GtkWidget*)parent), (gchar*)name) == 0) {
|
if (g_strcmp0(gtk_widget_get_name((GtkWidget *)parent), (gchar *)name) == 0) {
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ find_child(GtkWidget* parent, const gchar* name)
|
|||||||
if (GTK_IS_CONTAINER(parent)) {
|
if (GTK_IS_CONTAINER(parent)) {
|
||||||
GList *children = gtk_container_get_children(GTK_CONTAINER(parent));
|
GList *children = gtk_container_get_children(GTK_CONTAINER(parent));
|
||||||
while ((children = g_list_next(children)) != NULL) {
|
while ((children = g_list_next(children)) != NULL) {
|
||||||
GtkWidget* widget = find_child(children->data, name);
|
GtkWidget *widget = find_child(children->data, name);
|
||||||
if (widget != NULL) {
|
if (widget != NULL) {
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user