Ejemplo n.º 1
0
        private void OnViewFrames()
        {
            var dlg = new Gtk.Dialog( "Frames", this, Gtk.DialogFlags.Modal );

            var frame1 = new Gtk.Frame( "<b>Frame1</b>" );
            ( (Gtk.Label) frame1.LabelWidget ).UseMarkup = true;
            frame1.Add( new Gtk.Label( "This is frame1" ) );
            var frame2 = new Gtk.Frame( "<b>Frame2</b>" );
            ( (Gtk.Label) frame2.LabelWidget ).UseMarkup = true;
            frame2.Add( new Gtk.Label( "This is frame2" ) );
            var frame3 = new Gtk.Frame( "<b>Frame3</b>" );
            ( (Gtk.Label) frame3.LabelWidget ).UseMarkup = true;
            frame3.Add( new Gtk.Label( "This is frame3" ) );

            dlg.VBox.PackStart( frame1, true, true, 5 );
            dlg.VBox.PackStart( frame2, true, true, 5 );
            dlg.VBox.PackStart( frame3, true, true, 5 );

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry() {
                    MinHeight = 200,
                    MinWidth = 320
                },
                Gdk.WindowHints.MinSize
            );

            dlg.AddButton( "Ok", Gtk.ResponseType.Ok );
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
Ejemplo n.º 2
0
        void RunDialog(string message)
        {
            if (disposed)
            {
                return;
            }

            dialog = new Gtk.Dialog()
            {
                Title = "Waiting for debugger"
            };

            var label = new Gtk.Alignment(0.5f, 0.5f, 1f, 1f)
            {
                Child       = new Gtk.Label(message),
                BorderWidth = 12
            };

            dialog.VBox.PackStart(label);
            label.ShowAll();

            dialog.AddButton("Cancel", Gtk.ResponseType.Cancel);

            int response = MonoDevelop.Ide.MessageService.ShowCustomDialog(dialog);

            dialog.Destroy();
            dialog = null;

            if (!disposed && response != (int)Gtk.ResponseType.Ok && UserCancelled != null)
            {
                UserCancelled(null, null);
            }
        }
Ejemplo n.º 3
0
        private void OnViewBoxes()
        {
            var dlg = new Gtk.Dialog( "Boxes", this, Gtk.DialogFlags.Modal );

            var hbBox1 = new Gtk.HBox( false, 5 );
            hbBox1.Add( new Gtk.Label( "This is hbox 1" ) );
            var hbBox2 = new Gtk.HBox( false, 5 );
            hbBox2.Add( new Gtk.Label( "This is hbox 2" ) );
            var hbBox3 = new Gtk.HBox( false, 5 );
            hbBox3.Add( new Gtk.Label( "This is hbox 3" ) );

            dlg.VBox.PackStart( hbBox1, true, true, 5 );
            dlg.VBox.PackStart( hbBox2, true, true, 5 );
            dlg.VBox.PackStart( hbBox3, true, true, 5 );

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry() {
                    MinHeight = 200,
                    MinWidth = 320
                },
                Gdk.WindowHints.MinSize
            );

            dlg.AddButton( "Ok", Gtk.ResponseType.Ok );
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
        void ShowListenDialog(RemoteDebuggerStartInfo dsi)
        {
            string message = GetListenMessage(dsi);

            Gtk.Application.Invoke(delegate {
                if (VirtualMachine != null || Exited)
                {
                    return;
                }

                dialog = new Gtk.Dialog()
                {
                    Title = "Waiting for debugger"
                };

                var label = new Gtk.Alignment(0.5f, 0.5f, 1f, 1f)
                {
                    Child       = new Gtk.Label(message),
                    BorderWidth = 12
                };
                dialog.VBox.PackStart(label);
                label.ShowAll();

                dialog.AddButton("Cancel", Gtk.ResponseType.Cancel);

                int response = MonoDevelop.Ide.MessageService.ShowCustomDialog(dialog);

                if (response != (int)Gtk.ResponseType.Ok)
                {
                    EndSession();
                }
                dialog = null;
            });
        }
Ejemplo n.º 5
0
        public void Run(FSpot.IBrowsableCollection photos)
        {
            if (null == photos)
            {
                throw new ArgumentNullException("photos");
            }

            this.photos = photos;

            Glade.XML glade_xml = new Glade.XML(
                null, "TabbloExport.glade", DialogName,
                "f-spot");
            glade_xml.Autoconnect(this);

            dialog = (Gtk.Dialog)glade_xml.GetWidget(DialogName);

            FSpot.Widgets.IconView icon_view =
                new FSpot.Widgets.IconView(photos);
            icon_view.DisplayDates = false;
            icon_view.DisplayTags  = false;

            username_entry.Changed += HandleAccountDataChanged;
            password_entry.Changed += HandleAccountDataChanged;
            ReadAccountData();
            HandleAccountDataChanged(null, null);

            dialog.Modal        = false;
            dialog.TransientFor = null;

            dialog.Response += HandleResponse;

            thumb_scrolled_window.Add(icon_view);
            icon_view.Show();
            dialog.Show();
        }
Ejemplo n.º 6
0
        public void Run(object o, EventArgs e)
        {
            Console.WriteLine("EXECUTING ExiflowEditComment EXTENSION");

            xml = new Glade.XML(null, "ExiflowEditComment.glade", dialog_name, "f-spot");
            xml.Autoconnect(this);
            dialog = (Gtk.Dialog)xml.GetWidget(dialog_name);

            // collect comments of selected photos in current_comments
            ArrayList current_comments = new ArrayList();

            foreach (Photo p in App.Instance.Organizer.SelectedPhotos())
            {
                if (p.Description.Length > 0 && !current_comments.Contains(p.Description))
                {
                    current_comments.Add(p.Description);
                }
            }

            // fill text buffer with all current comments
            comment.Buffer.Text = String.Join("\n---\n", (String[])current_comments.ToArray(typeof(string)));

            dialog.Modal        = false;
            dialog.TransientFor = null;
            dialog.Response    += HandleResponse;
            dialog.ShowAll();
        }
Ejemplo n.º 7
0
        private void OnViewNotebook()
        {
            var dlg    = new Gtk.Dialog("Boxes", this, Gtk.DialogFlags.Modal);
            var nbTabs = new Gtk.Notebook();

            nbTabs.AppendPage(new Gtk.Label("Page1"), new Gtk.Label("Page1"));
            nbTabs.AppendPage(new Gtk.Label("Page2"), new Gtk.Label("Page2"));

            dlg.VBox.PackStart(nbTabs, true, true, 5);

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry()
            {
                MinHeight = 200,
                MinWidth  = 320
            },
                Gdk.WindowHints.MinSize
                );

            dlg.AddButton("Ok", Gtk.ResponseType.Ok);
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
Ejemplo n.º 8
0
        public AccountDialog(Gtk.Window parent, GalleryAccount account, bool show_error)
        {
            var builder = new GtkBeans.Builder (null, "gallery_add_dialog.ui", null);
            builder.Autoconnect (this);
            add_dialog = new Gtk.Dialog (builder.GetRawObject ("gallery_add_dialog"));
            add_dialog.Modal = false;
            add_dialog.TransientFor = parent;
            add_dialog.DefaultResponse = Gtk.ResponseType.Ok;

            this.account = account;

            status_area.Visible = show_error;

            if (account != null) {
                gallery_entry.Text = account.Name;
                url_entry.Text = account.Url;
                password_entry.Text = account.Password;
                username_entry.Text = account.Username;
                add_button.Label = Gtk.Stock.Ok;
                add_dialog.Response += HandleEditResponse;
            }

            if (remove_button != null)
                remove_button.Visible = account != null;

            add_dialog.Show ();

            gallery_entry.Changed += HandleChanged;
            url_entry.Changed += HandleChanged;
            password_entry.Changed += HandleChanged;
            username_entry.Changed += HandleChanged;
            HandleChanged (null, null);
        }
