diff options
author | Cristian García <cristian@cristian.(none)> | 2013-04-04 22:34:55 (GMT) |
---|---|---|
committer | Cristian García <cristian@cristian.(none)> | 2013-04-04 22:34:55 (GMT) |
commit | 65713b525e16a8ead34f62567fc7d723a38ca511 (patch) | |
tree | 9dd0e01d71eefc49d40971727c2fc52a2c973bd4 |
Subiendo archivos
-rw-r--r-- | Archivos.py | 552 | ||||
-rw-r--r-- | Archivos.pyc | bin | 0 -> 15449 bytes | |||
-rw-r--r-- | CExplorer.py | 302 | ||||
-rw-r--r-- | CExplorer.pyc | bin | 0 -> 8796 bytes | |||
-rw-r--r-- | Iconos/audio.svg | 14 | ||||
-rw-r--r-- | Iconos/borrar_archivo.svg | 86 | ||||
-rw-r--r-- | Iconos/borrar_directorio.svg | 82 | ||||
-rw-r--r-- | Iconos/compressed.svg | 148 | ||||
-rw-r--r-- | Iconos/desconocido.svg | 15 | ||||
-rw-r--r-- | Iconos/directory.svg | 54 | ||||
-rw-r--r-- | Iconos/directory_dennied.svg | 74 | ||||
-rw-r--r-- | Iconos/file_dennied.svg | 79 | ||||
-rw-r--r-- | Iconos/html.svg | 112 | ||||
-rw-r--r-- | Iconos/mas.svg | 75 | ||||
-rw-r--r-- | Iconos/pdf.svg | 108 | ||||
-rw-r--r-- | Iconos/pendrive.svg | 9 | ||||
-rw-r--r-- | Iconos/plain.svg | 14 | ||||
-rw-r--r-- | Iconos/preferencias.svg | 87 | ||||
-rw-r--r-- | Iconos/python.svg | 90 | ||||
-rw-r--r-- | Iconos/sound.svg | 14 | ||||
-rw-r--r-- | Iconos/video.svg | 17 | ||||
-rw-r--r-- | Iconos/xo.svg | 7 | ||||
-rw-r--r-- | Iconos/zip.svg | 148 | ||||
-rw-r--r-- | Widgets.py | 322 | ||||
-rw-r--r-- | Widgets.pyc | bin | 0 -> 10982 bytes | |||
-rw-r--r-- | activity/activity.info | 6 | ||||
-rw-r--r-- | activity/icon.svg | 54 | ||||
-rw-r--r-- | setup.py | 4 | ||||
-rw-r--r-- | window.py | 314 | ||||
-rw-r--r-- | window.pyc | bin | 0 -> 6422 bytes |
30 files changed, 2787 insertions, 0 deletions
diff --git a/Archivos.py b/Archivos.py new file mode 100644 index 0000000..22a6200 --- /dev/null +++ b/Archivos.py @@ -0,0 +1,552 @@ +#!/usr/bin/env python +# -*- coding:UTF-8 -*- + +import os +import mimetypes +import commands + +import gi +from gi.repository import Gtk +from gi.repository import GdkPixbuf +from gi.repository import GObject +from gi.repository import Gio + +IMAGENES = os.listdir(os.path.join(os.path.dirname(__file__), 'Iconos/')) +DIRECCION = os.path.join(os.path.dirname(__file__), 'Iconos/') +AUDIO = os.path.join(DIRECCION, 'audio.svg') +VIDEO = os.path.join(DIRECCION, 'video.svg') +DESCONOCIDO = os.path.join(DIRECCION, 'desconocido.svg') +DOCUMENTO = os.path.join(DIRECCION, 'documento.svg') +TEXTO = os.path.join(DIRECCION, 'texto.svg') +PENDRIVE = os.path.join(DIRECCION, 'pendrive.svg') +DIR_SIN_PER = os.path.join(DIRECCION, 'directory_dennied.svg') +FILE_SIN_PER = os.path.join(DIRECCION, 'file_dennied.svg') + +images = ('svg', 'png', 'gif', 'jpg', 'xmp', 'ico') +videos = ('flv', '.mp4', '.mpa', '.mpe', '.mpeg', '.mpg') + +local = os.path.expanduser('~/.local') +share = os.path.join(local, 'share') +trash = os.path.join(share, 'Trash') +PAPELERA = os.path.join(trash, 'files') + + +def intentar_abrir(direccion): + + print('No se puede abrir "%s"' % (direccion)) + + +def crear_papelera(): + + def crear(direccion): + if not os.path.exists(direccion): + os.mkdir(direccion) + + try: + crear(local) + crear(share) + crear(trash) + crear(PAPELERA) + + except: + pass + + +def get_tamanio(direccion): + + lectura, escritura, ejecucion = get_permisos(direccion) + + if lectura: + if os.path.isfile(direccion): + numero = os.path.getsize(direccion) + + if numero < 1024: + tamanio = numero + tipo = 'B' + + elif numero >= 1024 and numero < 1024 ** 2: + tamanio = numero / 1024 + tipo = 'KB' + + elif numero >= 1024 ** 2 and numero < 1024 ** 3: + tamanio = numero / 1024 / 1024 + tipo = 'MB' + + elif numero >= 1024 ** 3 and numero < 1024 ** 4: + tamanio = numero / 1024 / 1024 / 1024 + tipo = 'GB' + + elif numero >= 1024 ** 4: + tamanio = numero / 1024 / 1024 / 1024 / 1024 + tipo = 'TB' + + string = 'Pesa ' + str(tamanio) + ' ' + tipo + + elif os.path.isdir(direccion): + + archivos = len(os.listdir(direccion)) + if archivos == 1: + texto = ' archivo' + + else: + texto = ' archivos' + + string = 'Contiene ' + str(archivos) + texto + + else: + string = 'No tiene permisos para leerla' + + return string + + +def get_permisos(direccion): + + if os.path.exists(direccion): + lectura = os.access(direccion, os.R_OK) + escritura = os.access(direccion, os.W_OK) + ejecucion = os.access(direccion, os.X_OK) + + return lectura, escritura, ejecucion + + else: + return False, False, False + + +def get_pixbuf(direccion): + """Obtiene una dirección, inspecciona el tipo de archivo + o sí es un directorio, y devuelve un pixbuf con la imagen apropiada""" + + pixbuf = None + lectura, escritura, ejecucacion = get_permisos(direccion) + + if lectura and escritura: + if os.path.isdir(direccion): + tipo = 'inode/directory' + + if os.path.ismount(direccion): + tipo = 'montaje' + else: + tipo = commands.getoutput('file %s --mime-type -b' % (direccion)) + + if 'x-' in tipo: + tipo = tipo.replace('x-', '') + + if '/' in tipo: + tipo = tipo.split('/')[1] + + extension = direccion.split('.')[-1] + extension += '.svg' + + if 'image' in tipo or extension in images: + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(direccion, 64, 64) + + if 'video' in tipo or extension in videos: + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(VIDEO, 64, 64) + + tipo += '.svg' + + if tipo in IMAGENES: + imagen = DIRECCION + tipo + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(imagen, 64, 64) + + if extension in IMAGENES: + extension = DIRECCION + extension + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(extension, 64, 64) + + if 'montaje' in tipo: + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(PENDRIVE, 64, 64) + + if not pixbuf: + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(DESCONOCIDO, 64, 64) + + else: + if os.path.isdir(direccion): + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(DIR_SIN_PER, 64, 64) + + elif os.path.isfile(direccion): + pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(FILE_SIN_PER, 64, + 64) + + return pixbuf + + +def get_carpeta_contenedora(direccion): + + list = direccion.split('/') + + try: + direccion = '/' + numero = len(list) - 1 + while not bool(list[numero]): + numero -= 1 + + for directorio in list[:numero]: + if directorio: + direccion = direccion + directorio + '/' + + except IndexError: + direccion = '/' + + return direccion + + +class Archivos(): + + def __init__(self): + + self.origen_cortar = None + self.origen_copiar = None + self.accion = None + + def get_origen_copiar(self): + return self.origen_copiar + + def get_origen_cortar(self): + return self.origen_cortar + + def set_origen_cortar(self, widget, direccion): + if os.path.exists(direccion): + self.origen_cortar = direccion + self.accion = 'cortar' + + def set_origen_copiar(self, widget, direccion): + if os.path.exists(direccion): + self.origen_copiar = direccion + self.accion = 'copiar' + + def pegar(self, widget, direccion): + copiar = self.origen_copiar + cortar = self.origen_cortar + if os.path.exists(direccion): + if self.accion == 'copiar' and os.path.exists(copiar): + if os.path.isdir(copiar) or os.path.ismount(copiar): + os.system('cp -r %s %s' % (copiar, direccion)) + + elif os.path.isfile(copiar): + os.system('cp %s %s' % (copiar, direccion)) + + elif self.accion == 'cortar' and os.path.exists(cortar): + os.system('mv %s %s' % (cortar, direccion)) + + else: + print('El origen no existe') + + def borrar(self, archivo): + if os.path.exists(archivo): + Borrar(archivo) + + def crear_directorio(self, direccion): + os.mkdir(direccion) + + def crear_archivo(self, direccion, contenido=None): + if not os.path.exists(direccion): + archivo = open(direccion, 'w') + if contenido: + archivo.write(contenido) + + archivo.close() + + def mover_a_la_papelera(self, direccion): + if os.path.exists(direccion): + crear_papelera() + os.system('mv %s %s' % (direccion, PAPELERA)) + + +class CrearDirectorio(Gtk.Dialog): + + __gsignals__ = { + 'creado': (GObject.SIGNAL_RUN_FIRST, + GObject.TYPE_NONE, [])} + + def __init__(self, direccion): + + Gtk.Dialog.__init__(self) + + self.set_title('Crear Carpeta') + + self.direccion = direccion + + if list(self.direccion)[-1] != '/': + self.direccion += '/' + + label = Gtk.Label(direccion) + self.entry = Gtk.Entry() + self.entry.connect('activate', self.crear_directorio) + + self.hbox = Gtk.HBox() + self.vbox.pack_start(self.hbox, False, False, 0) + + boton_cerrar = Gtk.Button(None, Gtk.STOCK_CANCEL) + boton_cerrar.connect('clicked', self.cerrar) + self.action_area.add(boton_cerrar) + + boton_aceptar = Gtk.Button(None, Gtk.STOCK_OK) + boton_aceptar.connect('clicked', self.clicked) + self.action_area.add(boton_aceptar) + + self.hbox.add(label) + self.hbox.add(self.entry) + self.show_all() + + def crear_directorio(self, widget): + + self.direccion += self.entry.get_text() + + if not os.path.exists(self.direccion): + os.mkdir(self.direccion) + + self.emit('creado') + self.cerrar() + + def clicked(self, widget): + + self.entry.activate() + + def cerrar(self, *args): + + self.destroy() + + +class Propiedades(Gtk.Dialog): + """Un diálogo que muestra las propiedades de un archivo""" + + __gsignals__ = { + 'cambio-de-propiedades': (GObject.SIGNAL_RUN_FIRST, + GObject.TYPE_NONE, [])} + + def __init__(self, direccion): + + Gtk.Dialog.__init__(self) + + self.direccion = direccion + nombre = direccion.split('/')[-1] + lectura, escritura, ejecucion = get_permisos(self.direccion) + + self.set_title('Propiedades') + self.set_border_width(5) + self.vbox.set_spacing(2) + + hbox1 = Gtk.HBox() + hbox2 = Gtk.HBox() + hbox3 = Gtk.HBox() + hbox4 = Gtk.HBox() + hbox5 = Gtk.HBox() + hbox6 = Gtk.HBox() + hbox7 = Gtk.HBox() + + self.vbox.pack_start(hbox1, False, False, 2) + self.vbox.pack_start(hbox2, False, False, 2) + self.vbox.pack_start(hbox3, False, False, 2) + self.vbox.pack_start(hbox4, False, False, 2) + self.vbox.pack_start(hbox5, False, False, 2) + self.vbox.pack_start(hbox6, False, False, 2) + self.vbox.pack_start(hbox7, False, False, 2) + + tipo = commands.getoutput('file %s --mime-type -b' % (self.direccion)) + tamanio = get_tamanio(self.direccion) + ubicacion = get_carpeta_contenedora(self.direccion) + + label_nombre = Gtk.Label('Nombre:') + label_tipo = Gtk.Label('Tipo:') + label_tamanio = Gtk.Label('Tamaño:') + label_ubicacion = Gtk.Label('Ubicación:') + label_accedido = Gtk.Label('Accedido:') + label_modificado = Gtk.Label('Modificado:') + + self.entry_nombre = Gtk.Entry() + self.label_tipo = Gtk.Label(tipo) + self.label_tamanio = Gtk.Label(tamanio) + self.label_ubicacion = Gtk.Label(ubicacion) + self.label_accedido = Gtk.Label() + self.label_modificado = Gtk.Label() + + self.agregar(hbox1, label_nombre) + self.agregar(hbox1, self.entry_nombre) + self.agregar(hbox2, label_tipo) + self.agregar(hbox2, self.label_tipo) + self.agregar(hbox3, label_tamanio) + self.agregar(hbox3, self.label_tamanio) + self.agregar(hbox4, label_ubicacion) + self.agregar(hbox4, self.label_ubicacion) + self.agregar(hbox5, label_accedido) + self.agregar(hbox5, self.label_accedido) + self.agregar(hbox6, label_modificado) + self.agregar(hbox6, self.label_modificado) + + self.frame = Gtk.Frame() + + self.treeview = Gtk.TreeView() + self.treeview.modelo = Gtk.ListStore() + + self.crear_celdas() + + self.vbox.pack_start(Gtk.HSeparator(), False, False, 0) + self.vbox.pack_start(self.treeview, True, True, 0) + + self.entry_nombre.set_text(nombre) + self.entry_nombre.set_editable(lectura and escritura) + self.entry_nombre.connect('activate', self.rename) + + def agregar(self, box, widget): + + box.pack_start(widget, True, True, 2) + + def crear_celdas(self): + + columna1 = Gtk.TreeViewColumn('Usuario') + columna2 = Gtk.TreeViewColumn('Lectura') + columna3 = Gtk.TreeViewColumn('Escritura') + columna4 = Gtk.TreeViewColumn('Ejecución') + + render1 = Gtk.CellRendererText() + render2 = Gtk.CellRendererToggle() + render3 = Gtk.CellRendererToggle() + render4 = Gtk.CellRendererToggle() + + columna1.pack_start(render1, True) + columna2.pack_start(render2, True) + columna3.pack_start(render3, True) + columna4.pack_start(render4, True) + + columna1.set_attributes(render1, text=0) + columna2.set_attributes(render2, active=1) + columna3.set_attributes(render3, active=2) + columna4.set_attributes(render4, active=3) + + self.treeview.append_column(columna1) + self.treeview.append_column(columna2) + self.treeview.append_column(columna3) + self.treeview.append_column(columna4) + + def rename(self, widget): + + texto = widget.get_text() + list = self.direccion.split('/') + + try: + direccion = '/' + numero = len(list) - 1 + while not bool(list[numero]): + numero -= 1 + + for directorio in list[:numero]: + if directorio: + direccion = direccion + directorio + '/' + + except IndexError: + direccion = '/' + + nombre = direccion + texto + os.rename(self.direccion, nombre) + self.direccion = nombre + self.emit('cambio-de-propiedades') + + """ + self.direccion = direccion + nombre = direccion.split('/')[-1] + + if os.path.isdir(self.direccion): + texto = 'la carpeta' + texto2 = 'borrarla' + + elif os.path.isfile(self.direccion): + texto = 'el archivo' + texto2 = 'borrarlo' + + lectura, escritura, ejecucion = get_permisos(self.direccion) + + self.set_title('Propedades de %s' % nombre) + + tipo = os.system('file %s --mime-type -b' % direccion) + label_tipo = Gtk.Label('Tipo: %s' % tipo) + + hbox1 = Gtk.HBox() + label_nombre = Gtk.Label('Nombre de %s:' % texto) + self.entrada = Gtk.Entry() + self.entrada.set_text(nombre) + self.entrada.connect('activate', self.rename) + + hbox1.pack_start(label_nombre, False, False, 5) + hbox1.pack_start(self.entrada, False, False, 5) + self.vbox.pack_start(hbox1, False, False, 0) + + ejecutar = Gtk.CheckButton('Permitir ejecutar como un programa') + ejecutar.connect('clicked', self.permitir_ejecutar) + self.vbox.pack_start(ejecutar, False, False, 0) + + boton_cerrar = Gtk.Button(None, Gtk.STOCK_OK) + boton_cerrar.connect('clicked', self.cerrar) + self.action_area.add(boton_cerrar) + + self.entrada.set_sensitive(escritura) + ejecutar.set_sensitive(escritura) + ejecutar.set_active(ejecucion) + + self.show_all() + + def cerrar(self, widget): + + self.destroy() + + def permitir_ejecutar(self, widget): + + os.chmod(self.direccion, widget.get_active()) + self.emit('cambio-de-propiedades') + + + """ + +class Borrar(Gtk.MessageDialog): + + __gsignals__ = { + 'borrado': (GObject.SIGNAL_RUN_FIRST, + GObject.TYPE_NONE, [])} + + def __init__(self, direccion, type=Gtk.MessageType(2)): + + Gtk.MessageDialog.__init__(self) + + self.direccion = direccion + + if os.path.isdir(self.direccion): + texto = 'la carpeta' + texto2 = 'borrarla' + + elif os.path.isfile(self.direccion): + texto = 'el archivo' + texto2 = 'borrarlo' + + self.set_markup('<b>%s</b>' % + '¿Estas seguro que quieres borrar %s?' % texto) + + self.format_secondary_text( + 'Sí borras %s, se perderá para siempre' % texto) + + boton_no = Gtk.Button('_No quiero %s' % texto2) + boton_no.connect('clicked', self.cerrar) + self.action_area.add(boton_no) + + boton_si = Gtk.Button('_Si quiero %s' % texto2) + boton_si.connect('clicked', self.borrar) + self.action_area.add(boton_si) + + boton_no.set_use_underline(True) + boton_si.set_use_underline(True) + + self.show_all() + + def borrar(self, widget): + + if os.path.exists(self.direccion): + if os.path.isdir(self.direccion): + os.removedirs(self.direccion) + + elif os.path.isfile(self.direccion): + os.remove(self.direccion) + + self.emit('borrado') + + self.destroy() + + def cerrar(self, widget): + self.destroy() diff --git a/Archivos.pyc b/Archivos.pyc Binary files differnew file mode 100644 index 0000000..91b9557 --- /dev/null +++ b/Archivos.pyc diff --git a/CExplorer.py b/CExplorer.py new file mode 100644 index 0000000..b61abc1 --- /dev/null +++ b/CExplorer.py @@ -0,0 +1,302 @@ +#!/usr/share/env python +# -*- coding:UTF-8 -*- + +# CExplorer.py por: +# Cristian García <cristian99garcia@gmail.com> + +import os +import Archivos +import Widgets as Wid + +from gi.repository import Gtk +from gi.repository import Gdk +from gi.repository import GObject +from gi.repository import GdkPixbuf + +import sugar3 +from sugar3.activity import activity +from sugar3.activity.widgets import StopButton +from sugar3.activity.widgets import ActivityToolbarButton +from sugar3.graphics.toolbarbox import ToolbarBox +from sugar3.graphics.toolbutton import ToolButton + + +class CExplorer(activity.Activity): + + __gsignals__ = { + 'change-directory': (GObject.SIGNAL_RUN_FIRST, + GObject.TYPE_NONE, [])} + + def __init__(self, handle): + + activity.Activity.__init__(self, handle) + + self.ocultos = False + self.direccion = os.path.expanduser('~') + + self.archivos = [] + self.carpetas = [] + + self.vbox = Gtk.VBox() + self.entrada = Wid.Entrada(self.direccion) + scrolled_montajes = Gtk.ScrolledWindow() + scrolled = Gtk.ScrolledWindow() + self.area_montajes = Wid.Area_de_Montajes(self) + self.area = Wid.Area(self) + + self.entrada.connect('activate', self.nueva_direccion) + self.entrada.connect('icon-release', self.nueva_direccion) + + #****** Toolbar ****** + toolbarbox = ToolbarBox() + activity_button = ActivityToolbarButton(self) + + toolbarbox.toolbar.insert(activity_button, 0) + toolbarbox.toolbar.insert(Gtk.SeparatorToolItem(), -1) + + b_harddisk = ToolButton(Gtk.STOCK_HARDDISK) + b_home = ToolButton(Gtk.STOCK_HOME) + b_go_up = ToolButton(Gtk.STOCK_GO_UP) + b_refresh = ToolButton(Gtk.STOCK_REFRESH) + b_ocults = Gtk.ToolButton(Gtk.STOCK_YES) + + b_harddisk.connect('clicked', self.nueva_direccion, '/') + b_home.connect('clicked', self.nueva_direccion, '~') + b_go_up.connect('clicked', self.abrir_arriba) + b_refresh.connect('clicked', self.update) + b_ocults.connect('clicked', self.change_ocultos) + + b_harddisk.set_tooltip_text('Abrir al directorio raíz') + b_home.set_tooltip_text('Abrir al directorio personal') + b_go_up.set_tooltip_text('Abrir al la carpeta contenedora de la actual') + b_refresh.set_tooltip_text('Recargar') + b_ocults.set_tooltip_text('Mostrar archivos ocultos') + + toolbarbox.toolbar.insert(b_harddisk, -1) + toolbarbox.toolbar.insert(b_home, -1) + toolbarbox.toolbar.insert(b_go_up, -1) + toolbarbox.toolbar.insert(b_refresh, -1) + toolbarbox.toolbar.insert(Gtk.SeparatorToolItem(), -1) + toolbarbox.toolbar.insert(b_ocults, -1) + + separador = Gtk.SeparatorToolItem() + separador.set_expand(True) + separador.set_draw(False) + toolbarbox.toolbar.insert(separador, -1) + + stopbtn = StopButton(self) + toolbarbox.toolbar.insert(stopbtn, -1) + self.set_toolbar_box(toolbarbox) + + #****** Otros Widgets ****** + paned = Gtk.Paned() + self.b_estado = Wid.Barra_de_Estado() + + self.vbox.pack_start(self.entrada, False, False, 5) + self.vbox.pack_start(paned, True, True, 0) + self.vbox.pack_start(self.b_estado, False, False, 0) + + scrolled_montajes.add(self.area_montajes) + scrolled.add(self.area) + + paned.pack1(scrolled_montajes, False, True) + paned.pack2(scrolled, True, True) + + self.entrada.activate() + + self.connect('destroy', Gtk.main_quit) + self.connect('key-press-event', self.tecla_presionada) + self.connect('change-directory', self.borrar_todo) + + self.set_canvas(self.vbox) + self.show_all() + + def abrir(self, directorio): + """Abre el directorio especificado""" + + if os.path.isdir(directorio) or os.path.ismount(directorio): + # Sí es que no exíste, devolverá False + + self.direccion = directorio + self.entrada.set_text(directorio) + + self.emit('change-directory') + + for objeto in os.listdir(directorio): + direccion = os.path.join(directorio, objeto) + if os.path.isdir(direccion) or os.path.ismount(direccion): + if not self.ocultos and not list(objeto)[0] == '.': + self.carpetas.append(objeto) + + elif self.ocultos: + self.carpetas.append(objeto) + + if os.path.isfile(direccion): + if not self.ocultos and not \ + (list(objeto)[0] == '.' or list(objeto)[-1] == '~'): + + self.archivos.append(objeto) + + elif self.ocultos: + self.archivos.append(objeto) + + self.carpetas.sort() + self.archivos.sort() + + for carpeta in self.carpetas: + self.area.agregar(carpeta, self.direccion) + + for archivo in self.archivos: + self.area.agregar(archivo, self.direccion) + + elif os.path.isfile(directorio): + print 'La dirección es un archivo' + + else: + print 'La dirección no existe' + + def tecla_presionada(self, widget, event): + + tecla = event.keyval + print tecla + + direccion = self.direccion + if direccion[-1] != '/': + direccion += '/' + + lectura, escritura, ejecucion = Archivos.get_permisos(self.direccion) + + if self.area.get_selected_items(): + + path = self.area.get_selected_items()[0] + iter = self.area.modelo.get_iter(path) + direccion += self.area.modelo.get_value(iter, 0) + lectura, escritura, ejecucion = Archivos.get_permisos(direccion) + + if tecla == 32: + if lectura: + self.preferencias() + + elif tecla == 65535: + if lectura and escritura: + self.borrar_archivo() + + if tecla == 43: + if lectura and escritura: + self.crear_directorio() + + def crear_directorio(self, *args): + + lectura, escritura, ejecucion = Archivos.get_permisos(self.direccion) + + if lectura and escritura: + crear = Archivos.CrearDirectorio(self.direccion) + crear.connect('creado', self.update) + crear.show_all() + + def borrar_archivo(self, *args): + + direccion = self.get_nueva_direccion() + lectura, escritura, ejecucion = Archivos.get_permisos(direccion) + + if lectura and escritura: + borrar = Archivos.Borrar(direccion) + borrar.connect('borrado', self.update) + borrar.show_all() + + def preferencias(self, *args): + + direccion = self.get_nueva_direccion() + lectura, escritura, ejecucion = Archivos.get_permisos(direccion) + + if lectura: + propiedades = Archivos.Propiedades(direccion) + propiedades.connect('cambio-de-propiedades', self.update) + propiedades.show_all() + + def nueva_direccion(self, widget, direccion=None, *args): + """Abre la dirección introducida""" + + if not direccion: + direccion = widget.get_text() + + else: + if direccion == '~': + direccion = os.path.expanduser('~') + + self.abrir(direccion) + + def borrar_todo(self, *args): + """Borra todos los archivos y carpetas de las listas""" + + while len(self.carpetas) > 0: + for carpeta in self.carpetas: + self.carpetas.remove(carpeta) + + while len(self.archivos) > 0: + for archivo in self.archivos: + self.archivos.remove(archivo) + + self.area.borrar_area() + self.b_estado.borrar() + + def update(self, *args): + """Recarga el directorio acual""" + + self.borrar_todo() + self.abrir(self.direccion) + + def abrir_arriba(self, *args): + """Abre la carpeta que contiene la actual""" + + list = self.direccion.split('/') + + try: + direccion = '/' + numero = len(list) - 1 + while not bool(list[numero]): + numero -= 1 + + for directorio in list[:numero]: + if directorio: + direccion = direccion + directorio + '/' + + except IndexError: + direccion = '/' + + self.direccion = direccion + self.entrada.set_text(direccion) + self.entrada.activate() + self.update() + + def change_ocultos(self, widget): + """Cambia de mostrar ocultos a no mostrar ocultos o viceversa""" + + self.ocultos = not self.ocultos + + if self.ocultos: + stock = Gtk.STOCK_NO + widget.set_tooltip_text('No mostrar archivos ocultos') + + else: + stock = Gtk.STOCK_YES + widget.set_tooltip_text('Mostrar archivos ocultos') + + widget.set_icon_name(stock) + self.update() + + def get_nueva_direccion(self): + + try: + direccion = self.direccion + if direccion[-1] != '/': + direccion += '/' + + path = self.area.get_selected_items()[0] + iter = self.area.modelo.get_iter(path) + direccion += self.area.modelo.get_value(iter, 0) + + return direccion + + except: + return self.direccion diff --git a/CExplorer.pyc b/CExplorer.pyc Binary files differnew file mode 100644 index 0000000..b8bdad3 --- /dev/null +++ b/CExplorer.pyc diff --git a/Iconos/audio.svg b/Iconos/audio.svg new file mode 100644 index 0000000..5a3756b --- /dev/null +++ b/Iconos/audio.svg @@ -0,0 +1,14 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="clipping-audio"> + <g display="inline"> + <g> + <polygon fill="&fill_color;" points="10.932,6.088 31.874,6.088 43.818,18.027 43.818,48.914 10.932,48.914 " stroke="&stroke_color;" stroke-width="3.5"/> + <polyline fill="none" points="43.818,18.027 31.874,18.027 31.874,6.088 " stroke="&stroke_color;" stroke-width="3.5"/> + </g> + </g> + <path d="M28.325,39.697c-0.511-1.457-3.21-1.073-4.41-0.07 c-2.4,2.009-0.424,4.396,2.324,3.277C27.803,42.266,28.835,41.156,28.325,39.697z" display="inline" fill="&stroke_color;" stroke="&stroke_color;" stroke-width="3.5"/> + <line display="inline" fill="none" stroke="&stroke_color;" stroke-width="2.25" x1="28.941" x2="28.941" y1="39.806" y2="26.967"/> + <polygon display="inline" fill="&stroke_color;" points="35.047,25.036 27.838,28.595 27.838,24.728 35.047,21.166 "/> +</g></svg>
\ No newline at end of file diff --git a/Iconos/borrar_archivo.svg b/Iconos/borrar_archivo.svg new file mode 100644 index 0000000..b9189dc --- /dev/null +++ b/Iconos/borrar_archivo.svg @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 55 55" + height="40" + version="1.1" + viewBox="0 0 40 40" + width="40" + x="0px" + xml:space="preserve" + y="0px" + id="svg2" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="texto.svg"><metadata + id="metadata23"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs21"> + + + + + + +</defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview19" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="27.5" + inkscape:cy="27.5" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="0" + inkscape:current-layer="svg2" /><g + style="display:inline" + id="g5" + display="inline" + transform="matrix(0.68291947,0,0,0.68291947,2.4998165,2.928975)"> + <g + id="g7"> + <polygon + style="fill:#ffffff;stroke:#010101;stroke-width:3.5" + id="polygon9" + points="31.874,6.088 43.818,18.027 43.818,48.914 10.932,48.914 10.932,6.088 " /> + <polyline + style="fill:none;stroke:#010101;stroke-width:3.5" + id="polyline11" + points="43.818,18.027 31.874,18.027 31.874,6.088 " /> + </g> + </g><path + style="fill:#010101;fill-opacity:1;display:inline" + inkscape:connector-curvature="0" + id="path5-2" + display="inline" + d="M 15.683831,2.981779 C 13.183724,0.48138796 9.1313277,0.48252576 6.6329285,2.9812097 4.1322528,5.4818854 4.1319681,9.5331436 6.6323591,12.033535 c 2.5003911,2.500107 6.5513649,2.499823 9.0520399,-8.53e-4 2.4984,-2.4986844 2.499823,-6.5507966 -5.68e-4,-9.050903 z m -3.61234,7.71537 c -5.69e-4,0.504629 -0.409052,0.914818 -0.91425,0.91425 -0.252883,2.84e-4 -0.481588,-0.102121 -0.647143,-0.267676 -0.165555,-0.16527 -0.267391,-0.393975 -0.267391,-0.645721 l 0,-2.3172 H 7.925508 C 7.673478,8.3805182 7.4450579,8.2786816 7.2795029,8.1134113 7.113948,7.9475717 7.0115429,7.7185829 7.0115429,7.4659835 c 0,-0.5043447 0.4093357,-0.9139651 0.9151029,-0.9133958 H 10.242992 V 4.236241 c -8.54e-4,-0.5051978 0.409051,-0.9151029 0.91368,-0.9151029 0.504629,0 0.915387,0.4090511 0.914534,0.9145345 l 2.85e-4,2.3169151 2.3172,2.847e-4 c 0.504914,-0.00146 0.91368,0.4090511 0.913965,0.9139642 5.69e-4,0.5049143 -0.409905,0.9142501 -0.914535,0.9145347 h -2.316345 v 2.3157777 z" /><rect + ry="1.000953" + style="fill:#000000;fill-opacity:1" + id="rect3073" + width="2.0019059" + height="8.2930231" + x="10.157025" + y="3.3170733" /><rect + ry="1.000953" + style="fill:#ffffff;fill-opacity:1" + id="rect3075" + width="2.0019059" + height="8.2930231" + x="6.4438391" + y="-15.34208" + transform="matrix(0,1,-1,0,0,0)" /></svg>
\ No newline at end of file diff --git a/Iconos/borrar_directorio.svg b/Iconos/borrar_directorio.svg new file mode 100644 index 0000000..de3b27f --- /dev/null +++ b/Iconos/borrar_directorio.svg @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 55.125 55" + height="40" + version="1.1" + viewBox="0 0 40 40" + width="40" + x="0px" + xml:space="preserve" + y="0px" + id="svg2" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="mas.svg"><metadata + id="metadata11"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs9"> + +</defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="545" + id="namedview7" + showgrid="false" + inkscape:zoom="12.136524" + inkscape:cx="19.029442" + inkscape:cy="17.684061" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" /><path + id="path4" + style="fill:#ffffff;stroke:#010101;stroke-width:2.23581004;stroke-linecap:round;stroke-linejoin:round" + d="m 2.9229898,12.41147 3.7263496,-3.7263509 7.4526996,0 3.72635,3.7263509 14.9054,0 0,23.10337 -29.8107992,0 z" + inkscape:connector-curvature="0" /><path + style="fill:#010101;fill-opacity:1;display:inline" + inkscape:connector-curvature="0" + id="path5-2" + display="inline" + d="m 37.121292,7.5114905 c -2.740068,-2.74038 -7.181416,-2.739133 -9.919613,-6.24e-4 -2.740692,2.7406925 -2.741004,7.1807925 -6.24e-4,9.9211725 2.74038,2.740068 7.180169,2.739757 9.92086,-9.35e-4 2.738198,-2.738509 2.739757,-7.179545 -6.23e-4,-9.9196135 z m -3.959054,8.4558955 c -6.24e-4,0.553064 -0.448313,1.002623 -1.002,1.002 -0.277155,3.12e-4 -0.527811,-0.111922 -0.709256,-0.293367 -0.181445,-0.181133 -0.293055,-0.431789 -0.293055,-0.707698 l 0,-2.539606 h -2.539606 c -0.27622,-3.11e-4 -0.526564,-0.111922 -0.708009,-0.293055 -0.181445,-0.181757 -0.293679,-0.432724 -0.293679,-0.709568 0,-0.552752 0.448624,-1.001688 1.002935,-1.001064 h 2.538671 V 8.8863565 c -9.36e-4,-0.553687 0.448312,-1.002935 1.001375,-1.002935 0.553064,0 1.003247,0.448312 1.002312,1.002312 l 3.12e-4,2.5392945 2.539606,3.12e-4 c 0.553376,-0.0016 1.001376,0.448312 1.001688,1.001687 6.24e-4,0.553376 -0.449248,1.002 -1.002312,1.002312 h -2.53867 v 2.538047 z" /><rect + style="fill:#c83737;fill-opacity:1" + id="rect3059" + width="31.228813" + height="18.877119" + x="83.665253" + y="16.927965" /><rect + y="21.886274" + x="53.558105" + height="9.0889921" + width="2.1940501" + id="rect3063" + style="fill:#ffffff;fill-opacity:1" + ry="1.097025" /><rect + ry="1.097025" + style="fill:#000000;fill-opacity:1" + id="rect3073" + width="2.1940501" + height="9.0889921" + x="31.06402" + y="7.8789682" /><rect + ry="1.097025" + style="fill:#ffffff;fill-opacity:1" + id="rect3075" + width="2.1940501" + height="9.0889921" + x="11.305841" + y="-36.746742" + transform="matrix(0,1,-1,0,0,0)" /></svg>
\ No newline at end of file diff --git a/Iconos/compressed.svg b/Iconos/compressed.svg new file mode 100644 index 0000000..d998fc5 --- /dev/null +++ b/Iconos/compressed.svg @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 55 55" + height="55px" + version="1.1" + viewBox="0 0 55 55" + width="55px" + x="0px" + xml:space="preserve" + y="0px" + id="svg3050" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="zip.svg"><metadata + id="metadata3071"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs + id="defs3069"> + + + + +</defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="545" + id="namedview3067" + showgrid="false" + inkscape:zoom="5.6568542" + inkscape:cx="13.441559" + inkscape:cy="27.546609" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg3050" /><rect + style="fill:#010101;fill-opacity:1" + id="rect3086" + width="36.524017" + height="3.8222809" + x="5.457725" + y="19.650047" /><rect + y="-7.7935638" + x="19.650047" + height="3.8222809" + width="29.728853" + id="rect3088" + style="fill:#010101;fill-opacity:1" + transform="matrix(0,1,-1,0,0,0)" + inkscape:transform-center-y="14.864426" /><rect + y="45.556622" + x="5.457725" + height="3.8222809" + width="36.524017" + id="rect2991" + style="fill:#010101;fill-opacity:1" /><rect + inkscape:transform-center-y="14.864426" + transform="matrix(0,1,-1,0,0,0)" + style="fill:#010101;fill-opacity:1" + id="rect2993" + width="29.728853" + height="3.8222809" + x="19.650047" + y="-42.021709" /><rect + inkscape:transform-center-y="-3.3565009" + transform="matrix(0.76689995,-0.64176667,0.64176667,0.76689995,0,0)" + style="fill:#010101;fill-opacity:1" + id="rect3009" + width="10.460194" + height="3.8222809" + x="-9.5678978" + y="17.620935" + inkscape:transform-center-x="-4.0109611" /><rect + inkscape:transform-center-x="-4.0109611" + y="40.499416" + x="16.394217" + height="3.8222809" + width="10.460194" + id="rect3011" + style="fill:#010101;fill-opacity:1" + transform="matrix(0.76689995,-0.64176667,0.64176667,0.76689995,0,0)" + inkscape:transform-center-y="-3.3565009" /><rect + y="12.932533" + x="11.998463" + height="3.8222809" + width="37.054348" + id="rect3013" + style="fill:#010101;fill-opacity:1" /><rect + y="-50.054855" + x="12.925936" + height="3.8222809" + width="29.728853" + id="rect3015" + style="fill:#010101;fill-opacity:1" + transform="matrix(0,1,-1,0,0,0)" + inkscape:transform-center-y="14.864426" /><rect + inkscape:transform-center-y="-3.3565009" + transform="matrix(0.76689995,-0.64176667,0.64176667,0.76689995,0,0)" + style="fill:#010101;fill-opacity:1" + id="rect3017" + width="10.460194" + height="3.8222809" + x="0.53772563" + y="61.014023" + inkscape:transform-center-x="-4.0109611" /><rect + inkscape:transform-center-y="-3.1137721" + transform="matrix(0.71716338,-0.69690508,0.67227098,0.74030516,0,0)" + style="fill:#010101;fill-opacity:1" + id="rect3019" + width="8.9360065" + height="1.7827625" + x="2.1582694" + y="30.680279" + inkscape:transform-center-x="-3.2042891" /><rect + style="fill:#000000;fill-opacity:1" + id="rect2992" + width="0" + height="0" + x="0" + y="0" /><path + style="fill:#ffffff;fill-opacity:1" + d="m 7.6432831,34.524458 0,-11.136932 15.2911839,0 15.291185,0 0,11.136932 0,11.136932 -15.291185,0 -15.2911839,0 0,-11.136932 z" + id="path2994" + inkscape:connector-curvature="0" /><path + style="fill:#ffffff;fill-opacity:1" + d="m 10.47171,19.429177 c 0,-0.03809 0.666034,-0.634716 1.480074,-1.325826 l 1.480074,-1.256562 6.514648,0 6.514647,0 -1.316977,1.325825 -1.316977,1.325825 -6.677744,0 c -3.67276,0 -6.677745,-0.03117 -6.677745,-0.06926 z" + id="path2996" + inkscape:connector-curvature="0" /><path + style="fill:#ffffff;fill-opacity:1" + d="m 27.97762,18.170449 1.32799,-1.327991 6.699701,0.04636 6.6997,0.04636 -1.522054,1.281631 -1.522053,1.281631 -6.505637,0 -6.505638,0 1.327991,-1.32799 z" + id="path2998" + inkscape:connector-curvature="0" /><path + style="fill:#ffffff;fill-opacity:1" + d="m 42.114739,33.397433 0,-10.693014 1.635184,-1.3688 c 0.899352,-0.75284 1.814171,-1.527827 2.032932,-1.722193 l 0.397748,-0.353393 -0.0032,10.769999 -0.0032,10.769999 -1.708319,1.414214 c -0.939575,0.777817 -1.852938,1.518161 -2.029696,1.645207 -0.309657,0.222571 -0.321378,-0.159 -0.321378,-10.462019 z" + id="path3000" + inkscape:connector-curvature="0" /></svg>
\ No newline at end of file diff --git a/Iconos/desconocido.svg b/Iconos/desconocido.svg new file mode 100644 index 0000000..c094044 --- /dev/null +++ b/Iconos/desconocido.svg @@ -0,0 +1,15 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="clipping-data"> + <g> + <g> + <polygon fill="&fill_color;" points="10.932,6.088 31.874,6.088 43.818,18.027 43.818,48.914 10.932,48.914 " stroke="&stroke_color;" stroke-width="3.5"/> + <polyline fill="none" points="43.818,18.027 31.874,18.027 31.874,6.088 " stroke="&stroke_color;" stroke-width="3.5"/> + </g> + </g> + <rect fill="&stroke_color;" height="5.5" width="5.5" x="16.441" y="34.625"/> + <rect fill="&stroke_color;" height="5.5" width="5.5" x="21.941" y="29.125"/> + <rect fill="&stroke_color;" height="5.5" width="5.5" x="27.441" y="34.625"/> + <rect fill="&stroke_color;" height="5.5" width="5.5" x="32.941" y="29.125"/> +</g></svg>
\ No newline at end of file diff --git a/Iconos/directory.svg b/Iconos/directory.svg new file mode 100644 index 0000000..688ffc3 --- /dev/null +++ b/Iconos/directory.svg @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="55px" + viewBox="0 0 55 55" + width="55px" + id="svg2" + version="1.1" + inkscape:version="0.48.1 r9760" + sodipodi:docname="user-documents.svg"> + <metadata + id="metadata18"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs16" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1200" + inkscape:window-height="837" + id="namedview14" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="27.966102" + inkscape:cy="27.5" + inkscape:window-x="0" + inkscape:window-y="31" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" /> + <path + d="m 7,14 5,-5 10,0 5,5 20,0 0,31 -40,0 z" + style="fill:#FFFFFF;stroke:#010101;stroke-width:3;stroke-linecap:round;stroke-linejoin:round" + id="path4" /> +</svg> diff --git a/Iconos/directory_dennied.svg b/Iconos/directory_dennied.svg new file mode 100644 index 0000000..7936e8b --- /dev/null +++ b/Iconos/directory_dennied.svg @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="55px" + viewBox="0 0 55 55" + width="55px" + id="svg2" + version="1.1" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="directory_dennied.svg"> + <metadata + id="metadata18"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs16" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="541" + id="namedview14" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="27.966102" + inkscape:cy="27.5" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" /> + <path + d="m 7,14 5,-5 10,0 5,5 20,0 0,31 -40,0 z" + style="fill:#FFFFFF;stroke:#010101;stroke-width:3;stroke-linecap:round;stroke-linejoin:round" + id="path4" /> + <g + id="g2986" + transform="matrix(1.2871121,0,0,1.2871121,35.049817,-7.784965)"> + <rect + transform="matrix(0.74971562,-0.66176015,0.66176015,0.74971562,0,0)" + y="15.74616" + x="-38.146233" + height="3.3626575" + width="28.429741" + id="rect2982" + style="fill:#ff0000;fill-rule:evenodd;stroke:none" /> + <rect + style="fill:#ff0000;fill-rule:evenodd;stroke:none" + id="rect2984" + width="28.429741" + height="3.3626575" + x="-28.53653" + y="24.228468" + transform="matrix(-0.74971562,-0.66176015,-0.66176015,0.74971562,0,0)" /> + </g> +</svg> diff --git a/Iconos/file_dennied.svg b/Iconos/file_dennied.svg new file mode 100644 index 0000000..bfe0ee9 --- /dev/null +++ b/Iconos/file_dennied.svg @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 55 55" + height="55px" + version="1.1" + viewBox="0 0 55 55" + width="55px" + x="0px" + xml:space="preserve" + y="0px" + id="svg2" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="plain.svg"><metadata + id="metadata23"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs21"> + + + + +</defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview19" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="27.5" + inkscape:cy="27.5" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="0" + inkscape:current-layer="svg2" /><g + style="display:inline" + id="g5" + display="inline"> + <g + id="g7"> + <polygon + style="fill:#ffffff;stroke:#010101;stroke-width:3.5" + id="polygon9" + points="43.818,18.027 43.818,48.914 10.932,48.914 10.932,6.088 31.874,6.088 " /> + <polyline + style="fill:none;stroke:#010101;stroke-width:3.5" + id="polyline11" + points="43.818,18.027 31.874,18.027 31.874,6.088 " /> + </g> + </g><g + id="g2986" + transform="translate(33.360168,4.0760146)"><rect + transform="matrix(0.74971562,-0.66176015,0.66176015,0.74971562,0,0)" + y="15.74616" + x="-38.146233" + height="3.3626575" + width="28.429741" + id="rect2982" + style="fill:#ff0000;fill-rule:evenodd;stroke:none" /><rect + style="fill:#ff0000;fill-rule:evenodd;stroke:none" + id="rect2984" + width="28.429741" + height="3.3626575" + x="-28.53653" + y="24.228468" + transform="matrix(-0.74971562,-0.66176015,-0.66176015,0.74971562,0,0)" /></g></svg>
\ No newline at end of file diff --git a/Iconos/html.svg b/Iconos/html.svg new file mode 100644 index 0000000..dfc5af1 --- /dev/null +++ b/Iconos/html.svg @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 58.5 55" + height="55px" + version="1.1" + viewBox="0 0 58.5 55" + width="58.5px" + x="0px" + xml:space="preserve" + y="0px" + id="svg2" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="texto-html.svg"><metadata + id="metadata35"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs + id="defs33"> + + + + + + + + + + + + + + + + + + + + + +</defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="809" + inkscape:window-height="480" + id="namedview31" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="57.730702" + inkscape:cy="22.391784" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="0" + inkscape:current-layer="svg2" /><g + style="display:inline" + display="inline" + id="g3054" + transform="translate(2.8313498,-0.00100006)"> + <g + id="g3056"> + <polygon + style="fill:#ffffff;stroke:#010101;stroke-width:3.5" + points="43.818,48.914 10.932,48.914 10.932,6.088 31.874,6.088 43.818,18.027 " + id="polygon3058" /> + <polyline + style="fill:none;stroke:#010101;stroke-width:3.5" + points="43.818,18.027 31.874,18.027 31.874,6.088 " + id="polyline3060" /> + </g> + </g><circle + cx="29.122999" + cy="28.4" + r="6.4689999" + id="circle19-5" + d="m 35.591999,28.4 c 0,3.57273 -2.89627,6.468999 -6.469,6.468999 -3.57273,0 -6.469,-2.896269 -6.469,-6.468999 0,-3.57273 2.89627,-6.469 6.469,-6.469 3.57273,0 6.469,2.89627 6.469,6.469 z" + sodipodi:cx="29.122999" + sodipodi:cy="28.4" + sodipodi:rx="6.4689999" + sodipodi:ry="6.4689999" + style="fill:#010101;fill-opacity:1" + transform="matrix(1.7203268,0,0,1.7203268,-19.571415,-16.464073)" /><path + style="fill:#010101;fill-opacity:1;stroke:#ffffff;stroke-width:1.67731869" + inkscape:connector-curvature="0" + id="path23-7" + d="m 30.531383,21.266134 c 0,0 6.186295,5.111091 6.186295,11.168362 0,6.060711 -6.186295,11.087506 -6.186295,11.087506" /><path + style="fill:#010101;fill-opacity:1;stroke:#ffffff;stroke-width:1.67731869" + inkscape:connector-curvature="0" + id="path25-9" + d="m 30.531383,21.266134 c 0,0 -6.26543,4.693052 -6.26543,11.168362 0,6.47703 6.26543,11.087506 6.26543,11.087506" /><line + style="fill:none;stroke:#ffffff;stroke-width:1.67731869" + id="line27-4" + y2="43.522003" + y1="21.266132" + x2="30.531384" + x1="30.531384" /><line + style="fill:none;stroke:#ffffff;stroke-width:1.67731869" + id="line29-0" + y2="32.394066" + y1="32.394066" + x2="41.424541" + x1="19.168676" /></svg>
\ No newline at end of file diff --git a/Iconos/mas.svg b/Iconos/mas.svg new file mode 100644 index 0000000..cff6fb7 --- /dev/null +++ b/Iconos/mas.svg @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 55.125 55" + height="40" + version="1.1" + viewBox="0 0 40 40" + width="40" + x="0px" + xml:space="preserve" + y="0px" + id="svg2" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="mas.svg"><metadata + id="metadata11"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs + id="defs9"> + +</defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="545" + id="namedview7" + showgrid="false" + inkscape:zoom="6.0682618" + inkscape:cx="12.898378" + inkscape:cy="12.608632" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" /><path + id="path4" + style="fill:#ffffff;stroke:#010101;stroke-width:2.23581004;stroke-linecap:round;stroke-linejoin:round" + d="m 2.9229898,12.41147 3.7263496,-3.7263509 7.4526996,0 3.72635,3.7263509 14.9054,0 0,23.10337 -29.8107992,0 z" + inkscape:connector-curvature="0" /><path + style="fill:#010101;fill-opacity:1;display:inline" + inkscape:connector-curvature="0" + id="path5-2" + display="inline" + d="m 37.121292,7.5114905 c -2.740068,-2.74038 -7.181416,-2.739133 -9.919613,-6.24e-4 -2.740692,2.7406925 -2.741004,7.1807925 -6.24e-4,9.9211725 2.74038,2.740068 7.180169,2.739757 9.92086,-9.35e-4 2.738198,-2.738509 2.739757,-7.179545 -6.23e-4,-9.9196135 z m -3.959054,8.4558955 c -6.24e-4,0.553064 -0.448313,1.002623 -1.002,1.002 -0.277155,3.12e-4 -0.527811,-0.111922 -0.709256,-0.293367 -0.181445,-0.181133 -0.293055,-0.431789 -0.293055,-0.707698 l 0,-2.539606 h -2.539606 c -0.27622,-3.11e-4 -0.526564,-0.111922 -0.708009,-0.293055 -0.181445,-0.181757 -0.293679,-0.432724 -0.293679,-0.709568 0,-0.552752 0.448624,-1.001688 1.002935,-1.001064 h 2.538671 V 8.8863565 c -9.36e-4,-0.553687 0.448312,-1.002935 1.001375,-1.002935 0.553064,0 1.003247,0.448312 1.002312,1.002312 l 3.12e-4,2.5392945 2.539606,3.12e-4 c 0.553376,-0.0016 1.001376,0.448312 1.001688,1.001687 6.24e-4,0.553376 -0.449248,1.002 -1.002312,1.002312 h -2.53867 v 2.538047 z" /><rect + style="fill:#c83737;fill-opacity:1" + id="rect3059" + width="31.228813" + height="18.877119" + x="83.665253" + y="16.927965" /><rect + y="7.8789701" + x="31.146418" + height="9.0889921" + width="2.1940501" + id="rect3063" + style="fill:#ffffff;fill-opacity:1" + ry="1.097025" /><rect + ry="1.097025" + style="fill:#ffffff;fill-opacity:1" + id="rect3069" + width="2.1940501" + height="9.0889921" + x="11.32644" + y="-36.787937" + transform="matrix(0,1,-1,0,0,0)" /></svg>
\ No newline at end of file diff --git a/Iconos/pdf.svg b/Iconos/pdf.svg new file mode 100644 index 0000000..62fbd8f --- /dev/null +++ b/Iconos/pdf.svg @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 55 55" + height="55px" + version="1.1" + viewBox="0 0 55 55" + width="55px" + x="0px" + xml:space="preserve" + y="0px" + id="svg2" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="texto-python.svg"><metadata + id="metadata23"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs21"> + + + + + + + + +</defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="545" + id="namedview19" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="-18.276501" + inkscape:cy="40.853356" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" + inkscape:snap-nodes="false" + inkscape:object-paths="true" + inkscape:snap-intersection-paths="true" + inkscape:object-nodes="true" + inkscape:snap-bbox="false" /><g + style="display:inline" + id="g5" + display="inline" + transform="translate(0.93220339,-0.46610169)"> + <g + id="g7"> + <polygon + style="fill:#ffffff;stroke:#010101;stroke-width:3.5" + id="polygon9" + points="10.932,48.914 10.932,6.088 31.874,6.088 43.818,18.027 43.818,48.914 " /> + <polyline + style="fill:none;stroke:#010101;stroke-width:3.5" + id="polyline11" + points="43.818,18.027 31.874,18.027 31.874,6.088 " /> + </g> + </g><rect + style="fill:#010101;fill-opacity:1" + id="rect3205" + width="26.800848" + height="13.050849" + x="3.7288134" + y="10.25424" + rx="4.9749885" /><text + xml:space="preserve" + style="font-size:10px;font-style:normal;font-weight:bold;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans Bold" + x="5.3601699" + y="20.275421" + id="text3207" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3209" + x="5.3601699" + y="20.275421">PDF</tspan></text> +<path + sodipodi:type="star" + style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="path3367" + sodipodi:sides="3" + sodipodi:cx="-98.580505" + sodipodi:cy="19.110168" + sodipodi:r1="15.335383" + sodipodi:r2="7.6676917" + sodipodi:arg1="-0.2929124" + sodipodi:arg2="0.75428515" + inkscape:flatsided="true" + inkscape:rounded="-0.28" + inkscape:randomized="0" + d="m -83.898302,14.682202 c -2.147449,-7.12049 -25.428828,17.656611 -18.188578,19.357111 7.240254,1.700499 -2.57666,-30.8503136 -7.66946,-25.4303227 -5.0928,5.4199907 28.005488,13.1937027 25.858038,6.0732117 z" + inkscape:transform-center-x="-0.63949326" + inkscape:transform-center-y="-6.3722688" + transform="matrix(0.35646604,-0.77477054,0.7339345,0.11249894,50.500387,-42.216027)" /></svg>
\ No newline at end of file diff --git a/Iconos/pendrive.svg b/Iconos/pendrive.svg new file mode 100644 index 0000000..2fd43a1 --- /dev/null +++ b/Iconos/pendrive.svg @@ -0,0 +1,9 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#ffffff"> +]><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="media-flash-usb"> + <g display="inline"> + <path d="M15.885,16.723c-6.641,0-12.023,5.385-12.023,12.025 c0,6.639,5.383,12.023,12.023,12.023h0.014h27.259V16.723H15.899" fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5"/> + <rect fill="&fill_color;" height="14.182" stroke="&stroke_color;" stroke-width="3.5" width="9.14" x="43.722" y="21.731"/> + </g> +</g></svg>
\ No newline at end of file diff --git a/Iconos/plain.svg b/Iconos/plain.svg new file mode 100644 index 0000000..ae37e77 --- /dev/null +++ b/Iconos/plain.svg @@ -0,0 +1,14 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="clipping-text"> + <g display="inline"> + <g> + <polygon fill="&fill_color;" points="10.932,6.088 31.874,6.088 43.818,18.027 43.818,48.914 10.932,48.914 " stroke="&stroke_color;" stroke-width="3.5"/> + <polyline fill="none" points="43.818,18.027 31.874,18.027 31.874,6.088 " stroke="&stroke_color;" stroke-width="3.5"/> + </g> + </g> + <line display="inline" fill="none" stroke="&stroke_color;" stroke-width="3.5" x1="17.875" x2="36.875" y1="26.25" y2="26.25"/> + <line display="inline" fill="none" stroke="&stroke_color;" stroke-width="3.5" x1="17.875" x2="36.875" y1="33.25" y2="33.25"/> + <line display="inline" fill="none" stroke="&stroke_color;" stroke-width="3.5" x1="17.875" x2="36.875" y1="40.25" y2="40.25"/> +</g></svg>
\ No newline at end of file diff --git a/Iconos/preferencias.svg b/Iconos/preferencias.svg new file mode 100644 index 0000000..01d93a6 --- /dev/null +++ b/Iconos/preferencias.svg @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 55 55" + height="40" + id="Layer_1" + version="1.1" + viewBox="0 0 40 40" + width="40" + x="0px" + xml:space="preserve" + y="0px" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="preferences-system.svg"><metadata + id="metadata3034"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs3032"> + + + + +</defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="545" + id="namedview3030" + showgrid="false" + inkscape:zoom="6.8181818" + inkscape:cx="27.5" + inkscape:cy="15.766667" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="Layer_1" /><g + style="display:inline" + display="inline" + id="g3104" + transform="matrix(0.75622041,0,0,0.75622041,0.01671723,-0.15681713)"> + <g + id="g3106"> + <polygon + style="fill:#ffffff;stroke:#010101;stroke-width:3.5" + points="43.818,18.027 43.818,48.914 10.932,48.914 10.932,6.088 31.874,6.088 " + id="polygon3108" /> + <polyline + style="fill:none;stroke:#010101;stroke-width:3.5" + points="43.818,18.027 31.874,18.027 31.874,6.088 " + id="polyline3110" /> + </g> + </g><g + transform="matrix(0.38454406,0,0,0.38454406,10.48663,13.769352)" + style="fill:#010101;fill-opacity:1;display:block" + id="g3132" + display="block"> + <path + inkscape:connector-curvature="0" + id="path3134" + style="fill:#010101;fill-opacity:1" + d="m 51.103,50.895 c -2.343,2.343 -6.143,2.343 -8.485,0 L 19.813,28.091 c -2.343,-2.343 -2.343,-6.143 0,-8.485 l 0,0 c 2.343,-2.343 6.143,-2.343 8.485,0 L 51.102,42.41 c 2.343,2.342 2.343,6.142 0.001,8.485 l 0,0 z" /> + <g + style="fill:#010101;fill-opacity:1" + id="g3136"> + <g + style="fill:#010101;fill-opacity:1" + id="g3138"> + <path + inkscape:connector-curvature="0" + id="path3140" + style="fill:#010101;fill-opacity:1" + d="m 17.813,2.254 c -0.804,0 -1.587,0.081 -2.358,0.2 L 26.012,13.012 13.22,25.804 2.662,15.246 c -0.119,0.771 -0.2,1.555 -0.2,2.36 0,8.479 6.873,15.352 15.351,15.352 8.478,0 15.351,-6.873 15.351,-15.352 0,-8.479 -6.873,-15.352 -15.351,-15.352 z" /> + </g> + </g> +</g></svg>
\ No newline at end of file diff --git a/Iconos/python.svg b/Iconos/python.svg new file mode 100644 index 0000000..225d792 --- /dev/null +++ b/Iconos/python.svg @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 55 55" + height="55px" + version="1.1" + viewBox="0 0 55 55" + width="55px" + x="0px" + xml:space="preserve" + y="0px" + id="svg2" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="texto.svg"><metadata + id="metadata23"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs21"> + + + + +</defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview19" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="27.5" + inkscape:cy="27.5" + inkscape:window-x="206" + inkscape:window-y="65" + inkscape:window-maximized="0" + inkscape:current-layer="svg2" /><g + style="display:inline" + id="g5" + display="inline" + transform="translate(0.93220339,-0.46610169)"> + <g + id="g7"> + <polygon + style="fill:#ffffff;stroke:#010101;stroke-width:3.5" + id="polygon9" + points="10.932,48.914 10.932,6.088 31.874,6.088 43.818,18.027 43.818,48.914 " /> + <polyline + style="fill:none;stroke:#010101;stroke-width:3.5" + id="polyline11" + points="43.818,18.027 31.874,18.027 31.874,6.088 " /> + </g> + </g><g + id="activity-pippy" + display="block" + style="display:block" + transform="matrix(0.48221939,0,0,0.48221939,14.65323,19.103125)"> + <path + id="path3086" + d="m 28.497,48.507 c 5.988,0 14.88,-2.838 14.88,-11.185 0,-9.285 -7.743,-10.143 -10.954,-11.083 -3.549,-0.799 -5.913,-1.914 -6.055,-3.455 -0.243,-2.642 1.158,-3.671 3.946,-3.671 0,0 6.632,3.664 12.266,0.74 1.588,-0.823 4.432,-4.668 4.432,-7.32 0,-2.653 -9.181,-5.719 -11.967,-5.719 -2.788,0 -5.159,3.847 -5.159,3.847 -5.574,0 -11.149,5.306 -11.149,10.612 0,5.305 5.333,9.455 11.707,10.612 2.963,0.469 5.441,2.22 4.878,5.438 -0.457,2.613 -2.995,5.306 -8.361,5.306 -4.252,0 -13.3,-0.219 -14.745,-4.079 -0.929,-2.486 0.168,-5.205 1.562,-5.205 l -0.027,-0.16 c -1.42,-0.158 -5.548,0.16 -5.548,5.465 -10e-4,6.802 9.144,9.857 20.294,9.857 z" + inkscape:connector-curvature="0" + style="fill:#ffffff;stroke:#010101;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round" /> + <path + id="path3088" + d="m 42.579,19.854 c -2.623,-0.287 -6.611,-2 -7.467,-5.022" + inkscape:connector-curvature="0" + style="fill:none;stroke:#010101;stroke-width:3;stroke-linecap:round" /> + <circle + id="circle3090" + r="1.676" + cy="10.96" + cx="35.805" + sodipodi:cx="35.805" + sodipodi:cy="10.96" + sodipodi:rx="1.676" + sodipodi:ry="1.676" + style="fill:#010101" + d="m 37.481,10.96 c 0,0.925629 -0.75037,1.676 -1.676,1.676 -0.925629,0 -1.676,-0.750371 -1.676,-1.676 0,-0.925629 0.750371,-1.676 1.676,-1.676 0.92563,0 1.676,0.750371 1.676,1.676 z" /> +</g></svg>
\ No newline at end of file diff --git a/Iconos/sound.svg b/Iconos/sound.svg new file mode 100644 index 0000000..5a3756b --- /dev/null +++ b/Iconos/sound.svg @@ -0,0 +1,14 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="clipping-audio"> + <g display="inline"> + <g> + <polygon fill="&fill_color;" points="10.932,6.088 31.874,6.088 43.818,18.027 43.818,48.914 10.932,48.914 " stroke="&stroke_color;" stroke-width="3.5"/> + <polyline fill="none" points="43.818,18.027 31.874,18.027 31.874,6.088 " stroke="&stroke_color;" stroke-width="3.5"/> + </g> + </g> + <path d="M28.325,39.697c-0.511-1.457-3.21-1.073-4.41-0.07 c-2.4,2.009-0.424,4.396,2.324,3.277C27.803,42.266,28.835,41.156,28.325,39.697z" display="inline" fill="&stroke_color;" stroke="&stroke_color;" stroke-width="3.5"/> + <line display="inline" fill="none" stroke="&stroke_color;" stroke-width="2.25" x1="28.941" x2="28.941" y1="39.806" y2="26.967"/> + <polygon display="inline" fill="&stroke_color;" points="35.047,25.036 27.838,28.595 27.838,24.728 35.047,21.166 "/> +</g></svg>
\ No newline at end of file diff --git a/Iconos/video.svg b/Iconos/video.svg new file mode 100644 index 0000000..a20349c --- /dev/null +++ b/Iconos/video.svg @@ -0,0 +1,17 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="clipping-video"> + <g display="inline"> + <g> + <polygon fill="&fill_color;" points="48.788,43.944 48.788,23.002 36.849,11.058 5.962,11.058 5.962,43.944 " stroke="&stroke_color;" stroke-width="3.5"/> + <polyline fill="none" points="36.849,11.058 36.849,23.002 48.788,23.002 " stroke="&stroke_color;" stroke-width="3.5"/> + </g> + </g> + <path d="M27.504,24.842c-4.757,0-8.72,4.744-8.72,4.744s3.963,4.767,8.72,4.764 c4.757-0.004,8.722-4.77,8.722-4.77S32.262,24.839,27.504,24.842z M27.504,32.932c-1.842,0-3.335-1.494-3.335-3.336 c0-1.839,1.493-3.336,3.335-3.336c1.839,0,3.333,1.497,3.333,3.336C30.838,31.438,29.344,32.932,27.504,32.932z" display="inline" fill="&stroke_color;"/> + <circle cx="27.505" cy="29.597" display="inline" fill="&stroke_color;" r="1.514"/> + <circle cx="14.875" cy="29.597" display="inline" fill="&stroke_color;" r="1.514"/> + <circle cx="10.375" cy="29.597" display="inline" fill="&stroke_color;" r="1.514"/> + <circle cx="43.875" cy="29.597" display="inline" fill="&stroke_color;" r="1.514"/> + <circle cx="39.375" cy="29.597" display="inline" fill="&stroke_color;" r="1.514"/> +</g></svg>
\ No newline at end of file diff --git a/Iconos/xo.svg b/Iconos/xo.svg new file mode 100644 index 0000000..7abe926 --- /dev/null +++ b/Iconos/xo.svg @@ -0,0 +1,7 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [ + <!ENTITY stroke_color "#666666"> + <!ENTITY fill_color "#ffffff"> +]><svg enable-background="new 0 0 55 55" height="55px" id="Layer_1" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="module-about_x5F_me_1_"> + <path d="M33.359,35.101L43.46,45.201c0.752,0.75,1.217,1.784,1.217,2.932 c0,2.287-1.855,4.143-4.146,4.143c-1.145,0-2.178-0.463-2.932-1.211L27.498,40.963l-10.1,10.1c-0.75,0.75-1.787,1.211-2.933,1.211 c-2.285,0-4.143-1.854-4.143-4.141c0-1.146,0.465-2.184,1.212-2.934l10.104-10.101L11.535,24.997 c-0.747-0.749-1.212-1.785-1.212-2.93c0-2.289,1.854-4.145,4.146-4.145c1.143,0,2.18,0.465,2.93,1.214l10.099,10.101l10.101-10.102 c0.754-0.749,1.787-1.214,2.934-1.214c2.289,0,4.146,1.856,4.146,4.145c0,1.145-0.467,2.179-1.217,2.93L33.359,35.101z" fill="&fill_color;" stroke="&stroke_color;" stroke-width="3.5"/> + <circle cx="27.497" cy="10.849" fill="&fill_color;" r="8.122" stroke="&stroke_color;" stroke-width="3.5"/> +</g></svg>
\ No newline at end of file diff --git a/Iconos/zip.svg b/Iconos/zip.svg new file mode 100644 index 0000000..d998fc5 --- /dev/null +++ b/Iconos/zip.svg @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 55 55" + height="55px" + version="1.1" + viewBox="0 0 55 55" + width="55px" + x="0px" + xml:space="preserve" + y="0px" + id="svg3050" + inkscape:version="0.48.3.1 r9886" + sodipodi:docname="zip.svg"><metadata + id="metadata3071"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs + id="defs3069"> + + + + +</defs><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1024" + inkscape:window-height="545" + id="namedview3067" + showgrid="false" + inkscape:zoom="5.6568542" + inkscape:cx="13.441559" + inkscape:cy="27.546609" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:current-layer="svg3050" /><rect + style="fill:#010101;fill-opacity:1" + id="rect3086" + width="36.524017" + height="3.8222809" + x="5.457725" + y="19.650047" /><rect + y="-7.7935638" + x="19.650047" + height="3.8222809" + width="29.728853" + id="rect3088" + style="fill:#010101;fill-opacity:1" + transform="matrix(0,1,-1,0,0,0)" + inkscape:transform-center-y="14.864426" /><rect + y="45.556622" + x="5.457725" + height="3.8222809" + width="36.524017" + id="rect2991" + style="fill:#010101;fill-opacity:1" /><rect + inkscape:transform-center-y="14.864426" + transform="matrix(0,1,-1,0,0,0)" + style="fill:#010101;fill-opacity:1" + id="rect2993" + width="29.728853" + height="3.8222809" + x="19.650047" + y="-42.021709" /><rect + inkscape:transform-center-y="-3.3565009" + transform="matrix(0.76689995,-0.64176667,0.64176667,0.76689995,0,0)" + style="fill:#010101;fill-opacity:1" + id="rect3009" + width="10.460194" + height="3.8222809" + x="-9.5678978" + y="17.620935" + inkscape:transform-center-x="-4.0109611" /><rect + inkscape:transform-center-x="-4.0109611" + y="40.499416" + x="16.394217" + height="3.8222809" + width="10.460194" + id="rect3011" + style="fill:#010101;fill-opacity:1" + transform="matrix(0.76689995,-0.64176667,0.64176667,0.76689995,0,0)" + inkscape:transform-center-y="-3.3565009" /><rect + y="12.932533" + x="11.998463" + height="3.8222809" + width="37.054348" + id="rect3013" + style="fill:#010101;fill-opacity:1" /><rect + y="-50.054855" + x="12.925936" + height="3.8222809" + width="29.728853" + id="rect3015" + style="fill:#010101;fill-opacity:1" + transform="matrix(0,1,-1,0,0,0)" + inkscape:transform-center-y="14.864426" /><rect + inkscape:transform-center-y="-3.3565009" + transform="matrix(0.76689995,-0.64176667,0.64176667,0.76689995,0,0)" + style="fill:#010101;fill-opacity:1" + id="rect3017" + width="10.460194" + height="3.8222809" + x="0.53772563" + y="61.014023" + inkscape:transform-center-x="-4.0109611" /><rect + inkscape:transform-center-y="-3.1137721" + transform="matrix(0.71716338,-0.69690508,0.67227098,0.74030516,0,0)" + style="fill:#010101;fill-opacity:1" + id="rect3019" + width="8.9360065" + height="1.7827625" + x="2.1582694" + y="30.680279" + inkscape:transform-center-x="-3.2042891" /><rect + style="fill:#000000;fill-opacity:1" + id="rect2992" + width="0" + height="0" + x="0" + y="0" /><path + style="fill:#ffffff;fill-opacity:1" + d="m 7.6432831,34.524458 0,-11.136932 15.2911839,0 15.291185,0 0,11.136932 0,11.136932 -15.291185,0 -15.2911839,0 0,-11.136932 z" + id="path2994" + inkscape:connector-curvature="0" /><path + style="fill:#ffffff;fill-opacity:1" + d="m 10.47171,19.429177 c 0,-0.03809 0.666034,-0.634716 1.480074,-1.325826 l 1.480074,-1.256562 6.514648,0 6.514647,0 -1.316977,1.325825 -1.316977,1.325825 -6.677744,0 c -3.67276,0 -6.677745,-0.03117 -6.677745,-0.06926 z" + id="path2996" + inkscape:connector-curvature="0" /><path + style="fill:#ffffff;fill-opacity:1" + d="m 27.97762,18.170449 1.32799,-1.327991 6.699701,0.04636 6.6997,0.04636 -1.522054,1.281631 -1.522053,1.281631 -6.505637,0 -6.505638,0 1.327991,-1.32799 z" + id="path2998" + inkscape:connector-curvature="0" /><path + style="fill:#ffffff;fill-opacity:1" + d="m 42.114739,33.397433 0,-10.693014 1.635184,-1.3688 c 0.899352,-0.75284 1.814171,-1.527827 2.032932,-1.722193 l 0.397748,-0.353393 -0.0032,10.769999 -0.0032,10.769999 -1.708319,1.414214 c -0.939575,0.777817 -1.852938,1.518161 -2.029696,1.645207 -0.309657,0.222571 -0.321378,-0.159 -0.321378,-10.462019 z" + id="path3000" + inkscape:connector-curvature="0" /></svg>
\ No newline at end of file diff --git a/Widgets.py b/Widgets.py new file mode 100644 index 0000000..8b4a4bb --- /dev/null +++ b/Widgets.py @@ -0,0 +1,322 @@ +#!/usr/bin/env python +# -*- coding:UTF-8 -*- + +import os +import commands +import Archivos + +import gi +from gi.repository import Gtk +from gi.repository import GObject +from gi.repository import GdkPixbuf +from gi.repository import Gio + +COPIAR = None + +def get_accion(cadena, dato): + """Devuelve la dirección introducida, + sí es que existe o de lo contrario, + deuelve False""" + + if dato: + return os.path.exists(dato) + + +class Area_de_Montajes(Gtk.TreeView): + """Parte de la entana en la que se muestran + los montajes actualmente introducidos""" + + def __init__(self, padre): + """Inicia la clase""" + + Gtk.TreeView.__init__(self) + + self.padre = padre + self.montajes = [] + self.volume_monitor = Gio.VolumeMonitor.get() + self.numero = 0 + + nombre = Gtk.TreeViewColumn('Montajes') + direccion = Gtk.TreeViewColumn('Dirección') + + self.modelo = Gtk.ListStore(str, str) + self.set_model(self.modelo) + + celda1 = Gtk.CellRendererText() + nombre.pack_start(celda1, True) + nombre.set_attributes(celda1, text=0) + + celda2 = Gtk.CellRendererText() + direccion.pack_start(celda2, True) + direccion.set_attributes(celda2, text=1) + + self.append_column(nombre) + self.append_column(direccion) + + self.connect('button-press-event', self.click) + self.volume_monitor.connect('mount-added', self.agregar_montaje) + self.volume_monitor.connect('mount-removed', self.montaje_desconectado) + + def montaje_desconectado(self, demonio, unidad): + + iter = self.modelo.get_iter_first() + self.borrar_montaje(iter, unidad) + + def borrar_montaje(self, iter, unidad): + """Cuando se desconecta una unidad, se quita de la lista.""" + + directorio = self.modelo.get_value(iter, 1) + + if directorio == self.montajes[self.numero]: + self.modelo.remove(iter) + self.numero = 0 + + else: + iter = self.modelo.iter_next(iter) + self.numero += 1 + self.borrar_montaje(iter, unidad) + + def agregar_montaje(self, demonio, unidad, *args): + """Agrega una columna por montaje + que se encuentre actualmene""" + + direccion = unidad.get_default_location().get_path() + texto = direccion.split('/')[-1] + + self.modelo.append([texto, direccion]) + self.montajes.append(direccion) + + def click(self, widget, event): + """Cuando se hace clic en el Widget clase, + reacciona según el botón del mouse que se presionó""" + + boton = event.button + tiempo = event.time + + try: + path, columna, xdefondo, ydefondo = widget.get_path_at_pos(event.x, + event.y) + + if boton == 1: + direccion = self.montajes[path.get_indices()[0]] + self.abrir(None, direccion) + + if boton == 3: + self.crear_menu_emergente(boton, tiempo, path) + return True + + except TypeError: + pass + + def crear_menu_emergente(self, boton, tiempo, path): + """Crea un menú emergente desde la columna actual""" + + iter = self.modelo.get_iter(path) + nombre = self.modelo.get_value(iter, 0) + direccion = self.modelo.get_value(iter, 1) + + item = Gtk.MenuItem('Montaje %s' % nombre) + menu = Gtk.Menu() + item.set_submenu(menu) + + abrir = Gtk.MenuItem('Abrir') + copiar = Gtk.MenuItem('Copiar') + propiedades = Gtk.MenuItem('Proiedades') + + abrir.connect('activate', self.abrir, direccion) + copiar.connect('activate', self.copiar, direccion) + propiedades.connect('activate', self.propiedades, direccion) + + menu.append(abrir) + menu.append(copiar) + menu.append(propiedades) + + menu.show_all() + menu.popup(None, None, None, None, boton, tiempo) + + def abrir(self, widget, direccion): + """Abre la dirección del montaje seleccionado""" + + self.padre.abrir(direccion) + + def copiar(self, widget, direccion): + + COPIAR = direccion + + def propiedades(self, widget, direccion): + + dialogo = Archivos.Propiedades(direccion) + dialogo.show_all() + + +class Area(Gtk.IconView): + """Area de navegación""" + + __gsignals__ = { + 'cambio-de-direccion': (GObject.SIGNAL_RUN_FIRST, + GObject.TYPE_NONE, (GObject.TYPE_STRING,))} + + def __init__(self, padre): + """Inicia la clase""" + + Gtk.IconView.__init__(self) + + self.padre = padre + self.modelo = Gtk.ListStore(str, GdkPixbuf.Pixbuf) + + self.set_selection_mode(Gtk.SelectionMode(1)) + self.set_model(self.modelo) + self.set_text_column(0) + self.set_pixbuf_column(1) + + self.lista_carpetas = [] + self.lista_archivos = [] + + self.connect('button-press-event', self.click) + + def agregar(self, nombre, direccion): + """Agrega el icono de una carpeta o un archivo""" + + if not list(direccion)[-1] == '/': + direccion += '/' + + dir = direccion + nombre + + if ' ' in dir: + dir.replace(' ', '\ ') + + pixbuf = Archivos.get_pixbuf(dir) + + self.modelo.append([nombre, pixbuf]) + + def borrar_area(self): + """Borra todos los objetos en el modelo""" + + self.modelo.clear() + + def click(self, widget, event): + """Reacciona cuando se le hace clic, obteniendo con + que botón se le hizo clic y que debe hacer después""" + + boton = event.button + posx = event.x + posy = event.y + tiempo = event.time + + try: + path = widget.get_path_at_pos(int(posx), int(posy)) + + direccion = self.padre.direccion + if list(direccion)[-1] != '/': + direccion += '/' + + iter = self.modelo.get_iter(path) + direccion += self.modelo.get_value(iter, 0) + + if boton == 1: + if os.path.isfile(direccion): + tamanio = Archivos.get_tamanio(direccion) + string = ' - ' + tamanio + + elif os.path.isdir(direccion) or os.path.ismount(direccion): + archivos = Archivos.get_tamanio(direccion) + string = ' - ' + archivos + + self.padre.b_estado.set_text('Se ha seleccionado: ', + direccion, string) + + elif boton == 3: + self.crear_menu_emergente(boton, tiempo, path) + return True + + if event.type.value_name == "GDK_2BUTTON_PRESS" and boton == 1: + self.emit('cambio-de-direccion', direccion) + + except TypeError: + # Solo sucede cuando se le hace clic fuera de un iter + pass + + def crear_menu_emergente(self, boton, tiempo, path): + """Crea un menú emergente desde la iter actual""" + + iter = self.modelo.get_iter(path) + nombre = self.modelo.get_value(iter, 0) + direccion = self.padre.direccion + + if direccion[-1] != '/': + direccion += '/' + + direccion += nombre + + item = Gtk.MenuItem('') + menu = Gtk.Menu() + item.set_submenu(menu) + + abrir = Gtk.MenuItem('Abrir') + cortar = Gtk.MenuItem('Cor_tar') + copiar = Gtk.MenuItem('_Copiar') + pegar = Gtk.MenuItem('Pegar') + propiedades = Gtk.MenuItem('Proiedades') + + abrir.connect('activate', self.abrir, direccion) + copiar.connect('activate', self.copiar, direccion) + propiedades.connect('activate', self.propiedades, direccion) + + menu.append(abrir) + menu.append(Gtk.SeparatorMenuItem()) + menu.append(cortar) + menu.append(copiar) + menu.append(pegar) + menu.append(Gtk.SeparatorMenuItem()) + menu.append(propiedades) + + menu.show_all() + menu.popup(None, None, None, None, boton, tiempo) + + def abrir(self, widget, direccion): + """Abre la dirección del montaje seleccionado""" + + self.padre.abrir(direccion) + + def copiar(self, widget, direccion): + + COPIAR = direccion + + def propiedades(self, widget, direccion): + + dialogo = Archivos.Propiedades(direccion) + dialogo.show_all() + + +class Entrada(Gtk.Entry): + """Entrada de navegación""" + + def __init__(self, direccion): + """Inicia la clase""" + + Gtk.Entry.__init__(self) + + self.set_size_request(400, 40) + self.set_text(direccion) + + +class Barra_de_Estado(Gtk.Statusbar): + + def __init__(self): + + Gtk.Statusbar.__init__(self) + + def set_text(self, *args): + """Le pasa 'pop' y 'push' al Widget clase""" + + texto = '' + for x in args: + texto += x + + self.pop(0) + self.push(0, texto) + + def borrar(self, *args): + """Llama a la función "set_text()" con '' como parámetro""" + + self.set_text('') diff --git a/Widgets.pyc b/Widgets.pyc Binary files differnew file mode 100644 index 0000000..4320acc --- /dev/null +++ b/Widgets.pyc diff --git a/activity/activity.info b/activity/activity.info new file mode 100644 index 0000000..5ab31c7 --- /dev/null +++ b/activity/activity.info @@ -0,0 +1,6 @@ +[Activity] +name = CExplorer +activity_version = 1 +bundle_id = org.sugarlabs.CExplorer +exec = sugar-activity CExplorer.CExplorer +icon = icon diff --git a/activity/icon.svg b/activity/icon.svg new file mode 100644 index 0000000..688ffc3 --- /dev/null +++ b/activity/icon.svg @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + height="55px" + viewBox="0 0 55 55" + width="55px" + id="svg2" + version="1.1" + inkscape:version="0.48.1 r9760" + sodipodi:docname="user-documents.svg"> + <metadata + id="metadata18"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs16" /> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1200" + inkscape:window-height="837" + id="namedview14" + showgrid="false" + inkscape:zoom="4.2909091" + inkscape:cx="27.966102" + inkscape:cy="27.5" + inkscape:window-x="0" + inkscape:window-y="31" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" /> + <path + d="m 7,14 5,-5 10,0 5,5 20,0 0,31 -40,0 z" + style="fill:#FFFFFF;stroke:#010101;stroke-width:3;stroke-linecap:round;stroke-linejoin:round" + id="path4" /> +</svg> diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..bafa2c2 --- /dev/null +++ b/setup.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python + +from sugar.activity import bundlebuilder +bundlebuilder.start() diff --git a/window.py b/window.py new file mode 100644 index 0000000..6640b63 --- /dev/null +++ b/window.py @@ -0,0 +1,314 @@ +#!/usr/share/env python +# -*- coding:UTF-8 -*- + +# window.py por: +# Cristian García <cristian99garcia@gmail.com> + +import os +import Archivos +import Widgets as Wid + +from gi.repository import Gtk +from gi.repository import Gdk +from gi.repository import GObject +from gi.repository import GdkPixbuf + + +class CExplorer(Gtk.Window): + + __gsignals__ = { + 'change-directory': (GObject.SIGNAL_RUN_FIRST, + GObject.TYPE_NONE, [])} + + def __init__(self): + + Gtk.Window.__init__(self) + + self.ocultos = False + self.direccion = os.path.expanduser('~') + + self.archivos = [] + self.carpetas = [] + + self.vbox = Gtk.VBox() + self.entrada = Wid.Entrada(self.direccion) + scrolled_montajes = Gtk.ScrolledWindow() + scrolled = Gtk.ScrolledWindow() + self.area_montajes = Wid.Area_de_Montajes(self) + self.area = Wid.Area(self) + + self.entrada.connect('activate', self.nueva_direccion) + self.entrada.connect('icon-release', self.nueva_direccion) + + #****** Toolbar ****** + toolbar = Gtk.Toolbar() + self.vbox.pack_start(toolbar, False, False, 0) + + b_harddisk = Gtk.ToolButton(Gtk.STOCK_HARDDISK) + b_home = Gtk.ToolButton(Gtk.STOCK_HOME) + b_go_up = Gtk.ToolButton(Gtk.STOCK_GO_UP) + b_refresh = Gtk.ToolButton(Gtk.STOCK_REFRESH) + b_ocults = Gtk.ToolButton(Gtk.STOCK_YES) + img_mas = Gtk.Image() + img_menos = Gtk.Image() + img_preferencias = Gtk.Image() + b_create = Gtk.ToolButton() + b_remove = Gtk.ToolButton() + b_preferences = Gtk.ToolButton() + + img_mas.set_from_file(os.path.join(os.path.dirname(__file__), + 'Iconos/mas.svg')) + + img_menos.set_from_file(os.path.join(os.path.dirname(__file__), + 'Iconos/borrar_archivo.svg')) + + img_preferencias.set_from_file(os.path.join(os.path.dirname(__file__), + 'Iconos/preferencias.svg')) + + b_create.set_icon_widget(img_mas) + b_remove.set_icon_widget(img_menos) + b_preferences.set_icon_widget(img_preferencias) + + b_harddisk.connect('clicked', self.nueva_direccion, '/') + b_home.connect('clicked', self.nueva_direccion, '~') + b_go_up.connect('clicked', self.abrir_arriba) + b_refresh.connect('clicked', self.update) + b_ocults.connect('clicked', self.change_ocultos) + b_create.connect('clicked', self.crear_directorio) + b_remove.connect('clicked', self.borrar_archivo) + b_preferences.connect('clicked', self.preferencias) + + b_harddisk.set_tooltip_text('Dirigirse al directorio raíz') + b_home.set_tooltip_text('Dirigirse al directorio personal') + b_go_up.set_tooltip_text('Dirigirse al directorio anterior al actual') + b_refresh.set_tooltip_text('Recargar') + b_ocults.set_tooltip_text('Mostrar archivos ocultos') + + toolbar.insert(b_harddisk, -1) + toolbar.insert(b_home, -1) + toolbar.insert(b_go_up, -1) + toolbar.insert(b_refresh, -1) + toolbar.insert(b_ocults, -1) + toolbar.insert(Gtk.SeparatorToolItem(), -1) + toolbar.insert(b_create, -1) + toolbar.insert(b_remove, -1) + toolbar.insert(b_preferences, -1) + + separador = Gtk.SeparatorToolItem() + separador.set_expand(True) + separador.set_draw(False) + toolbar.insert(separador, -1) + + #****** Otros Widgets ****** + paned = Gtk.Paned() + self.b_estado = Wid.Barra_de_Estado() + + self.vbox.pack_start(self.entrada, False, False, 5) + self.vbox.pack_start(paned, True, True, 0) + self.vbox.pack_start(self.b_estado, False, False, 0) + + scrolled_montajes.add(self.area_montajes) + scrolled.add(self.area) + + paned.pack1(scrolled_montajes, False, True) + paned.pack2(scrolled, True, True) + + self.entrada.activate() + + self.area.connect('cambio-de-direccion', self.abrir_desde_widget) + self.connect('destroy', Gtk.main_quit) + self.connect('key-press-event', self.tecla_presionada) + self.connect('change-directory', self.borrar_todo) + + self.add(self.vbox) + self.show_all() + + def abrir(self, directorio): + """Abre el directorio especificado""" + + lectura, escritura, ejecucion = Archivos.get_permisos(directorio) + + if lectura and \ + (os.path.isdir(directorio) or os.path.ismount(directorio)): + + # Sí es que no exíste, devolverá False + + self.direccion = directorio + self.entrada.set_text(directorio) + + self.emit('change-directory') + + for objeto in os.listdir(directorio): + direccion = os.path.join(directorio, objeto) + if os.path.isdir(direccion) or os.path.ismount(direccion): + if not self.ocultos and not list(objeto)[0] == '.': + self.carpetas.append(objeto) + + elif self.ocultos: + self.carpetas.append(objeto) + + if os.path.isfile(direccion): + if not self.ocultos and \ + not (list(objeto)[0] == '.' or list(objeto)[-1] == '~'): + self.archivos.append(objeto) + + elif self.ocultos: + self.archivos.append(objeto) + + self.carpetas.sort() + self.archivos.sort() + + for carpeta in self.carpetas: + self.area.agregar(carpeta, self.direccion) + + for archivo in self.archivos: + self.area.agregar(archivo, self.direccion) + + elif os.path.isfile(directorio): + Archivos.intentar_abrir(directorio) + + else: + print 'La dirección no existe o no tiene permisos para leerla' + + def tecla_presionada(self, widget, event): + + tecla = event.keyval + + direccion = self.direccion + if direccion[-1] != '/': + direccion += '/' + + lectura, escritura, ejecucion = Archivos.get_permisos(self.direccion) + + if self.area.get_selected_items(): + + path = self.area.get_selected_items()[0] + iter = self.area.modelo.get_iter(path) + direccion += self.area.modelo.get_value(iter, 0) + lectura, escritura, ejecucion = Archivos.get_permisos(direccion) + + if tecla == 32: + if lectura: + self.preferencias() + + elif tecla == 65535: + if lectura and escritura: + self.borrar_archivo() + + if tecla == 43: + if lectura and escritura: + self.crear_directorio() + + def abrir_desde_widget(self, widget, direccion): + + self.abrir(direccion) + + def crear_directorio(self, *args): + + lectura, escritura, ejecucion = Archivos.get_permisos(self.direccion) + + if lectura and escritura: + crear = Archivos.CrearDirectorio(self.direccion) + crear.connect('creado', self.update) + crear.show_all() + + def borrar_archivo(self, *args): + + direccion = self.get_nueva_direccion() + lectura, escritura, ejecucion = Archivos.get_permisos(direccion) + + if lectura and escritura: + borrar = Archivos.Borrar(direccion) + borrar.connect('borrado', self.update) + borrar.show_all() + + def preferencias(self, *args): + + direccion = self.get_nueva_direccion() + lectura, escritura, ejecucion = Archivos.get_permisos(direccion) + + if lectura: + propiedades = Archivos.Propiedades(direccion) + propiedades.connect('cambio-de-propiedades', self.update) + propiedades.show_all() + + def nueva_direccion(self, widget, direccion=None, *args): + """Abre la dirección introducida""" + + if not direccion: + direccion = widget.get_text() + + else: + if direccion == '~': + direccion = os.path.expanduser('~') + + self.abrir(direccion) + + def borrar_todo(self, *args): + """Borra todos los archivos y carpetas de las listas""" + + while len(self.carpetas) > 0: + for carpeta in self.carpetas: + self.carpetas.remove(carpeta) + + while len(self.archivos) > 0: + for archivo in self.archivos: + self.archivos.remove(archivo) + + self.area.borrar_area() + self.b_estado.borrar() + + def update(self, *args): + """Recarga el directorio acual""" + + self.borrar_todo() + self.abrir(self.direccion) + + def abrir_arriba(self, *args): + """Abre la carpeta que contiene la actual""" + + self.direccion = Archivos.get_carpeta_contenedora(self.direccion) + + self.entrada.set_text(self.direccion) + self.entrada.activate() + self.update() + + def change_ocultos(self, widget): + """Cambia de mostrar ocultos a no mostrar ocultos o viceversa""" + + self.ocultos = not self.ocultos + + if self.ocultos: + widget.set_icon_name(Gtk.STOCK_NO) + + else: + widget.set_icon_name(Gtk.STOCK_YES) + + self.update() + + def get_nueva_direccion(self): + + try: + direccion = self.direccion + if direccion[-1] != '/': + direccion += '/' + + path = self.area.get_selected_items()[0] + iter = self.area.modelo.get_iter(path) + direccion += self.area.modelo.get_value(iter, 0) + + return direccion + + except: + return self.direccion + + +CExplorer() +Gtk.main() + +""" +ico = "/home/cristian/Documentos/JAMediaSuite/JAMediaObjects/Iconos/JAMedia.png" +p = GdkPixbuf.Pixbuf.new_from_file_at_size(ico, -1, 30) +cursor = Gdk.Cursor.new_from_pixbuf(Gdk.Display.get_default(), p, 0, 0) +ventna.set_cursor(cursor) +""" diff --git a/window.pyc b/window.pyc Binary files differnew file mode 100644 index 0000000..d4c3111 --- /dev/null +++ b/window.pyc |