Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Garcia <cristian99garcia@gmail.com>2013-05-27 09:30:22 (GMT)
committer Cristian Garcia <cristian99garcia@gmail.com>2013-05-27 09:30:22 (GMT)
commitc3e7221b320238f4cd85dc74fc2ee61ef864c8e6 (patch)
treeda8bf0334de7a6f56554b0e6d2d3272eec92a8fe
parent3f33fd8024cd5fb10784497baeb8591a8f1ce9af (diff)
Conectar click de los botones de archivo a las funciones de 'Archivo Nuevo' y 'Abrir Archivo'.
-rw-r--r--BasePanel.py7
-rw-r--r--IdeMain.py33
-rw-r--r--Widgets.py11
3 files changed, 43 insertions, 8 deletions
diff --git a/BasePanel.py b/BasePanel.py
index 54d8a8c..e585389 100644
--- a/BasePanel.py
+++ b/BasePanel.py
@@ -108,3 +108,10 @@ class BasePanel(Gtk.Paned):
self.infonotebook.set_path_estructura(path)
self.workpanel.abrir_archivo(os.path.join(path, main))
+
+ def abrir_archivo(self, archivo):
+ """
+ Abre archivo.
+ """
+
+ self.workpanel.abrir_archivo(archivo)
diff --git a/IdeMain.py b/IdeMain.py
index 2d120e4..07a2f6a 100644
--- a/IdeMain.py
+++ b/IdeMain.py
@@ -157,7 +157,7 @@ class IdeMain(Gtk.Window):
elif accion == "Abrir":
- self.__abrir()
+ self.__abrir(direccion = None)
def __abrir_proyecto(self, widget, archivo):
"""
@@ -260,14 +260,37 @@ class IdeMain(Gtk.Window):
No hace nada.
"""
- pass
+ self.base_panel.abrir_archivo(None)
- def __abrir(self, widget=None):
+ def __abrir(self, widget=None, direccion=None):
"""
- No hace nada.
+ Abre un archivo.
+ """
+
+ if direccion != None:
+
+ self.base_panel.abrir_archivo(direccion)
+ print direccion
+
+ else:
+
+ filechooser = My_FileChooser(
+ parent_window = self,
+ action_type = Gtk.FileChooserAction.OPEN,
+ filter_type = "*.py",
+ title = "Abrir archivo",
+ path = BatovideWorkSpace)
+
+ filechooser.connect('load', self.abrir)
+
+ respuesta = filechooser.run()
+
+ def abrir(self, widget, direccion):
+ """
+ Abre archivo.
"""
- pass
+ self.__abrir(direccion = direccion)
def __exit(self, widget=None):
"""
diff --git a/Widgets.py b/Widgets.py
index 90d77f6..e610664 100644
--- a/Widgets.py
+++ b/Widgets.py
@@ -671,8 +671,13 @@ class My_FileChooser(Gtk.FileChooserDialog):
self.show_all()
def __abrir(self, widget):
-
- self.emit('load', self.get_filename())
+
+ direccion = self.get_filename()
+
+ if direccion[:2] == '//':
+ direccion = direccion[0:]
+
+ self.emit('load', direccion)
self.__salir(None)
@@ -1128,4 +1133,4 @@ class ToolbarTerminal(Gtk.Toolbar):
def __emit_pegar(self, widget):
self.emit('accion', 'pegar')
- \ No newline at end of file
+