Merge lp:~donadigo/capnet-assist/gsettings into lp:~elementary-apps/capnet-assist/trunk

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Corentin Noël
Approved revision: 127
Merged at revision: 126
Proposed branch: lp:~donadigo/capnet-assist/gsettings
Merge into: lp:~elementary-apps/capnet-assist/trunk
Diff against target: 85 lines (+45/-0)
5 files modified
data/CMakeLists.txt (+4/-0)
data/org.pantheon.capnet-assist.gschema.xml (+8/-0)
src/Application.vala (+6/-0)
src/CMakeLists.txt (+1/-0)
src/Settings.vala (+26/-0)
To merge this branch: bzr merge lp:~donadigo/capnet-assist/gsettings
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email: mp+313810@code.launchpad.net

Commit message

* Add GSetting to enable the assistant

Description of the change

This branch fixes bug #1651585: "Add GSetting to disable".

Adds a gsettings xml file and a "enabled" key to disable / enable the assistant. The settings are implemented in a separate file, to minimize work in case of adding another keys if needed.

To post a comment you must log in.
Revision history for this message
Corentin Noël (tintou) wrote :

Tiny fix with the gettext-domain and then it's okay to merge

lp:~donadigo/capnet-assist/gsettings updated
127. By Adam Bieńkowski

Remove gettext-domain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/CMakeLists.txt'
2--- data/CMakeLists.txt 2016-09-02 17:26:17 +0000
3+++ data/CMakeLists.txt 2016-12-23 13:16:37 +0000
4@@ -1,3 +1,7 @@
5 configure_file(org.pantheon.capnet-assist.desktop ${CMAKE_CURRENT_BINARY_DIR}/org.pantheon.capnet-assist.desktop)
6
7 install (FILES ${CMAKE_CURRENT_BINARY_DIR}/org.pantheon.capnet-assist.desktop DESTINATION share/applications)
8+
9+include (GSettings)
10+
11+add_schema (org.pantheon.capnet-assist.gschema.xml)
12
13=== added file 'data/org.pantheon.capnet-assist.gschema.xml'
14--- data/org.pantheon.capnet-assist.gschema.xml 1970-01-01 00:00:00 +0000
15+++ data/org.pantheon.capnet-assist.gschema.xml 2016-12-23 13:16:37 +0000
16@@ -0,0 +1,8 @@
17+<schemalist>
18+ <schema path="/org/pantheon/capnet-assist/" id="org.pantheon.capnet-assist">
19+ <key name="enabled" type="b">
20+ <default>true</default>
21+ <summary>Whether the assistant should be enabled</summary>
22+ </key>
23+ </schema>
24+</schemalist>
25
26=== modified file 'src/Application.vala'
27--- src/Application.vala 2016-12-20 18:00:10 +0000
28+++ src/Application.vala 2016-12-23 13:16:37 +0000
29@@ -57,6 +57,12 @@
30 }
31
32 public override void activate () {
33+ var settings = new Settings ();
34+ if (!settings.enabled) {
35+ quit ();
36+ return;
37+ }
38+
39 if (!is_busy) {
40 mark_busy ();
41
42
43=== modified file 'src/CMakeLists.txt'
44--- src/CMakeLists.txt 2016-12-05 04:41:39 +0000
45+++ src/CMakeLists.txt 2016-12-23 13:16:37 +0000
46@@ -42,6 +42,7 @@
47 CaptiveLogin.vala
48 CertButton.vala
49 TabbedWebView.vala
50+ Settings.vala
51 PACKAGES
52 ${CAPTIVE_LOGIN_PACKAGES}
53 OPTIONS
54
55=== added file 'src/Settings.vala'
56--- src/Settings.vala 1970-01-01 00:00:00 +0000
57+++ src/Settings.vala 2016-12-23 13:16:37 +0000
58@@ -0,0 +1,26 @@
59+/*
60+* Copyright (c) 2016 elementary LLC (https://launchpad.net/capnet-assist)
61+*
62+* This program is free software; you can redistribute it and/or
63+* modify it under the terms of the GNU General Public
64+* License as published by the Free Software Foundation; either
65+* version 2 of the License, or (at your option) any later version.
66+*
67+* This program is distributed in the hope that it will be useful,
68+* but WITHOUT ANY WARRANTY; without even the implied warranty of
69+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
70+* General Public License for more details.
71+*
72+* You should have received a copy of the GNU General Public
73+* License along with this program; if not, write to the
74+* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
75+* Boston, MA 02111-1307, USA.
76+*/
77+
78+public class Captive.Settings : Granite.Services.Settings {
79+ public bool enabled { get; set; }
80+
81+ public Settings () {
82+ base ("org.pantheon.capnet-assist");
83+ }
84+}
85\ No newline at end of file

Subscribers

People subscribed via source and target branches

to all changes: