Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Widgets.py
diff options
context:
space:
mode:
authorflavio <fdanesse@gmail.com>2013-07-03 03:34:52 (GMT)
committer flavio <fdanesse@gmail.com>2013-07-03 03:34:52 (GMT)
commit34d690654baf019253f2cc15ac698f77fd368e32 (patch)
treec5878f4f2862b11c8a2f83ead97010e7fa574d39 /Widgets.py
parentab82a61efdd02018965a2cc392b528982204c142 (diff)
Limpieza
Diffstat (limited to 'Widgets.py')
-rw-r--r--Widgets.py72
1 files changed, 9 insertions, 63 deletions
diff --git a/Widgets.py b/Widgets.py
index e7734c9..93b7d3c 100644
--- a/Widgets.py
+++ b/Widgets.py
@@ -29,16 +29,15 @@ import gi
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
-from gi.repository import GdkPixbuf
-from gi.repository import Vte
from gi.repository import Pango
-from gi.repository import Gio
BASEPATH = os.path.dirname(__file__)
FUENTES_GLOBAL = Gtk.Window().get_pango_context().list_families()
def get_boton(stock, tooltip):
- """Devuelve un botón generico."""
+ """
+ Devuelve un botón generico.
+ """
boton = Gtk.ToolButton.new_from_stock(stock)
boton.set_tooltip_text(tooltip)
@@ -47,7 +46,9 @@ def get_boton(stock, tooltip):
return boton
def get_boton_icon(icon, tooltip):
- """Devuelve un botón con un icono específico."""
+ """
+ Devuelve un botón con un icono específico.
+ """
boton = Gtk.ToolButton()
boton.set_tooltip_text(tooltip)
@@ -57,7 +58,9 @@ def get_boton_icon(icon, tooltip):
return boton
def get_separador(draw = False, ancho = 0, expand = False):
- """Devuelve un separador generico."""
+ """
+ Devuelve un separador generico.
+ """
separador = Gtk.SeparatorToolItem()
separador.props.draw = draw
@@ -423,14 +426,6 @@ class DialogoProyecto(Gtk.Dialog):
### Autores
self.autores = WidgetAutores()
-
- ### Imagen para el preview del icono
- #self._icono_preview = Gtk.Image()
-
- ### botones internos
- #boton_buscar_icono = Gtk.Button(Gtk.STOCK_FIND)
- #boton_buscar_icono.set_use_stock(True)
- #boton_buscar_icono.connect("clicked", self.__buscar, "icono")
boton = Gtk.Button("Ver más Opciones . . .")
boton.connect("clicked", self.__show_options)
@@ -452,9 +447,6 @@ class DialogoProyecto(Gtk.Dialog):
[self.__get_label('Licencia:'), self.licencia] ),
self.__get_pack_box(
[self.__get_label('Web:'), self.url] ),
- #self.__get_pack_box(
- # [self.__get_label('Icono:'), self.icon_path,
- # self._icono_preview, boton_buscar_icono] ),
self.__get_pack_box(
[self.__get_label("Autores:"),
self.autores] ),
@@ -545,41 +537,6 @@ class DialogoProyecto(Gtk.Dialog):
box.pack_start(widget, True, True, 5)
return box
-
- #def __buscar(self, widget, tipo):
- # """
- # Abre Filechooser para guardar la
- # encuesta respondida o parcialmente respondida.
- # """
-
- # if tipo == "icono":
-
- # filechooser = My_FileChooser(
- # parent_window = self,
- # action_type = Gtk.FileChooserAction.OPEN,
- # filter_type = "image/*",
- # title = "Buscar Icono")
-
- # else:
- # return
-
- # filechooser.connect('load', self.__run_buscar, tipo)
-
- #def __run_buscar(self, widget, archivo, tipo):
- # """
- # Asigna el path del icono.
- # """
-
- # if not archivo or not tipo: return
-
- # if tipo == "icono":
- # self.icon_path.set_text(archivo)
- # self._icono_preview.set_from_pixbuf(
- # GdkPixbuf.Pixbuf.new_from_file_at_size(
- # archivo, 100, 100))
-
- # else:
- # return
def get_proyecto(self):
"""
@@ -599,7 +556,6 @@ class DialogoProyecto(Gtk.Dialog):
version = self.version.get_text()
licencia = self.licencia.get_active_text()
- #icon_path = self.icon_path.get_text()
url = self.url.get_text()
if nombre: nombre = nombre.strip()
@@ -609,7 +565,6 @@ class DialogoProyecto(Gtk.Dialog):
if version: version = version.strip()
if not version: version = "1"
if licencia: licencia = licencia.strip()
- #if icon_path: icon_path = icon_path.strip()
if url: url = url.strip()
dict = {
@@ -619,7 +574,6 @@ class DialogoProyecto(Gtk.Dialog):
"descripcion": buffer,
"version": version,
"licencia": licencia,
- #"icon_path": icon_path,
"url": url,
"autores": self.autores.get_autores()
}
@@ -639,13 +593,6 @@ class DialogoProyecto(Gtk.Dialog):
self.url.set_text(diccionario["url"])
self.autores.set_autores(diccionario["autores"])
- ### Actualizar preview del icono.
- #if os.path.exists(diccionario["icon_path"]):
- # self.icon_path.set_text(diccionario["icon_path"])
- # self._icono_preview.set_from_pixbuf(
- # GdkPixbuf.Pixbuf.new_from_file_at_size(
- # diccionario["icon_path"], 100, 100))
-
### Setear Combo para archivo Main.
if diccionario.get("path", False):
import glob
@@ -2019,4 +1966,3 @@ class TreeViewBusquedaGrep(Gtk.TreeView):
def seleccionar_primero(self, widget = None):
self.treeselection.select_path(0)
-