diff --git a/beampy/__init__.py b/beampy/__init__.py index b6e2336..db6a22d 100644 --- a/beampy/__init__.py +++ b/beampy/__init__.py @@ -29,7 +29,7 @@ # module from beampy import examples -__version__ = "0.0.1.3" +__version__ = "0.0.1.3.post1" def help(): diff --git a/beampy/user_interface.py b/beampy/user_interface.py index 60dda2a..0212539 100644 --- a/beampy/user_interface.py +++ b/beampy/user_interface.py @@ -126,8 +126,20 @@ def create_menu(self): :meth:`.open_file_name`, :meth:`.save_quick`, :meth:`.save_file_name`, :func:`.open_doc`. """ + folder = __file__ # Module name + # Replaces characters only when called from outer files + folder = folder.replace("\\", "/") + folder = folder.split("/") + folder = folder[:-1] # Remove the file name + folder2 = str() + + for line in folder: + folder2 = folder2+"/"+line + + folder = folder2[1:]+"/" + icon = QIcon() - icon.addFile('icons/beampy-logo.png', QSize(256, 256)) + icon.addFile(folder+'icons/beampy-logo.png', QSize(256, 256)) self.setWindowIcon(icon) menubar = self.menuBar() @@ -138,28 +150,28 @@ def create_menu(self): action.triggered.connect(self.open_file_name) action.setShortcut('Ctrl+O') icon = QIcon() - icon.addFile('icons/document-open.png', QSize(22, 22)) + icon.addFile(folder+'icons/document-open.png', QSize(22, 22)) action.setIcon(icon) action = file.addAction('Save') action.triggered.connect(self.save_quick) action.setShortcut('Ctrl+S') icon = QIcon() - icon.addFile('icons/document-save.png', QSize(22, 22)) + icon.addFile(folder+'icons/document-save.png', QSize(22, 22)) action.setIcon(icon) action = file.addAction('Save as') action.triggered.connect(self.save_file_name) action.setShortcut('Ctrl+Shift+S') icon = QIcon() - icon.addFile('icons/document-save-as.png', QSize(22, 22)) + icon.addFile(folder+'icons/document-save-as.png', QSize(22, 22)) action.setIcon(icon) action = file.addAction('Exit') # Clean exit for spyder action.setShortcut('Ctrl+Q') action.triggered.connect(QApplication.quit) icon = QIcon() - icon.addFile('icons/application-exit.png', QSize(22, 22)) + icon.addFile(folder+'icons/application-exit.png', QSize(22, 22)) action.setIcon(icon) file = menubar.addMenu('Help') @@ -167,7 +179,7 @@ def create_menu(self): action = file.addAction('Documentation') action.triggered.connect(open_doc) icon = QIcon() - icon.addFile('icons/help-about.png', QSize(22, 22)) + icon.addFile(folder+'icons/help-about.png', QSize(22, 22)) action.setIcon(icon) def calculate_guide(self, topology='array'):