Browse Source

adopt to new build system

master
Nils 8 months ago
parent
commit
0d82fa3342
4 changed files with 13 additions and 15 deletions
  1. +1
    -0
      __main__.py
  2. +0
    -9
      exampleClientCboxQtNsm
  3. +1
    -0
      exampleClientCboxQtNsm
  4. +11
    -6
      qtgui/mainwindow.py

+ 1
- 0
__main__.py View File

@@ -0,0 +1 @@
template/main.py.template

+ 0
- 9
exampleClientCboxQtNsm View File

@@ -1,9 +0,0 @@
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

from template import start #Executes various start up checks and sets up our environment likes search paths

from qtgui import mainwindow #which in turn imports the engine and starts the engine
with start.profiler():
mainwindow.MainWindow().qtApp.exec_()
#Program is over. Code here does not get executed. Quit is done via NSM in mainWindow._nsmQuit

+ 1
- 0
exampleClientCboxQtNsm View File

@@ -0,0 +1 @@
template/launcher.template

+ 11
- 6
qtgui/mainwindow.py View File

@@ -51,15 +51,15 @@ class MainWindow(TemplateMainWindow):
#We use injection into the class and not a parameter because this dialog gets shown by creating an object. We can't give the parameters when this is shown via the mainWindow menu.
About.didYouKnow = [
QtCore.QCoreApplication.translate("About", "This is an example application. Extend it to your liking. Start by editing config.py")
] + About.didYouKnow
] + About.didYouKnow
super().__init__()

#New menu entries and template-menu overrides
self.menu.connectMenuEntry("actionAbout", lambda: print("About Dialog Menu deactivated")) #deactivates the original function
self.menu.addMenuEntry("menuEdit", "actionNils", "Nils", lambda: print("Merle"))
self.menu.connectMenuEntry("actionNils", lambda: print("Perle"))
self.menu.connectMenuEntry("actionNils", lambda: print("Perle"))
self.start() #This shows the GUI, or not, depends on the NSM gui save setting. We need to call that after the menu, otherwise the about dialog will block and then we get new menu entries, which looks strange.

def dropEvent(self, event):
@@ -68,10 +68,10 @@ class MainWindow(TemplateMainWindow):

Having that function in the mainWindow will not make drops available for subwindows
like About or UserManual. """
if True: # remove if you want to handle file drops
if True: # remove if you want to handle file drops
for url in event.mimeData().urls():
print ("TODO: Enable this function", url)

for url in event.mimeData().urls():
filePath = url.toLocalFile()
@@ -79,3 +79,8 @@ class MainWindow(TemplateMainWindow):
if os.path.isfile(filePath) and filePath.lower().endswith(".sf2"):
linkedPath = self.nsmClient.importResource(filePath)
print ("linked sf2 into", linkedPath)

def zoom(self, scaleFactor:float):
pass
def stretchXCoordinates(self, factor):
pass

Loading…
Cancel
Save