Use primary menu instead of gtk/menus.ui

Part of the 3.32 initiative to get rid of the app menu.
This commit is contained in:
Christopher Davis
2019-08-06 07:27:41 -07:00
parent 287970bec8
commit 46431b1787
4 changed files with 235 additions and 200 deletions

View File

@@ -1,17 +0,0 @@
<?xml version="1.0"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<menu id="app-menu">
<section>
<item>
<attribute name="label" translatable="yes">_About</attribute>
<attribute name="action">app.about</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
</item>
</section>
</menu>
</interface>

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/frac_tion/teleport">
<file alias="gtk/menus.ui">gtk/menus.ui</file>
<file preprocess="xml-stripblanks">window.ui</file>
<file preprocess="xml-stripblanks">settings.ui</file>
<file preprocess="xml-stripblanks">device_settings.ui</file>

View File

@@ -1,88 +1,90 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object id="settings" class="GtkPopover">
<requires lib="gtk+" version="3.16"/>
<object class="GtkPopover" id="settings">
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="margin">12</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="margin">10</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Save received files in:</property>
<property name="can_focus">False</property>
<property name="margin_bottom">6</property>
<property name="label" translatable="yes">Save received files in:</property>
<property name="xalign">0</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="GtkFileChooserButton" id="settings_download_directory">
<property name="visible">True</property>
<property name="sensitive">True</property>
<property name="can_focus">False</property>
<property name="action">select-folder</property>
<property name="title" translatable="yes">Choose download dir</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="GtkLabel">
<property name="visible">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Automatically enable Teleport on these networks:</property>
<property name="margin_bottom">6</property>
<property name="can_focus">False</property>
<property name="margin_top">18</property>
<property name="margin_bottom">6</property>
<property name="label" translatable="yes">Automatically enable Teleport on these networks:</property>
<property name="xalign">0</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">False</property>
<property name="can_focus">True</property>
<property name="can_focus">False</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>
<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_left">12</property>
<property name="margin_right">6</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>
<property name="column_spacing">16</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>
<property name="xalign">0</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>
@@ -91,14 +93,12 @@
<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="height_request">35</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="height_request">35</property>
<property name="receives_default">False</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -110,13 +110,18 @@
<class name="image-button"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<style>
<class name="linked"/>
</style>
</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>
@@ -127,31 +132,30 @@
<object class="GtkListBoxRow" id="primary-button-row">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activatable">false</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_left">12</property>
<property name="margin_right">6</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>
<property name="column_spacing">16</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>
<property name="xalign">0</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>
@@ -160,14 +164,12 @@
<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="height_request">35</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="height_request">35</property>
<property name="receives_default">False</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
@@ -179,26 +181,74 @@
<class name="image-button"/>
</style>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<style>
<class name="linked"/>
</style>
</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>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="action_name">app.about</property>
<property name="text" translatable="yes">_About Fragments</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>

View File

@@ -354,6 +354,7 @@ static void
teleport_app_startup (GApplication *app) {
TeleportAppPrivate *priv;
GtkStyleProvider *provider;
static const gchar *quit_accels[] = { "<Primary>q", NULL };
mainApplication = TELEPORT_APP (app);
priv = mainApplication->priv;
@@ -363,6 +364,8 @@ teleport_app_startup (GApplication *app) {
G_N_ELEMENTS (app_entries),
app);
gtk_application_set_accels_for_action (GTK_APPLICATION (app), "app.quit", quit_accels);
G_APPLICATION_CLASS (teleport_app_parent_class)->startup (app);
/* window */