From d4c2166d2bb12d9c7459979b0607409f564202bd Mon Sep 17 00:00:00 2001 From: Julian Sparber Date: Thu, 23 Feb 2017 14:16:08 +0100 Subject: [PATCH] [add] add settings menu --- src/Makefile | 2 +- src/settings.ui | 226 ++++++++++++++++++++++++++++++++++++++++--- src/teleportappwin.c | 7 +- 3 files changed, 219 insertions(+), 16 deletions(-) diff --git a/src/Makefile b/src/Makefile index 3b404de..af9c062 100644 --- a/src/Makefile +++ b/src/Makefile @@ -11,7 +11,7 @@ OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o) all: teleportapp -resources.c: teleportapp.gresource.xml window.ui +resources.c: teleportapp.gresource.xml window.ui settings.ui $(GLIB_COMPILE_RESOURCES) teleportapp.gresource.xml --target=$@ --sourcedir=. --generate-source %.o: %.c diff --git a/src/settings.ui b/src/settings.ui index fb0e929..6d5a176 100644 --- a/src/settings.ui +++ b/src/settings.ui @@ -1,16 +1,218 @@ - -
- - _Words - win.show-words - - - _Lines - win.show-lines - -
-
+ + + + True + 10 + + + True + 0 + Save received files in: + 6 + + + 0 + 0 + 1 + 1 + + + + + True + ~/Downloads + + + 0 + 1 + 1 + 1 + + + + + True + Browse... + 12 + + + 1 + 1 + 1 + 1 + + + + + True + 0 + Automaticaly enable Teleport on these networks: + 6 + 18 + + + 0 + 2 + 2 + 1 + + + + + True + True + none + + + True + True + false + + + True + False + 0 + 16 + 12 + 6 + 6 + 6 + + + True + False + True + 0 + o2-WLAN09 + True + + + 0 + 0 + 1 + 1 + + + + + True + False + center + True + + + + True + True + 35 + + + True + False + window-close-symbolic + + + + + + + + 1 + 0 + 1 + 1 + + + + + + + + + True + True + false + + + True + False + 0 + 16 + 12 + 6 + 6 + 6 + + + True + False + True + 0 + Add Network + True + + + 0 + 0 + 1 + 1 + + + + + True + False + center + True + + + + True + True + 35 + + + True + False + list-add-symbolic + + + + + + + + 1 + 0 + 1 + 1 + + + + + + + + + + 0 + 4 + 2 + 1 + + + + +
diff --git a/src/teleportappwin.c b/src/teleportappwin.c index 3478c40..028ca5c 100644 --- a/src/teleportappwin.c +++ b/src/teleportappwin.c @@ -23,15 +23,16 @@ teleport_app_window_init (TeleportAppWindow *win) { TeleportAppWindowPrivate *priv; GtkBuilder *builder; - GMenuModel *menu; + GtkWidget *menu; //GAction *action; priv = teleport_app_window_get_instance_private (win); gtk_widget_init_template (GTK_WIDGET (win)); builder = gtk_builder_new_from_resource ("/org/gtk/teleportapp/settings.ui"); - menu = G_MENU_MODEL (gtk_builder_get_object (builder, "menu")); - gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (priv->gears), menu); + menu = GTK_WIDGET (gtk_builder_get_object (builder, "settings")); + + gtk_menu_button_set_popover(GTK_MENU_BUTTON (priv->gears), menu); //action = g_settings_create_action (priv->settings, "show-words"); //g_action_map_add_action (G_ACTION_MAP (win), action);