Skip to content

Commit

Permalink
Merge pull request #186 from nodedge/fix/fix-open-config
Browse files Browse the repository at this point in the history
In Dats, fix open json configuration
  • Loading branch information
nodedge committed Mar 17, 2023
2 parents 9ff9541 + da4dbbe commit fc7b813
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nodedge/dats/dats_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, parent=None):
self.createActions()
self.createMenus()

self.statusBar().showMessage("Welcome in Dats", timeout=5000)
self.statusBar().showMessage("Welcome to Dats", timeout=5000)
self.statusBar().show()

self._configPath = ""
Expand Down Expand Up @@ -702,7 +702,9 @@ def openLog(self, filename=None):
self.updateDataItems(log)
self.modifiedConfig = True

self.addToRecentFiles(filename)
if log is not None:
self.addToRecentFiles(filename)

if len(self.workbooksTabWidget.workbooks) == 0:
self.addWorkbook()

Expand Down
16 changes: 16 additions & 0 deletions nodedge/dats/logs_list_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def openLog(self, filename) -> Optional[MDF]:

else:
logging.warning("Cannot open this extension")
self.unsupportedMessageWarning()
return None

self.addLog(log, shortname)
Expand Down Expand Up @@ -228,6 +229,21 @@ def eventFilter(self, source, event):
return True
return super().eventFilter(source, event)

def unsupportedMessageWarning(self) -> None:
"""
Unsupported message warning.
Shows a message box saying that the data format is not supported.
:return: ``None``
"""
res = QMessageBox.warning(
self,
"Unsupported file format",
"This data file format is not supported yet. "
"For further information, please refer to Nodedge documentation.",
)


def remove_dummy_char_from_string(string, dummy_char=DUMMY_CHAR):
"""
Expand Down

0 comments on commit fc7b813

Please sign in to comment.