Ejemplo n.º 9
0
        protected override void Run()
        {
            var widget = new Gtk.Dialog();
            var label  = new Gtk.Label();

            widget.Remove(label);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Shows a modal dialog.
        /// </summary>
        /// <param name="dialog">The dialog to show.</param>
        /// <param name="alwaysClose">If set to <c>true</c> always close the dialog as soon as a response is known.</param>
        /// <param name="closeForResponses">If <paramref name="alwaysClose"/> is <c>false</c>, only the provided values will exit the dialog run loop.</param>
        /// <returns>A value indicating whether the dialog was cancelled (<c>false</c>), aborted (<c>null</c>) or approved (<c>true</c>).</returns>
        /// <remarks>Dialogs with 'sub-functions' should always use a response value of Gtk.ResponseType.None. Other explicit values
        /// may be ignored -- that is, only specific values will exit the dialog if the <paramref name="closeForResponses"/> argument
        /// is non-empty and <paramref name="alwaysClose"/> is <c>false</c>. If alwaysClose is false and no response values for close are
        /// provided, it is a Bad Thing and you shouldn't do that.</remarks>
        public static bool?ShowDialog(this Gtk.Dialog dialog, bool alwaysClose, params Gtk.ResponseType[] closeForResponses)
        {
            bool?accepted = null;
            var  result   = Gtk.ResponseType.None;

            do
            {
                result = (Gtk.ResponseType)dialog.Run();
                if (result != Gtk.ResponseType.None)
                {
                    switch (result)
                    {
                    case Gtk.ResponseType.Reject:
                    case Gtk.ResponseType.Cancel:
                    case Gtk.ResponseType.Close:
                    case Gtk.ResponseType.No:
                        accepted = false;
                        break;

                    case Gtk.ResponseType.Accept:
                    case Gtk.ResponseType.Apply:
                    case Gtk.ResponseType.Help:
                    case Gtk.ResponseType.Yes:
                    case Gtk.ResponseType.Ok:
                        accepted = true;
                        break;

                    default:
                        break;
                    }
                }
            }while (!alwaysClose && ((closeForResponses == null) || !closeForResponses.Contains(result)));
            VisualHelpers.Close(dialog);
            return(accepted);
        }
Ejemplo n.º 11
0
        public AccountDialog(Gtk.Window parent, GalleryAccount account, bool show_error)
        {
            Glade.XML xml = new Glade.XML (null, "GalleryExport.glade", "gallery_add_dialog", "f-spot");
            xml.Autoconnect (this);
            add_dialog = (Gtk.Dialog) xml.GetWidget ("gallery_add_dialog");
            add_dialog.Modal = false;
            add_dialog.TransientFor = parent;
            add_dialog.DefaultResponse = Gtk.ResponseType.Ok;

            this.account = account;

            status_area.Visible = show_error;

            if (account != null) {
                gallery_entry.Text = account.Name;
                url_entry.Text = account.Url;
                password_entry.Text = account.Password;
                username_entry.Text = account.Username;
                add_button.Label = Gtk.Stock.Ok;
                add_dialog.Response += HandleEditResponse;
            }

            if (remove_button != null)
                remove_button.Visible = account != null;

            add_dialog.Show ();

            gallery_entry.Changed += HandleChanged;
            url_entry.Changed += HandleChanged;
            password_entry.Changed += HandleChanged;
            username_entry.Changed += HandleChanged;
            HandleChanged (null, null);
        }
Ejemplo n.º 12
0
        public void Initialize()
        {
            String host = "forumserver.twoplustwo.com";

            _synchronousInvoker = a => Gtk.Application.Invoke(delegate { a.Invoke(); });
            _forum             = new TwoPlusTwoForum(_synchronousInvoker, host);
            _forum.LoginEvent += HandleLoginEvent;
            _db = new PogSqlite();
            String dbPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "/pog";

            System.IO.Directory.CreateDirectory(dbPath);
            String dbName = dbPath + "/pogposts.sqlite";

            _db.Connect(dbName);

            Gtk.Dialog dlg = null;
            try
            {
                dlg = new LoginDialog(_forum);
                dlg.Run();
            }
            finally
            {
                if (dlg != null)
                {
                    dlg.Destroy();
                }
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Places and runs a transient dialog. Does not destroy it, so values can be retrieved from its widgets.
        /// </summary>
        public static int RunCustomDialog(Dialog dlg, Window parent)
        {
            // if dialog is modal, make sure it's parented on any existing modal dialog
            Gtk.Dialog dialog = dlg;
            if (dialog.Modal)
            {
                parent = GetDefaultModalParent();
            }

            //ensure the dialog has a parent
            if (parent == null)
            {
                if (dialog.TransientFor != null)
                {
                    parent = dialog.TransientFor;
                }
                else
                {
                    parent = RootWindow;
                }
            }

            //TODO: use native parenting API for native windows
            if (parent.nativeWidget is Gtk.Window)
            {
                dialog.TransientFor      = parent;
                dialog.DestroyWithParent = true;
            }

            MonoDevelop.Components.IdeTheme.ApplyTheme(dialog);

            if (dialog.Title == null)
            {
                dialog.Title = BrandingService.ApplicationName;
            }

                        #if MAC
            Runtime.RunInMainThread(() => {
                // If there is a native NSWindow model window running, we need
                // to show the new dialog over that window.
                if (NSApplication.SharedApplication.ModalWindow != null)
                {
                    dialog.Shown += HandleShown;
                }
                else
                {
                    PlaceDialog(dialog, parent);
                }
            }).Wait();
                        #endif

            try {
                IdeApp.DisableIdleActions();
                return(GtkWorkarounds.RunDialogWithNotification(dialog));
            } finally {
                IdeApp.EnableIdleActions();
            }
        }
Ejemplo n.º 14
0
 public static int ShowCustomDialog(Dialog dlg, Window parent)
 {
     Gtk.Dialog dialog = dlg;
     try {
         return(RunCustomDialog(dlg, parent));
     } finally {
         dialog?.Destroy();
     }
 }
Ejemplo n.º 15
0
        public static int RunDialogWithNotification(Gtk.Dialog dialog)
        {
            if (Platform.IsMac)
            {
                MacRequestAttention(dialog.Modal);
            }

            return(dialog.Run());
        }
Ejemplo n.º 16
0
        public IAsyncOperation <IUICommand> ShowAsync()
        {
            Func <CancellationToken, Task <IUICommand> > func = async(ct) =>
            {
                return(await Task.Run(() =>
                {
                    var waitHandle = new ManualResetEventSlim();
                    int result = -1;
                    Gtk.Application.Invoke((s, a) =>
                    {
                        var dialog = new Gtk.Dialog(Title, GtkHost.Window, Gtk.DialogFlags.Modal);
                        dialog.SkipTaskbarHint = true;

                        Gtk.Label label = new Gtk.Label(Content);
                        label.Halign = Gtk.Align.Fill;
                        dialog.ContentArea.Add(label);
                        label.Show();

                        if (Commands.Count == 0)
                        {
                            Commands.Add(new UICommand("Close"));
                        }
                        for (int i = 0; i < Commands.Count; ++i)
                        {
                            dialog.AddButton(Commands[i].Label, i);
                        }

                        dialog.DefaultResponse = (Gtk.ResponseType)DefaultCommandIndex;

                        result = dialog.Run();

                        dialog.Hide();
                        // dialog.Destroy();
                        dialog.Dispose();

                        waitHandle.Set();
                    });
                    waitHandle.Wait();

                    if (result < 0)
                    {
                        result = unchecked ((int)CancelCommandIndex);
                    }
                    // CancelCommandIndex still not set.
                    if (result < 0)
                    {
                        result = (int)DefaultCommandIndex;
                    }

                    return Commands[result];
                }, ct));
            };

            return(FromTaskFunction.Invoke(null, new object[] { func }) as IAsyncOperation <IUICommand>);
        }
Ejemplo n.º 17
0
        public void Run(IBrowsableCollection selection)
        {
            var builder = new GtkBeans.Builder(null, "gallery_export_dialog.ui", null);

            builder.Autoconnect(this);
            export_dialog = new Gtk.Dialog(builder.GetRawObject("gallery_export_dialog"));

            album_optionmenu = new Gtk.ComboBox();
            (album_button.Parent as Gtk.HBox).PackStart(album_optionmenu);
            (album_button.Parent as Gtk.HBox).ReorderChild(album_optionmenu, 1);
            album_optionmenu.Show();

            gallery_optionmenu = new Gtk.ComboBox();
            (edit_button.Parent as Gtk.HBox).PackStart(gallery_optionmenu);
            (edit_button.Parent as Gtk.HBox).ReorderChild(gallery_optionmenu, 1);
            gallery_optionmenu.Show();

            this.items = selection.Items.ToArray();
            Array.Sort <IPhoto> (this.items, new IPhotoComparer.CompareDateName());
            album_button.Sensitive = false;
            var view = new TrayView(selection);

            view.DisplayDates = false;
            view.DisplayTags  = false;

            export_dialog.Modal        = false;
            export_dialog.TransientFor = null;

            thumb_scrolledwindow.Add(view);
            view.Show();
            export_dialog.Show();

            GalleryAccountManager manager = GalleryAccountManager.GetInstance();

            manager.AccountListChanged += PopulateGalleryOptionMenu;
            PopulateGalleryOptionMenu(manager, null);

            if (edit_button != null)
            {
                edit_button.Clicked += HandleEditGallery;
            }

            export_dialog.Response += HandleResponse;
            connect = true;
            HandleSizeActive(null, null);
            Connect();

            LoadPreference(SCALE_KEY);
            LoadPreference(SIZE_KEY);
            LoadPreference(BROWSER_KEY);
            LoadPreference(META_KEY);
        }
Ejemplo n.º 18
0
        public PickFolderDialog(Gtk.Dialog parent, string folder)
        {
            Glade.XML xml = new Glade.XML(null, "MergeDb.glade", "pickfolder_dialog", "f-spot");
            xml.Autoconnect(this);
            Console.WriteLine("new pickfolder");
            pickfolder_dialog.Modal        = false;
            pickfolder_dialog.TransientFor = parent;

            pickfolder_chooser.LocalOnly = false;

            pickfolder_label.Text      = String.Format(Catalog.GetString("<big>The database refers to files contained in the <b>{0}</b> folder.\n Please select that folder so I can do the mapping.</big>"), folder);
            pickfolder_label.UseMarkup = true;
        }
Ejemplo n.º 19
0
 void ShowImage(Pixbuf img, string title)
 {
     if (DiagnosticMode)
     {
         Gtk.Dialog Win   = new Gtk.Dialog(title, parent, Gtk.DialogFlags.Modal, Gtk.ButtonsType.Ok);
         Gtk.Image  Image = new Gtk.Image(img);
         Win.VBox.Add(Image);
         Win.ShowAll();
         Win.Run();
         Image.Pixbuf = null;
         Win.Destroy();
     }
     logger.Info(title);
 }
Ejemplo n.º 20
0
        public void PopupException(GalleryCommandException e, Gtk.Dialog d)
        {
            Log.DebugFormat("{0} : {1} ({2})", e.Message, e.ResponseText, e.Status);
            HigMessageDialog md =
                new HigMessageDialog(d,
                                     Gtk.DialogFlags.Modal |
                                     Gtk.DialogFlags.DestroyWithParent,
                                     Gtk.MessageType.Error, Gtk.ButtonsType.Ok,
                                     Catalog.GetString("Error while creating new album"),
                                     String.Format(Catalog.GetString("The following error was encountered while attempting to perform the requested operation:\n{0} ({1})"), e.Message, e.Status));

            md.Run();
            md.Destroy();
        }
Ejemplo n.º 21
0
        private void OnViewDrawing()
        {
            var dlg      = new Gtk.Dialog("Drawing", this, Gtk.DialogFlags.Modal);
            var swScroll = new Gtk.ScrolledWindow();
            var rnd      = new System.Random();

            int[][] valuesSeries = new int[3][];

            // Create series
            for (int i = 0; i < valuesSeries.Length; ++i)
            {
                valuesSeries[i] = new int[12];

                for (int j = 0; j < valuesSeries[i].Length; ++j)
                {
                    valuesSeries[i][j] = rnd.Next(50);
                }
            }

            // Drawing area
            Chart chart = new Chart(512, 512)
            {
                LegendY = "Sells (in thousands)",
                LegendX = "Months",
                Values  = valuesSeries
            };

            // Layout
            swScroll.AddWithViewport(chart);
            dlg.VBox.PackStart(swScroll, true, true, 5);
            dlg.AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close);

            // Polish
            dlg.WindowPosition = Gtk.WindowPosition.CenterOnParent;
            dlg.Resize(640, 640);
            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry()
            {
                MinWidth  = 640,
                MinHeight = 640
            },
                Gdk.WindowHints.MinSize
                );

            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
Ejemplo n.º 22
0
        public PickFolderDialog(Gtk.Dialog parent, string folder)
        {
            var builder = new GtkBeans.Builder(null, "pickfolder_dialog.ui", null);

            builder.Autoconnect(this);

            Log.Debug("new pickfolder");
            pickfolder_dialog.Modal        = false;
            pickfolder_dialog.TransientFor = parent;

            pickfolder_chooser.LocalOnly = false;

            pickfolder_label.Text      = String.Format(Catalog.GetString("<big>The database refers to files contained in the <b>{0}</b> folder.\n Please select that folder so I can do the mapping.</big>"), folder);
            pickfolder_label.UseMarkup = true;
        }
Ejemplo n.º 23
0
        public static void ShowHintWindow(Gtk.Widget parent, String caption, String text)
        {
            Gtk.Dialog dialog = new Gtk.Dialog();
            dialog.ParentWindow = parent.GdkWindow;
            dialog.Parent       = parent;
            dialog.Title        = caption;
            dialog.VBox.PackStart(new Gtk.Label(text), true, true, 12);

            Gtk.Button closeButton = (Gtk.Button)dialog.AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Close);
            closeButton.Clicked += delegate(object sender, EventArgs ea) { dialog.Hide(); dialog.Dispose(); };

            EventHandler showDelegate = delegate(object s, EventArgs ea) { dialog.ShowAll(); dialog.Present(); };

            Gtk.Application.Invoke(showDelegate);
        }
Ejemplo n.º 24
0
		public TextEditorDialog ()
		{
			Gtk.ScrolledWindow sc = new Gtk.ScrolledWindow ();
			sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.ShadowType = Gtk.ShadowType.In;
			sc.BorderWidth = 6;
			
			textview = new Gtk.TextView ();
			sc.Add (textview);
			
			dialog = new Gtk.Dialog ();
			dialog.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
			dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok);
			dialog.VBox.Add (sc);
		}
