added user settings ui
This commit is contained in:
parent
c6f45ae2d9
commit
77c7aed79d
@ -1,13 +1,16 @@
|
||||
import glob
|
||||
import wx
|
||||
import wx.lib.buttons as buttons
|
||||
from wx.adv import Wizard, WizardPageSimple
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class ServerPanel(wx.Frame):
|
||||
|
||||
def __init__(self, parent):
|
||||
self.open_dashboard
|
||||
super().__init__(parent)
|
||||
main_sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
secondary_sizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
@ -22,8 +25,8 @@ class ServerPanel(wx.Frame):
|
||||
|
||||
|
||||
#tb.AddTool( wx.ID_ANY, '', wx.Bitmap("IPPigeonLogo.png"))
|
||||
tb.AddTool(wx.ID_ANY, '',wx.Bitmap("WXPython.png"))
|
||||
tb.AddTool(wx.ID_ANY, '',wx.Bitmap("settings.png"))
|
||||
tb.AddTool(0, '',wx.Bitmap("WXPython.png"), "Server Dashboard")
|
||||
tb.AddTool(1, '',wx.Bitmap("settings.png"), "Settings")
|
||||
|
||||
#tb.Bind(wx.EVT_TOOL, self.Onright)
|
||||
#tb.Bind(wx.EVT_COMBOBOX,self.OnCombo)
|
||||
@ -59,21 +62,79 @@ class ServerPanel(wx.Frame):
|
||||
# stop_button.SetWindowStyleFlag(wx.SIMPLE_BORDER)
|
||||
# wx.StaticBitmap(self, -1, png, (500, 300), (png.GetWidth(), png.GetHeight()))
|
||||
self.SetSizer(main_sizer)
|
||||
|
||||
def OnQuit(self, e):
|
||||
self.Close()
|
||||
|
||||
self.Bind(wx.EVT_TOOL, self.open_dashboard, id=0)
|
||||
self.Bind(wx.EVT_TOOL, self.open_settings, id=1)
|
||||
|
||||
# self.Bind(wx.EVT_BUTTON, super().__init__(parent))
|
||||
# self.Bind(wx.EVT_BUTTON, self.open_settings)
|
||||
def on_edit(self, event):
|
||||
print('in on_edit')
|
||||
|
||||
def update_mp3_listing(self, folder_path):
|
||||
print(folder_path)
|
||||
def open_dashboard(self, e):
|
||||
print("open dashboard")
|
||||
|
||||
# def Onright(self, event):
|
||||
# self.text.AppendText(str(event.GetId())+"\n")
|
||||
|
||||
# def OnCombo(self,event):
|
||||
# self.text.AppendText( self.combo.GetValue()+"\n")
|
||||
|
||||
|
||||
def open_settings(self,e):
|
||||
|
||||
print("open settings")
|
||||
dg = GetData(parent = ServerPanel(self))
|
||||
dg.ShowModal()
|
||||
# box = wx.TextEntryDialog(None, "Host: ")
|
||||
# if box.ShowModal() == wx.ID_OK:
|
||||
# answer = box.GetValue()
|
||||
# main_sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
|
||||
|
||||
# self.Bind(wx.EVT_TOOL, self.open_dashboard, id=0)
|
||||
# self.Bind(wx.EVT_TOOL, self.open_settings, id=1)
|
||||
|
||||
|
||||
class GetData(wx.Dialog):
|
||||
def __init__(self, parent):
|
||||
wx.Dialog.__init__(self, parent, wx.ID_ANY, "User Settings: ", size = (800,440))
|
||||
self.p = wx.Panel(self, wx.ID_ANY)
|
||||
self.hostname = wx.StaticText(self.p, label="Host", pos=(20,20))
|
||||
self.hostnametext = wx.TextCtrl(self.p, value="", pos=(180,20), size=(500,-1))
|
||||
|
||||
self.user = wx.StaticText(self.p, label="User: ", pos=(20,60))
|
||||
self.usertext = wx.TextCtrl(self.p, value="", pos=(180,60), size=(500,-1))
|
||||
|
||||
self.port = wx.StaticText(self.p, label="Port: ", pos=(20,100))
|
||||
self.porttext = wx.TextCtrl(self.p, value="", pos=(180,100), size=(500,-1))
|
||||
|
||||
self.keyfile = wx.StaticText(self.p, label="Keyfile: ", pos=(20,140))
|
||||
self.keyfiletext = wx.TextCtrl(self.p, value="", pos=(180,140), size=(500,-1))
|
||||
|
||||
self.filepathsend = wx.StaticText(self.p, label="Sending File Path: ", pos=(20,180))
|
||||
self.filepathsendtext = wx.TextCtrl(self.p, value="", pos=(180,180), size=(500,-1))
|
||||
|
||||
self.filepathsendlogin = wx.StaticText(self.p, label="Sending Login Path: ", pos=(20,220))
|
||||
self.filepathsendlogintext = wx.TextCtrl(self.p, value="", pos=(180,220), size=(500,-1))
|
||||
|
||||
self.filepathreceive = wx.StaticText(self.p, label="Receiving File Path: ", pos=(20,260))
|
||||
self.filepathreceivetext = wx.TextCtrl(self.p, value="", pos=(180,260), size=(500,-1))
|
||||
|
||||
self.filepathreceivelogin = wx.StaticText(self.p, label="Receiving Login Path: ", pos=(20,300))
|
||||
self.filepathreceivelogintext = wx.TextCtrl(self.p, value="", pos=(180,300), size=(500,-1))
|
||||
|
||||
self.darkmode = wx.StaticText(self.p, label="Dark mode (On/Off): ", pos=(20,340))
|
||||
self.darkmodetext = wx.TextCtrl(self.p, value="", pos=(180,340), size=(500,-1))
|
||||
|
||||
self.interval = wx.StaticText(self.p, label="Interval (sec): ", pos=(20,380))
|
||||
self.interval = wx.TextCtrl(self.p, value="", pos=(180,380), size=(500,-1))
|
||||
|
||||
self.Bind(wx.EVT_CLOSE, self.OnQuit)
|
||||
|
||||
|
||||
def OnQuit(self, event):
|
||||
self.result_name = None
|
||||
self.Destroy()
|
||||
|
||||
def on_edit(self, event):
|
||||
print('in on_edit')
|
||||
|
||||
class ServerFrame(wx.Frame):
|
||||
def __init__(self):
|
||||
@ -81,7 +142,7 @@ class ServerFrame(wx.Frame):
|
||||
self.frame = ServerPanel(self)
|
||||
# image = wx.StaticBitmap(self, wx.ID_ANY)
|
||||
# image.SetBitmap(wx.Bitmap('WXPython.png'))
|
||||
self.Show()
|
||||
# self.Show()
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = wx.App(False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user