[gevice] set focus to VTE terminal.
- From: Alejandro Valdes Jimenez <avaldes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gevice] set focus to VTE terminal.
- Date: Wed, 22 Dec 2010 14:07:24 +0000 (UTC)
commit c45564e7399c6d075962fc5707fc2d821da7c2c8
Author: Alejandro Valdes Jimenez <avaldes gnome org>
Date: Wed Dec 22 11:07:07 2010 -0300
set focus to VTE terminal.
ChangeLog | 3 +++
src/gevice.py | 5 +++--
src/gevicevte.py | 9 +++++++--
3 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 22107d7..2a598fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2010-12-22 Alejandro Valdes Jimenez <avaldes gnome org>
+ * src/gevicevte.py: set focus to VTE terminal.
+
2010-07-27 Alejandro Valdes Jimenez <avaldes gnome org>
Fixed bug #623562
diff --git a/src/gevice.py b/src/gevice.py
index 9bf5ae8..0a7cdb3 100755
--- a/src/gevice.py
+++ b/src/gevice.py
@@ -1,3 +1,4 @@
+
#!/usr/bin/python
#
# gevice GNOME Network Device Manager.
@@ -368,6 +369,7 @@ class Gevice:
hbox_term2,terminal2 = gvte.new_terminal (self)
vpaned.add2 (hbox_term2)
terminal2.fork_command ()
+
else:
i = self.gmodel.get_iter_selected (self.gmodel.treeview)
if i["iter"]:
@@ -387,13 +389,12 @@ class Gevice:
page = self.notebook.append_page(vpaned,hbox_label)
self.notebook.set_tab_reorderable(vpaned,True)
self.notebook.set_tab_detachable(vpaned,True)
-
- terminal.grab_focus()
hbox_label.show_all()
vpaned.show_all()
self.notebook.set_current_page(page)
+
def create_button_with_image (self,id_stock,sensitive):
"return a button with image, utilized in tool of browser"
diff --git a/src/gevicevte.py b/src/gevicevte.py
index f97afd1..79544d8 100644
--- a/src/gevicevte.py
+++ b/src/gevicevte.py
@@ -2,6 +2,7 @@ import pygtk
pygtk.require('2.0')
import gtk.glade
import vte
+import gtk.gdk
import gettext
gettext.textdomain("gevice")
@@ -13,6 +14,11 @@ class GeviceVte:
def __init__ (self):
pass
+ def the_focus (self,widget,event,terminal):
+ if (event.type==gtk.gdk.ENTER_NOTIFY):
+ terminal.grab_focus()
+
+
def new_terminal (self,gevice):
hbox_term = gtk.HBox(False,0)
@@ -25,12 +31,11 @@ class GeviceVte:
terminal.set_size (30,1)
terminal.set_mouse_autohide (True)
+ terminal.connect('event',self.the_focus,terminal)
scroll = gtk.VScrollbar(terminal.get_adjustment())
hbox_term.pack_start(terminal,True,True,0)
hbox_term.pack_start(scroll,False,False,0)
- terminal.grab_focus()
-
return hbox_term,terminal
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]