~kelemeng/software-center/bug640969

« back to all changes in this revision

Viewing changes to softwarecenter/view/dialogs.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt, Gary Lasker, Michael Vogt, Kiwinote, Mohamed Amine IL Idrissi
  • Date: 2010-09-09 09:11:23 UTC
  • Revision ID: james.westby@ubuntu.com-20100909091123-domo868235pb7vuk
Tags: 2.1.17
[ Gary Lasker ]
* softwarecenter/view/purchasedialog.py:
  - make popup window a modal dialog so it works with
    metacity too (LP: #625398)
* softwarecenter/view/softwarepane.py,
  softwarecenter/view/availablepane.py,
  softwarecenter/view/channelpane.py
  softwarecenter/view/installedpane.py,
  test/test_appview.py:
  - factor show/hide nonapps functionality up to the
    SoftwarePane base class, cleanup redundant code
  - enable show/hide nonapps in the "Provided by Ubuntu"
    subitem of "Installed Software" per updated spec
    (LP: #556375) 
  - add test for show/hide nonapps
* softwarecenter/backend/channel.py:
  - small fix in debug code

[ Michael Vogt ]
* merged lp:~mpt/software-center/basic-css, improves the
  style of the purchase dialog (thanks!)
* merged lp:~mmcg069/software-center/small-fixes that fixes
  minor drawing error with the paging dot drawing outside its 
  allocated area (thanks!)
* merged lp:~mpt/software-center/help-3.0 (thanks!)
* softwarecenter/gwibber_helper.py:
  - to find out if gwibber has accounts setup, poke around in
    gconf instead of doing a dbus call. The dbus call will trigger
    a gwibber start on each s-c start

[ Kiwinote ]
* softwarecenter/view/appdetailsview_gtk.py:
  - set action_bar.pkg_state as well as local state 
    (LP: #629230, LP: #632889)
    this means that the button will always take the right action
    (testcase: click 'install', cancel auth, click 'install', auth)
  - don't show warning in pkgstatusbar while transaction is in progress,
    instead show 'installing..', 'updating..', etc
    (test case: install any deb file and watch the pkgstatusbar)
* softwarecenter/view/catview.py:
  - sort categories alphabetically (LP: #633238)
* softwarecenter/view/catview_gtk.py:
  - skip the carousel transition if we are hovering above a poster, or if
    the poster is selected (ie hold down mouse, but don't release)

[ Mohamed Amine IL Idrissi ]
* Fix bug that allowed silent removal of conflicting packages
  (LP: #554319)
* Fix missing icons in the remove alerts

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
import gtk
21
21
from gettext import gettext as _
22
 
from pkgview import PkgNamesView
23
22
 
24
 
class SimpleGladeDialog(object):
 
23
class SimpleGtkbuilderDialog(object):
25
24
    def __init__(self, datadir):
26
25
        # setup ui
27
26
        self.builder = gtk.Builder()
34
33
            else:
35
34
                print >> sys.stderr, "WARNING: can not get name for '%s'" % o
36
35
 
37
 
def confirm_remove(parent, datadir, primary, cache, button_text, icon_path, depends):
38
 
    """Confirm removing of the given app with the given depends"""
39
 
    glade_dialog = SimpleGladeDialog(datadir)
40
 
    dialog = glade_dialog.dialog_dependency_alert
41
 
    dialog.set_resizable(True)
42
 
    dialog.set_transient_for(parent)
43
 
    dialog.set_default_size(360, -1)
44
 
 
45
 
    # fixes launchpad bug #560021
46
 
    pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(icon_path, 48, 48)
47
 
    glade_dialog.image_package_icon.set_from_pixbuf(pixbuf)
48
 
 
49
 
    glade_dialog.label_dependency_primary.set_text("<span font_weight=\"bold\" font_size=\"large\">%s</span>" % primary)
50
 
    glade_dialog.label_dependency_primary.set_use_markup(True)
51
 
    glade_dialog.button_dependency_do.set_label(button_text)
52
 
 
53
 
    # add the dependencies
54
 
    vbox = dialog.get_content_area()
55
 
    # FIXME: make this a generic pkgview widget
56
 
    view = PkgNamesView(_("Dependency"), cache, depends)
57
 
    view.set_headers_visible(False)
58
 
    # FIXME: work out how not to select?/focus?/activate? first item
59
 
    glade_dialog.scrolledwindow_dependencies.add(view)
60
 
    glade_dialog.scrolledwindow_dependencies.show_all()
61
 
        
62
 
    result = dialog.run()
63
 
    dialog.hide()
64
 
    if result == gtk.RESPONSE_ACCEPT:
65
 
        return True
66
 
    return False
67
 
    
 
36
 
68
37
def confirm_repair_broken_cache(parent, datadir):
69
 
    glade_dialog = SimpleGladeDialog(datadir)
 
38
    glade_dialog = SimpleGtkbuilderDialog(datadir)
70
39
    dialog = glade_dialog.dialog_broken_cache
71
40
    dialog.set_default_size(380, -1)
72
41
    dialog.set_transient_for(parent)
133
102
 
134
103
if __name__ == "__main__":
135
104
    print "Running remove dialog"
136
 
    import apt
137
 
    cache = apt.Cache()
138
105
    
139
 
    confirm_remove(None, 
140
 
                   "./data", 
141
 
                   "To remove Package, these items must be removed as well",
142
 
                   cache,
143
 
                   "Remove", 
144
 
                   "./data/icons/48x48/apps/softwarecenter.png", 
145
 
                   depends=["apt"])
146
106
                   
147
107
    print "Running broken apt-cache dialog"               
148
108
    confirm_repair_broken_cache(None, "./data")