From 251614e9f082b599df12ca57364d4177436236e4 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sat, 18 May 2019 20:53:46 +0200 Subject: [PATCH] Added theme setting to config file --- nw/config.py | 7 +++++++ sample/sampleNovel/nwProject.nwx | 2 +- tests/reference/novelwriter.conf | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nw/config.py b/nw/config.py index 549d21c2..a12aaa9a 100644 --- a/nw/config.py +++ b/nw/config.py @@ -126,6 +126,12 @@ class Config: # Get options + ## Main + cnfSec = "Main" + if confParser.has_section(cnfSec): + if confParser.has_option(cnfSec,"theme"): + self.guiTheme = confParser.get(cnfSec,"theme") + ## Sizes cnfSec = "Sizes" if confParser.has_section(cnfSec): @@ -204,6 +210,7 @@ class Config: cnfSec = "Main" confParser.add_section(cnfSec) confParser.set(cnfSec,"timestamp", datetime.now().strftime("%Y-%m-%d %H:%M:%S")) + confParser.set(cnfSec,"theme", str(self.guiTheme)) ## Sizes cnfSec = "Sizes" diff --git a/sample/sampleNovel/nwProject.nwx b/sample/sampleNovel/nwProject.nwx index 4c1043a5..03750f32 100644 --- a/sample/sampleNovel/nwProject.nwx +++ b/sample/sampleNovel/nwProject.nwx @@ -1,5 +1,5 @@ - + Sample Project Sample Project diff --git a/tests/reference/novelwriter.conf b/tests/reference/novelwriter.conf index 9a7362e8..112f9fd8 100644 --- a/tests/reference/novelwriter.conf +++ b/tests/reference/novelwriter.conf @@ -1,5 +1,6 @@ [Main] timestamp = 2019-05-18 15:06:44 +theme = default [Sizes] geometry = 1100, 650