Disconnect first draft
This commit is contained in:
parent
d005c1b9a8
commit
4215d0551c
2 changed files with 27 additions and 5 deletions
|
|
@ -43,6 +43,9 @@ class DBusBridgeFrontend(BridgeFrontend):
|
|||
def connect(self):
|
||||
return self.db_comm_iface.connect()
|
||||
|
||||
def disconnect(self):
|
||||
return self.db_comm_iface.disconnect()
|
||||
|
||||
def getContacts(self):
|
||||
return self.db_comm_iface.getContacts()
|
||||
|
||||
|
|
|
|||
|
|
@ -36,10 +36,11 @@ from quick_frontend.quick_app import QuickApp
|
|||
msgOFFLINE = "offline"
|
||||
msgONLINE = "online"
|
||||
idCONNECT = 1
|
||||
idEXIT = 2
|
||||
idPARAM = 3
|
||||
idADD_CONTACT = 4
|
||||
idREMOVE_CONTACT = 5
|
||||
idDISCONNECT = 2
|
||||
idEXIT = 3
|
||||
idPARAM = 4
|
||||
idADD_CONTACT = 5
|
||||
idREMOVE_CONTACT = 6
|
||||
const_DEFAULT_GROUP = "Unclassed"
|
||||
const_STATUS = {"Online":"",
|
||||
"Want to discuss":"chat",
|
||||
|
|
@ -190,6 +191,7 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
info("Creating menus")
|
||||
connectMenu = wx.Menu()
|
||||
connectMenu.Append(idCONNECT, "&Connect CTRL-c"," Connect to the server")
|
||||
connectMenu.Append(idDISCONNECT, "&Disconnect CTRL-d"," Disconnect from the server")
|
||||
connectMenu.Append(idPARAM,"&Parameters"," Configure the program")
|
||||
connectMenu.AppendSeparator()
|
||||
connectMenu.Append(idEXIT,"E&xit"," Terminate the program")
|
||||
|
|
@ -203,6 +205,7 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
|
||||
#events
|
||||
wx.EVT_MENU(self, idCONNECT, self.onConnectRequest)
|
||||
wx.EVT_MENU(self, idDISCONNECT, self.onDisconnectRequest)
|
||||
wx.EVT_MENU(self, idPARAM, self.onParam)
|
||||
wx.EVT_MENU(self, idEXIT, self.onExit)
|
||||
wx.EVT_MENU(self, idADD_CONTACT, self.onAddContact)
|
||||
|
|
@ -316,6 +319,9 @@ class MainWindow(wx.Frame, QuickApp):
|
|||
def onConnectRequest(self, e):
|
||||
self.bridge.connect()
|
||||
|
||||
def onDisconnectRequest(self, e):
|
||||
self.bridge.disconnect()
|
||||
|
||||
def __updateStatus(self):
|
||||
show = const_STATUS[self.statusBox.GetValue()]
|
||||
status = self.statusTxt.GetValue()
|
||||
|
|
|
|||
Loading…
Reference in a new issue