示例#1
0
 protected void HandleAddResponse(object sender, Gtk.ResponseArgs args)
 {
     if (args.ResponseId == Gtk.ResponseType.Ok)
     {
         if (!System.Text.RegularExpressions.Regex.IsMatch(name, "^[A-Za-z0-9_-]+$"))
         {
             HigMessageDialog md =
                 new HigMessageDialog(add_album_dialog,
                                      Gtk.DialogFlags.Modal |
                                      Gtk.DialogFlags.DestroyWithParent,
                                      Gtk.MessageType.Error, Gtk.ButtonsType.Ok,
                                      Catalog.GetString("Invalid Gallery name"),
                                      Catalog.GetString("The gallery name contains invalid characters.\nOnly letters, numbers, - and _ are allowed"));
             md.Run();
             md.Destroy();
             return;
         }
         try {
             gallery.NewAlbum(parent, name, title, description);
             export.HandleAlbumAdded(title);
         } catch (GalleryCommandException e) {
             gallery.PopupException(e, add_album_dialog);
             return;
         }
     }
     add_album_dialog.Destroy();
 }
示例#2
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();
        }
示例#3
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();
        }
示例#4
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);
            }
        }
示例#5
0
 public static int ShowCustomDialog(Dialog dlg, Window parent)
 {
     Gtk.Dialog dialog = dlg;
     try {
         return(RunCustomDialog(dlg, parent));
     } finally {
         dialog?.Destroy();
     }
 }
        private void HandleResponse(object sender, Gtk.ResponseArgs args)
        {
            if (args.ResponseId != Gtk.ResponseType.Ok)
            {
                export_dialog.Destroy();
                return;
            }

            if (scale_check != null)
            {
                scale = scale_check.Active;
                size  = size_spin.ValueAsInt;
            }
            else
            {
                scale = false;
            }

            browser = browser_check.Active;
            meta    = meta_check.Active;
            rotate  = rotate_check.Active;

            if (account != null)
            {
                //System.Console.WriteLine ("history = {0}", album_optionmenu.History);
                album       = (Album)account.Gallery.Albums [Math.Max(0, album_optionmenu.History)];
                photo_index = 0;

                export_dialog.Destroy();

                command_thread      = new System.Threading.Thread(new System.Threading.ThreadStart(this.Upload));
                command_thread.Name = Catalog.GetString("Uploading Pictures");

                progress_dialog = new FSpot.ThreadProgressDialog(command_thread, items.Length);
                progress_dialog.Start();

                // Save these settings for next time
                Preferences.Set(SCALE_KEY, scale);
                Preferences.Set(SIZE_KEY, size);
                Preferences.Set(BROWSER_KEY, browser);
                Preferences.Set(META_KEY, meta);
                Preferences.Set(ROTATE_KEY, rotate);
            }
        }
示例#7
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);
 }
示例#8
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();
        }
示例#9
0
 private void HandleResponse(object sender, Gtk.ResponseArgs args)
 {
     if (args.ResponseId != Gtk.ResponseType.Ok)
     {
         // FIXME this is to work around a bug in gtk+ where
         // the filesystem events are still listened to when
         // a FileChooserButton is destroyed but not finalized
         // and an event comes in that wants to update the child widgets.
         dialog.Destroy();
         Console.WriteLine("cancel pressed");
         //uri_chooser.Dispose ();
         //uri_chooser = null;
         return;
     }
     Console.WriteLine("ok pressed in ExiflowEditComments EXTENSION");
     Console.WriteLine("New comment is: " + comment.Buffer.Text);
     foreach (Photo p in App.Instance.Organizer.SelectedPhotos())
     {
         p.Description         = comment.Buffer.Text;
         p.Changes.DataChanged = true;
         App.Instance.Database.Photos.Commit(p);
     }
     dialog.Destroy();
 }
        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);
        }
示例#12
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();
 }
示例#13
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 ();
 }
示例#14
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();
                }
            }
        }
示例#15
0
        private void HandleResponse(object sender,
                                    Gtk.ResponseArgs args)
        {
            dialog.Destroy();

            if (Gtk.ResponseType.Ok != args.ResponseId)
            {
                Log.DebugFormat("Tabblo export was canceled.");
                return;
            }

            WriteAccountData();

            Log.DebugFormat("Starting Tabblo export");

            Thread upload_thread =
                new Thread(new ThreadStart(Upload));

            progress_dialog = new FSpot.ThreadProgressDialog(
                upload_thread, photos.Items.Length);
            progress_dialog.Start();
        }
示例#16
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();
        }
示例#17
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();
        }
示例#18
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();
        }
示例#19
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();
        }
示例#20
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);
 }
示例#21
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 ();
		}
        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;
        }
 public void Dispose()
 {
     dialog.Destroy();
 }
        void GtkDBusInit()
        {
            /* setup ApplicationMenu */

            dbusMenu      = new MenuStripDBusMenu(pluginHost.MainWindow.MainMenu);
            emptyDBusMenu = new MenuStripDBusMenu(new MenuStrip());

            var sessionBus = Bus.Session;

#if DEBUG
            const string dbusBusPath    = "/org/freedesktop/DBus";
            const string dbusBusName    = "org.freedesktop.DBus";
            var          dbusObjectPath = new ObjectPath(dbusBusPath);
            var          dbusService    =
                sessionBus.GetObject <org.freedesktop.DBus.IBus>(dbusBusName, dbusObjectPath);
            dbusService.NameAcquired += (name) => Console.WriteLine("NameAcquired: " + name);
#endif
            const string registrarBusPath    = "/com/canonical/AppMenu/Registrar";
            const string registratBusName    = "com.canonical.AppMenu.Registrar";
            var          registrarObjectPath = new ObjectPath(registrarBusPath);
            unityPanelServiceBus =
                sessionBus.GetObject <com.canonical.AppMenu.Registrar.IRegistrar>(registratBusName,
                                                                                  registrarObjectPath);
            mainFormXid        = GetWindowXid(pluginHost.MainWindow);
            mainFormObjectPath = new ObjectPath(string.Format(menuPath,
                                                              mainFormXid));
            sessionBus.Register(mainFormObjectPath, dbusMenu);
            try {
                unityPanelServiceBus.RegisterWindow((uint)mainFormXid.ToInt32(),
                                                    mainFormObjectPath);
                gtkInitOk = true;
                gtkInitDoneEvent.Set();
            } catch (Exception) {
                gtkInitDoneEvent.Set();
                if (!pluginHost.CustomConfig.GetBool(keebuntuAppMenuWarningSeenId, false))
                {
                    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();
                    }
                    DBusBackgroundWorker.Stop();
                }
            }
        }
示例#25
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);
			}
		}
		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;
		}