diff --git a/pismotek-remote.py b/pismotek-remote.py index 9f1f59f..d40f1b8 100644 --- a/pismotek-remote.py +++ b/pismotek-remote.py @@ -1,7 +1,10 @@ #!/bin/env python import os +import psutil import PySimpleGUI as sg +import subprocess +import time """ Pismotek-Remote - Remote Desktop Application @@ -31,6 +34,8 @@ layout1 = [ layout2 = [ [sg.Text('Remote connection started')], + [sg.Text('Allow connection through firewall if asked.')], + [sg.Text('')], [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)) layout = 1 # The currently visible layout while True: event, values = window.read() - print(event, values) if event in (sg.WIN_CLOSED, 'Exit'): 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': window['-COL1-'].update(visible=False) layout = int(3) @@ -74,5 +87,15 @@ while True: window['No'].update(visible=False) window['Yes'].update(visible=False) 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() diff --git a/requirements.txt b/requirements.txt index 15237a7..3340109 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +psutil pyinstaller pyinstaller-hooks-contrib PySimpleGUI==4.60.1