Skip to content

Commit

Permalink
feat: Add VSKShellConnector to NavaleBinding and update MenuButton
Browse files Browse the repository at this point in the history
The code changes include adding the `VSKShellConnector` import statement to `navale_binding.py` and creating a new method `exec` in the `NavaleBinding` class. Additionally, the `openMenu` function in `MenuButton.vue` has been updated to call the `exec` method with the command `'hydriam'`.
  • Loading branch information
JoaquinDecima committed Jun 14, 2024
1 parent ca571e8 commit a542347
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/navale_binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
from Vasak.system.vsk_icon_manager import VSKIconManager
from Vasak.system.vsk_network_manager import VSKNetworkManager
from Vasak.application.vsk_shell_connector import VSKShellConnector
from PyQt6.QtCore import pyqtSlot, QObject

class NavaleBinding(QObject):
Expand All @@ -10,6 +11,7 @@ def __init__(self, window):
self.window = window
self.iconsManager = VSKIconManager()
self.networkManager = VSKNetworkManager()
self.shellConnector = VSKShellConnector()

@pyqtSlot(str, result=str)
def getGlobalIcon(self, iconName):
Expand All @@ -35,4 +37,8 @@ def getHome(self):

@pyqtSlot(str)
def toggleWindow(self, id):
self.window.toggleWindow(id)
self.window.toggleWindow(id)

@pyqtSlot(str)
def exec(self, command):
self.shellConnector.run(command)
2 changes: 1 addition & 1 deletion ui/src/components/button/MenuButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ref, onMounted, inject, computed } from 'vue'
const $vsk: any = inject('vsk')
const menuIcon = ref('')
const openMenu = (): void => {
console.log('hydriam')
$vsk.exec('hydriam')
}
const setIcon = async (): Promise<void> => {
menuIcon.value = await $vsk.getGlobalIcon('applications-all')
Expand Down

0 comments on commit a542347

Please sign in to comment.