The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Add template for a preferences dialog

master
Gergely Polonkai 8 years ago
parent f8a419aab1
commit 3d884c1fdc
  1. 1
      src/Makefile.am
  2. 8
      src/gg-application.vala
  3. 28
      src/gg-preferences.vala
  4. 1
      src/resources/gnome-gitlab.gresource.xml
  5. 19
      src/resources/ui/gg-preferences.ui
  6. 10
      src/resources/ui/gg-window.ui

@ -21,6 +21,7 @@ gg-resources.c: $(res_src) $(resource_files)
VALA_SOURCES = \
gg-application.vala \
gg-window.vala \
gg-preferences.vala \
gg-main.vala
gnome_gitlab_SOURCES = \

@ -8,6 +8,7 @@ namespace GnomeGitlab
};
const GLib.ActionEntry[] action_entries = {
{ "preferences", on_preferences_activate },
{ "quit", on_quit_activate }
};
@ -59,5 +60,12 @@ namespace GnomeGitlab
{
quit ();
}
void on_preferences_activate ()
{
Preferences.show ((Window)get_active_window ());
return;
}
}
}

@ -0,0 +1,28 @@
namespace GnomeGitlab
{
[GtkTemplate (ui = "/eu/polonkai/gergely/gnome-gitlab/ui/gg-preferences.ui")]
public class Preferences : Gtk.Dialog
{
private static GLib.Once<Preferences> instance;
private Preferences () {
response.connect (() => {
hide ();
});
}
public static void show (Window parent)
{
Preferences inst;
inst = instance.once (() => { return new Preferences (); });
if (parent != inst.get_transient_for ()) {
inst.set_transient_for (parent);
}
inst.present ();
}
}
}

@ -2,5 +2,6 @@
<gresources>
<gresource prefix="/eu/polonkai/gergely/gnome-gitlab">
<file>ui/gg-window.ui</file>
<file>ui/gg-preferences.ui</file>
</gresource>
</gresources>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.12"/>
<template class="GnomeGitlabPreferences" parent="GtkDialog">
<property name="title" translatable="yes">Preferences</property>
<property name="type_hint">normal</property>
<property name="can_focus">False</property>
<child internal-child="vbox">
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label">Preferences dialog</property>
</object>
</child>
</object>
</child>
</template>
</interface>

@ -38,6 +38,16 @@
<property name="fill">True</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Manage GitLab instances</property>
<property name="action_name">app.preferences</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="name">no-instances</property>

Loading…
Cancel
Save