Skip to content

Commit 80086ba

Browse files
authored
Add an CML option to clear the application cache (#160)
1 parent a96872c commit 80086ba

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@ can be used to generate images from the command line without opening the plotter
5959
```console
6060
$ openmc-plotter -b view1.pltvw view1.pltvw view1.pltvw
6161
```
62+
## Troubleshooting
63+
64+
Updates to the plotter can result in stale references to deprecated features. For example, it's possible that something like the following may appear after an update:
65+
66+
```
67+
AttributeError: 'MainWindow' object has no attribute 'shortcutOverlay'
68+
```
69+
70+
To address this, the application settings can be cleared, the plotter can be started with the `--clear-config` (or `-c`) to reset the application's settings cache on startup.
71+
72+
```bash
73+
$ openmc-plotter --clear-cache
74+
```
6275

6376
## Features
6477

openmc_plotter/__main__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def main():
2828
'XML files (default is current dir)')
2929
ap.add_argument('-b', '--batch-mode', nargs='+', default=False,
3030
help='View files used to generate plots in batch mode')
31+
ap.add_argument('-c', '--clear-config', action='store_true', default=False,
32+
help='Clear the Qt application configuration settings')
3133

3234
args = ap.parse_args()
3335

@@ -45,6 +47,10 @@ def run_app(user_args):
4547
app.setWindowIcon(QtGui.QIcon(path_icon))
4648
app.setAttribute(QtCore.Qt.AA_DontShowIconsInMenus, True)
4749

50+
if user_args.clear_config:
51+
settings = QtCore.QSettings()
52+
settings.clear()
53+
4854
splash_pix = QtGui.QPixmap(path_splash)
4955
splash = QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint)
5056
splash.setMask(splash_pix.mask())

0 commit comments

Comments
 (0)