+
+
\ No newline at end of file
diff --git a/frontend/src/components/General/Input.svelte b/frontend/src/components/General/Input.svelte
index ff1248c..bf9572f 100644
--- a/frontend/src/components/General/Input.svelte
+++ b/frontend/src/components/General/Input.svelte
@@ -1,6 +1,6 @@
-
{label}
+
{label}
{#if type === 'large'}
-
diff --git a/frontend/src/components/General/NavigationBar.svelte b/frontend/src/components/General/NavigationBar.svelte
index 52b5c08..bd05ec7 100644
--- a/frontend/src/components/General/NavigationBar.svelte
+++ b/frontend/src/components/General/NavigationBar.svelte
@@ -2,18 +2,9 @@
import RoundIconButton from './RoundIconButton.svelte';
import Toggle from './Toggle.svelte';
import { createEventDispatcher, onDestroy } from 'svelte';
- import * as SoftwareVariables from '../../stores.js';
+ import {colors} from '../../stores.js';
import { _ } from 'svelte-i18n'
- // Import the main colors from the store
- let firstColor, secondColor, thirdColor, fourthColor, okColor, nokColor
- const unsubscribeFirstColor = SoftwareVariables.firstColor.subscribe((value) => (firstColor = value));
- const unsubscribeSecondColor = SoftwareVariables.secondColor.subscribe((value) => (secondColor = value));
- const unsubscribeThirdColor = SoftwareVariables.thirdColor.subscribe((value) => (thirdColor = value));
- const unsubscribeFourthColor = SoftwareVariables.fourthColor.subscribe((value) => (fourthColor = value));
- const unsubscribeOkColor = SoftwareVariables.okColor.subscribe((value) => (okColor = value));
- const unsubscribeNokColor = SoftwareVariables.nokColor.subscribe((value) => (nokColor = value));
-
//---Navigation System---//
let menuStates = {
@@ -47,26 +38,17 @@
});
}
- // Unsubscribe for all variables used from the store
- onDestroy(() => {
- unsubscribeFirstColor();
- unsubscribeSecondColor();
- unsubscribeThirdColor();
- unsubscribeFourthColor();
- unsubscribeOkColor();
- unsubscribeNokColor();
- })
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/components/Settings/Settings.svelte b/frontend/src/components/Settings/Settings.svelte
index 5d41385..06ba603 100644
--- a/frontend/src/components/Settings/Settings.svelte
+++ b/frontend/src/components/Settings/Settings.svelte
@@ -1,24 +1,72 @@
-
-
+
+
\ No newline at end of file
diff --git a/frontend/src/lang/en.json b/frontend/src/lang/en.json
index ea04754..d4b544e 100644
--- a/frontend/src/lang/en.json
+++ b/frontend/src/lang/en.json
@@ -7,10 +7,11 @@
"consoleMenuTooltip": "General console",
"stageRenderingToggleTooltip": "Show/hide the rendering view",
"showActivationToggleTooltip": "Activate/Deactivate the play mode",
+ "saveButtonTooltip": "Save the project",
"newProjectString": "New",
- "openProjectString": "Open",
"newProjectTooltip": "Create a new project",
+ "openProjectString": "Open",
"openProjectTooltip": "Open an existing project",
"projectPropertiesTab": "Project properties",
"projectPropertiesTooltip": "The project properties",
diff --git a/frontend/src/main.js b/frontend/src/main.js
index 0545c0b..1e6ca8a 100644
--- a/frontend/src/main.js
+++ b/frontend/src/main.js
@@ -1,5 +1,9 @@
import App from './App.svelte';
+import { WindowSetTitle } from "../wailsjs/runtime/runtime"
+
+import {currentProject, needProjectSave} from './stores.js';
+
// Load dictionaries
import { addMessages, init } from 'svelte-i18n';
@@ -13,11 +17,35 @@ addMessages('en', en);
init({
fallbackLocale: 'en',
initialLocale: 'en',
- });
+});
// Create the main app
const app = new App({
target: document.body,
});
+// Set the initial title
+WindowSetTitle("DMXConnect")
+
+// When the current project data is modified, pass it to unsaved and change the title
+let title;
+currentProject.subscribe(value => {
+ needProjectSave.set(true)
+ title = value.Name
+});
+
+// If the project need to be saved, show the information in the title
+needProjectSave.subscribe(value => {
+ if (value) {
+ console.log(` The current project need to be save`);
+ WindowSetTitle("DMXConnect - " + title + " (unsaved)")
+ } else {
+ WindowSetTitle("DMXConnect - " + title)
+ }
+})
+
+document.addEventListener("DOMContentLoaded", function() {
+
+});
+
export default app;
\ No newline at end of file
diff --git a/frontend/src/stores.js b/frontend/src/stores.js
index e9f96d9..2979d0f 100644
--- a/frontend/src/stores.js
+++ b/frontend/src/stores.js
@@ -1,14 +1,23 @@
import { writable } from 'svelte/store';
-// Colors defined in the software
-export const firstColor = writable("#1B262C");
-export const secondColor = writable("#0F4C75");
-export const thirdColor = writable("#3282B8");
-export const fourthColor = writable("#BBE1FA");
-export const okColor = writable("#2BA646");
-export const nokColor = writable("#A6322B");
-export const whiteColor = writable("#FFFFFF");
-export const orangeColor = writable("#BC9714")
+// Projects management
+export let projectsList = writable([])
+
+// Show settings
+export let currentProject = writable({});
+export let needProjectSave = writable(false)
+
+// Application colors
+export const colors = writable({
+ first: "#1B262C",
+ second: "#0F4C75",
+ third: "#3282B8",
+ fourth: "#BBE1FA",
+ ok: "#2BA646",
+ nok: "#A6322B",
+ white: "#FFFFFF",
+ orange: "#BC9714"
+})
// Font sizes defined in the software
export const firstSize = writable("10px")
diff --git a/frontend/src/style.css b/frontend/src/style.css
index b185506..a620dbc 100644
--- a/frontend/src/style.css
+++ b/frontend/src/style.css
@@ -2,6 +2,14 @@
-webkit-user-select: none; /* Safari */
-ms-user-select: none; /* IE 10 and IE 11 */
user-select: none; /* Standard syntax */
+ --first-color: #1B262C;
+ --second-color: #0F4C75;
+ --third-color: #3282B8;
+ --fourth-color: #BBE1FA;
+ --ok-color: #2BA646;
+ --nok-color: #A6322B;
+ --white-color: #FFFFFF;
+ --orange-color: #BC9714;
}
html, body {
diff --git a/go.mod b/go.mod
index f58cb34..3c74a04 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,10 @@ go 1.21
toolchain go1.21.3
-require github.com/wailsapp/wails/v2 v2.9.1
+require (
+ github.com/wailsapp/wails/v2 v2.9.1
+ gopkg.in/yaml.v2 v2.4.0
+)
require (
github.com/bep/debounce v1.2.1 // indirect
diff --git a/go.sum b/go.sum
index 7e8f88d..be87a56 100644
--- a/go.sum
+++ b/go.sum
@@ -87,7 +87,10 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
diff --git a/main.go b/main.go
index 23cbac3..ae86fa3 100644
--- a/main.go
+++ b/main.go
@@ -33,4 +33,4 @@ func main() {
if err != nil {
println("Error:", err.Error())
}
-}
+}
\ No newline at end of file