added psuitl and additonal includes

This commit is contained in:
Fredrcik W. Warren 2024-05-26 20:49:53 -06:00
parent 8246f11ad6
commit 83914fa353
2 changed files with 32 additions and 8 deletions

View File

@ -1,7 +1,10 @@
#!/bin/env python #!/bin/env python
import os import os
import psutil
import PySimpleGUI as sg import PySimpleGUI as sg
import subprocess
import time
""" """
Pismotek-Remote - Remote Desktop Application Pismotek-Remote - Remote Desktop Application
@ -31,6 +34,8 @@ layout1 = [
layout2 = [ layout2 = [
[sg.Text('Remote connection started')], [sg.Text('Remote connection started')],
[sg.Text('Allow connection through firewall if asked.')],
[sg.Text('')],
[sg.Text('Click Exit when finished')], [sg.Text('Click Exit when finished')],
] ]
@ -51,22 +56,30 @@ layout = [
] ]
def vncdisconnect():
print("Starting TightVNC")
subprocess.call("tvnserver.exe -run", shell=True)
time.sleep(3)
print("Starting Disconnecting TightVNC")
subprocess.call("tvnserver.exe -controlservice -disconnectall", shell=True)
print("Did we get an error")
time.sleep(15)
# def vncconnect():
# print("This one as well")
# subprocess.call("tvnserver.exe -controlservice -connect remotesupport.pismotek.com", shell=True)
# time.sleep(3)
window = sg.Window('Pismotek', layout, size=(380, 350)) window = sg.Window('Pismotek', layout, size=(380, 350))
layout = 1 # The currently visible layout layout = 1 # The currently visible layout
while True: while True:
event, values = window.read() event, values = window.read()
print(event, values)
if event in (sg.WIN_CLOSED, 'Exit'): if event in (sg.WIN_CLOSED, 'Exit'):
break break
elif event == 'Yes':
window['-COL1-'].update(visible=False)
layout = int(2)
window['-COL2-'].update(visible=True)
window['No'].update(visible=False)
window['Yes'].update(visible=False)
window['Exit'].update(visible=True)
elif event == 'No': elif event == 'No':
window['-COL1-'].update(visible=False) window['-COL1-'].update(visible=False)
layout = int(3) layout = int(3)
@ -74,5 +87,15 @@ while True:
window['No'].update(visible=False) window['No'].update(visible=False)
window['Yes'].update(visible=False) window['Yes'].update(visible=False)
window['Exit'].update(visible=True) window['Exit'].update(visible=True)
elif event == 'Yes':
window['-COL1-'].update(visible=False)
layout = int(2)
window['-COL2-'].update(visible=True)
window['No'].update(visible=False)
window['Yes'].update(visible=False)
window['Exit'].update(visible=True)
# window.perform_long_operation(vncdisconnect, '-VNCCONNECT-')
# elif event == '-VNCCONNECT-':
# print("Woot")
window.close() window.close()

View File

@ -1,3 +1,4 @@
psutil
pyinstaller pyinstaller
pyinstaller-hooks-contrib pyinstaller-hooks-contrib
PySimpleGUI==4.60.1 PySimpleGUI==4.60.1