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
=== modified file 'data/CMakeLists.txt'
--- data/CMakeLists.txt 2016-09-02 17:26:17 +0000
+++ data/CMakeLists.txt 2016-12-23 13:16:37 +0000
@@ -1,3 +1,7 @@
1configure_file(org.pantheon.capnet-assist.desktop ${CMAKE_CURRENT_BINARY_DIR}/org.pantheon.capnet-assist.desktop)1configure_file(org.pantheon.capnet-assist.desktop ${CMAKE_CURRENT_BINARY_DIR}/org.pantheon.capnet-assist.desktop)
22
3install (FILES ${CMAKE_CURRENT_BINARY_DIR}/org.pantheon.capnet-assist.desktop DESTINATION share/applications)3install (FILES ${CMAKE_CURRENT_BINARY_DIR}/org.pantheon.capnet-assist.desktop DESTINATION share/applications)
4
5include (GSettings)
6
7add_schema (org.pantheon.capnet-assist.gschema.xml)
48
=== added file 'data/org.pantheon.capnet-assist.gschema.xml'
--- data/org.pantheon.capnet-assist.gschema.xml 1970-01-01 00:00:00 +0000
+++ data/org.pantheon.capnet-assist.gschema.xml 2016-12-23 13:16:37 +0000
@@ -0,0 +1,8 @@
1<schemalist>
2 <schema path="/org/pantheon/capnet-assist/" id="org.pantheon.capnet-assist">
3 <key name="enabled" type="b">
4 <default>true</default>
5 <summary>Whether the assistant should be enabled</summary>
6 </key>
7 </schema>
8</schemalist>
09
=== modified file 'src/Application.vala'
--- src/Application.vala 2016-12-20 18:00:10 +0000
+++ src/Application.vala 2016-12-23 13:16:37 +0000
@@ -57,6 +57,12 @@
57 }57 }
5858
59 public override void activate () {59 public override void activate () {
60 var settings = new Settings ();
61 if (!settings.enabled) {
62 quit ();
63 return;
64 }
65
60 if (!is_busy) {66 if (!is_busy) {
61 mark_busy ();67 mark_busy ();
6268
6369
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2016-12-05 04:41:39 +0000
+++ src/CMakeLists.txt 2016-12-23 13:16:37 +0000
@@ -42,6 +42,7 @@
42 CaptiveLogin.vala42 CaptiveLogin.vala
43 CertButton.vala43 CertButton.vala
44 TabbedWebView.vala44 TabbedWebView.vala
45 Settings.vala
45PACKAGES46PACKAGES
46 ${CAPTIVE_LOGIN_PACKAGES}47 ${CAPTIVE_LOGIN_PACKAGES}
47OPTIONS48OPTIONS
4849
=== added file 'src/Settings.vala'
--- src/Settings.vala 1970-01-01 00:00:00 +0000
+++ src/Settings.vala 2016-12-23 13:16:37 +0000
@@ -0,0 +1,26 @@
1/*
2* Copyright (c) 2016 elementary LLC (https://launchpad.net/capnet-assist)
3*
4* This program is free software; you can redistribute it and/or
5* modify it under the terms of the GNU General Public
6* License as published by the Free Software Foundation; either
7* version 2 of the License, or (at your option) any later version.
8*
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 GNU
12* General Public License for more details.
13*
14* You should have received a copy of the GNU General Public
15* License along with this program; if not, write to the
16* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17* Boston, MA 02111-1307, USA.
18*/
19
20public class Captive.Settings : Granite.Services.Settings {
21 public bool enabled { get; set; }
22
23 public Settings () {
24 base ("org.pantheon.capnet-assist");
25 }
26}
0\ No newline at end of file27\ No newline at end of file

Subscribers

People subscribed via source and target branches

to all changes: