Skip to content

Commit 6a89a05

Browse files
committed
minimal fixes
1 parent e081ac1 commit 6a89a05

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/artisanlib/main.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -3899,12 +3899,11 @@ def reset(self,redraw=True,soundOn=True,sampling=False,keepProperties=False):
38993899
aw.qmc.dutycycleTX = 0.
39003900
aw.qmc.currentpidsv = 0.
39013901

3902-
# if there is already some data recorded, we remove the filename to force writing a new file
3902+
# we remove the filename to force writing a new file
39033903
# and avoid accidential overwriting of existing data
3904-
if len(self.timex) > 2:
3905-
#current file name
3906-
aw.curFile = None
3907-
aw.setWindowTitle(aw.windowTitle)
3904+
#current file name
3905+
aw.curFile = None
3906+
aw.setWindowTitle(aw.windowTitle)
39083907

39093908
# if on turn mouse crosslines off
39103909
if aw.qmc.crossmarker:
@@ -17989,7 +17988,8 @@ def setProfile(self,filename,profile,quiet=False):
1798917988
if "roastUUID" in profile:
1799017989
self.qmc.roastUUID = d(profile["roastUUID"])
1799117990
else:
17992-
self.qmc.roastUUID = None
17991+
self.qmc.roastUUID = uuid.uuid4().hex # generate UUID
17992+
self.qmc.safesaveflag = True
1799317993
if "roastbatchnr" in profile:
1799417994
try:
1799517995
self.qmc.roastbatchnr = int(profile["roastbatchnr"])
@@ -18197,6 +18197,7 @@ def setProfile(self,filename,profile,quiet=False):
1819718197
# we don't report errors on settingsLoad
1819818198
_, _, exc_tb = sys.exc_info()
1819918199
QMessageBox.information(aw,QApplication.translate("Error Message", "Exception:",None) + " setProfile()",str(ex) + "@line " + str(exc_tb.tb_lineno))
18200+
return False
1820018201

1820118202
# the int n specifies the number of digits
1820218203
def float2float(self,f,n=1):
@@ -30289,7 +30290,8 @@ def accept(self):
3028930290
if aw.plus_account is None and aw.qmc.plus_blend is not None and self.org_beans != aw.qmc.beans:
3029030291
aw.qmc.plus_blend = None
3029130292

30292-
aw.sendmessage(QApplication.translate("Message","Roast properties updated but profile not saved to disk", None))
30293+
if not aw.qmc.flagon:
30294+
aw.sendmessage(QApplication.translate("Message","Roast properties updated but profile not saved to disk", None))
3029330295
aw.qmc.redraw(recomputeAllDeltas=False)
3029430296
self.close()
3029530297

0 commit comments

Comments
 (0)