Commit d269ceac authored by Florent Viard's avatar Florent Viard Committed by John (J5) Palmieri

Pressing "Enter" in the add connection combobox activates the connect action

parent 8ed298d2
......@@ -2,14 +2,18 @@ import gtk
from uiloader import UILoader
class AddConnectionDialog:
RESPONSE_CANCEL = -1
RESPONSE_CONNECT = 1
def __init__(self, parent):
ui = UILoader(UILoader.UI_ADDCONNECTIONDIALOG)
self.dialog = ui.get_root_widget()
self.combo_entry = ui.get_widget('address_comboentry1')
self.dialog.add_button('gtk-cancel', -1)
self.dialog.add_button('gtk-connect', 1)
self.combo_entry.get_child().connect('activate', self.activate_combo)
self.dialog.add_button('gtk-cancel', self.RESPONSE_CANCEL)
self.dialog.add_button('gtk-connect', self.RESPONSE_CONNECT)
def get_address(self):
return self.combo_entry.get_active_text()
......@@ -20,3 +24,7 @@ class AddConnectionDialog:
def destroy(self):
self.dialog.destroy()
def activate_combo(self, user_data):
self.dialog.response(self.RESPONSE_CONNECT)
return True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment