# -*- 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>
from __future__ import absolute_import
# gtk stuff
import gtk
import gobject
try:
import gtksourceview2
except ImportError:
gtksourceview2 = None
# other
import types, logging
from subprocess import Popen
from gettext import lgettext as _
# our backend stuff
from ... import listener, plugin
from ...helper import debug, warning, error, unique_array
from ...constants import CONFIG_LOCATION, VERSION, APP_ICON
from ...backend import flags, system
from ...backend.exceptions import PackageNotFoundException, BlockedException
# more GUI stuff
from ..gui_helper import Database, Config, EmergeQueue
from .basic import Window, AbstractDialog, Popup
from .wrapper import GtkTree, GtkConsole
from .usetips import UseTips
from .exception_handling import GtkThread
from .dialogs import (blocked_dialog, changed_flags_dialog, io_ex_dialog,
nothing_found_dialog, queue_not_empty_dialog, remove_deps_dialog,
remove_queue_dialog, unmask_dialog)
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
|