~ubuntu-branches/ubuntu/quantal/shotwell/quantal

« back to all changes in this revision

Viewing changes to src/library/LibraryWindow.vala

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-02-21 13:52:58 UTC
  • mto: This revision was merged to the branch mainline in revision 47.
  • Revision ID: package-import@ubuntu.com-20120221135258-ao9jiib5qicomq7q
Tags: upstream-0.11.92
ImportĀ upstreamĀ versionĀ 0.11.92

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2009-2011 Yorba Foundation
 
1
/* Copyright 2009-2012 Yorba Foundation
2
2
 *
3
3
 * This software is licensed under the GNU Lesser General Public License
4
4
 * (version 2.1 or later).  See the COPYING file in this distribution. 
69
69
    
70
70
    // special Yorba-selected sidebar background color for standard themes (humanity,
71
71
    // clearlooks, etc.); dark themes use the theme's native background color
72
 
    public static Gdk.Color SIDEBAR_STANDARD_BG_COLOR = parse_color("#EEE");
 
72
    public static Gdk.RGBA SIDEBAR_STANDARD_BG_COLOR = parse_color("#EEE");
73
73
    
74
74
    // Max brightness value to trigger SIDEBAR_STANDARD_BG_COLOR 
75
75
    public const uint16 STANDARD_COMPONENT_MINIMUM = 0xe000;
388
388
        import.tooltip = _("Import photos from disk to library");
389
389
        actions += import;
390
390
        
391
 
        // Add one action per alien database driver
392
 
        foreach (AlienDb.AlienDatabaseDriver driver in AlienDb.AlienDatabaseHandler.get_instance().get_drivers()) {
393
 
            Gtk.ActionEntry import_from_alien_db = driver.get_action_entry();
394
 
            actions += import_from_alien_db;
395
 
        }
 
391
        Gtk.ActionEntry import_from_external = {
 
392
            "ExternalLibraryImport", Resources.IMPORT, TRANSLATABLE,
 
393
            "<Ctrl>E", TRANSLATABLE, on_external_library_import
 
394
        };
 
395
        import_from_external.label = _("Import From _Application...");
 
396
        actions += import_from_external;
396
397
 
397
398
        Gtk.ActionEntry sort = { "CommonSortEvents", null, TRANSLATABLE, null, null, null };
398
399
        sort.label = _("Sort _Events");
499
500
    
500
501
    public override void replace_common_placeholders(Gtk.UIManager ui) {
501
502
        base.replace_common_placeholders(ui);
502
 
        
503
 
        // Adds one menu entry per alien database driver
504
 
        AlienDb.AlienDatabaseHandler.get_instance().add_menu_entries(
505
 
            ui, "/MenuBar/FileMenu/CommonImportFromAlienDbPlaceholder"
506
 
        );
507
503
    }
508
504
    
509
505
    protected override void switched_pages(Page? old_page, Page? new_page) {
744
740
        import_dialog.destroy();
745
741
    }
746
742
    
 
743
    private void on_external_library_import() {
 
744
        Gtk.Dialog import_dialog = DataImportsUI.DataImportsDialog.get_or_create_instance();
 
745
        
 
746
        import_dialog.run();
 
747
    }
 
748
    
747
749
    protected override void update_common_action_availability(Page? old_page, Page? new_page) {
748
750
        base.update_common_action_availability(old_page, new_page);
749
751
        
959
961
    private Gdk.DragAction get_drag_action() {
960
962
        Gdk.ModifierType mask;
961
963
        
962
 
        get_window().get_pointer(null, null, out mask);
 
964
        get_window().get_device_position(Gdk.Display.get_default().get_device_manager()
 
965
            .get_client_pointer(), null, null, out mask);
963
966
 
964
967
        bool ctrl = (mask & Gdk.ModifierType.CONTROL_MASK) != 0;
965
968
        bool alt = (mask & Gdk.ModifierType.MOD1_MASK) != 0;
1354
1357
            // if the current theme is a standard theme (as opposed to a dark theme), then
1355
1358
            // use the specially-selected Yorba muted background color for the sidebar.
1356
1359
            // otherwise, use the theme's native background color.
1357
 
            sidebar_tree.modify_base(Gtk.StateType.NORMAL, SIDEBAR_STANDARD_BG_COLOR);
 
1360
            sidebar_tree.override_color(Gtk.StateFlags.NORMAL, SIDEBAR_STANDARD_BG_COLOR);
1358
1361
        }
1359
1362
        
1360
1363
        // put the sidebar in a scrolling window