Ejemplo n.º 25
0
        public TextEditorDialog()
        {
            Gtk.ScrolledWindow sc = new Gtk.ScrolledWindow();
            sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            sc.ShadowType       = Gtk.ShadowType.In;
            sc.BorderWidth      = 6;

            textview = new Gtk.TextView();
            sc.Add(textview);

            dialog = new Gtk.Dialog();
            dialog.AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
            dialog.AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok);
            dialog.VBox.Add(sc);
        }
Ejemplo n.º 26
0
        public GalleryAddAlbum(GalleryExport export, Gallery gallery)
        {
            Glade.XML xml = new Glade.XML(null, "GalleryExport.glade", "gallery_add_album_dialog", "f-spot");
            xml.Autoconnect(this);
            add_album_dialog       = (Gtk.Dialog)xml.GetWidget("gallery_add_album_dialog");
            add_album_dialog.Modal = true;
            this.export            = export;
            this.gallery           = gallery;
            PopulateAlbums();

            add_album_dialog.Response += HandleAddResponse;

            name_entry.Changed        += HandleChanged;
            description_entry.Changed += HandleChanged;
            title_entry.Changed       += HandleChanged;
            HandleChanged(null, null);
        }
        private bool DoGetDecision()
        {
            Glade.XML glade_xml = new Glade.XML(
                null, "TrustError.glade", DialogName,
                "f-spot");
            glade_xml.Autoconnect(this);

            dialog = (Gtk.Dialog)glade_xml.GetWidget(DialogName);

            url_label.Markup = String.Format(
                url_label.Text, String.Format(
                    "<b>{0}</b>",
                    request.RequestUri));

            Gtk.ResponseType response =
                (Gtk.ResponseType)dialog.Run();
            Log.DebugFormat("Decision dialog response: " + response);

            dialog.Destroy();

            decision = Decision.DontTrust;
            if (0 == response)
            {
                if (abort_radiobutton.Active)
                {
                    decision = Decision.DontTrust;
                }
                else if (once_radiobutton.Active)
                {
                    decision = Decision.TrustOnce;
                }
                else if (always_radiobutton.Active)
                {
                    decision = Decision.TrustAlways;
                }
                else
                {
                    Debug.Assert(false,
                                 "Unhandled decision");
                }
            }

            decision_event.Set();
            return(false);
        }
        private bool DoGetDecision()
        {
            GtkBeans.Builder builder = new GtkBeans.Builder(
                Assembly.GetExecutingAssembly(),
                "TrustError.ui", null);
            builder.Autoconnect(this);
            dialog = (Gtk.Dialog)builder.GetObject(DialogName);

            url_label.Markup = String.Format(
                url_label.Text, String.Format(
                    "<b>{0}</b>",
                    request.RequestUri));

            Gtk.ResponseType response =
                (Gtk.ResponseType)dialog.Run();
            Log.Debug("Decision dialog response: " + response);

            dialog.Destroy();

            decision = Decision.DontTrust;
            if (0 == response)
            {
                if (abort_radiobutton.Active)
                {
                    decision = Decision.DontTrust;
                }
                else if (once_radiobutton.Active)
                {
                    decision = Decision.TrustOnce;
                }
                else if (always_radiobutton.Active)
                {
                    decision = Decision.TrustAlways;
                }
                else
                {
                    Debug.Assert(false,
                                 "Unhandled decision");
                }
            }

            decision_event.Set();
            return(false);
        }
