Exemplo n.º 1
0
    def create_interface(self):
        if module_check.has_apt() and package_worker.get_cache():
            self.package_worker = package_worker

            self.advanced_settings = AptCheckButton(_("Install Advanced Desktop Effects Settings Manager"),
                    'compizconfig-settings-manager')
            self.advanced_settings.connect('toggled', self.colleague_changed)
            self.simple_settings = AptCheckButton(_("Install Simple Desktop Effects Settings manager"),
                    'simple-ccsm')
            self.simple_settings.connect('toggled', self.colleague_changed)
            self.screenlets = AptCheckButton(_("Install Screenlets Widget Application"),
                    'screenlets')
            self.screenlets.connect('toggled', self.colleague_changed)

        if self.context:
            hbox = gtk.HBox(False, 0)
            hbox.pack_start(self.create_edge_setting(), True, False, 0)
            edge_setting = SinglePack(_('Edge Settings'), hbox)
            self.add_start(edge_setting, False, False, 0)

            self.snap = SnapWindow(_("Enable snapping windows"), self)
            self.wobbly_w = WobblyWindow(_("Enable wobbly windows"), self);

            box = ListPack(_("Window Effects"), (self.snap, self.wobbly_w))
            self.add_start(box, False, False, 0)

            button1 = OpacityMenu(_("Enable transparent menus"))
            self.wobbly_m = WobblyMenu(_("Enable wobbly menus"), self)

            box = ListPack(_("Menu Effects"), (button1, self.wobbly_m))
            self.add_start(box, False, False, 0)

            if module_check.has_apt() and package_worker.get_cache():
                box = ListPack(_("Useful Extensions"), (
                    self.simple_settings,
                    self.screenlets,
                ))

                self.button = gtk.Button(stock = gtk.STOCK_APPLY)
                self.button.connect("clicked", self.on_apply_clicked, box)
                self.button.set_sensitive(False)
                hbox = gtk.HBox(False, 0)
                hbox.pack_end(self.button, False, False, 0)

                box.vbox.pack_start(hbox, False, False, 0)

                self.add_start(box, False, False, 0)
        else:
            box = ListPack(_("Prerequisite Conditions"), (
                self.advanced_settings,
            ))

            self.button = gtk.Button(stock = gtk.STOCK_APPLY)
            self.button.connect("clicked", self.on_apply_clicked, box)
            self.button.set_sensitive(False)
            hbox = gtk.HBox(False, 0)
            hbox.pack_end(self.button, False, False, 0)

            box.vbox.pack_start(hbox, False, False, 0)
            self.add_start(box, False, False, 0)
Exemplo n.º 2
0
    def update_updates(self, pkgs):
        '''apps is a list to iter pkgname,
        cates is a dict to find what the category the pkg is
        '''
        model = self.get_model()

        model.append((None,
                        None,
                        None,
                        None,
                        None,
                        '<span size="large" weight="bold">%s</span>' % _('Available Package Updates'),
                        None,
                        None))

        apps = []
        updates = []
        for pkg in pkgs:
            if pkg in BUILTIN_APPS:
                apps.append(pkg)
            else:
                updates.append(pkg)

        for pkgname in apps:
            pixbuf = get_app_logo(pkgname)

            package = PackageInfo(pkgname)
            appname = package.get_name()
            desc = get_app_describ(pkgname)

            self.append_app(True,
                    pixbuf,
                    pkgname,
                    appname,
                    desc,
                    0,
                    'update')
            self.to_add.append(pkgname)

        for pkgname in updates:
            package = package_worker.get_cache()[pkgname]

            self.append_update(True, package.name, package.summary)
Exemplo n.º 3
0
# You should have received a copy of the GNU General Public License
# along with Ubuntu Tweak; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

import pygtk
pygtk.require("2.0")
import gtk
import os
import gobject
import gconf
import gettext
import thread

try:
    from ubuntutweak.package import package_worker, AptCheckButton
    if package_worker.get_cache():
        DISABLE = False
    else:
        DISABLE = True
except ImportError:
    DISABLE = True

from ubuntutweak.modules  import TweakModule
from ubuntutweak.common.misc import filesizeformat
from ubuntutweak.common.factory import WidgetFactory
from ubuntutweak.widgets import ListPack, TablePack
from ubuntutweak.widgets.dialogs import InfoDialog, QuestionDialog
from ubuntutweak.common.utils import set_label_for_stock_button

(
    COLUMN_ICON,