aboutsummaryrefslogtreecommitdiffstats
path: root/muddle
diff options
context:
space:
mode:
authorNao Pross <np@0hm.ch>2020-11-13 01:33:21 +0100
committerNao Pross <np@0hm.ch>2020-11-13 01:33:21 +0100
commit89d284fa5dbc921f4fb2695901fa7b678de3d01b (patch)
treefc8def35d4904d3ecce83c9b7dfef8f62e836117 /muddle
parentTemporary fix for missing autotristate bug (diff)
downloadMuddle-89d284fa5dbc921f4fb2695901fa7b678de3d01b.tar.gz
Muddle-89d284fa5dbc921f4fb2695901fa7b678de3d01b.zip
Load config data into config tab
Diffstat (limited to '')
-rw-r--r--muddle.ini.example3
-rw-r--r--muddle.py8
-rw-r--r--muddle.ui43
3 files changed, 46 insertions, 8 deletions
diff --git a/muddle.ini.example b/muddle.ini.example
index 6a1c2f0..cabcd05 100644
--- a/muddle.ini.example
+++ b/muddle.ini.example
@@ -1,3 +1,6 @@
[server]
url = https://moodle.rj.ost.ch
token = <your token here>
+
+[muddle]
+always_run_gui = false
diff --git a/muddle.py b/muddle.py
index b1dc7f1..c7adbab 100644
--- a/muddle.py
+++ b/muddle.py
@@ -117,6 +117,10 @@ log.debug(f"reading config file {config_file}")
config = configparser.ConfigParser()
config.read(config_file)
+# runtime data that should NOT be written
+config.add_section("runtime_data")
+config["runtime_data"]["config_path"] = str(config_file)
+
# S T A R T
@@ -129,5 +133,5 @@ are welcome to redistribute it under certain conditions; see LICENSE.txt for
details. Project repository: https://github.com/NaoPross/Muddle
""")
-if args.gui:
- gui.start(config["server"]["url"], config["server"]["token"])
+if args.gui or config.getboolean("muddle", "always_run_gui"):
+ gui.start(config)
diff --git a/muddle.ui b/muddle.ui
index 02dbae5..ccd98bc 100644
--- a/muddle.ui
+++ b/muddle.ui
@@ -92,6 +92,12 @@
<property name="enabled">
<bool>true</bool>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Select</string>
</property>
@@ -153,7 +159,11 @@
</widget>
</item>
<item row="0" column="1">
- <widget class="QLineEdit" name="instanceUrlEdit"/>
+ <widget class="QLineEdit" name="instanceUrlEdit">
+ <property name="clearButtonEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="tokenLabel">
@@ -163,7 +173,21 @@
</widget>
</item>
<item row="1" column="1">
- <widget class="QLineEdit" name="tokenEdit"/>
+ <widget class="QLineEdit" name="tokenEdit">
+ <property name="clearButtonEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QPushButton" name="requestTokenBtn">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Request Token</string>
+ </property>
+ </widget>
</item>
</layout>
</widget>
@@ -195,16 +219,23 @@
</property>
</widget>
</item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="defaltDownloadPathEdit">
+ <property name="placeholderText">
+ <string>Not set</string>
+ </property>
+ <property name="clearButtonEnabled">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
<item row="2" column="1">
- <widget class="QCheckBox" name="checkBox">
+ <widget class="QCheckBox" name="alwaysStartGuiCheckBox">
<property name="text">
<string>Always start GUI</string>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="defaltDownloadPathEdit"/>
- </item>
</layout>
</widget>
</item>