Skip to content

Commit

Permalink
Update 20.06.06_b1700
Browse files Browse the repository at this point in the history
- add automatic theme support
- various little fixes
  • Loading branch information
Blacky_BPG committed Jun 6, 2020
1 parent a06b2af commit 4677039
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 24 deletions.
1 change: 0 additions & 1 deletion L10n/de.strings
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
"Jumps" = "Jumps";
"Distance/Hour:" = "Distanz/Stunde:";
"Overall dist.:" = "Gesamtdistanz:";
"Dark Theme" = "Dunkles Design";
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ Die Zeit die ein Profil gespielt wurde sowie aktuelle Sprungdistanz und die Anza

## Wichtiges

Das Plugin erkennt nicht automatisch welches Design (Theme) man in EDMC aktiviert hat, weshalb es eine Optionsseite mit der möglichkeit der Designwahl für das Plugin gibt.

![EDMC Optionen](edmc_options_jumpspeed.png)
~~Das Plugin erkennt nicht automatisch welches Design (Theme) man in EDMC aktiviert hat, weshalb es eine Optionsseite mit der möglichkeit der Designwahl für das Plugin gibt.~~


## Weiteres
Expand Down
Binary file removed edmc_options_jumpspeed.png
Binary file not shown.
26 changes: 6 additions & 20 deletions load.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
except ImportError:
config = dict()

APP_VERSION = "20.04.26_b0049"
APP_VERSION = "20.06.06_b1700"

CFG_DISTANCE = "JumpSpeed_distance"
CFG_JUMPS = "JumpSpeed_jumps"
CFG_TIME = "JumpSpeed_time"
CFG_DESIGN = "JumpSpeed_design"
COLOR_NORM = ("#000000", "#80FFFF")
CFG_DESIGN = "theme"
COLOR_NORM = ("#000000", "#80FFFF", "#80FFFF")


class Jump(object):
Expand Down Expand Up @@ -74,8 +74,8 @@ def load(self):
"""
Load saved distance from config
"""
if config.get(CFG_DESIGN):
self.appdesign = int(config.get(CFG_DESIGN))
if config.getint(CFG_DESIGN):
self.appdesign = config.getint(CFG_DESIGN)
else:
self.appdesign = 0

Expand Down Expand Up @@ -249,25 +249,11 @@ def update_jumpspeed_dist(self):
self.distnow_widget.after(0, self.distnow_widget.config, {"text": msgnow})


def plugin_prefs(parent, cmdr, is_beta):
if config.get(CFG_DESIGN) != None:
this.appdesign = tk.IntVar(value=config.get(CFG_DESIGN))
else:
this.appdesign = tk.IntVar(value=0)

frame = nb.Frame(parent)
nb.Label(frame, text="JumpSpeed-EDMC Version: {INSTALLED}\n".format(INSTALLED=APP_VERSION)).grid(padx=10, sticky=tk.W)
nb.Checkbutton(frame, text=_("Dark Theme").encode('utf-8'), variable=this.appdesign, onvalue = 1, offvalue = 0).grid(padx=10, pady = 3, sticky=tk.W)
return frame


def prefs_changed(cmdr, is_beta):
jumpspeed = this.jumpspeed
jumpspeed.appdesign = int(this.appdesign.get())
config.set(CFG_DESIGN, str(jumpspeed.appdesign))
jumpspeed.appdesign = config.getint(CFG_DESIGN)
jumpspeed.update_window()


def plugin_start():
jumpspeed = JumpSpeed()
jumpspeed.load()
Expand Down

0 comments on commit 4677039

Please sign in to comment.