Ejemplo n.º 29
0
        public FlagsSelectorDialog(Gtk.Window parent, Type enumDesc, ulong flags, string title)
        {
            this.flags  = flags;
            this.parent = parent;

            Gtk.ScrolledWindow sc = new Gtk.ScrolledWindow();
            sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            sc.ShadowType       = Gtk.ShadowType.In;
            sc.BorderWidth      = 6;

            treeView = new Gtk.TreeView();
            sc.Add(treeView);

            dialog = new Gtk.Dialog();
            IdeTheme.ApplyTheme(dialog);
            dialog.VBox.Add(sc);
            dialog.AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
            dialog.AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok);

            store                   = new Gtk.ListStore(typeof(bool), typeof(string), typeof(ulong));
            treeView.Model          = store;
            treeView.HeadersVisible = false;

            Gtk.TreeViewColumn col = new Gtk.TreeViewColumn();

            Gtk.CellRendererToggle tog = new Gtk.CellRendererToggle();
            tog.Toggled += new Gtk.ToggledHandler(OnToggled);
            col.PackStart(tog, false);
            col.AddAttribute(tog, "active", 0);

            Gtk.CellRendererText crt = new Gtk.CellRendererText();
            col.PackStart(crt, true);
            col.AddAttribute(crt, "text", 1);

            treeView.AppendColumn(col);

            values = System.Enum.GetValues(enumDesc);
            foreach (object value in values)
            {
                ulong val = Convert.ToUInt64(value);
                store.AppendValues((flags == 0 && val == 0) || ((flags & val) != 0), value.ToString(), val);
            }
        }
Ejemplo n.º 30
0
 private static void RunModalDialog(string title, string format, params object [] args)
 {
     Gtk.Dialog dlg = new Gtk.Dialog ("Tomboy.InsertImage - " + Catalog.GetString(title), null,
                                      Gtk.DialogFlags.Modal | Gtk.DialogFlags.DestroyWithParent);
     var text = new Gtk.TextView ();
     text.WrapMode = Gtk.WrapMode.Word;
     text.Editable = false;
     if (args.Length > 0)
         format = string.Format (format, args);
     text.Buffer.Text = format;
     var scroll = new Gtk.ScrolledWindow ();
     scroll.Add (text);
     dlg.AddButton (Catalog.GetString("Close"), Gtk.ResponseType.Close);
     dlg.VBox.PackStart (scroll, true, true, 0);
     dlg.SetSizeRequest (300, 240);
     scroll.ShowAll ();
     dlg.Run ();
     dlg.Destroy ();
 }
		public FlagsSelectorDialog (Gtk.Window parent, Type enumDesc, ulong flags, string title)
		{
			this.flags = flags;
			this.parent = parent;

			Gtk.ScrolledWindow sc = new Gtk.ScrolledWindow ();
			sc.HscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.VscrollbarPolicy = Gtk.PolicyType.Automatic;
			sc.ShadowType = Gtk.ShadowType.In;
			sc.BorderWidth = 6;
			
			treeView = new Gtk.TreeView ();
			sc.Add (treeView);
			
			dialog = new Gtk.Dialog ();
			IdeTheme.ApplyTheme (dialog);
			dialog.VBox.Add (sc);
			dialog.AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel);
			dialog.AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok);
			
			store = new Gtk.ListStore (typeof(bool), typeof(string), typeof(ulong));
			treeView.Model = store;
			treeView.HeadersVisible = false;
			
			Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();
			
			Gtk.CellRendererToggle tog = new Gtk.CellRendererToggle ();
			tog.Toggled += new Gtk.ToggledHandler (OnToggled);
			col.PackStart (tog, false);
			col.AddAttribute (tog, "active", 0);
			
			Gtk.CellRendererText crt = new Gtk.CellRendererText ();
			col.PackStart (crt, true);
			col.AddAttribute (crt, "text", 1);
			
			treeView.AppendColumn (col);

			values = System.Enum.GetValues (enumDesc);
			foreach (object value in values) {
				ulong val = Convert.ToUInt64 (value);
				store.AppendValues ((flags == 0 && val == 0) || ((flags & val) != 0), value.ToString (), val);
			}
		}
Ejemplo n.º 32
0
 void ShowErrorMessage()
 {
     DBusBackgroundWorker.Request();
     DBusBackgroundWorker.InvokeGtkThread(() => {
         using (var dialog = new Gtk.Dialog()) {
             dialog.BorderWidth  = 6;
             dialog.Resizable    = false;
             dialog.HasSeparator = false;
             var message         = "<span weight=\"bold\"size=\"larger\">"
                                   + "Could not register KeebuntuAppMenu with Unity panel service."
                                   + "</span>\n\n"
                                   + "This plugin only works with Ubuntu Unity desktop."
                                   + " If you do not use Unity, you should uninstall the KeebuntuAppMenu plugin."
                                   + "\n";
             var label              = new Gtk.Label(message);
             label.UseMarkup        = true;
             label.Wrap             = true;
             label.Yalign           = 0;
             var icon               = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Dialog);
             icon.Yalign            = 0;
             var contentBox         = new Gtk.HBox();
             contentBox.Spacing     = 12;
             contentBox.BorderWidth = 6;
             contentBox.PackStart(icon);
             contentBox.PackEnd(label);
             dialog.VBox.PackStart(contentBox);
             dialog.AddButton("Don't show this again", Gtk.ResponseType.Accept);
             dialog.AddButton("OK", Gtk.ResponseType.Ok);
             dialog.DefaultResponse = Gtk.ResponseType.Ok;
             dialog.Response       += (o, args) => {
                 dialog.Destroy();
                 if (args.ResponseId == Gtk.ResponseType.Accept)
                 {
                     pluginHost.CustomConfig.SetBool(keebuntuAppMenuWarningSeenId, true);
                 }
             };
             dialog.ShowAll();
             dialog.KeepAbove = true;
             dialog.Run();
         }
     }).Wait();
     DBusBackgroundWorker.Release();
 }
Ejemplo n.º 33
0
        static void ShowMessage(Gtk.Window parent, string title, string message)
        {
            Gtk.Dialog dialog = null;
            try
            {
                dialog = new Gtk.Dialog(title, parent,
                                        Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal,
                                        Gtk.ResponseType.Ok);
                dialog.VBox.Add(new Gtk.Label(message));
                dialog.ShowAll();

                dialog.Run();
            }
            finally
            {
                if (dialog != null)
                {
                    dialog.Destroy();
                }
            }
        }
Ejemplo n.º 34
0
        /// <summary>
        /// Places and runs a transient dialog. Does not destroy it, so values can be retrieved from its widgets.
        /// </summary>
        public static int RunCustomDialog(Dialog dlg, Window parent)
        {
            // if dialog is modal, make sure it's parented on any existing modal dialog
            Gtk.Dialog dialog = dlg;
            if (dialog.Modal)
            {
                parent = GetDefaultModalParent();
            }

            //ensure the dialog has a parent
            if (parent == null)
            {
                parent = dialog.TransientFor ?? RootWindow;
            }

            dialog.TransientFor      = parent;
            dialog.DestroyWithParent = true;

            if (dialog.Title == null)
            {
                dialog.Title = BrandingService.ApplicationName;
            }

                        #if MAC
            Runtime.RunInMainThread(() => {
                // If there is a native NSWindow model window running, we need
                // to show the new dialog over that window.
                if (NSApplication.SharedApplication.ModalWindow != null)
                {
                    dialog.Shown += HandleShown;
                }
                else
                {
                    PlaceDialog(dialog, parent);
                }
            }).Wait();
                        #endif
            return(GtkWorkarounds.RunDialogWithNotification(dialog));
        }
Ejemplo n.º 35
0
        public GalleryAddAlbum(GalleryExport export, Gallery gallery)
        {
            var builder = new GtkBeans.Builder (null, "gallery_add_album_dialog.ui", null);
            builder.Autoconnect (this);
            add_album_dialog = new Gtk.Dialog (builder.GetRawObject ("gallery_add_album_dialog"));
            add_album_dialog.Modal = true;

            album_optionmenu = new Gtk.ComboBox ();
            (name_entry.Parent as Gtk.Table).Attach (album_optionmenu, 1, 2, 1, 2);
            album_optionmenu.Show ();

            this.export = export;
            this.gallery = gallery;
            PopulateAlbums ();

            add_album_dialog.Response += HandleAddResponse;

            name_entry.Changed += HandleChanged;
            description_entry.Changed += HandleChanged;
            title_entry.Changed += HandleChanged;
            HandleChanged (null, null);
        }
