[gevice] Fixed bug #663868
- From: Alejandro Valdes Jimenez <avaldes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gevice] Fixed bug #663868
- Date: Fri, 11 Nov 2011 18:38:57 +0000 (UTC)
commit cfb099e5d22f60a7fd59b5035b71d6c17b1bfc43
Author: Alejandro Valdes Jimenez <avaldes gnome org>
Date: Fri Nov 11 15:38:48 2011 -0300
Fixed bug #663868
ChangeLog | 4 +++
src/gevice.py | 83 ++++++++++++++++++++++++++++++++++++++++++--------------
2 files changed, 66 insertions(+), 21 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c310854..fd7f639 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-11 Alejandro Valdes Jimenez <avaldes gnome org>
+ * src/gevice.py:
+ * Fixed bug #663868
+
2011-11-03 Alejandro Valdes Jimenez <avaldes gnome org>
* data/other/Makefile.am: add db_gevice.sql:
* data/other/db_gevice.sql: script to create database.
diff --git a/src/gevice.py b/src/gevice.py
index 9b96b3c..9f67f0c 100755
--- a/src/gevice.py
+++ b/src/gevice.py
@@ -52,14 +52,16 @@ class Gevice:
# model for list of users for SSH session
self.modelusers = Gtk.ListStore(str)
- # model for protocol
- self.modelproto = Gtk.ListStore(str)
- self.modelproto.append (["ssh"])
- self.modelproto.append (["telnet"])
- self.modelproto.append (["local"])
- self.modelproto.append (["vnc"])
- self.modelproto.append (["rdp"])
- self.modelproto.append (["xdmcp"])
+ # model for protocol (protocol and default port)
+ self.modelproto = Gtk.ListStore(str,int)
+ self.modelproto.append ([_("Protocol"),0])
+ self.modelproto.append (["ssh",22])
+ self.modelproto.append (["telnet",23])
+ self.modelproto.append (["local",0])
+ # for VNC value is display
+ self.modelproto.append (["vnc",1])
+ self.modelproto.append (["rdp",0])
+ #self.modelproto.append (["xdmcp",0])
# model for devices
self.gmodel = gevicemodel.GeviceModel(self)
@@ -124,10 +126,8 @@ class Gevice:
self.combobox_user.add_attribute(cell, "text", 0)
# create toolitem for combobox protocol
- separator_user = Gtk.SeparatorToolItem()
self.toolitem_proto = Gtk.ToolItem()
- self.maintoolbar.insert(separator_user,12)
- self.maintoolbar.insert(self.toolitem_proto,13)
+ self.maintoolbar.insert(self.toolitem_proto,12)
# create combobox_proto
self.vboxproto = Gtk.VBox(homogeneous=False,spacing=0)
@@ -135,6 +135,19 @@ class Gevice:
self.vboxproto.pack_end (self.combobox_proto,True,False,0)
self.toolitem_proto.add(self.vboxproto)
self.combobox_proto.set_active(0)
+ self.combobox_proto.connect("changed", self.on_protocol_changed)
+
+ # create toolitem for spinbutton ports
+ self.toolitem_port = Gtk.ToolItem()
+ self.maintoolbar.insert(self.toolitem_port,13)
+
+ # create spinbutton ports
+ self.vboxports = Gtk.VBox(homogeneous=False,spacing=0)
+ #adjustment = Gtk.Adjustment(value=5, lower=0, upper=65535, step_increment=1, page_increment=1, page_size=0)
+ adjustment = Gtk.Adjustment(value=0, lower=0, upper=65535, step_increment=1)
+ self.spinb_ports = Gtk.SpinButton(adjustment=adjustment)
+ self.vboxports.pack_end (self.spinb_ports,True,False,0)
+ self.toolitem_port.add(self.vboxports)
cell = Gtk.CellRendererText()
self.combobox_proto.pack_start(cell, True)
@@ -244,17 +257,26 @@ class Gevice:
self.actiongroup_model.set_sensitive (False)
self.actiongroup_window.set_sensitive (True)
self.actiongroup_device.set_sensitive (False)
+
+ def main(self):
+ Gtk.main()
def set_listusers_on_combobox (self):
self.modelusers.clear()
+ self.modelusers.append([_("User")])
+
for user in self.gpref.listusers:
self.modelusers.append([user])
self.combobox_user.set_active(0)
- def main(self):
- Gtk.main()
+ def on_protocol_changed (self, combo):
+ tree_iter = combo.get_active_iter()
+ proto = self.modelproto.get_value(tree_iter,0)
+ port = self.modelproto.get_value(tree_iter,1)
+
+ self.spinb_ports.set_value (port)
def show_infobar_message (self,msg,type_msg):
self.infobar.set_message_type(type_msg)
@@ -336,9 +358,10 @@ class Gevice:
model_user = self.combobox_user.get_model()
iter_user = self.combobox_user.get_active_iter()
user = model_user.get(iter_user,0)
+ port = self.spinb_ports.get_value_as_int ()
proto = self.get_protocol_selected()
-
+
if (proto == "rdp"):
cmd = "rdesktop "
cmd += "-T'" + data[2] + "' "
@@ -358,19 +381,37 @@ class Gevice:
cmd += "-geometry 800x600 "
cmd += "-Xdialog "
cmd += data[2]
- cmd += ":1 "
+ cmd += ":"
+ cmd += str(port)
cmd += " &"
os.system(cmd)
return
- terminal.fork_command_full (Vte.PtyFlags.DEFAULT, None, [proto,'-l',user[0],data[2]], [], GLib.SpawnFlags.SEARCH_PATH, None, None)
-
- if isdual:
- hbox_term2,terminal2 = gvte.new_terminal (self)
- vpaned.add2 (hbox_term2)
- terminal2.fork_command_full (Vte.PtyFlags.DEFAULT, None, [proto,'-l',user[0],data[2]], [], GLib.SpawnFlags.SEARCH_PATH, None, None)
-
+ if (proto == "ssh"):
+ terminal.fork_command_full (Vte.PtyFlags.DEFAULT, None,
+ [proto,'-l',user[0],'-p',str(port),data[2]],
+ [], GLib.SpawnFlags.SEARCH_PATH, None, None)
+
+ if isdual:
+ hbox_term2,terminal2 = gvte.new_terminal (self)
+ vpaned.add2 (hbox_term2)
+ terminal2.fork_command_full (Vte.PtyFlags.DEFAULT, None,
+ [proto,'-l',user[0],'-p',str(port),data[2]],
+ [], GLib.SpawnFlags.SEARCH_PATH, None, None)
+
+ if (proto == "telnet"):
+ terminal.fork_command_full (Vte.PtyFlags.DEFAULT, None,
+ [proto,'-l',user[0],data[2],str(port)],
+ [], GLib.SpawnFlags.SEARCH_PATH, None, None)
+
+ if isdual:
+ hbox_term2,terminal2 = gvte.new_terminal (self)
+ vpaned.add2 (hbox_term2)
+ terminal2.fork_command_full (Vte.PtyFlags.DEFAULT, None,
+ [proto,'-l',user[0],data[2],str(port)],
+ [], GLib.SpawnFlags.SEARCH_PATH, None, None)
+
page = self.notebook.append_page(vpaned,hbox_label)
self.notebook.set_tab_reorderable(vpaned,True)
self.notebook.set_tab_detachable(vpaned,True)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]