[gevice] add combox_geometry for selecting geometry display connection with VNC and RDP protocol.



commit ed3ab1eb7e2cf0d380a34bedc00615e8ed32af5d
Author: Alejandro Valdes Jimenez <avaldes gnome org>
Date:   Thu Nov 17 21:21:19 2011 -0300

    add combox_geometry for selecting geometry display connection with VNC and RDP protocol.

 ChangeLog        |    4 ++++
 data/ui/main.xml |    2 +-
 src/gevice.py    |   39 +++++++++++++++++++++++++++++++++++----
 3 files changed, 40 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e736b13..b0434ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-17  Alejandro Valdes Jimenez  <avaldes gnome org>
+	* data/ui/main.xml: change dimension of main windows.
+	* src/gevice.py: add combox_geometry for selecting geometry display connection with VNC and RDP protocol.
+
 2011-11-12  Alejandro Valdes Jimenez  <avaldes gnome org>
 	* src/gevicedatabase.py: add new functions for enable Foreign Key support in sqlite3.
 	* Fixed bug #663918
diff --git a/data/ui/main.xml b/data/ui/main.xml
index c867f16..c7c69ac 100644
--- a/data/ui/main.xml
+++ b/data/ui/main.xml
@@ -2,7 +2,7 @@
 <interface>
   <!-- interface-requires gtk+ 2.6 -->
   <object class="GtkWindow" id="window_main">
-    <property name="width_request">800</property>
+    <property name="width_request">850</property>
     <property name="height_request">600</property>
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">Gevice</property>
diff --git a/src/gevice.py b/src/gevice.py
index 9f67f0c..d9be790 100755
--- a/src/gevice.py
+++ b/src/gevice.py
@@ -63,6 +63,12 @@ class Gevice:
     self.modelproto.append (["rdp",0])
     #self.modelproto.append (["xdmcp",0])
     
+    # model for display geometry (vnc,rdp)
+    self.modelgeometry = Gtk.ListStore(str)
+    self.modelgeometry.append ([_("Geometry")])
+    self.modelgeometry.append (["800x600"])
+    self.modelgeometry.append (["1024x720"])    
+    
     # model for devices
     self.gmodel = gevicemodel.GeviceModel(self)
 
@@ -136,6 +142,10 @@ class Gevice:
     self.toolitem_proto.add(self.vboxproto)
     self.combobox_proto.set_active(0)
     self.combobox_proto.connect("changed", self.on_protocol_changed)
+
+    cell = Gtk.CellRendererText()
+    self.combobox_proto.pack_start(cell, True)
+    self.combobox_proto.add_attribute(cell, "text", 0)
     
     # create toolitem for spinbutton ports
     self.toolitem_port = Gtk.ToolItem()
@@ -148,10 +158,21 @@ class Gevice:
     self.spinb_ports = Gtk.SpinButton(adjustment=adjustment)
     self.vboxports.pack_end (self.spinb_ports,True,False,0)
     self.toolitem_port.add(self.vboxports)
+
+    # create toolitem for combobox display geometry
+    self.toolitem_geometry = Gtk.ToolItem()
+    self.maintoolbar.insert(self.toolitem_geometry,14)
     
+    # create combobox_geometry
+    self.vboxgeometry = Gtk.VBox(homogeneous=False,spacing=0)
+    self.combobox_geometry = Gtk.ComboBox(model=self.modelgeometry,has_entry=False)
+    self.vboxgeometry.pack_end (self.combobox_geometry,True,False,0)
+    self.toolitem_geometry.add(self.vboxgeometry)
+    self.combobox_geometry.set_active(0)
+
     cell = Gtk.CellRendererText()
-    self.combobox_proto.pack_start(cell, True)
-    self.combobox_proto.add_attribute(cell, "text", 0)
+    self.combobox_geometry.pack_start(cell, True)
+    self.combobox_geometry.add_attribute(cell, "text", 0)    
     
     self.hbox.pack_start (self.maintoolbar,True,True,0)	
     
@@ -362,11 +383,14 @@ class Gevice:
 
         proto = self.get_protocol_selected()
         
+        geometry = self.get_geometry_display_selected()
+        
         if (proto == "rdp"):
           cmd =  "rdesktop " 
           cmd += "-T'" + data[2] + "' "
           cmd += "-u" + user[0]
-          cmd += " -g800x600 "
+          #cmd += " -g1024x720 "
+          cmd += " -g" + geometry + " "
           cmd += "-rsound:local "
           cmd += "-rclipboard:PRIMARYCLIPBOARD "
           cmd += "-b -4 "
@@ -378,7 +402,8 @@ class Gevice:
 
         if (proto == "vnc"):
           cmd =  "vncviewer " 
-          cmd += "-geometry 800x600 "
+          #cmd += "-geometry 1024x720 "
+          cmd += "-geometry " + geometry + " "
           cmd += "-Xdialog "
           cmd += data[2]
           cmd += ":"
@@ -748,6 +773,12 @@ class Gevice:
     proto = self.modelproto.get_value(iter,0)
     
     return proto
+
+  def get_geometry_display_selected (self):
+    iter = self.combobox_geometry.get_active_iter()
+    geometry = self.modelgeometry.get_value(iter,0)
+    
+    return geometry
   
   def update_statusbar (self,dbsqlite):
     self.statusbar.push (self.context_id,dbsqlite)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]