Ejemplo n.º 36
0
        private void OnViewBoxes()
        {
            var dlg = new Gtk.Dialog("Boxes", this, Gtk.DialogFlags.Modal);

            var hbBox1 = new Gtk.HBox(false, 5)
            {
                new Gtk.Label("This is hbox 1")
            };

            var hbBox2 = new Gtk.HBox(false, 5)
            {
                new Gtk.Label("This is hbox 2")
            };

            var hbBox3 = new Gtk.HBox(false, 5)
            {
                new Gtk.Label("This is hbox 3")
            };

            dlg.VBox.PackStart(hbBox1, true, true, 5);
            dlg.VBox.PackStart(hbBox2, true, true, 5);
            dlg.VBox.PackStart(hbBox3, true, true, 5);

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry()
            {
                MinHeight = 200,
                MinWidth  = 320
            },
                Gdk.WindowHints.MinSize
                );

            dlg.AddButton("Ok", Gtk.ResponseType.Ok);
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
Ejemplo n.º 37
0
        public GalleryAddAlbum(GalleryExport export, Gallery gallery)
        {
            var builder = new GtkBeans.Builder(null, "gallery_add_album_dialog.ui", null);

            builder.Autoconnect(this);
            add_album_dialog       = new Gtk.Dialog(builder.GetRawObject("gallery_add_album_dialog"));
            add_album_dialog.Modal = true;

            album_optionmenu = new Gtk.ComboBox();
            (name_entry.Parent as Gtk.Table).Attach(album_optionmenu, 1, 2, 1, 2);
            album_optionmenu.Show();

            this.export  = export;
            this.gallery = gallery;
            PopulateAlbums();

            add_album_dialog.Response += HandleAddResponse;

            name_entry.Changed        += HandleChanged;
            description_entry.Changed += HandleChanged;
            title_entry.Changed       += HandleChanged;
            HandleChanged(null, null);
        }
		private bool DoGetDecision ()
		{
			Glade.XML glade_xml = new Glade.XML (
					null, "TrustError.glade", DialogName,
					"f-spot");
			glade_xml.Autoconnect (this);

			dialog = (Gtk.Dialog) glade_xml.GetWidget (DialogName);

			url_label.Markup = String.Format (
					url_label.Text, String.Format (
							"<b>{0}</b>",
							request.RequestUri));

			Gtk.ResponseType response =
					(Gtk.ResponseType) dialog.Run ();
			Log.DebugFormat ("Decision dialog response: " + response);

			dialog.Destroy ();

			decision = Decision.DontTrust;
			if (0 == response) {
				if (abort_radiobutton.Active) {
					decision = Decision.DontTrust;
				} else if (once_radiobutton.Active) {
					decision = Decision.TrustOnce;
				} else if (always_radiobutton.Active) {
					decision = Decision.TrustAlways;
				} else {
					Debug.Assert (false,
							"Unhandled decision");
				}
			}

			decision_event.Set ();
			return false;
		}
Ejemplo n.º 39
0
        private void OnViewFrames()
        {
            var dlg = new Gtk.Dialog("Frames", this, Gtk.DialogFlags.Modal);

            var frame1 = new Gtk.Frame("<b>Frame1</b>");

            ((Gtk.Label)frame1.LabelWidget).UseMarkup = true;
            frame1.Add(new Gtk.Label("This is frame1"));
            var frame2 = new Gtk.Frame("<b>Frame2</b>");

            ((Gtk.Label)frame2.LabelWidget).UseMarkup = true;
            frame2.Add(new Gtk.Label("This is frame2"));
            var frame3 = new Gtk.Frame("<b>Frame3</b>");

            ((Gtk.Label)frame3.LabelWidget).UseMarkup = true;
            frame3.Add(new Gtk.Label("This is frame3"));


            dlg.VBox.PackStart(frame1, true, true, 5);
            dlg.VBox.PackStart(frame2, true, true, 5);
            dlg.VBox.PackStart(frame3, true, true, 5);

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry()
            {
                MinHeight = 200,
                MinWidth  = 320
            },
                Gdk.WindowHints.MinSize
                );

            dlg.AddButton("Ok", Gtk.ResponseType.Ok);
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
Ejemplo n.º 40
0
        public void Run(object o, EventArgs e)
        {
            Console.WriteLine ("EXECUTING ExiflowEditComment EXTENSION");

            xml = new Glade.XML (null,"ExiflowEditComment.glade", dialog_name, "f-spot");
            xml.Autoconnect (this);
            dialog = (Gtk.Dialog) xml.GetWidget(dialog_name);

            // collect comments of selected photos in current_comments
            ArrayList current_comments = new ArrayList ();
            foreach (Photo p in App.Instance.Organizer.SelectedPhotos ()) {
                if (p.Description.Length > 0 && ! current_comments.Contains(p.Description)) {
                    current_comments.Add(p.Description);
                }
            }

            // fill text buffer with all current comments
            comment.Buffer.Text = String.Join("\n---\n", (String[]) current_comments.ToArray(typeof(string)));

            dialog.Modal = false;
            dialog.TransientFor = null;
            dialog.Response += HandleResponse;
            dialog.ShowAll();
        }
Ejemplo n.º 41
0
 public override void Initialize()
 {
     Window = new Gtk.Dialog ();
     Window.VBox.PackStart (CreateMainLayout ());
     Window.ActionArea.Hide ();
 }
		public void Run (FSpot.IBrowsableCollection photos)
		{
			if (null == photos) {
				throw new ArgumentNullException ("photos");
			}

			this.photos = photos;

			Glade.XML glade_xml = new Glade.XML (
					null, "TabbloExport.glade", DialogName,
					"f-spot");
			glade_xml.Autoconnect (this);

			dialog = (Gtk.Dialog) glade_xml.GetWidget (DialogName);

			FSpot.Widgets.IconView icon_view =
					new FSpot.Widgets.IconView (photos);
			icon_view.DisplayDates = false;
			icon_view.DisplayTags = false;

			username_entry.Changed += HandleAccountDataChanged;
			password_entry.Changed += HandleAccountDataChanged;
			ReadAccountData ();
			HandleAccountDataChanged (null, null);

			dialog.Modal = false;
			dialog.TransientFor = null;

			dialog.Response += HandleResponse;

			thumb_scrolled_window.Add (icon_view);
			icon_view.Show ();
			dialog.Show ();
		}
Ejemplo n.º 43
0
		void OnAddinPrefsButton (object sender, EventArgs args)
		{
			Gtk.Dialog dialog = null;
			Mono.Addins.Addin addin =
			        addin_tree.ActiveAddinData as Mono.Addins.Addin;

			if (addin == null)
				return;

			if (addin_prefs_dialogs.ContainsKey (addin.Id) == false) {
				// A preference dialog isn't open already so create a new one
				Gtk.Image icon =
				        new Gtk.Image (Gtk.Stock.Preferences, Gtk.IconSize.Dialog);
				Gtk.Label caption = new Gtk.Label ();
				caption.Markup = string.Format (
				                         "<span size='large' weight='bold'>{0} {1}</span>",
				                         addin.Name, addin.Version);
				caption.Xalign = 0;
				caption.UseMarkup = true;
				caption.UseUnderline = false;

				Gtk.Widget pref_widget =
				        addin_manager.CreateAddinPreferenceWidget (addin);

				if (pref_widget == null)
					pref_widget = new Gtk.Label (Catalog.GetString ("Not Implemented"));

				Gtk.HBox hbox = new Gtk.HBox (false, 6);
				Gtk.VBox vbox = new Gtk.VBox (false, 6);
				vbox.BorderWidth = 6;

				hbox.PackStart (icon, false, false, 0);
				hbox.PackStart (caption, true, true, 0);
				vbox.PackStart (hbox, false, false, 0);

				vbox.PackStart (pref_widget, true, true, 0);
				vbox.ShowAll ();

				dialog = new Gtk.Dialog (
				        string.Format (Catalog.GetString ("{0} Preferences"),
				                       addin.Name),
				        this,
				        Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.NoSeparator,
				        Gtk.Stock.Close, Gtk.ResponseType.Close);

				dialog.VBox.PackStart (vbox, true, true, 0);
				dialog.DeleteEvent += AddinPrefDialogDeleted;
				dialog.Response += AddinPrefDialogResponse;

				// Store this dialog off in the dictionary so it can be
				// presented again if the user clicks on the preferences button
				// again before closing the preferences dialog.
				dialog.Data ["AddinId"] = addin.Id;
				addin_prefs_dialogs [addin.Id] = dialog;
			} else {
				// It's already opened so just present it again
				dialog = addin_prefs_dialogs [addin.Id];
			}

			dialog.Present ();
		}
