Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Widgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'Widgets.py')
-rw-r--r--Widgets.py42
1 files changed, 36 insertions, 6 deletions
diff --git a/Widgets.py b/Widgets.py
index 776f3ca..c6c5896 100644
--- a/Widgets.py
+++ b/Widgets.py
@@ -18,6 +18,9 @@ class Area_de_Montajes(Gtk.TreeView):
"""Parte de la entana en la que se muestran
los montajes actualmente introducidos"""
+ __gsinglas__ = {'change-directory': (GObject.SIGNAL_RUN_FIRST,
+ GObject.TYPE_NONE, (GObject.TYPE_STRING,))}
+
def __init__(self, padre):
"""Inicia la clase"""
@@ -129,7 +132,7 @@ class Area_de_Montajes(Gtk.TreeView):
def abrir(self, widget, direccion):
"""Abre la dirección del montaje seleccionado"""
- self.padre.abrir(direccion)
+ self.emit('change-directory', direccion)
def copiar(self, widget, direccion):
@@ -147,7 +150,7 @@ class Area(Gtk.IconView):
__gsignals__ = {
'cambio-de-direccion': (GObject.SIGNAL_RUN_FIRST,
GObject.TYPE_NONE, (GObject.TYPE_STRING,)),
- 'cambio-de-texto': (GObject.SIGNAL_RUN_FIRST,
+ 'cambio-de-mensaje': (GObject.SIGNAL_RUN_FIRST,
GObject.TYPE_NONE, (GObject.TYPE_STRING,))}
def __init__(self, padre):
@@ -187,8 +190,8 @@ class Area(Gtk.IconView):
archivos = Archivos.get_tamanio(direccion)
string = ' - ' + archivos
- self.padre.b_estado.set_text('Se ha seleccionado: ',
- direccion, string)
+ mensaje = 'se ha seleccionada: ' + direccion + string
+ self.emit('cambio-de-mensaje', mensaje)
else:
self.padre.b_estado.set_text('')
@@ -240,7 +243,10 @@ class Area(Gtk.IconView):
self.emit('cambio-de-direccion', direccion)
except TypeError:
- # Solo sucede cuando se le hace clic fuera de un iter
+
+ # Solo sucede cuando se le hace clic fuera de un iter,
+ # por eso lo dejo pasar
+
pass
def crear_menu_emergente(self, boton, tiempo, path):
@@ -283,7 +289,7 @@ class Area(Gtk.IconView):
def abrir(self, widget, direccion):
"""Abre la dirección del montaje seleccionado"""
- self.padre.abrir(direccion)
+ self.emit('change-directory', direccion)
def copiar(self, widget, direccion):
@@ -303,8 +309,32 @@ class Entrada(Gtk.Entry):
Gtk.Entry.__init__(self)
+ self.modelo = Gtk.ListStore(str)
+ completion = Gtk.EntryCompletion()
+
+ completion.set_model(self.modelo)
+ completion.set_text_column(0)
+
self.set_size_request(400, 40)
self.set_text(direccion)
+ self.set_placeholder_text(os.path.expanduser('Dirección'))
+ self.set_completion(completion)
+
+ self.connect('changed', self.changed)
+
+ def changed(self, widget):
+
+ texto = widget.get_text()
+
+ if os.path.exists(texto) and not os.path.isfile(texto) and texto[-1] == '/':
+ lista = os.listdir(texto)
+
+ self.modelo.clear()
+
+ for x in lista:
+ self.modelo.append([texto + x])
+
+ self.show_all()
class Barra_de_Estado(Gtk.Statusbar):