2
// Copyright (C) 2012 Ivo Nunes
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
public class Sample.Plug : Switchboard.Plug {
20
private Gtk.Grid main_grid;
23
Object (category: Category.HARDWARE,
24
code_name: "hardware-template-sample",
25
display_name: _("Sample"),
26
description: _("Configure nothing but is a big step"),
30
public override Gtk.Widget get_widget () {
31
if (main_grid == null) {
32
main_grid = new Gtk.Grid ();
33
var label = new Gtk.Label ("Hello World!");
34
main_grid.attach (label, 0, 0, 1, 1);
36
main_grid.show_all ();
40
public override void shown () {
44
public override void hidden () {
48
public override void search_callback (string location) {
52
// 'search' returns results like ("Keyboard → Behavior → Duration", "keyboard<sep>behavior")
53
public override async Gee.TreeMap<string, string> search (string search) {
54
return new Gee.TreeMap<string, string> (null, null);
1
// -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-
3
* Copyright (c) 2014 YOUR NAME (http://launchpad.net/your-project)
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License as published by the Free Software Foundation; either
8
* version 3 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Library General Public License for more details.
15
* You should have received a copy of the GNU Library General Public
16
* License along with this library; if not, write to the
17
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
* Boston, MA 02111-1307, USA.
20
* Authored by: Corentin Noël <tintou@mailoo.org>
24
public static Plug plug;
26
public class Plug : Switchboard.Plug {
30
Object (category: Category.PERSONAL,
31
code_name: Build.PLUGCODENAME,
32
display_name: _("Sample Plug"),
33
description: _("Try to play with it!"),
34
icon: "applications-development");
38
public override Gtk.Widget get_widget () {
39
if (main_grid == null) {
40
main_grid = new Gtk.Grid ();
41
var hello_label = new Gtk.Label (_("Hello World"));
42
main_grid.attach (hello_label, 0, 0, 1, 1);
43
main_grid.show_all ();
49
public override void shown () {
53
public override void hidden () {
57
public override void search_callback (string location) {
61
// 'search' returns results like ("Keyboard → Behavior → Duration", "keyboard<sep>behavior")
62
public override async Gee.TreeMap<string, string> search (string search) {
63
return new Gee.TreeMap<string, string> (null, null);
68
public Switchboard.Plug get_plug (Module module) {
69
debug ("Activating Sample plug");
70
var plug = new Sample.Plug ();
b'\\ No newline at end of file'