private void InnerUpdate() { if (source == null || source.CurrentMessage == null || source.CurrentMessage.IsHidden) { Hide(); return; } Message = source.CurrentMessage.Text; Pixbuf = null; ShowCloseButton = source.CurrentMessage.CanClose; Spinning = source.CurrentMessage.IsSpinning; Pixbuf = source.CurrentMessage.IconNames == null ? null : IconThemeUtils.LoadIcon(22, source.CurrentMessage.IconNames); ClearButtons(); if (source.CurrentMessage.Actions != null) { foreach (MessageAction action in source.CurrentMessage.Actions) { Button button = new ActionButton(action); button.UseStock = action.IsStock; AddButton(button); } } Show(); }
private void UpdateIcons() { icon_names = job.IconNames; if (icon_pixbuf != null) { icon_pixbuf.Dispose(); icon_pixbuf = null; } if (icon_names == null || icon_names.Length == 0) { icon.Hide(); return; } icon_pixbuf = IconThemeUtils.LoadIcon(22, icon_names); if (icon_pixbuf != null) { icon.Pixbuf = icon_pixbuf; icon.Show(); return; } icon_pixbuf = new Gdk.Pixbuf(icon_names[0]); if (icon_pixbuf != null) { Gdk.Pixbuf scaled = icon_pixbuf.ScaleSimple(22, 22, Gdk.InterpType.Bilinear); icon_pixbuf.Dispose(); icon.Pixbuf = scaled; icon.Show(); } }
private void CloseWindow(object o, EventArgs args) { try { if (NotifyOnCloseSchema.Get()) { Gdk.Pixbuf image = IconThemeUtils.LoadIcon(48, Banshee.ServiceStack.Application.IconName); if (image != null) { image = image.ScaleSimple(icon_size, icon_size, Gdk.InterpType.Bilinear); } Notification nf = new Notification( Catalog.GetString("Still Running"), Catalog.GetString("Banshee was closed to the notification area. " + "Use the <i>Quit</i> option to end your session."), image, notif_area.Widget); nf.Urgency = Urgency.Low; nf.Timeout = 4500; nf.Show(); NotifyOnCloseSchema.Set(false); } } catch { } elements_service.PrimaryWindow.SetVisible(false); }
// This code has been shamelessly ripped off from // Tomboy, the wonderful life organizer! private void ConfigureIconSize() { // For some reason, the first time we ask for the allocation, // it's a 1x1 pixel. Prevent against this by returning a // reasonable default. Setting the icon causes OnSizeAllocated // to be called again anyhow. (--Boyd) int icon_size = panel_size; if (icon_size < 16) { icon_size = 16; } // Control specifically which icon is used at the smaller sizes // so that no scaling occurs. See bug #403500 for more info (--Boyd) if (icon_size <= 21) { icon_size = 16; } else if (icon_size <= 31) { icon_size = 22; } else if (icon_size <= 47) { icon_size = 32; } icon.IconName = (IconThemeUtils.HasIcon("banshee-panel")) ? "banshee-panel" : Banshee.ServiceStack.Application.IconName; icon.PixelSize = icon_size; }
private bool DrawAppIndicator() { try { indicator = new ApplicationIndicator("banshee", (IconThemeUtils.HasIcon("banshee-panel")) ? "banshee-panel" : Banshee.ServiceStack.Application.IconName, Category.ApplicationStatus); // Load the menu Gtk3.Menu menu = (Gtk3.Menu)interface_action_service.UIManager.GetWidget("/AppIndicatorTrayMenu"); menu.Show(); //This cannot be enabled at the moment because of the Gtk3/Gtk2 conflict. Need to find a solution //indicator.Menu = menu; // Show the tray icon indicator.Status = Status.Active; if (!QuitOnCloseSchema.Get()) { RegisterCloseHandler(); } } catch (Exception e) { Hyena.Log.Warning("Error while trying to create the Application Indicator.", e.Message, false); return(false); } return(true); }
public void AddPage(BaseContextPage page) { Hyena.Log.DebugFormat("Adding context page {0}", page.Id); // TODO delay adding the page.Widget until the page is first activated, // that way we don't even create those objects unless used var frame = new Hyena.Widgets.RoundedFrame(); frame.Add(page.Widget); frame.Show(); // TODO implement DnD? /*if (page is ITrackContextPage) { * Gtk.Drag.DestSet (frame, DestDefaults.Highlight | DestDefaults.Motion, * new TargetEntry [] { Banshee.Gui.DragDrop.DragDropTarget.UriList }, * Gdk.DragAction.Default); * frame.DragDataReceived += delegate(object o, DragDataReceivedArgs args) { * }; * }*/ page.Widget.Show(); notebook.AppendPage(frame, null); pane_pages[page] = frame; // Setup the tab-like button that switches the notebook to this page var tab_image = new Image(IconThemeUtils.LoadIcon(22, page.IconNames)); var toggle_button = new RadioButton(radio_group) { Child = tab_image, DrawIndicator = false, Relief = ReliefStyle.None }; TooltipSetter.Set(tooltip_host, toggle_button, page.Name); toggle_button.Clicked += (s, e) => { if (pane_pages.ContainsKey(page)) { if (page.State == ContextState.Loaded) { notebook.CurrentPage = notebook.PageNum(pane_pages[page]); } SetActivePage(page); } }; toggle_button.ShowAll(); vbox.PackStart(toggle_button, false, false, 0); pane_tabs[page] = toggle_button; pages.Add(page); if (initialized && pages.Count == 1) { SetActivePage(page); toggle_button.Active = true; } UpdateVisibility(); }
public GtkNotificationAreaBox(BaseClientWindow window) { Visible = false; IconName = (IconThemeUtils.HasIcon("banshee-panel")) ? "banshee-panel" : Banshee.ServiceStack.Application.IconName; Tooltip = window.Title; window.TitleChanged += delegate { Tooltip = window.Title; }; }
// ----------------------------------------------- // // FIXME: Ok, this is a real hack, it has half-support for buying multiple songs // but doenst really allow it yet. Will overwrite the song with the last one downloaded. protected virtual void ThreadWorker() { user_event = new ActiveUserEvent (String.Format (Catalog.GetString ("Purchasing {0} - {1}"), track.Artist, track.Title)); user_event.CanCancel = false; user_event.Icon = IconThemeUtils.LoadIcon("document-save", 22); // FIXME: Get a nice icon user_event.Header = Catalog.GetString ("Purchasing"); user_event.Message = String.Format ("{0} - {1}", track.Artist, track.Title); ArrayList songs = new ArrayList (); try { songs = plugin.Store.Buy (track.Data); } catch (Exception ex) { // FIXME: Error handling correct? user_event.Dispose (); HigMessageDialog.RunHigMessageDialog (null, 0, MessageType.Error, ButtonsType.Ok, "Purchase Error", String.Format ("There was an error while performing the purchase: {0}", ex.Message)); return; } Hashtable song, meta; for (int i = 0; i < songs.Count; i++) { song = (Hashtable) songs[i]; meta = song[ "metaData" ] != null ? (Hashtable)song ["metaData"] : song; user_event.Header = String.Format (Catalog.GetString ("Downloading {0} of {1}"), i+1, songs.Count); user_event.Message = String.Format (Catalog.GetString ("{0} - {1}"), track.Artist, track.Title); try { byte [] buffer = plugin.Store.DownloadSong (song, new FairStore.Progress (ProgressUpdate)); FileStream fs = new FileStream (MusicStorePlugin.GetLibraryPathForTrack (track), FileMode.CreateNew); BinaryWriter bw = new BinaryWriter (fs); bw.Write (buffer); bw.Close (); fs.Close (); } catch (Exception ex) { // FIXME: Error handling correct? user_event.Dispose (); HigMessageDialog.RunHigMessageDialog (null, 0, MessageType.Error, ButtonsType.Ok, "Download Error", String.Format ("There was an error while performing the download: {0}", ex.Message)); return; } } user_event.Dispose (); }
public void LoadImage(TrackMediaAttributes attr, string artwork_id) { if (Pixbuf != null) { Pixbuf.Dispose(); } Pixbuf = ServiceManager.Get <ArtworkManager> ().LookupScalePixbuf(artwork_id, HeightRequest) ?? IconThemeUtils.LoadIcon("audiobook", HeightRequest); }
protected override void LoadPixbufs() { base.LoadPixbufs(); // Downloading Pixbufs[base.PixbufCount + 0] = IconThemeUtils.LoadIcon(PixbufSize, "document-save", "go-bottom"); // Downloaded //Pixbufs[base.PixbufCount + 1] = IconThemeUtils.LoadIcon (PixbufSize, "podcast-new"); }
public PodcastSubscribeDialog() : base( Catalog.GetString("Subscribe"), null, DialogFlags.Modal | DialogFlags.NoSeparator) { IconThemeUtils.SetWindowIcon(this); accel_group = new Gtk.AccelGroup(); AddAccelGroup(accel_group); BuildWindow(); }
public PodcastFeedPropertiesDialog(PodcastFeedInfo feed) : base(feed.Title, InterfaceElements.MainWindow, DialogFlags.DestroyWithParent) { this.feed = feed; Title = feed.Title; IconThemeUtils.SetWindowIcon(this); BuildWindow(); }
protected Cairo.ImageSurface GetDefaultSurface() { Cairo.ImageSurface surface = new Cairo.ImageSurface(Cairo.Format.ARGB32, CoverManager.TextureSize, CoverManager.TextureSize); Cairo.Context context = new Cairo.Context(surface); Gdk.CairoHelper.SetSourcePixbuf(context, IconThemeUtils.LoadIcon(CoverManager.TextureSize, "media-optical", "browser-album-cover"), 0, 0); context.Paint(); //((IDisposable) context.Target).Dispose(); ((IDisposable)context).Dispose(); return(surface); }
private void SetSource(TreeIter iter, Source source) { Gdk.Pixbuf icon = source.Icon; if (icon == null) { icon = IconThemeUtils.LoadIcon(22, "source-library"); } SetValue(iter, 0, icon); SetValue(iter, 1, source.Name); SetValue(iter, 2, source); }
public GtkNotificationAreaBox(BaseClientWindow window) { Visible = false; IconName = (IconThemeUtils.HasIcon("banshee-panel")) ? "banshee-panel" : ServiceStack.Application.IconName; HasTooltip = true; Activate += delegate { OnActivated(); }; PopupMenu += delegate { OnPopupMenuEvent(); }; _popup = new TrackInfoPopup(); }
public RecommendationPane(ContextPage contextPage) : base() { this.context_page = contextPage; main_box = this; main_box.BorderWidth = 5; artist_box = new TitledList(Catalog.GetString("Recommended Artists")); artist_box.ShowAll(); similar_artists_view = new TileView(2); similar_artists_view_sw = new Gtk.ScrolledWindow(); similar_artists_view_sw.SetPolicy(PolicyType.Never, PolicyType.Automatic); similar_artists_view_sw.Add(similar_artists_view); similar_artists_view_sw.ShowAll(); artist_box.PackStart(similar_artists_view_sw, true, true, 0); album_box = new TitledList(null); album_box.TitleWidthChars = 25; album_box.SizeAllocated += OnSideSizeAllocated; album_list = new VBox(); album_box.PackStart(album_list, false, false, 0); track_box = new TitledList(null); track_box.SizeAllocated += OnSideSizeAllocated; track_box.TitleWidthChars = 25; track_list = new VBox(); track_box.PackStart(track_list, true, true, 0); no_artists_pane = new MessagePane(); no_artists_pane.NoShowAll = true; no_artists_pane.Visible = false; string no_results_message; if (!ApplicationContext.Debugging) { no_artists_pane.HeaderIcon = IconThemeUtils.LoadIcon(48, "face-sad", Stock.DialogError); no_results_message = Catalog.GetString("No similar artists found"); } else { no_artists_pane.HeaderIcon = Gdk.Pixbuf.LoadFromResource("no-results.png"); no_results_message = "No one likes your music, fool!"; } no_artists_pane.HeaderMarkup = String.Format("<big><b>{0}</b></big>", GLib.Markup.EscapeText(no_results_message)); artist_box.PackEnd(no_artists_pane, true, true, 0); main_box.PackStart(artist_box, true, true, 5); main_box.PackStart(new VSeparator(), false, false, 0); main_box.PackStart(album_box, false, false, 5); main_box.PackStart(new VSeparator(), false, false, 0); main_box.PackStart(track_box, false, false, 5); no_artists_pane.Hide(); }
static PodcastPixbufs() { new_podcast_icon = Gdk.Pixbuf.LoadFromResource("banshee-new.png"); podcast_icon_16 = Gdk.Pixbuf.LoadFromResource("podcast-icon-16.png"); podcast_icon_22 = Gdk.Pixbuf.LoadFromResource("podcast-icon-22.png"); podcast_icon_48 = Gdk.Pixbuf.LoadFromResource("podcast-icon-48.png"); activity_column_icon = IconThemeUtils.LoadIcon(16, "audio-volume-high", "blue-speaker"); download_column_icon = Gdk.Pixbuf.LoadFromResource("document-save-as-16.png"); }
private static void CreateUserEventProxy(object o, EventArgs args) { if (userEvent == null) { userEvent = new ActiveUserEvent(Catalog.GetString("Download")); userEvent.Icon = IconThemeUtils.LoadIcon(Stock.Network, 22); userEvent.Header = Catalog.GetString("Downloading Files"); userEvent.Message = Catalog.GetString("Initializing downloads"); userEvent.CancelRequested += OnUserEventCancelRequestedHandler; cancel_requested = false; } }
protected override void LoadPixbufs() { base.LoadPixbufs(); // Downloading Pixbufs[base.PixbufCount + 0] = IconThemeUtils.LoadIcon(PixbufSize, "document-save", "go-bottom"); StatusNames[base.PixbufCount + 0] = Catalog.GetString("Downloading"); // Podcast is Downloaded Pixbufs[base.PixbufCount + 1] = IconThemeUtils.LoadIcon(PixbufSize, "podcast-new"); StatusNames[base.PixbufCount + 1] = Catalog.GetString("New"); }
public PodcastPropertiesDialog(PodcastInfo pi) : base(pi.Title, InterfaceElements.MainWindow, DialogFlags.DestroyWithParent) { if (pi == null) { throw new ArgumentNullException("pi"); } this.pi = pi; BuildWindow(); IconThemeUtils.SetWindowIcon(this); }
protected void SetupViewport() { Stage.Color = new Clutter.Color(0x00, 0x00, 0x00, 0xff); cover_manager.SetRotation(RotateAxis.X, viewportAngleX, Stage.Width / 2, Stage.Height / 2, 0); Stage.Add(cover_manager); cover_manager.EmptyActor.SetToPb( IconThemeUtils.LoadIcon(cover_manager.TextureSize, "gtk-stop", "clutterflow-large.png") ); CoverManager.DoubleClickTime = (uint)Gtk.Settings.GetForScreen(this.Screen).DoubleClickTime; cover_manager.LowerBottom(); cover_manager.Show(); }
private void LoadMissingImages() { if (missing_audio_surface == null) { missing_audio_surface = new PixbufImageSurface(IconThemeUtils.LoadIcon( missing_artwork_size, "audio-x-generic"), true); } if (missing_video_surface == null) { missing_video_surface = new PixbufImageSurface(IconThemeUtils.LoadIcon( missing_artwork_size, "video-x-generic"), true); } }
public UnsupportedDatabaseView(IpodSource source) : base(source) { this.source = source; pane = new MessagePane(); pane.HeaderIcon = IconThemeUtils.LoadIcon(48, "face-surprise", Stock.DialogError); pane.ArrowIcon = IconThemeUtils.LoadIcon(24, "go-next", Stock.GoForward); pane.HeaderMarkup = String.Format("<big><b>{0}</b></big>", GLib.Markup.EscapeText(Catalog.GetString("Unable to read your iPod"))); AddPaneItems(); Add(pane); ShowAll(); }
private void LoadPixbufs() { if (pixbufs == null) { pixbufs = new Gdk.Pixbuf[attributes.Length]; } for (int i = 0; i < attributes.Length - 1; i++) { pixbufs[i] = IconThemeUtils.LoadIcon(ICON_SIZE, String.Format("creative-commons-{0}", attributes[i])); } // HACK to enable 'publicdomain' to work pixbufs[attributes.Length - 1] = pixbufs[attributes.Length - 2]; }
public ColumnCellArtistCover(bool smallImagesUsed) : base(null, true) { use_small_images = smallImagesUsed; artwork_initialized = false; image_size = use_small_images ? small_image_size : normal_image_size; default_cover_image = PixbufImageSurface.Create(IconThemeUtils.LoadIcon(image_size, "media-optical", "browser-album-cover")); column_controller = new ColumnController(); var current_layout = new Column("Artist", this, 1.0); column_controller.Add(current_layout); ServiceManager.SourceManager.ActiveSourceChanged += HandleActiveSourceChanged; }
public static Gdk.Pixbuf ResolveIcon(Source source, int size, string @namespace) { string name_property = @namespace == null ? "Icon.Name" : String.Format("{0}.Icon.Name", @namespace); string pixbuf_property = @namespace == null ? String.Format("Icon.Pixbuf_{0}", size) : String.Format("{0}.Icon.Pixbuf_{1}", @namespace, size); Gdk.Pixbuf icon = source.Properties.Get <Gdk.Pixbuf> (pixbuf_property); if (icon != null) { return(icon); } Type icon_type = source.Properties.GetType(name_property); Assembly asm = source.Properties.Get <Assembly> ("ResourceAssembly"); if (icon_type == typeof(string)) { icon = IconThemeUtils.LoadIcon(asm, size, source.Properties.Get <string> (name_property)); } else if (icon_type == typeof(string [])) { icon = IconThemeUtils.LoadIcon(asm, size, source.Properties.Get <string[]> (name_property)); } if (icon == null) { icon = Banshee.Gui.IconThemeUtils.LoadIcon(size, "image-missing"); } if (icon != null) { source.Properties.Set <Gdk.Pixbuf> (pixbuf_property, icon); } return(icon); }
public DaapErrorView(DaapSource source, DaapErrorType failure) : base() { //AppPaintable = true; //BorderWidth = 10; this.source = source; this.failure = failure; pane = new MessagePane(); pane.HeaderIcon = IconThemeUtils.LoadIcon(48, "face-surprise", Stock.DialogError); pane.ArrowIcon = IconThemeUtils.LoadIcon(24, "go-next", Stock.GoForward); pane.HeaderMarkup = String.Format("<big><b>{0}</b></big>", GLib.Markup.EscapeText((failure == DaapErrorType.UserDisconnect ? Catalog.GetString("Disconnected from music share") : Catalog.GetString("Unable to connect to music share")))); AddPaneItems(); pane.Show(); Add(pane); }
protected virtual void LoadPixbufs() { if (pixbufs != null && pixbufs.Length > 0) { for (int i = 0; i < pixbufs.Length; i++) { if (pixbufs[i] != null) { pixbufs[i].Dispose(); pixbufs[i] = null; } } } if (pixbufs == null) { pixbufs = new Gdk.Pixbuf[PixbufCount]; } pixbufs[(int)Icon.Playing] = IconThemeUtils.LoadIcon(PixbufSize, "media-playback-start"); pixbufs[(int)Icon.Paused] = IconThemeUtils.LoadIcon(PixbufSize, "media-playback-pause"); pixbufs[(int)Icon.Error] = IconThemeUtils.LoadIcon(PixbufSize, "emblem-unreadable", "dialog-error"); pixbufs[(int)Icon.Protected] = IconThemeUtils.LoadIcon(PixbufSize, "emblem-readonly", "dialog-error"); pixbufs[(int)Icon.External] = IconThemeUtils.LoadIcon(PixbufSize, "x-office-document"); if (status_names == null) { status_names = new string[PixbufCount]; for (int i = 0; i < PixbufCount; i++) { status_names[i] = ""; } } status_names[(int)Icon.Playing] = Catalog.GetString("Playing"); status_names[(int)Icon.Paused] = Catalog.GetString("Paused"); status_names[(int)Icon.Error] = Catalog.GetString("Error"); status_names[(int)Icon.Protected] = Catalog.GetString("Protected"); status_names[(int)Icon.External] = Catalog.GetString("External Document"); }
private void CreateTabButtonBox() { vbox = new VBox(); HBox hbox = new HBox(); var max = new Button(new Image(IconThemeUtils.LoadIcon("context-pane-maximize", 7))); max.Clicked += (o, a) => { large = !large; expand_handler(large); }; TooltipSetter.Set(tooltip_host, max, Catalog.GetString("Make the context pane larger or smaller")); var close = new Button(new Image(IconThemeUtils.LoadIcon("context-pane-close", 7))); close.Clicked += (o, a) => ShowAction.Activate(); TooltipSetter.Set(tooltip_host, close, Catalog.GetString("Hide context pane")); max.Relief = close.Relief = ReliefStyle.None; hbox.PackStart(max, false, false, 0); hbox.PackStart(close, false, false, 0); vbox.PackStart(hbox, false, false, 0); PackStart(vbox, false, false, 6); vbox.ShowAll(); }
private void AddPaneItems() { if (info_link_clicked) { bool file_exists = System.IO.File.Exists(Paths.Combine( source.IpodDevice.ControlPath, "iTunes", "iTunesDB")); if (file_exists) { pane.Append(Catalog.GetString( "You have used this iPod with a version of iTunes that saves a " + "version of the song database for your iPod that is too new " + "for Banshee to recognize.\n\n" + "Banshee can rebuild your database, but some settings might be lost. " + "Using Banshee and iTunes with the same iPod is not recommended." )); LinkLabel link = new LinkLabel(); link.Xalign = 0.0f; link.Markup = String.Format("<u>{0}</u>", GLib.Markup.EscapeText(Catalog.GetString( "Learn more about Banshee's iPod support"))); link.Clicked += delegate { Banshee.Web.Browser.Open("http://banshee-project.org/IpodAndItunes"); }; link.Show(); pane.Append(link, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, true); } else { pane.Append(Catalog.GetString( "An iPod database could not be found on this device.\n\n" + "Banshee can build a new database for you." )); } } else { LinkLabel link = new LinkLabel(); link.Xalign = 0.0f; link.Markup = String.Format("<u>{0}</u>", GLib.Markup.EscapeText(Catalog.GetString( "What is the reason for this?"))); link.Clicked += delegate { info_link_clicked = true; pane.Clear(); AddPaneItems(); }; link.Show(); pane.Append(link, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, true); } if (source.IpodDevice.VolumeInfo.IsMountedReadOnly) { pane.Append(Catalog.GetString("Your iPod is mounted read only. Banshee can not restore your iPod."), true, IconThemeUtils.LoadIcon(48, "dialog-error")); return; } LinkLabel rebuild_link = new LinkLabel(); rebuild_link.Xalign = 0.0f; rebuild_link.Markup = String.Format("<u>{0}</u>", GLib.Markup.EscapeText(Catalog.GetString( "Rebuild iPod Database..."))); rebuild_link.Clicked += OnRebuildDatabase; rebuild_link.Show(); pane.Append(rebuild_link, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, true); }