Ejemplo n.º 44
0
		private void OnAdvancedSyncConfigButton (object sender, EventArgs args)
		{
			// Get saved behavior
			SyncTitleConflictResolution savedBehavior = SyncTitleConflictResolution.Cancel;
			object dlgBehaviorPref = Preferences.Get (Preferences.SYNC_CONFIGURED_CONFLICT_BEHAVIOR);
			if (dlgBehaviorPref != null && dlgBehaviorPref is int) // TODO: Check range of this int
				savedBehavior = (SyncTitleConflictResolution)dlgBehaviorPref;

			// Create dialog
			Gtk.Dialog advancedDlg =
			        new Gtk.Dialog (Catalog.GetString ("Other Synchronization Options"),
			                        this,
			                        Gtk.DialogFlags.DestroyWithParent | Gtk.DialogFlags.Modal | Gtk.DialogFlags.NoSeparator,
			                        Gtk.Stock.Close, Gtk.ResponseType.Close);
			// Populate dialog
			Gtk.Label label =
			        new Gtk.Label (Catalog.GetString ("When a conflict is detected between " +
			                                          "a local note and a note on the configured " +
			                                          "synchronization server:"));
			label.Wrap = true;
			label.Xalign = 0;

			promptOnConflictRadio =
			        new Gtk.RadioButton (Catalog.GetString ("Always ask me what to do."));
			promptOnConflictRadio.Toggled += OnConflictOptionToggle;

			renameOnConflictRadio =
			        new Gtk.RadioButton (promptOnConflictRadio, Catalog.GetString ("Rename my local note."));
			renameOnConflictRadio.Toggled += OnConflictOptionToggle;

			overwriteOnConflictRadio =
			        new Gtk.RadioButton (promptOnConflictRadio, Catalog.GetString ("Replace my local note with the server's update."));
			overwriteOnConflictRadio.Toggled += OnConflictOptionToggle;

			switch (savedBehavior) {
			case SyncTitleConflictResolution.RenameExistingNoUpdate:
				renameOnConflictRadio.Active = true;
				break;
			case SyncTitleConflictResolution.OverwriteExisting:
				overwriteOnConflictRadio.Active = true;
				break;
			default:
				promptOnConflictRadio.Active = true;
				break;
			}

			Gtk.VBox vbox = new Gtk.VBox ();
			vbox.BorderWidth = 18;

			vbox.PackStart (promptOnConflictRadio);
			vbox.PackStart (renameOnConflictRadio);
			vbox.PackStart (overwriteOnConflictRadio);

			advancedDlg.VBox.PackStart (label, false, false, 6);
			advancedDlg.VBox.PackStart (vbox, false, false, 0);

			advancedDlg.ShowAll ();

			// Run dialog
			advancedDlg.Run ();
			advancedDlg.Destroy ();
		}
Ejemplo n.º 45
0
		static void ShowEvalDialog ()
		{
			string evalTitle = GettextCatalog.GetString ("Evaluation Version");
			string evalHeader = GettextCatalog.GetString ("Feature Not Available In Evaluation Version");
			string evalMessage = GettextCatalog.GetString (
				"Upgrade to the full version of Mono for Android to deploy\n" +
				"to devices, and to enable your applications to be distributed.");
			string continueMessage = GettextCatalog.GetString ("Continue evaluation");
			
			var dialog = new Gtk.Dialog () {
				Title = evalTitle,
			};
			
			dialog.VBox.PackStart (
			 	new Gtk.Label ("<b><big>" + evalHeader + "</big></b>") {
					Xalign = 0.5f,
					UseMarkup = true
				}, true, false, 12);
			
			var align = new Gtk.Alignment (0.5f, 0.5f, 1.0f, 1.0f) { LeftPadding = 12, RightPadding = 12 };
			dialog.VBox.PackStart (align, true, false, 12);
			align.Add (new Gtk.Label (evalMessage) {
					Xalign = 0.5f,
					Justify = Gtk.Justification.Center
				});
			
			align = new Gtk.Alignment (0.5f, 0.5f, 1.0f, 1.0f) { LeftPadding = 12, RightPadding = 12 };
			dialog.VBox.PackStart (align, true, false, 12);
			
			string activateMessage;
			if (PropertyService.IsWindows) {
				activateMessage = GettextCatalog.GetString ("Activate Mono for Android");
			} else {
				activateMessage = GettextCatalog.GetString ("Buy Mono for Android");
			}
			
			var buyButton = new Gtk.Button (new Gtk.Label ("<big>" + activateMessage + "</big>") { UseMarkup = true } );
			buyButton.Clicked += delegate {
				Activate ();
				dialog.Respond (Gtk.ResponseType.Accept);
			};
			align.Add (buyButton);
			
			dialog.AddButton (continueMessage, Gtk.ResponseType.Close);
			dialog.ShowAll ();
			
			MessageService.ShowCustomDialog (dialog);
		}
