# -*- coding: utf-8 -*-
#
# File: portato/gui/gtk/windows.py
# This file is part of the Portato-Project, a graphical portage-frontend.
#
# Copyright (C) 2006-2007 René 'Necoro' Neumann
# This is free software. You may redistribute copies of it under the terms of
# the GNU General Public License version 2.
# There is NO WARRANTY, to the extent permitted by law.
#
# Written by René 'Necoro' Neumann <necoro@necoro.net>
# gtk stuff
import gtk
import gobject
# other
import types, logging
from subprocess import Popen
from gettext import lgettext as _
# our backend stuff
from portato import listener
from portato.helper import *
from portato.constants import CONFIG_LOCATION, VERSION, APP_ICON
from portato.backend import flags, system
from portato.backend.exceptions import *
# plugins
from portato import plugin
# more GUI stuff
from portato.gui.gui_helper import Database, Config, EmergeQueue
from basic import Window, AbstractDialog, Popup
from dialogs import *
from wrapper import GtkTree, GtkConsole
from usetips import UseTips
from exception_handling import GtkThread
class AboutWindow (AbstractDialog):
"""A window showing the "about"-informations."""
def __init__ (self, parent):
AbstractDialog.__init__(self, parent)
img = gtk.Image()
img.set_from_file(APP_ICON)
self.window.set_version(VERSION)
self.window.set_logo(img.get_pixbuf())
self.window.show_all()
class PluginWindow (AbstractDialog):
def __init__ (self, parent, plugins):
"""Constructor.
@param parent: the parent window
@type parent: gtk.Window"""
AbstractDialog.__init__(self, parent)
self.plugins = plugins
self.changedPlugins = {}
view = self.tree.get_widget("pluginList")
self.store = gtk.ListStore(str,str,bool)
view.set_model(self.store)
cell = gtk.CellRendererText()
col = gtk.TreeViewColumn(_("Plugin"), cell, markup = 0)
view.append_column(col)
col = gtk.TreeViewColumn(_("Authors"), cell, text = 1)
view.append_column(col)
bcell = gtk.CellRendererToggle()
bcell.connect("toggled", self.cb_plugin_toggled)
col = gtk.TreeViewColumn(_("Enabled"), bcell, active = 2)
view.append_column(col)
for p in [("<b>"+p.name+"</b>", p.author, p.is_enabled()) for p in plugins]:
self.store.append(p)
self.window.show_all()
def cb_plugin_toggled (self, cell, path):
path = int(path)
self.store
|