private void InitializeBookmarks(CountdownEvent bookmarksSemaphore) { // Load all bookmarks in background _controller.Background(() => { AbstractHostCollection c = BookmarkCollection.defaultCollection(); c.load(); bookmarksSemaphore.Signal(); }, () => { if (PreferencesFactory.get().getBoolean("browser.open.untitled")) { if (PreferencesFactory.get().getProperty("browser.open.bookmark.default") != null) { _bc.Invoke(() => { BrowserController bc = NewBrowser(); OpenDefaultBookmark(bc); }); } } }); }
private void ImportBookmarks(CountdownEvent bookmarksSemaphore, CountdownEvent thirdpartySemaphore) { // Import thirdparty bookmarks. IList <ThirdpartyBookmarkCollection> thirdpartyBookmarks = GetThirdpartyBookmarks(); _controller.Background(() => { foreach (ThirdpartyBookmarkCollection c in thirdpartyBookmarks) { if (!c.isInstalled()) { Logger.info("No application installed for " + c.getBundleIdentifier()); continue; } c.load(); if (c.isEmpty()) { if (!PreferencesFactory.get().getBoolean(c.getConfiguration())) { // Flag as imported PreferencesFactory.get().setProperty(c.getConfiguration(), true); } } } bookmarksSemaphore.Wait(); }, () => { foreach (ThirdpartyBookmarkCollection c in thirdpartyBookmarks) { AbstractHostCollection bookmarks = BookmarkCollection.defaultCollection(); c.filter(bookmarks); if (!c.isEmpty()) { ThirdpartyBookmarkCollection c1 = c; Core.Utils.CommandBox(LocaleFactory.localizedString("Import", "Configuration"), String.Format(LocaleFactory.localizedString("Import {0} Bookmarks", "Configuration"), c.getName()), String.Format( LocaleFactory.localizedString( "{0} bookmarks found. Do you want to add these to your bookmarks?", "Configuration"), c.size()), String.Format("{0}", LocaleFactory.localizedString("Import", "Configuration")), true, LocaleFactory.localizedString("Don't ask again", "Configuration"), TaskDialogIcon.Question, (int option, bool verificationChecked) => { if (verificationChecked) { // Flag as imported PreferencesFactory.get().setProperty(c1.getConfiguration(), true); } switch (option) { case 0: BookmarkCollection.defaultCollection().addAll(c1); // Flag as imported PreferencesFactory.get().setProperty(c1.getConfiguration(), true); break; } }); } else { PreferencesFactory.get().setProperty(c.getConfiguration(), true); } } thirdpartySemaphore.Signal(); }); }
public FilterBookmarkListener(AbstractHostCollection source) { _source = source; }
public BookmarkModel(BrowserController controller, AbstractHostCollection source) { _controller = controller; Source = source; }
public FilterBookmarkCollection(AbstractHostCollection source) { _source = source; }
public MenuCollectionListener(BrowserForm f, MenuItem menu, AbstractHostCollection collection, String empty) { _form = f; _menu = menu; _collection = collection; _empty = empty; if (_collection.size() > 0) { BuildMenuItems(); } }