~mvo/software-center/promote-ubuntu-webapps

« back to all changes in this revision

Viewing changes to tests/gtk3/windows.py

  • Committer: Gary Lasker
  • Date: 2012-09-20 00:29:18 UTC
  • mfrom: (3103.1.10 path-cleansweep)
  • Revision ID: gary.lasker@canonical.com-20120920002918-mxfo3upue1unkryg
* lp:~mvo/software-center/path-cleansweep:
  - cleanup branch to eliminate the passing
    around of datadir/desktopdir or xapian dir

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
from tests.utils import (
75
75
    do_events,
76
76
    get_test_categories,
77
 
    get_test_datadir,
78
77
    get_test_db,
79
78
    get_test_gtk3_icon_cache,
80
79
    get_test_gtk3_viewmanager,
130
129
    primary = "primary text"
131
130
    button_text = "button_text"
132
131
    dia = dependency_dialogs._get_confirm_internal_dialog(
133
 
        parent=None, datadir=softwarecenter.paths.datadir, app=app,
 
132
        parent=None, app=app,
134
133
        db=db, icons=icons, primary=primary, button_text=button_text,
135
134
        depends=depends, cache=db._aptcache)
136
135
    return dia
142
141
    db = get_test_db()
143
142
    app = application.Application("", "p7zip-full")
144
143
    return dependency_dialogs.confirm_remove(None,
145
 
        softwarecenter.paths.datadir, app, db, icons)
 
144
        app, db, icons)
146
145
 
147
146
 
148
147
def get_query_from_search_entry(search_term):
254
253
    assert vm is not None
255
254
    db = get_test_db()
256
255
    cache = get_test_pkg_info()
257
 
    datadir = get_test_datadir()
258
256
    icons = get_test_gtk3_icon_cache()
259
257
    backend = get_test_install_backend()
260
258
 
268
266
    navhistory_forward_action = Gtk.Action("navhistory_forward_action",
269
267
        "Forward", "Forward", None)
270
268
 
