diff --git a/src/teleportappwin.c b/src/teleportappwin.c index 27bc824..3478c40 100644 --- a/src/teleportappwin.c +++ b/src/teleportappwin.c @@ -8,28 +8,80 @@ struct _TeleportAppWindow GtkApplicationWindow parent; }; -G_DEFINE_TYPE(TeleportAppWindow, teleport_app_window, GTK_TYPE_APPLICATION_WINDOW); +typedef struct _TeleportAppWindowPrivate TeleportAppWindowPrivate; + +struct _TeleportAppWindowPrivate +{ + GSettings *settings; + GtkWidget *gears; +}; + +G_DEFINE_TYPE_WITH_PRIVATE(TeleportAppWindow, teleport_app_window, GTK_TYPE_APPLICATION_WINDOW); static void teleport_app_window_init (TeleportAppWindow *win) { + TeleportAppWindowPrivate *priv; GtkBuilder *builder; GMenuModel *menu; - GAction *action; + //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")); - g_object_unref (builder); + gtk_menu_button_set_menu_model (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); + /* + const gchar *authors[] = { + "Julian Sparber ", + NULL + }; + + gtk_show_about_dialog (parent, + "authors", authors, + "comments", "", + "copyright", "Copyright \xc2\xa9 2017 Julian Sparber", + "license-type", GTK_LICENSE_AGPL_3_0, + "logo-icon-name", "", + "program-name", "", + "translator-credits", "translator-credits", + "version", "20", + "website", "https://wiki.gnome.org/Apps/teleport", + "website-label", "Teleport website", + NULL); + */ + + //g_object_unref (action); + //g_object_unref (builder); +} + + static void +teleport_app_window_dispose (GObject *object) +{ + TeleportAppWindow *win; + TeleportAppWindowPrivate *priv; + + win = TELEPORT_APP_WINDOW (object); + priv = teleport_app_window_get_instance_private (win); + + //g_clear_object (&priv->settings); + + G_OBJECT_CLASS (teleport_app_window_parent_class)->dispose (object); } static void teleport_app_window_class_init (TeleportAppWindowClass *class) { + G_OBJECT_CLASS (class)->dispose = teleport_app_window_dispose; + gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (class), "/org/gtk/teleportapp/window.ui"); + + gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), TeleportAppWindow, gears); } TeleportAppWindow * @@ -42,4 +94,6 @@ teleport_app_window_new (TeleportApp *app) teleport_app_window_open (TeleportAppWindow *win, GFile *file) { + TeleportAppWindowPrivate *priv; + priv = teleport_app_window_get_instance_private (win); } diff --git a/src/window.ui b/src/window.ui index cf7ffd0..f501238 100644 --- a/src/window.ui +++ b/src/window.ui @@ -89,7 +89,6 @@ 0 Angela's Thinkpad True - primary-button-chooser-grid 0 @@ -99,7 +98,7 @@ - + True False 0 @@ -122,7 +121,7 @@ - + True False center @@ -167,174 +166,7 @@ - - False - False - 12 - 12 - none - 0.45 - - - True - False - 0 - Mouse - - - - - - - - True - False - 6 - 6 - in - - - True - True - none - - - True - True - false - - - True - False - 0 - 32 - 12 - 6 - 8 - 8 - center - - - True - False - 0 - end - Mouse Speed - True - primary-button-chooser-grid - - - 0 - 0 - 1 - 1 - - - - - True - True - adjustment1 - False - 300 - end - True - - - Double-click timeout - - - - - 1 - 0 - 1 - 2 - - - - - - - - - True - True - false - - - True - False - 0 - 16 - 12 - 6 - 6 - 6 - center - - - True - False - True - 0 - Natural Scrolling - True - mouse-natural-scrolling-switch - - - 0 - 0 - 1 - 1 - - - - - True - False - 0 - Scrolling moves the content, not the view. - - - - - - - 0 - 1 - 1 - 1 - - - - - True - True - end - center - - - 1 - 0 - 1 - 2 - - - - - - - - - - - - - - + True False 12 @@ -342,7 +174,7 @@ none 0.45 - + True False 0 @@ -353,29 +185,29 @@ - + True False 6 12 in - + True False vertical - + True True none - + True True false - + True False 0 @@ -386,15 +218,14 @@ 6 center - + True False True 0 end - Touchpad + Kim's Librem True - touchpad-toggle-switch 0 @@ -404,12 +235,33 @@ - + + True + False + 0 + Drag and drop files here to send it + + + + + + + 0 + 1 + 1 + 1 + + + + + True True end center - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + send File 1 @@ -457,9 +309,8 @@ False True 0 - Natural Scrolling + Progressbar True - touchpad-natural-scrolling-switch 0 @@ -468,26 +319,6 @@ 1 - - - True - False - 0 - Scrolling moves the content, not the view. - - - - - - - 0 - 1 - 1 - 1 - - True @@ -506,222 +337,6 @@ - - - True - True - false - - - True - False - 0 - 16 - 12 - 6 - 8 - 8 - center - - - True - False - 0 - end - Touchpad Speed - True - touchpad-speed-scale - - - 0 - 0 - 1 - 1 - - - - - True - True - adjustment11 - False - True - end - - - Double-click timeout - - - - - 1 - 0 - 1 - 2 - - - - - - - - - False - True - false - - - True - False - 0 - 32 - 12 - 6 - 6 - 6 - center - - - True - False - True - 0 - end - Tap to Click - True - tap-to-click-switch - - - 0 - 0 - 1 - 1 - - - - - True - True - end - center - - - 1 - 0 - 1 - 2 - - - - - - - - - False - True - True - false - - - True - False - 0 - 32 - 12 - 6 - 6 - 6 - center - - - True - False - True - 0 - end - Two-finger Scrolling - True - two-finger-scrolling-switch - - - 0 - 0 - 1 - 1 - - - - - True - True - end - center - - - 1 - 0 - 1 - 2 - - - - - - - - - False - True - True - false - - - True - False - 0 - 32 - 12 - 6 - 6 - 6 - center - - - True - False - True - 0 - end - Edge Scrolling - True - edge-scrolling-switch - - - 0 - 0 - 1 - 1 - - - - - True - True - end - center - - - 1 - 0 - 1 - 2 - - - - - - @@ -733,7 +348,6 @@ -