From d469383f43685dd5e254cd6e732e15a732000d0c Mon Sep 17 00:00:00 2001 From: Sara <sarasdj@stud.ntnu.no> Date: Wed, 15 May 2024 10:17:45 +0200 Subject: [PATCH] add: software license with AS-IS clause --- README.md | 17 +++++++++++++++++ app/lib/pages/default_page.dart | 3 +-- app/lib/server_requests/init_state.dart | 12 ++++++------ 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f65581ec..a944b9fc 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ This software was developed at NTNU as part of a Bachelor thesis for the municipality of Gjøvik. ## Table of contents +* [IceMap sofwtare license](#icemap-software-license) * [Server](#server) * [Endpoints](#endpoints) * [Update map](#update-map) @@ -18,6 +19,22 @@ This software was developed at NTNU as part of a Bachelor thesis for the municip * [Application dependencies](#application-dependencies) * [Developers](#devleopers) +# IceMap software license +The IceMap software was produced by Joakim Aleksandersen, +Sara Savanovic Djordjevic, and Hoa Ben The Nguyen. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation to view the Software. +Any distribution and modification of the Software requires prior written +permission from the authors. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + # Server The server currently only accepts HTTPS requests, not HTTP. It listens on ip address 127.0.0.1 and port 8443. diff --git a/app/lib/pages/default_page.dart b/app/lib/pages/default_page.dart index 3d9459e3..021c6097 100644 --- a/app/lib/pages/default_page.dart +++ b/app/lib/pages/default_page.dart @@ -64,8 +64,7 @@ class _DefaultPageState extends State<DefaultPage> { if (result != selectedLake) { setState(() { selectedLake = result; - // NB update lastLake persistent variable - //fetchNewLake(context); + initialiseState(false); }); } }), diff --git a/app/lib/server_requests/init_state.dart b/app/lib/server_requests/init_state.dart index 2a873695..b6d2fc03 100644 --- a/app/lib/server_requests/init_state.dart +++ b/app/lib/server_requests/init_state.dart @@ -12,7 +12,7 @@ import '../server_requests/fetch_relation.dart'; /// initialiseState makes three requests to the server, one requesting /// measurements for the selected relation, the other requesting the relation, /// and the last requesting the list of all system lakes -Future<void> initialiseState(bool fetchSearchOptions) async { +Future<void> initialiseState(bool initNewLake) async { bool serverConnection = true; late Future<List<Measurement>> markerListFuture; @@ -70,14 +70,14 @@ Future<void> initialiseState(bool fetchSearchOptions) async { relationFuture = loadRelation(); } - if (fetchSearchOptions) { + if (initNewLake) { + // Last lake initialised to last persistent variable, or Mjøsa if the variable is not found + final prefs = await SharedPreferences.getInstance(); + selectedLake = prefs.getString('lastLake') ?? "Mjøsa"; + initSearchOptions(); } - // Last lake initialised to last persistent variable, or Mjøsa if the variable is not found - final prefs = await SharedPreferences.getInstance(); - selectedLake = prefs.getString('lastLake') ?? "Mjøsa"; - // Set the selected relation selectedRelation = await relationFuture; selectedMeasurements = await markerListFuture; -- GitLab