271
 
    w = availablepane.AvailablePane(cache, db, 'Ubuntu', icons, datadir,
 
269
    w = availablepane.AvailablePane(cache, db, 'Ubuntu', icons,
272
270
        navhistory_back_action, navhistory_forward_action)
273
271
    w.init_view()
274
272
    w.show()
284
282
    vm = get_test_gtk3_viewmanager()
285
283
    db = get_test_db()
286
284
    cache = get_test_pkg_info()
287
 
    datadir = get_test_datadir()
288
285
    icons = get_test_gtk3_icon_cache()
289
286
 
290
 
    p = globalpane.GlobalPane(vm, datadir, db, cache, icons)
 
287
    p = globalpane.GlobalPane(vm, db, cache, icons)
291
288
 
292
289
    win = get_test_window(child=p)
293
290
    win.set_data("pane", p)
313
310
    cache = get_test_pkg_info()
314
311
    db = get_test_db()
315
312
    icons = get_test_gtk3_icon_cache()
316
 
    datadir = get_test_datadir()
317
313
    manager = get_test_gtk3_viewmanager()
318
314
 
319
 
    view = viewswitcher.ViewSwitcher(manager, datadir, db, cache, icons)
 
315
    view = viewswitcher.ViewSwitcher(manager, db, cache, icons)
320
316
 
321
317
    scroll = Gtk.ScrolledWindow()
322
318
    box = Gtk.VBox()
333
329
    vm  # make pyflakes happy
334
330
    db = get_test_db()
335
331
    cache = get_test_pkg_info()
336
 
    datadir = get_test_datadir()
337
332
    icons = get_test_gtk3_icon_cache()
338
333
 
339
 
    w = installedpane.InstalledPane(cache, db, 'Ubuntu', icons, datadir)
 
334
    w = installedpane.InstalledPane(cache, db, 'Ubuntu', icons)
340
335
    w.show()
341
336
 
342
337
    # init the view
360
355
    cache = get_test_pkg_info()
361
356
    icons = get_test_gtk3_icon_cache()
362
357
 
363
 
    widget = historypane.HistoryPane(cache, db, None, icons, None)
 
358
    widget = historypane.HistoryPane(cache, db, None, icons)
364
359
    widget.show()
365
360
 
366
361
    win = get_test_window(child=widget)
411
406
    else:
412
407
        cache = db._aptcache
413
408
 
414
 
    datadir = softwarecenter.paths.datadir
415
 
    icons = get_sc_icon_theme(datadir)
 
409
    icons = get_sc_icon_theme()
416
410
    distro = softwarecenter.distro.get_distro()
417
411
    apps_filter = appfilter.AppFilter(db, cache)
418
412
 
419
413
    # gui
420
414
    notebook = Gtk.Notebook()
421
415
 
422
 
    lobby_view = lobbyview.LobbyView(softwarecenter.paths.datadir,
423
 
        softwarecenter.paths.APP_INSTALL_PATH,
424
 
        cache, db, icons, distro, apps_filter)
 
416
    lobby_view = lobbyview.LobbyView(cache, db, icons, distro, apps_filter)
425
417
 
426
418
    scroll = Gtk.ScrolledWindow()
427
419
    scroll.add(lobby_view)
437
429
            subcat_cat = cat
438
430
            break
439
431
 
440
 
    subcat_view = catview.SubCategoryView(datadir,
441
 
        softwarecenter.paths.APP_INSTALL_PATH, cache, db, icons, apps_filter)
 
432
    subcat_view = catview.SubCategoryView(cache, db, icons, apps_filter)
442
433
    subcat_view.connect("category-selected", on_category_selected)
443
434
    subcat_view.set_subcategory(subcat_cat)
444
435
 
465
456
    db = database.StoreDatabase(pathname, cache)
466
457
    db.open()
467
458
 
468
 
    datadir = softwarecenter.paths.datadir
469
 
    icons = get_sc_icon_theme(datadir)
 
459
    icons = get_sc_icon_theme()
470
460
    distro = softwarecenter.distro.get_distro()
471
461
    apps_filter = appfilter.AppFilter(db, cache)
472
462
 
473
 
    cat_view = lobbyview.LobbyView(softwarecenter.paths.datadir,
474
 
        softwarecenter.paths.APP_INSTALL_PATH,
475
 
        cache, db, icons, distro, apps_filter)
 
463
    cat_view = lobbyview.LobbyView(cache, db, icons, distro, apps_filter)
476
464
 
477
465
    return cat_view
478
466
 
486
474
    db = database.StoreDatabase(pathname, cache)
487
475
    db.open()
488
476
 
489
 
    datadir = softwarecenter.paths.datadir
490
 
    icons = get_sc_icon_theme(datadir)
 
477
    icons = get_sc_icon_theme()
491
478
    distro = softwarecenter.distro.get_distro()
492
479
 
493
480
    # gui
494
481
    scroll = Gtk.ScrolledWindow()
495
 
    view = appdetailsview.AppDetailsView(db, distro, icons, cache, datadir)
 
482
    view = appdetailsview.AppDetailsView(db, distro, icons, cache)
496
483
 
497
484
    if pkgname is None:
498
485
        pkgname = "totem"
527
514
    db = database.StoreDatabase(pathname, cache)
528
515
    db.open()
529
516
 
530
 
    datadir = softwarecenter.paths.datadir
531
 
    icons = get_sc_icon_theme(datadir)
 
517
    icons = get_sc_icon_theme()
532
518
    pkgs = ["apt", "software-center"]
533
519
    view = pkgnamesview.PackageNamesView("header", cache, pkgs, icons, 32, db)
534
520
    view.show()
1061
1047
    distro = softwarecenter.distro.get_distro()
1062
1048
 
1063
1049
    init_sc_css_provider(win, Gtk.Settings.get_default(),
1064
 
                         Gdk.Screen.get_default(), "data")
 
1050
                         Gdk.Screen.get_default())
1065
1051
 
1066
1052
    t = thumbnail.ScreenshotGallery(distro, icons)
1067
1053
    t.connect('draw', t.draw)