diff --git a/QtPyHammer/ops/__init__.py b/QtPyHammer/ops/__init__.py index 87c0ebd..bb6ed2c 100644 --- a/QtPyHammer/ops/__init__.py +++ b/QtPyHammer/ops/__init__.py @@ -7,7 +7,6 @@ filename_filters = ["Valve Map Format (*.vmf)", - "QtPyHammer file (*.qph)", "All files (*.*)"] # TODO: write a common function for detecting if files / folders exist diff --git a/QtPyHammer/ui/core.py b/QtPyHammer/ui/core.py index b5ba7bf..a43bf9e 100644 --- a/QtPyHammer/ui/core.py +++ b/QtPyHammer/ui/core.py @@ -14,7 +14,6 @@ class MainWindow(QtWidgets.QMainWindow): def __init__(self, parent=None): super(QtWidgets.QMainWindow, self).__init__(parent) global current_dir - self.setWindowIcon(QtGui.QIcon('HammerLogo.png')) self.setWindowTitle("QtPyHammer - Fork") self.setMinimumSize(640, 480) self.setTabPosition(QtCore.Qt.TopDockWidgetArea, QtWidgets.QTabWidget.North) @@ -387,10 +386,9 @@ def open(self, filename): # allows loading via drag & drop short_filename = os.path.basename(filename) if extension == ".vmf": tab = workspace.VmfTab(filename, new=False, parent=self) - elif extension == ".qph": - raise NotImplementedError("No .qph viewport tabs yet") - # tab = workspace.QphTab(filename, new=False, parent=self) + self.tabs.addTab(tab, short_filename) + self.tabs.setCurrentIndex(self.tabs.count() - 1) else: - raise RuntimeError(f"{filename} is not a .vmf file") - self.tabs.addTab(tab, short_filename) - self.tabs.setCurrentIndex(self.tabs.count() - 1) + not_vmf_popup = popup.browser(parent=self, popuptext="Error", msgtext=f"{filename} is not a .vmf file") + not_vmf_popup.show() + pass diff --git a/QtPyHammer/utilities/lang.py b/QtPyHammer/utilities/lang.py index 57db017..14dfcfe 100644 --- a/QtPyHammer/utilities/lang.py +++ b/QtPyHammer/utilities/lang.py @@ -8,7 +8,7 @@ def setLanguage(language): def langFile(language=usingLanguage): match(language): case "english": - return "File" + return "&File" case "spanish": return "Archivo" case "russian": @@ -19,7 +19,7 @@ def langFile(language=usingLanguage): def langEdit(language=usingLanguage): match(language): case "english": - return "Edit" + return "&Edit" case "spanish": return "Editar" case "russian": @@ -30,7 +30,7 @@ def langEdit(language=usingLanguage): def langTools(language=usingLanguage): match(language): case "english": - return "Tools" + return "&Tools" case "spanish": return "Herramientas" case "russian": diff --git a/hammer.py b/hammer.py index 5662249..e4dc418 100644 --- a/hammer.py +++ b/hammer.py @@ -2,7 +2,7 @@ import sys import valvefgd -from PyQt5 import QtCore, QtWidgets +from PyQt5 import QtCore, QtGui, QtWidgets from QtPyHammer.ui.core import MainWindow from QtPyHammer.ui.user_preferences.theme import load_theme @@ -22,6 +22,7 @@ class QtPyHammerApp(QtWidgets.QApplication): # -- QtWidgets.QApplication.instance() def __init__(self, argv): super(QtWidgets.QApplication, self).__init__(argv) + self.setWindowIcon(QtGui.QIcon('HammerLogo.png')) self.folder = os.path.dirname(__file__) self.preferences = load_ini("configs/preferences.ini") game = self.preferences.value("Game", "Team Fortress 2")