Skip to content

Commit 24fdab3

Browse files
committed
- updates app name
- adds UI scale factor
1 parent 714163c commit 24fdab3

87 files changed

Lines changed: 58800 additions & 53486 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Info.plist

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<key>CFBundleDevelopmentRegion</key>
66
<string>en</string>
77
<key>CFBundleDisplayName</key>
8-
<string>Artisan</string>
8+
<string>artisan</string>
99
<key>CFBundleDocumentTypes</key>
1010
<array>
1111
<dict>
@@ -16,7 +16,7 @@
1616
<key>CFBundleTypeIconFile</key>
1717
<string>artisanProfile.icns</string>
1818
<key>CFBundleTypeName</key>
19-
<string>Artisan Profile</string>
19+
<string>artisan profile</string>
2020
<key>CFBundleTypeRole</key>
2121
<string>Editor</string>
2222
<key>LSTypeIsPackage</key>
@@ -32,7 +32,7 @@
3232
<key>CFBundleTypeIconFile</key>
3333
<string>artisanAlarms.icns</string>
3434
<key>CFBundleTypeName</key>
35-
<string>Artisan Alarms</string>
35+
<string>artisan alarms</string>
3636
<key>CFBundleTypeRole</key>
3737
<string>Editor</string>
3838
<key>LSTypeIsPackage</key>
@@ -48,7 +48,7 @@
4848
<key>CFBundleTypeIconFile</key>
4949
<string>artisanPalettes.icns</string>
5050
<key>CFBundleTypeName</key>
51-
<string>Artisan Palettes</string>
51+
<string>artisan palettes</string>
5252
<key>CFBundleTypeRole</key>
5353
<string>Editor</string>
5454
<key>LSTypeIsPackage</key>
@@ -64,7 +64,7 @@
6464
<key>CFBundleTypeIconFile</key>
6565
<string>artisanSettings.icns</string>
6666
<key>CFBundleTypeName</key>
67-
<string>Artisan Settings</string>
67+
<string>artisan settings</string>
6868
<key>CFBundleTypeRole</key>
6969
<string>Editor</string>
7070
<key>LSTypeIsPackage</key>
@@ -80,7 +80,7 @@
8080
<key>CFBundleTypeIconFile</key>
8181
<string>artisanWheel.icns</string>
8282
<key>CFBundleTypeName</key>
83-
<string>Artisan Wheel</string>
83+
<string>artisan wheel</string>
8484
<key>CFBundleTypeRole</key>
8585
<string>Editor</string>
8686
<key>LSTypeIsPackage</key>
@@ -96,7 +96,7 @@
9696
<key>CFBundleTypeIconFile</key>
9797
<string>artisanTheme.icns</string>
9898
<key>CFBundleTypeName</key>
99-
<string>Artisan Theme</string>
99+
<string>artisan theme</string>
100100
<key>CFBundleTypeRole</key>
101101
<string>Editor</string>
102102
<key>LSTypeIsPackage</key>
@@ -106,17 +106,17 @@
106106
</dict>
107107
</array>
108108
<key>CFBundleExecutable</key>
109-
<string>Artisan</string>
109+
<string>artisan</string>
110110
<key>CFBundleGetInfoString</key>
111-
<string>Artisan, Roast Logger</string>
111+
<string>artisan scope</string>
112112
<key>CFBundleIconFile</key>
113113
<string>artisan.icns</string>
114114
<key>CFBundleIdentifier</key>
115115
<string>org.artisan-scope.artisan</string>
116116
<key>CFBundleInfoDictionaryVersion</key>
117117
<string>6.0</string>
118118
<key>CFBundleName</key>
119-
<string>Artisan</string>
119+
<string>artisan</string>
120120
<key>CFBundlePackageType</key>
121121
<string>APPL</string>
122122
<key>CFBundleShortVersionString</key>

