|
|
@ -3,6 +3,7 @@ import gi |
|
|
|
gi.require_version('Gtk', '3.0') |
|
|
|
gi.require_version('Gtk', '3.0') |
|
|
|
from gi.repository import Gtk |
|
|
|
from gi.repository import Gtk |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConnectDialog(Gtk.Window): |
|
|
|
class ConnectDialog(Gtk.Window): |
|
|
|
|
|
|
|
|
|
|
|
host = None |
|
|
|
host = None |
|
|
@ -17,12 +18,12 @@ class ConnectDialog(Gtk.Window): |
|
|
|
|
|
|
|
|
|
|
|
self.host_label = Gtk.Label('Hostname or IP') |
|
|
|
self.host_label = Gtk.Label('Hostname or IP') |
|
|
|
|
|
|
|
|
|
|
|
self.host_input = Gtk.Entry(); |
|
|
|
self.host_input = Gtk.Entry() |
|
|
|
self.host_input.set_text('localhost') |
|
|
|
self.host_input.set_text('localhost') |
|
|
|
|
|
|
|
|
|
|
|
self.port_label = Gtk.Label('Port') |
|
|
|
self.port_label = Gtk.Label('Port') |
|
|
|
self.port_input = Gtk.Entry(); |
|
|
|
self.port_input = Gtk.Entry() |
|
|
|
self.port_input.set_text('7887') |
|
|
|
self.port_input.set_text('7668') |
|
|
|
|
|
|
|
|
|
|
|
self.connect_btn = Gtk.Button(label="Connect") |
|
|
|
self.connect_btn = Gtk.Button(label="Connect") |
|
|
|
self.connect_btn.connect("clicked", self.finish) |
|
|
|
self.connect_btn.connect("clicked", self.finish) |
|
|
@ -30,13 +31,12 @@ class ConnectDialog(Gtk.Window): |
|
|
|
self.abort_btn = Gtk.Button(label="Abort") |
|
|
|
self.abort_btn = Gtk.Button(label="Abort") |
|
|
|
self.abort_btn.connect("clicked", self.abort) |
|
|
|
self.abort_btn.connect("clicked", self.abort) |
|
|
|
|
|
|
|
|
|
|
|
grid.attach(self.host_label,0,0,1,1) |
|
|
|
grid.attach(self.host_label, 0, 0, 1, 1) |
|
|
|
grid.attach(self.host_input,1,0,1,1) |
|
|
|
grid.attach(self.host_input, 1, 0, 1, 1) |
|
|
|
grid.attach(self.port_label,0,1,1,1) |
|
|
|
grid.attach(self.port_label, 0, 1, 1, 1) |
|
|
|
grid.attach(self.port_input,1,1,1,1) |
|
|
|
grid.attach(self.port_input, 1, 1, 1, 1) |
|
|
|
grid.attach(self.abort_btn,0,2,1,1) |
|
|
|
grid.attach(self.abort_btn, 0, 2, 1, 1) |
|
|
|
grid.attach(self.connect_btn,1,2,1,1) |
|
|
|
grid.attach(self.connect_btn, 1, 2, 1, 1) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def abort(self, widget): |
|
|
|
def abort(self, widget): |
|
|
|
Gtk.main_quit() |
|
|
|
Gtk.main_quit() |
|
|
|