Ejemplo n.º 46
0
        public PreferencesDialog(Gtk.Window parent)
        {
            Trace.Call(parent);

            if (parent == null) {
                throw new ArgumentNullException("parent");
            }

            _Glade = new Glade.XML(null, Frontend.GladeFilename, "PreferencesDialog", null);
            //_Glade.BindFields(this);
            // changed signal is used in all settings, so use glade for now
            _Glade.Autoconnect(this);
            _Dialog = (Gtk.Dialog)_Glade["PreferencesDialog"];
            _Dialog.TransientFor = parent;

            ((Gtk.Button)_Glade["OKButton"]).Clicked += new EventHandler(_OnOKButtonClicked);
            ((Gtk.Button)_Glade["ApplyButton"]).Clicked += new EventHandler(_OnApplyButtonClicked);
            ((Gtk.Button)_Glade["CancelButton"]).Clicked += new EventHandler(_OnCancelButtonClicked);

            ((Gtk.TextView)_Glade["OnConnectCommandsTextView"]).Buffer.Changed += new EventHandler(_OnChanged);
            ((Gtk.TextView)_Glade["OnStartupCommandsTextView"]).Buffer.Changed += new EventHandler(_OnChanged);

            ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Toggled += OnNotificationAreaIconCheckButtonToggled;
            ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Toggled += _OnChanged;
            ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonAlways"]).Toggled += _OnChanged;
            ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Toggled += _OnChanged;
            ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Toggled += _OnChanged;

            ((Gtk.CheckButton)_Glade["OverrideForegroundColorCheckButton"]).Toggled += OnOverrideForegroundColorCheckButtonToggled;
            ((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Toggled += OnOverrideBackgroundColorCheckButtonToggled;
            ((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Toggled += OnOverrideFontCheckButtonToggled;

            Gtk.ComboBox wrapModeComboBox = (Gtk.ComboBox)_Glade["WrapModeComboBox"];
            // initialize wrap modes
            // glade might initialize it already!
            wrapModeComboBox.Clear();
            wrapModeComboBox.Changed += _OnChanged;
            Gtk.CellRendererText cell = new Gtk.CellRendererText();
            wrapModeComboBox.PackStart(cell, false);
            wrapModeComboBox.AddAttribute(cell, "text", 1);
            Gtk.ListStore store = new Gtk.ListStore(typeof(Gtk.WrapMode), typeof(string));
            // fill ListStore
            store.AppendValues(Gtk.WrapMode.Char,     _("Character"));
            store.AppendValues(Gtk.WrapMode.WordChar, _("Word"));
            wrapModeComboBox.Model = store;
            wrapModeComboBox.Active = 0;

            _Notebook.ShowTabs = false;

            Gtk.ListStore ls = new Gtk.ListStore(typeof(Page), typeof(Gdk.Pixbuf), typeof(string));
            ls.AppendValues(Page.Connection, _Dialog.RenderIcon(
                                                Gtk.Stock.Connect,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Connection"));
            ls.AppendValues(Page.Interface, _Dialog.RenderIcon(
                                                Gtk.Stock.SelectFont,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Interface"));
            ls.AppendValues(Page.Servers, _Dialog.RenderIcon(
                                                Gtk.Stock.Network,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Servers"));
            /*
            ls.AppendValues(Page.Filters, _Dialog.RenderIcon(
                                                Gtk.Stock.Delete,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Filters"));
            */

            int i = 1;
            _MenuTreeView.AppendColumn(null, new Gtk.CellRendererPixbuf(), "pixbuf",i++);
            _MenuTreeView.AppendColumn(null, new Gtk.CellRendererText(), "text", i++);
            _MenuTreeView.Selection.Changed += new EventHandler(_MenuTreeViewSelectionChanged);
            _MenuTreeView.Selection.Mode = Gtk.SelectionMode.Browse;
            _MenuTreeView.Model = ls;

            // select the first item
            Gtk.TreeIter iter;
            ls.GetIterFirst(out iter);
            _MenuTreeView.Selection.SelectIter(iter);

            _ChannelFilterListView = new ChannelFilterListView(_Glade);
            _ServerListView = new ServerListView(parent, _Glade);

            _Load();
        }
		void ShowListenDialog (RemoteDebuggerStartInfo dsi)
		{
			string message = GetListenMessage (dsi);
			
			Gtk.Application.Invoke (delegate {
				if (VirtualMachine != null || Exited)
					return;
				
				dialog = new Gtk.Dialog () {
					Title = "Waiting for debugger"
				};
				
				var label = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f) {
					Child = new Gtk.Label (message),
					BorderWidth = 12
				};
				dialog.VBox.PackStart (label);
				label.ShowAll ();	
				
				dialog.AddButton ("Cancel", Gtk.ResponseType.Cancel);
				
				int response = MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog);
				
				if (response != (int) Gtk.ResponseType.Ok) {
					EndSession ();
				}
				dialog = null;
			});
		}
Ejemplo n.º 48
0
        public GalleryAddAlbum(GalleryExport export, Gallery gallery)
        {
            Glade.XML xml = new Glade.XML (null, "GalleryExport.glade", "gallery_add_album_dialog", "f-spot");
            xml.Autoconnect (this);
            add_album_dialog = (Gtk.Dialog) xml.GetWidget ("gallery_add_album_dialog");
            add_album_dialog.Modal = true;
            this.export = export;
            this.gallery = gallery;
            PopulateAlbums ();

            add_album_dialog.Response += HandleAddResponse;

            name_entry.Changed += HandleChanged;
            description_entry.Changed += HandleChanged;
            title_entry.Changed += HandleChanged;
            HandleChanged (null, null);
        }
Ejemplo n.º 49
0
        public void Run(IBrowsableCollection selection)
        {
            Glade.XML xml = new Glade.XML (null, "GalleryExport.glade", "gallery_export_dialog", "f-spot");
            xml.Autoconnect (this);
            export_dialog = (Gtk.Dialog) xml.GetWidget ("gallery_export_dialog");

            this.items = selection.Items;
            Array.Sort<IBrowsableItem> (this.items as Photo[], new Photo.CompareDateName());
            album_button.Sensitive = false;
            IconView view = new IconView (selection);
            view.DisplayDates = false;
            view.DisplayTags = false;

            export_dialog.Modal = false;
            export_dialog.TransientFor = null;

            thumb_scrolledwindow.Add (view);
            view.Show ();
            export_dialog.Show ();

            GalleryAccountManager manager = GalleryAccountManager.GetInstance ();
            manager.AccountListChanged += PopulateGalleryOptionMenu;
            PopulateGalleryOptionMenu (manager, null);

            if (edit_button != null)
                edit_button.Clicked += HandleEditGallery;

            export_dialog.Response += HandleResponse;
            connect = true;
            HandleSizeActive (null, null);
            Connect ();

            LoadPreference (SCALE_KEY);
            LoadPreference (SIZE_KEY);
            LoadPreference (BROWSER_KEY);
            LoadPreference (META_KEY);
            LoadPreference (ROTATE_KEY);
        }
Ejemplo n.º 50
0
 void ShowImage(Pixbuf img, string title)
 {
     if(DiagnosticMode)
     {
         Gtk.Dialog Win = new Gtk.Dialog(title, parent, Gtk.DialogFlags.Modal, Gtk.ButtonsType.Ok);
         Gtk.Image Image = new Gtk.Image(img);
         Win.VBox.Add(Image);
         Win.ShowAll();
         Win.Run();
         Image.Pixbuf = null;
         Win.Destroy();
     }
     logger.Info(title);
 }
Ejemplo n.º 51
0
		public override void Initialize ()
		{
			Window = new Gtk.Dialog ();
			Window.AddContent (CreateMainLayout ());
			Window.ActionArea.Hide ();
		}
Ejemplo n.º 52
0
        private void OnViewNotebook()
        {
            var dlg = new Gtk.Dialog( "Boxes", this, Gtk.DialogFlags.Modal );
            var nbTabs = new Gtk.Notebook();

            nbTabs.AppendPage( new Gtk.Label( "Page1" ), new Gtk.Label( "Page1" ) );
            nbTabs.AppendPage( new Gtk.Label( "Page2" ), new Gtk.Label( "Page2" ) );

            dlg.VBox.PackStart( nbTabs, true, true, 5 );

            dlg.SetGeometryHints(
                dlg,
                new Gdk.Geometry() {
                    MinHeight = 200,
                    MinWidth = 320
                },
                Gdk.WindowHints.MinSize
            );

            dlg.AddButton( "Ok", Gtk.ResponseType.Ok );
            dlg.ShowAll();
            dlg.Run();
            dlg.Destroy();
        }
Ejemplo n.º 53
0
        private bool DoGetDecision()
        {
            GtkBeans.Builder builder = new GtkBeans.Builder (
                    Assembly.GetExecutingAssembly (),
                    "TrustError.ui", null);
            builder.Autoconnect (this);
            dialog = (Gtk.Dialog) builder.GetObject (DialogName);

            url_label.Markup = String.Format (
                    url_label.Text, String.Format (
                            "<b>{0}</b>",
                            request.RequestUri));

            Gtk.ResponseType response =
                    (Gtk.ResponseType) dialog.Run ();
            Log.Debug ("Decision dialog response: " + response);

            dialog.Destroy ();

            decision = Decision.DontTrust;
            if (0 == response) {
                if (abort_radiobutton.Active) {
                    decision = Decision.DontTrust;
                } else if (once_radiobutton.Active) {
                    decision = Decision.TrustOnce;
                } else if (always_radiobutton.Active) {
                    decision = Decision.TrustAlways;
                } else {
                    Debug.Assert (false,
                            "Unhandled decision");
                }
            }

            decision_event.Set ();
            return false;
        }
Ejemplo n.º 54
0
        public PreferencesDialog(Gtk.Window parent)
        {
            Trace.Call(parent);

            if (parent == null) {
                throw new ArgumentNullException("parent");
            }

            _Glade = new Glade.XML(null, Frontend.GladeFilename, "PreferencesDialog", null);
            //_Glade.BindFields(this);
            // changed signal is used in all settings, so use glade for now
            _Glade.Autoconnect(this);
            _Dialog = (Gtk.Dialog)_Glade["PreferencesDialog"];
            _Dialog.TransientFor = parent;

            ((Gtk.Button)_Glade["OKButton"]).Clicked += new EventHandler(_OnOKButtonClicked);
            ((Gtk.Button)_Glade["ApplyButton"]).Clicked += new EventHandler(_OnApplyButtonClicked);
            ((Gtk.Button)_Glade["CancelButton"]).Clicked += new EventHandler(_OnCancelButtonClicked);

            ((Gtk.TextView)_Glade["OnConnectCommandsTextView"]).Buffer.Changed += new EventHandler(_OnChanged);
            ((Gtk.TextView)_Glade["OnStartupCommandsTextView"]).Buffer.Changed += new EventHandler(_OnChanged);

            ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Toggled += OnNotificationAreaIconCheckButtonToggled;
            ((Gtk.CheckButton) _Glade["NotificationAreaIconCheckButton"]).Toggled += _OnChanged;
            ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonAlways"]).Toggled += _OnChanged;
            ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Toggled += _OnChanged;
            // we can't support minimize for now, see: http://projects.qnetp.net/issues/show/158
            ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonMinimized"]).Visible = false;
            ((Gtk.RadioButton) _Glade["NotificationAreaIconRadioButtonClosed"]).Toggled += _OnChanged;

            ((Gtk.CheckButton)_Glade["OverrideForegroundColorCheckButton"]).Toggled += OnOverrideForegroundColorCheckButtonToggled;
            ((Gtk.CheckButton)_Glade["OverrideBackgroundColorCheckButton"]).Toggled += OnOverrideBackgroundColorCheckButtonToggled;
            ((Gtk.CheckButton)_Glade["OverrideFontCheckButton"]).Toggled += OnOverrideFontCheckButtonToggled;
            ((Gtk.FontButton)_Glade["FontButton"]).FontSet += _OnChanged;
            ((Gtk.CheckButton)_Glade["ShowAdvancedSettingsCheckButton"]).Toggled += delegate {
                CheckShowAdvancedSettingsCheckButton();
            };

            ((Gtk.CheckButton)_Glade["ProxyShowPasswordCheckButton"]).Toggled += delegate {
                CheckProxyShowPasswordCheckButton();
            };

            ((Gtk.TextView)_Glade["HighlightWordsTextView"]).Buffer.Changed += _OnChanged;
            if (Frontend.EngineVersion < new Version("0.7.2")) {
                // feature introduced in >= 0.7.2
                ((Gtk.TextView)_Glade["HighlightWordsTextView"]).Sensitive = false;
            }

            ((Gtk.Button)_Glade["LoggingOpenButton"]).Clicked += delegate {
                ThreadPool.QueueUserWorkItem(delegate {
                    try {
                        var logPath = Platform.LogPath;
                        if (!Directory.Exists(logPath)) {
                            Directory.CreateDirectory(logPath);
                        }
                        Process.Start(logPath);
                    } catch (Exception ex) {
                        Frontend.ShowError(parent, ex);
                    }
                });
            };

            Gtk.ComboBox wrapModeComboBox = (Gtk.ComboBox)_Glade["WrapModeComboBox"];
            // initialize wrap modes
            // glade might initialize it already!
            wrapModeComboBox.Clear();
            wrapModeComboBox.Changed += _OnChanged;
            Gtk.CellRendererText cell = new Gtk.CellRendererText();
            wrapModeComboBox.PackStart(cell, false);
            wrapModeComboBox.AddAttribute(cell, "text", 1);
            Gtk.ListStore store = new Gtk.ListStore(typeof(Gtk.WrapMode), typeof(string));
            // fill ListStore
            store.AppendValues(Gtk.WrapMode.Char,     _("Character"));
            store.AppendValues(Gtk.WrapMode.WordChar, _("Word"));
            wrapModeComboBox.Model = store;
            wrapModeComboBox.Active = 0;

            Gtk.ComboBox persistencyTypeComboBox =
                (Gtk.ComboBox) _Glade["PersistencyTypeComboBox"];
            // glade might initialize it already!
            persistencyTypeComboBox.Clear();
            persistencyTypeComboBox.Changed += _OnChanged;
            cell = new Gtk.CellRendererText();
            persistencyTypeComboBox.PackStart(cell, false);
            persistencyTypeComboBox.AddAttribute(cell, "text", 1);
            store = new Gtk.ListStore(
                typeof(MessageBufferPersistencyType), typeof(string)
            );
            // fill ListStore
            store.AppendValues(MessageBufferPersistencyType.Volatile,
                               _("Volatile"));
            store.AppendValues(MessageBufferPersistencyType.Persistent,
                               _("Persistent"));
            persistencyTypeComboBox.Model = store;
            persistencyTypeComboBox.Active = 0;
            if (Frontend.EngineVersion < new Version("0.8.1")) {
                persistencyTypeComboBox.Sensitive = false;
                ((Gtk.SpinButton) _Glade["VolatileMaxCapacitySpinButton"]).Sensitive = false;
                ((Gtk.SpinButton) _Glade["PersistentMaxCapacitySpinButton"]).Sensitive = false;
            }

            Gtk.ComboBox proxyTypeComboBox = (Gtk.ComboBox)_Glade["ProxyTypeComboBox"];
            // initialize wrap modes
            // glade might initialize it already!
            proxyTypeComboBox.Clear();
            proxyTypeComboBox.Changed += _OnChanged;
            proxyTypeComboBox.Changed += delegate {
                CheckProxyTypeComBoBox();
            };
            cell = new Gtk.CellRendererText();
            proxyTypeComboBox.PackStart(cell, false);
            proxyTypeComboBox.AddAttribute(cell, "text", 1);
            store = new Gtk.ListStore(typeof(ProxyType), typeof(string));
            // fill ListStore
            store.AppendValues(ProxyType.None,    String.Format("<{0}>",
                                                                _("No Proxy")));
            store.AppendValues(ProxyType.System,  String.Format("<{0}>",
                                                                _("System Default")));
            store.AppendValues(ProxyType.Http,    "HTTP");
            store.AppendValues(ProxyType.Socks4,  "SOCK 4");
            store.AppendValues(ProxyType.Socks4a, "SOCK 4a");
            store.AppendValues(ProxyType.Socks5,  "SOCK 5");
            proxyTypeComboBox.Model = store;
            proxyTypeComboBox.Active = 0;

            _Notebook.ShowTabs = false;

            Gtk.ListStore ls = new Gtk.ListStore(typeof(Page), typeof(Gdk.Pixbuf), typeof(string));
            ls.AppendValues(Page.Connection, _Dialog.RenderIcon(
                                                Gtk.Stock.Connect,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Connection"));
            ls.AppendValues(Page.Interface, _Dialog.RenderIcon(
                                                Gtk.Stock.SelectFont,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Interface"));
            ls.AppendValues(Page.Servers, _Dialog.RenderIcon(
                                                Gtk.Stock.Network,
                                                Gtk.IconSize.SmallToolbar, null),
                            _("Servers"));

            if (Frontend.EngineVersion >= new Version("0.7.2")) {
                // features introduced in >= 0.7.2
                ls.AppendValues(Page.Filters, _Dialog.RenderIcon(
                                                    Gtk.Stock.Delete,
                                                    Gtk.IconSize.SmallToolbar, null),
                                _("Filters"));
                ls.AppendValues(Page.Logging, _Dialog.RenderIcon(
                                                    Gtk.Stock.JustifyLeft,
                                                    Gtk.IconSize.SmallToolbar, null),
                                _("Logging"));
            }

            int i = 1;
            _MenuTreeView.AppendColumn(null, new Gtk.CellRendererPixbuf(), "pixbuf",i++);
            _MenuTreeView.AppendColumn(null, new Gtk.CellRendererText(), "text", i++);
            _MenuTreeView.Selection.Changed += new EventHandler(_MenuTreeViewSelectionChanged);
            _MenuTreeView.Selection.Mode = Gtk.SelectionMode.Browse;
            _MenuTreeView.Model = ls;

            // select the first item
            Gtk.TreeIter iter;
            ls.GetIterFirst(out iter);
            _MenuTreeView.Selection.SelectIter(iter);

            _ServerListView = new ServerListView(_Dialog, _Glade);
            _FilterListWidget = new FilterListWidget(_Dialog, Frontend.UserConfig);
            _FilterListWidget.Changed += _OnChanged;
            _FilterListEventBox.Add(_FilterListWidget);
            _FilterListEventBox.ShowAll();

            _Load();
        }
Ejemplo n.º 55
0
    public static void ShowHintWindow(Gtk.Widget parent, String caption, String text)
    {
      Gtk.Dialog dialog = new Gtk.Dialog();
      dialog.ParentWindow = parent.GdkWindow;
      dialog.Parent = parent;
      dialog.Title = caption;
      dialog.VBox.PackStart(new Gtk.Label(text), true, true, 12);
      
      Gtk.Button closeButton = (Gtk.Button)dialog.AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Close);
      closeButton.Clicked += delegate(object sender, EventArgs ea) { dialog.Hide(); dialog.Dispose(); };

      EventHandler showDelegate = delegate(object s, EventArgs ea) { dialog.ShowAll(); dialog.Present(); };
      Gtk.Application.Invoke(showDelegate);
    }
Ejemplo n.º 56
0
		void RunDialog (string message)
		{
			if (disposed)
				return;
			
			dialog = new Gtk.Dialog () {
				Title = "Waiting for debugger"
			};
			
			var label = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f) {
				Child = new Gtk.Label (message),
				BorderWidth = 12
			};
			dialog.VBox.PackStart (label);
			label.ShowAll ();
			
			dialog.AddButton ("Cancel", Gtk.ResponseType.Cancel);
			
			int response = MonoDevelop.Ide.MessageService.ShowCustomDialog (dialog);
			dialog.Destroy ();
			dialog = null;
			
			if (!disposed && response != (int) Gtk.ResponseType.Ok && UserCancelled != null) {
				UserCancelled (null, null);
			}
		}
Ejemplo n.º 57
0
        public void Run(IBrowsableCollection selection)
        {
            var builder = new GtkBeans.Builder (null, "gallery_export_dialog.ui", null);
            builder.Autoconnect (this);
            export_dialog = new Gtk.Dialog (builder.GetRawObject ("gallery_export_dialog"));

            album_optionmenu = new Gtk.ComboBox ();
            (album_button.Parent as Gtk.HBox).PackStart (album_optionmenu);
            (album_button.Parent as Gtk.HBox).ReorderChild (album_optionmenu, 1);
            album_optionmenu.Show ();

            gallery_optionmenu = new Gtk.ComboBox ();
            (edit_button.Parent as Gtk.HBox).PackStart (gallery_optionmenu);
            (edit_button.Parent as Gtk.HBox).ReorderChild (gallery_optionmenu, 1);
            gallery_optionmenu.Show ();

            this.items = selection.Items;
            Array.Sort<IPhoto> (this.items, new IPhotoComparer.CompareDateName ());
            album_button.Sensitive = false;
            var view = new TrayView (selection);
            view.DisplayDates = false;
            view.DisplayTags = false;

            export_dialog.Modal = false;
            export_dialog.TransientFor = null;

            thumb_scrolledwindow.Add (view);
            view.Show ();
            export_dialog.Show ();

            GalleryAccountManager manager = GalleryAccountManager.GetInstance ();
            manager.AccountListChanged += PopulateGalleryOptionMenu;
            PopulateGalleryOptionMenu (manager, null);

            if (edit_button != null)
                edit_button.Clicked += HandleEditGallery;

            export_dialog.Response += HandleResponse;
            connect = true;
            HandleSizeActive (null, null);
            Connect ();

            LoadPreference (SCALE_KEY);
            LoadPreference (SIZE_KEY);
            LoadPreference (BROWSER_KEY);
            LoadPreference (META_KEY);
        }