src/artisan-linux.spec

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,41 @@ EXCLUDES = [
5252
'hypothesis',
5353
'tornado',
5454
'pkg_resources',
55+
'setuptools',
56+
'curses',
57+
'matplotlib.tests',
58+
'numpy.tests',
59+
'scipy.tests',
60+
'numpy.lib.tests',
61+
'numpy.ma.tests',
62+
'numpy.matrixlib.tests',
63+
'numpy.polynomial.tests',
64+
'numpy.random.tests',
65+
'numpy.testing.tests',
66+
'numpy.typing.tests',
67+
'scipy._lib.tests',
68+
'scipy.constants.tests',
69+
'scipy.datasets.tests',
70+
'scipy.fft.tests',
71+
'scipy.fftpack.tests',
72+
'scipy.integrate._ivp.tests',
73+
'scipy.interpolate.tests',
74+
'scipy.io._harwell_boeing.tests',
75+
'scipy.io.arff.tests',
76+
'scipy.io.matlab.tests',
77+
'scipy.io.tests',
78+
'scipy.linalg.tests',
79+
'scipy.ndimage.tests',
80+
'scipy.odr.tests',
81+
'scipy.optimize.tests',
82+
'scipy.signal.tests',
83+
'scipy.sparse.linalg._isolve.tests',
84+
'scipy.sparse.linalg.tests',
85+
'scipy.sparse.tests',
86+
'scipy.spatial.tests',
87+
'scipy.spatial.transform.tests',
88+
'scipy.special.tests',
89+
'scipy.stats.tests',
5590
'PyQt5',
5691
'PyQt6.Multimedia',
5792
'PyQt6.Network',
@@ -63,15 +98,15 @@ EXCLUDES = [
6398
'PyQt6.QtTest',
6499
'PyQt6.QtTextToSpeech',
65100
# the following are required by QtWebEngineWidgets and thus by QtWebEngine for the HTML2PDF export
66-
# 'PyQt6.QtQuick',
67-
# 'PyQt6.QtQml',
68-
# 'PyQt6.QtQmlMeta',
69-
# 'PyQt6.QtQmlModels',
70-
# 'PyQt6.QtQmlWorkerScript',
71-
# 'PyQt6.OpenGL',
72-
# 'PyQt6.QtWebChannel',
73-
# 'PyQt6.QtPositioning',
74-
# 'PyQt6.QtWebEngineQuick'
101+
'PyQt6.QtQuick',
102+
'PyQt6.QtQml',
103+
'PyQt6.QtQmlMeta',
104+
'PyQt6.QtQmlModels',
105+
'PyQt6.QtQmlWorkerScript',
106+
'PyQt6.OpenGL',
107+
'PyQt6.QtWebChannel',
108+
'PyQt6.QtPositioning',
109+
'PyQt6.QtWebEngineQuick'
75110
]
76111

77112

src/artisan-mac.spec

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,13 @@ a = Analysis(['artisan.py'],
149149
hookspath=[],
150150
runtime_hooks=['./pyinstaller_hooks/rthooks/pyi_rth_mplconfig.py'], # overwrites default MPL runtime hook which keeps loading font cache from (new) temp directory
151151
additional_hooks_dir=[],
152-
excludes= ['tkinter', 'mypy', 'hypothesis', 'tornado', 'pkg_resources'],
152+
excludes=['tkinter', 'mypy', 'hypothesis', 'tornado', 'pkg_resources', 'setuptools', 'curses', 'matplotlib.tests', 'numpy.tests',
153+
'scipy.tests', 'numpy.lib.tests', 'numpy.ma.tests', 'numpy.matrixlib.tests', 'numpy.polynomial.tests', 'numpy.random.tests',
154+
'numpy.testing.tests', 'numpy.typing.tests', 'scipy._lib.tests', 'scipy.constants.tests', 'scipy.datasets.tests', 'scipy.fft.tests',
155+
'scipy.fftpack.tests', 'scipy.integrate._ivp.tests', 'scipy.interpolate.tests', 'scipy.io._harwell_boeing.tests', 'scipy.io.arff.tests',
156+
'scipy.io.matlab.tests', 'scipy.io.tests', 'scipy.linalg.tests', 'scipy.ndimage.tests', 'scipy.odr.tests', 'scipy.optimize.tests',
157+
'scipy.signal.tests', 'scipy.sparse.linalg._isolve.tests', 'scipy.sparse.linalg.tests', 'scipy.sparse.tests', 'scipy.spatial.tests',
158+
'scipy.spatial.transform.tests', 'scipy.special.tests', 'scipy.stats.tests'],
153159
win_no_prefer_redirects=False,
154160
win_private_assemblies=False,
155161
cipher=block_cipher,
@@ -165,7 +171,7 @@ exe = EXE(pyz,
165171
a.datas if onefile else [],
166172
options=[], # runtime python options
167173
exclude_binaries=not onefile,
168-
name='Artisan',
174+
name='artisan',
169175
debug=False,
170176
bootloader_ignore_signals=False,
171177
strip=True, # not recommended for Windows
@@ -188,11 +194,11 @@ except Exception: # pylint: disable=broad-except
188194
plist = {}
189195
with open('Info.plist', 'rb') as infile:
190196
plist = plistlib.load(infile)
191-
plist.update({ 'CFBundleDisplayName': 'Artisan',
192-
'CFBundleGetInfoString': 'Artisan, Roast Logger',
197+
plist.update({ 'CFBundleDisplayName': 'artisan',
198+
'CFBundleGetInfoString': 'artisan scope',
193199
'CFBundleIdentifier': 'org.artisan-scope.artisan',
194200
'CFBundleShortVersionString': VERSION,
195-
'CFBundleVersion': 'Artisan ' + VERSION,
201+
'CFBundleVersion': 'artisan ' + VERSION,
196202
'LSMinimumSystemVersion': minimumSystemVersion,
197203
'LSMultipleInstancesProhibited': False,
198204
'LSArchitecturePriority': ['x86_64'],
@@ -218,14 +224,14 @@ if not onefile:
218224
bundle_obj = coll
219225

220226
app = BUNDLE(bundle_obj,
221-
name='Artisan.app',
227+
name='artisan.app',
222228
icon='artisan.icns',
223229
bundle_identifier='org.artisan-scope.artisan',
224230
info_plist=plist)
225231

226232
#------
227233

228-
subprocess.check_call(r'mv dist/Artisan.app/Contents/Resources/translations dist/Artisan.app/Contents/',shell = True)
234+
subprocess.check_call(r'mv dist/artisan.app/Contents/Resources/translations dist/artisan.app/Contents/',shell = True)
229235
subprocess.check_call(r'rm -rf dist/Test/_internal/babel/*',shell = True) # unclear: without this line, the next fails
230236
subprocess.check_call(r'rm -rf dist/Test',shell = True)
231237
subprocess.check_call(r'cp README.txt dist',shell = True)
@@ -238,7 +244,7 @@ subprocess.check_call(r'cp Wheels/Cupping/* dist/Wheels/Cupping',shell = True)
238244
subprocess.check_call(r'cp Wheels/Other/* dist/Wheels/Other',shell = True)
239245
subprocess.check_call(r'cp Wheels/Roasting/* dist/Wheels/Roasting',shell = True)
240246
try:
241-
subprocess.check_call('rm -rf dist/Artisan.app/Contents/Resources/matplotlib/mpl-data/sample_data',shell = True)
247+
subprocess.check_call('rm -rf dist/artisan.app/Contents/Resources/matplotlib/mpl-data/sample_data',shell = True)
242248
except Exception: # pylint: disable=broad-except
243249
pass
244250

@@ -247,7 +253,7 @@ os.chdir('./dist')
247253

248254
# add localization stubs to make macOS translate the systems menu item and native dialogs
249255
for lang in SUPPORTED_LANGUAGES:
250-
loc_dir = r'Artisan.app/Contents/Resources/' + lang + r'.lproj'
256+
loc_dir = r'artisan.app/Contents/Resources/' + lang + r'.lproj'
251257
subprocess.check_call(r'mkdir ' + loc_dir,shell = True)
252258
subprocess.check_call(r'touch ' + loc_dir + r'/Localizable.string',shell = True)
253259

@@ -298,7 +304,7 @@ qt_plugin_files = [
298304
]
299305

300306
## remove unused Qt frameworks libs (not in Qt_modules_frameworks)
301-
for subdir, dirs, _files in os.walk('./Artisan.app/Contents/Frameworks/PyQt6/Qt6/lib'):
307+
for subdir, dirs, _files in os.walk('./artisan.app/Contents/Frameworks/PyQt6/Qt6/lib'):
302308
for di in dirs:
303309
if di.startswith('Qt') and di.endswith('.framework') and di not in Qt_frameworks:
304310
file_path = os.path.join(subdir, di)
@@ -307,7 +313,7 @@ for subdir, dirs, _files in os.walk('./Artisan.app/Contents/Frameworks/PyQt6/Qt6
307313

308314

309315
## remove unused plugins
310-
for root, dirs, _ in os.walk('./Artisan.app/Contents/Frameworks/PyQt6/Qt6/plugins'):
316+
for root, dirs, _ in os.walk('./artisan.app/Contents/Frameworks/PyQt6/Qt6/plugins'):
311317
for d in dirs:
312318
if d not in qt_plugin_dirs:
313319
print(f'rm -rf {os.path.join(root,d)}')
@@ -320,11 +326,11 @@ for root, dirs, _ in os.walk('./Artisan.app/Contents/Frameworks/PyQt6/Qt6/plugin
320326
print(f'rm -rf {file_path}')
321327
subprocess.check_call(f'rm -rf {file_path}',shell = True)
322328

323-
subprocess.check_call(r'rm -rf ./Artisan.app/Contents/Frameworks/PyQt6/Qt6/qml',shell = True)
329+
subprocess.check_call(r'rm -rf ./artisan.app/Contents/Frameworks/PyQt6/Qt6/qml',shell = True)
324330

325331

326332

327-
rootdir = f'./Artisan.app/Contents/Resources'
333+
rootdir = f'./artisan.app/Contents/Resources'
328334

329335
# remove Qt artefacts
330336
for qt_dir in [
@@ -362,9 +368,9 @@ for qt_dir in ['PyQt6/Qt6/translations']:
362368

363369
print('*** Fix symbolic link to Qt translations ***')
364370
# remove Framework/translations symbolic link to translations -> Resources/translations
365-
subprocess.check_call(f'unlink ./Artisan.app/Contents/Frameworks/translations',shell = True)
371+
subprocess.check_call(f'unlink ./artisan.app/Contents/Frameworks/translations',shell = True)
366372
# add symbolic link Frameworks/translations -> Resources/PyQt6/Qt6/translations
367-
os.symlink(f'../Resources/PyQt6/Qt6/translations', f'./Artisan.app/Contents/Frameworks/translations')
373+
os.symlink(f'../Resources/PyQt6/Qt6/translations', f'./artisan.app/Contents/Frameworks/translations')
368374

369375

370376
print('*** Removing unused files ***')
@@ -410,7 +416,7 @@ for root, dirs, files in os.walk('.'):
410416

411417
print('*** Removing unused language support from babel ***')
412418

413-
for root, _, files in os.walk(f'./Artisan.app/Contents/Resources/babel/locale-data'):
419+
for root, _, files in os.walk(f'./artisan.app/Contents/Resources/babel/locale-data'):
414420
for file in files:
415421
if (file.endswith('.dat') and
416422
file != 'root.dat' and not (file.startswith('zh') and file.endswith('.dat')) and
@@ -422,7 +428,7 @@ for root, _, files in os.walk(f'./Artisan.app/Contents/Resources/babel/locale-da
422428

423429
print('*** Removing mypy completely ***')
424430
try:
425-
subprocess.check_call(f'rm -rf ./Artisan.app/Contents/Frameworks/mypy',shell = True)
431+
subprocess.check_call(f'rm -rf ./artisan.app/Contents/Frameworks/mypy',shell = True)
426432
except Exception: # pylint: disable=broad-except
427433
pass
428434

src/artisan-win.spec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,13 @@ a = Analysis(['artisan.py'],
158158
hookspath=[],
159159
runtime_hooks=[r'pyinstaller_hooks\rthooks\pyi_rth_mplconfig.py'], # overwrites default MPL runtime hook which keeps loading font cache from (new) temp directory
160160
additional_hooks_dir=[],
161-
excludes=['tkinter', 'mypy', 'hypothesis', 'tornado', 'pkg_resources'],
161+
excludes=['tkinter', 'mypy', 'hypothesis', 'tornado', 'pkg_resources', 'setuptools', 'curses', 'matplotlib.tests', 'numpy.tests',
162+
'scipy.tests', 'numpy.lib.tests', 'numpy.ma.tests', 'numpy.matrixlib.tests', 'numpy.polynomial.tests', 'numpy.random.tests',
163+
'numpy.testing.tests', 'numpy.typing.tests', 'scipy._lib.tests', 'scipy.constants.tests', 'scipy.datasets.tests', 'scipy.fft.tests',
164+
'scipy.fftpack.tests', 'scipy.integrate._ivp.tests', 'scipy.interpolate.tests', 'scipy.io._harwell_boeing.tests', 'scipy.io.arff.tests',
165+
'scipy.io.matlab.tests', 'scipy.io.tests', 'scipy.linalg.tests', 'scipy.ndimage.tests', 'scipy.odr.tests', 'scipy.optimize.tests',
166+
'scipy.signal.tests', 'scipy.sparse.linalg._isolve.tests', 'scipy.sparse.linalg.tests', 'scipy.sparse.tests', 'scipy.spatial.tests',
167+
'scipy.spatial.transform.tests', 'scipy.special.tests', 'scipy.stats.tests'],
162168
hiddenimports=hiddenimports_list,
163169
win_no_prefer_redirects=False,
164170
win_private_assemblies=False,

src/artisanlib/cup_profile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(self, parent:'QWidget', aw:'ApplicationWindow') -> None:
7171

7272
defaultlabel = QLabel(QApplication.translate('Label','Default'))
7373
self.defaultcombobox = QComboBox()
74-
self.defaultcombobox.addItems(['','Artisan','SCA','SCAA','CQI','SweetMarias','C','E','CoffeeGeek','Intelligentsia','IIAC','WCRC','*CUSTOM*'])
74+
self.defaultcombobox.addItems(['','artisan','SCA','SCAA','CQI','SweetMarias','C','E','CoffeeGeek','Intelligentsia','IIAC','WCRC','*CUSTOM*'])
7575
self.defaultcombobox.setCurrentIndex(0)
7676
self.lastcomboboxIndex = 0
7777
self.defaultcombobox.currentIndexChanged.connect(self.setdefault)
@@ -328,7 +328,7 @@ def setdefault(self,_:int) -> None:
328328
# store the current labels as *CUSTOM*
329329
self.aw.qmc.customflavorlabels = self.aw.qmc.flavorlabels
330330
dindex = self.defaultcombobox.currentIndex()
331-
#["","Artisan","SCAA","CQI","SweetMarias","C","E","coffeegeek","Intelligentsia","WCRC"]
331+
#["","artisan","SCAA","CQI","SweetMarias","C","E","coffeegeek","Intelligentsia","WCRC"]
332332
if dindex > 0 or dindex < self.defaultcombobox.count()-1:
333333
self.aw.qmc.flavorstartangle = 90
334334
if dindex == 1:

src/artisanlib/curves.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ def __init__(self, parent:QWidget, aw:'ApplicationWindow', activeTab:int = 0) ->
339339
self.org_foregroundShowFullflag = self.aw.qmc.foregroundShowFullflag
340340
self.org_LCDdecimalplaces = self.aw.qmc.LCDdecimalplaces
341341
self.org_percent_decimals = self.aw.percent_decimals
342+
self.org_qt_scale_factor = self.aw.qt_scale_factor
342343

343344
#delta ET
344345
self.DeltaET = QCheckBox()
@@ -1229,6 +1230,15 @@ def __init__(self, parent:QWidget, aw:'ApplicationWindow', activeTab:int = 0) ->
12291230
self.soundCheck.setChecked(bool(self.aw.soundflag))
12301231
self.soundCheck.setFocusPolicy(Qt.FocusPolicy.NoFocus)
12311232
self.soundCheck.stateChanged.connect(self.soundset) #toggle
1233+
scaleFactorLabel = QLabel(QApplication.translate('Label','Scale Factor'))
1234+
scaleFactorLabel.setToolTip(QApplication.translate('Tooltip','User interface scaling factor'))
1235+
self.scalefactorSpinBox = MyQDoubleSpinBox()
1236+
self.scalefactorSpinBox.setToolTip(QApplication.translate('Tooltip','User interface scaling factor'))
1237+
self.scalefactorSpinBox.setDecimals(2)
1238+
self.scalefactorSpinBox.setSingleStep(0.05)
1239+
self.scalefactorSpinBox.setRange(0.8,1.4)
1240+
self.scalefactorSpinBox.setValue(self.aw.qt_scale_factor)
1241+
self.scalefactorSpinBox.setAlignment(Qt.AlignmentFlag.AlignRight)
12321242
self.glowCheck = QCheckBox(QApplication.translate('CheckBox', 'Glow'))
12331243
self.glowCheck.setChecked(bool(self.aw.qmc.glow))
12341244
self.glowCheck.setFocusPolicy(Qt.FocusPolicy.NoFocus)
@@ -1241,6 +1251,8 @@ def __init__(self, parent:QWidget, aw:'ApplicationWindow', activeTab:int = 0) ->
12411251
notifyLayout.addSpacing(15)
12421252
notifyLayout.addWidget(self.soundCheck)
12431253
notifyLayout.addStretch()
1254+
notifyLayout.addWidget(scaleFactorLabel)
1255+
notifyLayout.addWidget(self.scalefactorSpinBox)
12441256
appLayout1 = QHBoxLayout()
12451257
appLayout1.addLayout(pathEffectsLayout)
12461258
appLayout1.addStretch()
@@ -2608,6 +2620,7 @@ def close(self) -> bool:
26082620
self.aw.qmc.foregroundShowFullflag = self.org_foregroundShowFullflag
26092621
self.aw.qmc.LCDdecimalplaces = self.org_LCDdecimalplaces
26102622
self.aw.percent_decimals = self.org_percent_decimals
2623+
self.aw.qt_scale_factor = self.org_qt_scale_factor
26112624

26122625
self.aw.setFonts(False)
26132626
self.aw.qmc.resetlinecountcaches()
@@ -2685,5 +2698,26 @@ def updatetargets(self) -> None:
26852698
else:
26862699
self.aw.qmc.redraw_keep_view(recomputeAllDeltas=True, re_smooth_background=True)
26872700

2701+
self.aw.qt_scale_factor = self.scalefactorSpinBox.value()
2702+
if self.aw.qt_scale_factor != self.org_qt_scale_factor:
2703+
msg:str = QApplication.translate('Tooltip','Scaling factor changed')
2704+
text:str = QApplication.translate('Tooltip','Restart the app for the change to take effect')
2705+
# native dialog
2706+
if platform.system() == 'Darwin':
2707+
mbox = QMessageBox() # only without super this one shows the native dialog on macOS under Qt 6.6.2
2708+
# for native dialogs, text and informativetext need to be plain strings, no RTF incl. HTML instructions like <br>
2709+
mbox.setText(msg)
2710+
mbox.setInformativeText(text)
2711+
mbox.setWindowModality(Qt.WindowModality.ApplicationModal) # for native dialog it has to be ApplicationModal
2712+
mbox.setStandardButtons(QMessageBox.StandardButton.Ok)
2713+
mbox.setDefaultButton(QMessageBox.StandardButton.Ok)
2714+
mbox.exec()
2715+
else:
2716+
# non-native dialog
2717+
QMessageBox.warning(None, #self, # only without super this one shows the native dialog on macOS under Qt 6.6.2 and later
2718+
msg,text,
2719+
QMessageBox.StandardButton.Ok, QMessageBox.StandardButton.Ok)
2720+
2721+
26882722
# self.aw.closeEventSettings()
26892723
self.accept()

0 commit comments

Comments
 (0)