[add] add settings menu
This commit is contained in:
@@ -11,7 +11,7 @@ OBJS = $(BUILT_SRC:.c=.o) $(SRC:.c=.o)
|
|||||||
|
|
||||||
all: teleportapp
|
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
|
$(GLIB_COMPILE_RESOURCES) teleportapp.gresource.xml --target=$@ --sourcedir=. --generate-source
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
|
|||||||
226
src/settings.ui
226
src/settings.ui
@@ -1,16 +1,218 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<interface>
|
<interface>
|
||||||
<!-- interface-requires gtk+ 3.0 -->
|
<!-- interface-requires gtk+ 3.0 -->
|
||||||
<menu id="menu">
|
<object id="settings" class="GtkPopover">
|
||||||
<section>
|
<child>
|
||||||
<item>
|
<object class="GtkGrid">
|
||||||
<attribute name="label" translatable="yes">_Words</attribute>
|
<property name="visible">True</property>
|
||||||
<attribute name="action">win.show-words</attribute>
|
<property name="margin">10</property>
|
||||||
</item>
|
<child>
|
||||||
<item>
|
<object class="GtkLabel">
|
||||||
<attribute name="label" translatable="yes">_Lines</attribute>
|
<property name="visible">True</property>
|
||||||
<attribute name="action">win.show-lines</attribute>
|
<property name="xalign">0</property>
|
||||||
</item>
|
<property name="label" translatable="yes">Save received files in:</property>
|
||||||
</section>
|
<property name="margin_bottom">6</property>
|
||||||
</menu>
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
<property name="width">1</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="text">~/Downloads</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="width">1</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label">Browse...</property>
|
||||||
|
<property name="margin_start">12</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="width">1</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Automaticaly enable Teleport on these networks:</property>
|
||||||
|
<property name="margin_bottom">6</property>
|
||||||
|
<property name="margin_top">18</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">2</property>
|
||||||
|
<property name="width">2</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkListBox" id="general-listbox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="selection_mode">none</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkListBoxRow" id="primary-button-row-1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="activatable">false</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkGrid" id="primary-button-grid-1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="row_spacing">0</property>
|
||||||
|
<property name="column_spacing">16</property>
|
||||||
|
<property name="margin_start">12</property>
|
||||||
|
<property name="margin_end">6</property>
|
||||||
|
<property name="margin_top">6</property>
|
||||||
|
<property name="margin_bottom">6</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="device-name-lable-1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">o2-WLAN09</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
<property name="width">1</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkGrid">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="column_homogeneous">True</property>
|
||||||
|
<style>
|
||||||
|
<class name="linked"/>
|
||||||
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="localSettings-1">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="height_request">35</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="icon_name">window-close-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<style>
|
||||||
|
<class name="image-button"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
<property name="width">1</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkListBoxRow" id="primary-button-row">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="activatable">false</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkGrid" id="primary-button-grid">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="row_spacing">0</property>
|
||||||
|
<property name="column_spacing">16</property>
|
||||||
|
<property name="margin_start">12</property>
|
||||||
|
<property name="margin_end">6</property>
|
||||||
|
<property name="margin_top">6</property>
|
||||||
|
<property name="margin_bottom">6</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="device-name-lable">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="hexpand">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">Add Network</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
<property name="width">1</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkGrid">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="column_homogeneous">True</property>
|
||||||
|
<style>
|
||||||
|
<class name="linked"/>
|
||||||
|
</style>
|
||||||
|
<child>
|
||||||
|
<object class="GtkButton" id="localSettings">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="height_request">35</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="icon_name">list-add-symbolic</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<style>
|
||||||
|
<class name="image-button"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
<property name="width">1</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">4</property>
|
||||||
|
<property name="width">2</property>
|
||||||
|
<property name="height">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
</interface>
|
</interface>
|
||||||
|
|||||||
@@ -23,15 +23,16 @@ teleport_app_window_init (TeleportAppWindow *win)
|
|||||||
{
|
{
|
||||||
TeleportAppWindowPrivate *priv;
|
TeleportAppWindowPrivate *priv;
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
GMenuModel *menu;
|
GtkWidget *menu;
|
||||||
//GAction *action;
|
//GAction *action;
|
||||||
|
|
||||||
priv = teleport_app_window_get_instance_private (win);
|
priv = teleport_app_window_get_instance_private (win);
|
||||||
gtk_widget_init_template (GTK_WIDGET (win));
|
gtk_widget_init_template (GTK_WIDGET (win));
|
||||||
|
|
||||||
builder = gtk_builder_new_from_resource ("/org/gtk/teleportapp/settings.ui");
|
builder = gtk_builder_new_from_resource ("/org/gtk/teleportapp/settings.ui");
|
||||||
menu = G_MENU_MODEL (gtk_builder_get_object (builder, "menu"));
|
menu = GTK_WIDGET (gtk_builder_get_object (builder, "settings"));
|
||||||
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (priv->gears), menu);
|
|
||||||
|
gtk_menu_button_set_popover(GTK_MENU_BUTTON (priv->gears), menu);
|
||||||
|
|
||||||
//action = g_settings_create_action (priv->settings, "show-words");
|
//action = g_settings_create_action (priv->settings, "show-words");
|
||||||
//g_action_map_add_action (G_ACTION_MAP (win), action);
|
//g_action_map_add_action (G_ACTION_MAP (win), action);
|
||||||
|
|||||||
Reference in New Issue
Block a user