示例#1
0
        //this is a popup so it behaves like other splashes on Windows, i.e. doesn't show up as a second window in the taskbar.
        public SplashScreenForm() : base(Gtk.WindowType.Popup)
        {
            AppPaintable         = true;
            this.Decorated       = false;
            this.WindowPosition  = WindowPosition.Center;
            this.TypeHint        = Gdk.WindowTypeHint.Splashscreen;
            this.showVersionInfo = BrandingService.GetBool("SplashScreen", "ShowVersionInfo") ?? true;
            try {
                using (var stream = BrandingService.GetStream("SplashScreen.png", true))
                    bitmap = new Gdk.Pixbuf(stream);
            } catch (Exception e) {
                LoggingService.LogError("Can't load splash screen pixbuf 'SplashScreen.png'.", e);
            }
            progress               = new ProgressBar();
            progress.Fraction      = 0.00;
            progress.HeightRequest = 6;

            vbox             = new VBox();
            vbox.BorderWidth = 12;
            label            = new Gtk.Label();
            label.UseMarkup  = true;
            label.Xalign     = 0;
            vbox.PackEnd(progress, false, true, 0);
            vbox.PackEnd(label, false, true, 3);
            this.Add(vbox);
            if (bitmap != null)
            {
                this.Resize(bitmap.Width, bitmap.Height);
            }
        }
示例#2
0
 bool CheckSCPlugin()
 {
     if (Platform.IsMac && Directory.Exists("/Library/Contextual Menu Items/SCFinderPlugin.plugin"))
     {
         string message = "SCPlugin not supported";
         string detail  = "MonoDevelop has detected that SCPlugin (scplugin.tigris.org) is installed. " +
                          "SCPlugin is a Subversion extension for Finder that is known to cause crashes in MonoDevelop and" +
                          "other applications running on Mac OSX 10.9 (Mavericks) or upper. Please uninstall SCPlugin " +
                          "before proceeding.";
         var close = new AlertButton(BrandingService.BrandApplicationName(GettextCatalog.GetString("Close MonoDevelop")));
         var info  = new AlertButton(GettextCatalog.GetString("More Information"));
         var cont  = new AlertButton(GettextCatalog.GetString("Continue Anyway"));
         while (true)
         {
             var res = MessageService.GenericAlert(Gtk.Stock.DialogWarning, message, BrandingService.BrandApplicationName(detail), info, cont, close);
             if (res == close)
             {
                 LoggingService.LogInternalError("SCPlugin detected", new Exception("SCPlugin detected. Closing."));
                 return(false);
             }
             if (res == info)
             {
                 DesktopService.ShowUrl("https://bugzilla.xamarin.com/show_bug.cgi?id=21755");
             }
             if (res == cont)
             {
                 bool exists = Directory.Exists("/Library/Contextual Menu Items/SCFinderPlugin.plugin");
                 LoggingService.LogInternalError("SCPlugin detected", new Exception("SCPlugin detected. Continuing " + (exists ? "Installed." : "Uninstalled.")));
                 return(true);
             }
         }
     }
     return(true);
 }
示例#3
0
        void HandleFromFile(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog(GettextCatalog.GetString("Select Policy File"));

            dlg.Action       = MonoDevelop.Components.FileChooserAction.Open;
            dlg.TransientFor = this;
            dlg.AddFilter(BrandingService.BrandApplicationName(GettextCatalog.GetString("MonoDevelop policy files")), "*.mdpolicy");
            dlg.AddAllFilesFilter();
            dlg.CurrentFolder = ExportProjectPolicyDialog.DefaultFileDialogPolicyDir;
            if (dlg.Run())
            {
                try {
                    PolicySet pset = new PolicySet();
                    pset.LoadFromFile(dlg.SelectedFile);
                    if (string.IsNullOrEmpty(pset.Name))
                    {
                        pset.Name = dlg.SelectedFile.FileNameWithoutExtension;
                    }
                    pset.Name = GetUnusedName(pset.Name);
                    sets.Add(pset);
                    ExportProjectPolicyDialog.DefaultFileDialogPolicyDir = dlg.SelectedFile.ParentDirectory;
                    FillPolicySets();
                    policiesCombo.Active = sets.IndexOf(pset);
                } catch (Exception ex) {
                    MessageService.ShowError(GettextCatalog.GetString("The policy set could not be loaded"), ex);
                }
            }
        }
示例#4
0
        public ApplyPolicyDialog(IPolicyProvider policyProvider)
        {
            this.policyProvider = policyProvider;

            this.Build();
            tree = new PoliciesListSummaryTree();
            policiesScroll.Add(tree);
            tree.Show();

            foreach (PolicySet pset in PolicyService.GetPolicySets())
            {
                if (pset.Visible)
                {
                    combPolicies.AppendText(pset.Name);
                }
            }

            fileEntry.DefaultPath = ExportProjectPolicyDialog.DefaultFileDialogPolicyDir;
            fileEntry.FileFilters.AddFilter(BrandingService.BrandApplicationName(GettextCatalog.GetString("MonoDevelop policy files")), "*.mdpolicy");
            fileEntry.FileFilters.AddAllFilesFilter();
            combPolicies.Active = 0;
            OnRadioCustomToggled(null, null);
            UpdateContentLabels();

            combPolicies.Accessible.Name = "ApplyPolicyDialog.PolicyCombo";
            combPolicies.SetAccessibilityLabelRelationship(label2);
            CombPolicies_Changed(null, null);
            combPolicies.Changed += CombPolicies_Changed;
        }
示例#5
0
        static WelcomePageBranding()
        {
            try {
                using (var stream = BrandingService.GetStream("WelcomePageContent.xml")) {
                    Content = XDocument.Load(stream);
                }
            } catch (Exception ex) {
                LoggingService.LogError("Error while reading welcome page contents.", ex);
                using (var stream = typeof(WelcomePageBranding).Assembly.GetManifestResourceStream("WelcomePageContent.xml")) {
                    Content = XDocument.Load(stream);
                }
            }

            try {
                HeaderTextSize  = BrandingService.GetString("WelcomePage", "HeaderTextSize") ?? HeaderTextSize;
                HeaderTextColor = BrandingService.GetString("WelcomePage", "HeaderTextColor") ?? HeaderTextColor;
                BackgroundColor = BrandingService.GetString("WelcomePage", "BackgroundColor") ?? BackgroundColor;
                TextColor       = BrandingService.GetString("WelcomePage", "TextColor") ?? TextColor;
                TextSize        = BrandingService.GetString("WelcomePage", "TextSize") ?? TextSize;
                LinkColor       = BrandingService.GetString("WelcomePage", "LinkColor") ?? LinkColor;
                Spacing         = BrandingService.GetInt("WelcomePage", "Spacing") ?? Spacing;
                LogoHeight      = BrandingService.GetInt("WelcomePage", "LogoHeight") ?? LogoHeight;
            } catch (Exception e) {
                LoggingService.LogError("Error while reading welcome page branding.", e);
            }
        }
示例#6
0
        public WelcomePageFirstRun()
        {
            VisibleWindow = false;
            SetSizeRequest(WidgetSize.Width, WidgetSize.Height);

            string iconFile = BrandingService.GetString("ApplicationIcon");

            if (iconFile != null)
            {
                iconFile    = BrandingService.GetFile(iconFile);
                brandedIcon = Xwt.Drawing.Image.FromFile(iconFile);
            }

            TitleOffset = TextOffset = IconOffset = new Gdk.Point();

            tracker             = new MouseTracker(this);
            tracker.MouseMoved += (sender, e) => {
                ButtonHovered = new Gdk.Rectangle(ButtonPosistion, ButtonSize).Contains(tracker.MousePosition);
            };

            tracker.HoveredChanged += (sender, e) => {
                if (!tracker.Hovered)
                {
                    ButtonHovered = false;
                }
            };
        }
            void LoadBranding()
            {
                try {
                    var textColStr = BrandingService.GetString("AboutBox", "TextColor");
                    if (textColStr != null)
                    {
                        Gdk.Color.Parse(textColStr, ref textColor);
                    }
                    var bgColStr = BrandingService.GetString("AboutBox", "BackgroundColor");
                    if (bgColStr != null)
                    {
                        Gdk.Color.Parse(bgColStr, ref bgColor);
                    }

                    //branders may provide either fg image or bg image, or both
                    using (var stream = BrandingService.GetStream("AboutImage.png", false)) {
                        image = (stream != null ? new Gdk.Pixbuf(stream) : null);
                    }
                    using (var streamBg = BrandingService.GetStream("AboutImageBg.png", false)) {
                        imageBg = (streamBg != null ? new Gdk.Pixbuf(streamBg) : null);
                    }

                    //if branding did not provide any image, use the built-in one
                    if (imageBg == null && image == null)
                    {
                        image = Gdk.Pixbuf.LoadFromResource("AboutImage.png");
                    }
                } catch (Exception ex) {
                    LoggingService.LogError("Error loading about box branding", ex);
                }
            }
示例#8
0
        static IdeCustomizer LoadBrandingCustomizer()
        {
            var pathsString = BrandingService.GetString("CustomizerAssemblyPath");

            if (string.IsNullOrEmpty(pathsString))
            {
                return(null);
            }

            var paths = pathsString.Split(new [] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            var type  = BrandingService.GetString("CustomizerType");

            if (!string.IsNullOrEmpty(type))
            {
                foreach (var path in paths)
                {
                    var file = BrandingService.GetFile(path.Replace('/', Path.DirectorySeparatorChar));
                    if (File.Exists(file))
                    {
                        Assembly asm = Runtime.LoadAssemblyFrom(file);
                        var      t   = asm.GetType(type, true);
                        var      c   = Activator.CreateInstance(t) as IdeCustomizer;
                        if (c == null)
                        {
                            throw new InvalidOperationException("Customizer class specific in the branding file is not an IdeCustomizer subclass");
                        }
                        return(c);
                    }
                }
            }
            return(null);
        }
示例#9
0
        static void SetupWithoutBundle()
        {
            // set a bundle IDE to prevent NSProgress crash
            // https://bugzilla.xamarin.com/show_bug.cgi?id=8850
            NSBundle.MainBundle.InfoDictionary ["CFBundleIdentifier"] = new NSString("com.xamarin.monodevelop");

            FilePath exePath  = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string   iconFile = null;

            iconFile = BrandingService.GetString("ApplicationIcon");
            if (iconFile != null)
            {
                iconFile = BrandingService.GetFile(iconFile);
            }
            else
            {
                var bundleRoot = GetAppBundleRoot(exePath);
                if (bundleRoot.IsNotNull)
                {
                    //running from inside an app bundle, use its icon
                    iconFile = bundleRoot.Combine("Contents", "Resources", "monodevelop.icns");
                }
                else
                {
                    // assume running from build directory
                    var mdSrcMain = exePath.ParentDirectory.ParentDirectory.ParentDirectory;
                    iconFile = mdSrcMain.Combine("theme-icons", "Mac", "monodevelop.icns");
                }
            }

            if (File.Exists(iconFile))
            {
                NSApplication.SharedApplication.ApplicationIconImage = new NSImage(iconFile);
            }
        }
示例#10
0
        static void SetupDockIcon()
        {
            NSObject initialBundleIconFileValue;

            // Don't do anything if we're inside an app bundle.
            if (NSBundle.MainBundle.InfoDictionary.TryGetValue(new NSString("CFBundleIconFile"), out initialBundleIconFileValue))
            {
                return;
            }

            // Setup without bundle.
            FilePath exePath  = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string   iconName = BrandingService.GetString("ApplicationIcon");
            string   iconFile = null;

            if (iconName != null)
            {
                iconFile = BrandingService.GetFile(iconName);
            }
            else
            {
                // assume running from build directory
                var mdSrcMain = exePath.ParentDirectory.ParentDirectory.ParentDirectory;
                iconFile = mdSrcMain.Combine("theme-icons", "Mac", "monodevelop.icns");
            }

            if (File.Exists(iconFile))
            {
                var image     = new NSImage();
                var imageFile = new NSString(iconFile);

                IntPtr p = IntPtr_objc_msgSend_IntPtr(image.Handle, Selector.GetHandle("initByReferencingFile:"), imageFile.Handle);
                NSApplication.SharedApplication.ApplicationIconImage = ObjCRuntime.Runtime.GetNSObject <NSImage> (p);
            }
        }
 public UserInfoConflictDialog(string mdInfo, string gitInfo)
 {
     this.Build();
     label1.LabelProp = BrandingService.BrandApplicationName(label1.LabelProp);
     radioMD.Label    = BrandingService.BrandApplicationName(radioMD.Label);
     labelMD.Markup   = "<b>" + GLib.Markup.EscapeText(mdInfo) + "</b>";
     labelGit.Markup  = "<b>" + GLib.Markup.EscapeText(gitInfo) + "</b>";
 }
示例#12
0
        public static void SendFeedback(string email, string body)
        {
            PropertyService.Set("MonoDevelop.Feedback.Count", FeedbacksSent + 1);
            PropertyService.Set("MonoDevelop.Feedback.Email", email);
            PropertyService.SaveProperties();

            string header = BrandingService.BrandApplicationName("MonoDevelop: ") + BuildInfo.VersionLabel + "\n";

            Type t = Type.GetType("Mono.Runtime");

            if (t != null)
            {
                try {
                    string ver = (string)t.InvokeMember("GetDisplayName", BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.NonPublic, null, null, null);
                    header += "Runtime: Mono " + ver + "\n";
                } catch {
                    header += "Runtime: Mono (detection failed)\n";
                }
            }
            else
            {
                header += "Runtime: Microsoft .NET v" + Environment.Version + "\n";
            }

            string os = Platform.IsMac ? "Mac OSX" : (Platform.IsWindows ? "Windows" : "Linux");

            header += "Operating System: " + os + " (" + Environment.OSVersion + ")\n";
            header += "Distributor: " + PropertyService.Get <string> ("MonoDevelop.Distributor", "Xamarin") + "\n";
            header += SystemInformation.GetTextDescription();
            body    = header + "\n" + body;

            lock (sendingLock) {
                // Append the feedback entry to the end of the file
                XmlDocument doc = LoadFeedbackDoc();
                if (doc.DocumentElement == null)
                {
                    doc.AppendChild(doc.CreateElement("Feedbacks"));
                }

                var f = doc.CreateElement("Feedback");
                f.SetAttribute("email", email);
                f.InnerText = body;
                doc.DocumentElement.AppendChild(f);
                try {
                    if (!Directory.Exists(FeedbackFile.ParentDirectory))
                    {
                        Directory.CreateDirectory(FeedbackFile.ParentDirectory);
                    }
                    doc.Save(FeedbackFile);
                } catch (Exception ex) {
                    LoggingService.LogError("Could not save feedback file", ex);
                }
            }
            SendPendingFeedback();
        }
示例#13
0
 //this is a popup so it behaves like other splashes on Windows, i.e. doesn't show up as a second window in the taskbar.
 public SplashScreenForm() : base(WindowType.Popup)
 {
     AppPaintable         = true;
     this.Decorated       = false;
     this.WindowPosition  = WindowPosition.Center;
     this.TypeHint        = Gdk.WindowTypeHint.Splashscreen;
     this.showVersionInfo = BrandingService.GetBool("SplashScreen", "ShowVersionInfo") ?? true;
     using (var stream = BrandingService.GetStream("SplashScreen.png", true))
         bitmap = new Gdk.Pixbuf(stream);
     this.Resize(bitmap.Width, bitmap.Height);
 }
示例#14
0
        static void SetupDockIcon()
        {
            FilePath exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
            NSObject initialBundleIconFileValue;
            string   iconFile = null;

            // Try setting a dark variant of the application dock icon if one exists in the app bundle.
            if (NSBundle.MainBundle.InfoDictionary.TryGetValue(new NSString("CFBundleIconFile"), out initialBundleIconFileValue))
            {
                FilePath bundleIconRoot        = GetAppBundleRoot(exePath).Combine("Contents", "Resources");
                NSString initialBundleIconFile = (NSString)initialBundleIconFileValue;

                if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark)
                {
                    iconFile = bundleIconRoot.Combine(Path.GetFileNameWithoutExtension(initialBundleIconFile) + "~dark" + Path.GetExtension(initialBundleIconFile));
                }

                // There is no monodevelop~dark.icns, fallback to monodevelop.icns
                if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light || iconFile == null || !File.Exists(iconFile))
                {
                    iconFile = bundleIconRoot.Combine(initialBundleIconFile);
                }
            }
            else
            {
                // Setup without bundle.
                string iconName = BrandingService.GetString("ApplicationIcon");
                if (iconName != null)
                {
                    if (IdeApp.Preferences.UserInterfaceSkin == Skin.Dark)
                    {
                        string darkIconName = Path.GetFileNameWithoutExtension(iconName) + "~dark" + Path.GetExtension(iconName);
                        iconFile = BrandingService.GetFile(darkIconName);
                    }

                    if (IdeApp.Preferences.UserInterfaceSkin == Skin.Light || iconFile == null)
                    {
                        iconFile = BrandingService.GetFile(iconName);
                    }
                }
                else
                {
                    // assume running from build directory
                    var mdSrcMain = exePath.ParentDirectory.ParentDirectory.ParentDirectory;
                    iconFile = mdSrcMain.Combine("theme-icons", "Mac", "monodevelop.icns");
                }
            }

            if (File.Exists(iconFile))
            {
                NSApplication.SharedApplication.ApplicationIconImage = new NSImage(iconFile);
            }
        }
        public DebugSourceFilesOptionsPanelWidget(Solution solution)
        {
            this.solution = solution;

            label        = new Label(BrandingService.BrandApplicationName(GettextCatalog.GetString("Folders where MonoDevelop should look for debug source files:")));
            label.Xalign = 0;
            PackStart(label, false, false, 0);
            selector.Directories = new List <string> (SourceCodeLookup.GetDebugSourceFolders(solution));
            PackStart(selector, true, true, 0);
            ShowAll();
            SetupAccessibility();
        }
            public ScrollBox()
            {
                LoadBranding();
                this.Realized += new EventHandler(OnRealized);
                this.ModifyBg(Gtk.StateType.Normal, bgColor);
                this.ModifyText(Gtk.StateType.Normal, textColor);
                using (var stream = BrandingService.GetStream("AboutImage.png"))
                    image = new Gdk.Pixbuf(stream);
                monoPowered = new Gdk.Pixbuf(GetType().Assembly, "mono-powered.png");
                this.SetSizeRequest(450, image.Height - 1);

                TimerHandle = GLib.Timeout.Add(50, new TimeoutHandler(ScrollDown));
            }
示例#17
0
        public string GetInstructions()
        {
            if (instructions != null)
            {
                return(BrandingService.BrandApplicationName(instructions));
            }

            if (requiresPlatform != null)
            {
                string[] platID;
                string   platName;
                if (Platform.IsMac)
                {
                    platID   = new[] { "mac" };
                    platName = "OS X";
                }
                else if (Platform.IsWindows)
                {
                    platID   = new[] { "win32", "windows", "win" };
                    platName = "Windows";
                }
                else
                {
                    platID   = new [] { "linux" };
                    platName = "Linux";
                }
                var plats = requiresPlatform.Split(';');
                if (!plats.Any(a => platID.Any(b => string.Equals(a, b, StringComparison.OrdinalIgnoreCase))))
                {
                    var msg = GettextCatalog.GetString("This project type is not supported by MonoDevelop on {0}.", platName);
                    return(BrandingService.BrandApplicationName(msg));
                }
            }

            if (!string.IsNullOrEmpty(requiresProduct))
            {
                return(GettextCatalog.GetString("This project type requires {0} to be installed.", requiresProduct));
            }

            if (!string.IsNullOrEmpty(requiresAddin))
            {
                return(GettextCatalog.GetString("The {0} extension is not installed.", requiresAddin));
            }

            if (!string.IsNullOrEmpty(instructions))
            {
                return(BrandingService.BrandApplicationName(Addin.Localizer.GetString(instructions)));
            }

            return(BrandingService.BrandApplicationLongName(GettextCatalog.GetString("This project type is not supported by MonoDevelop.")));
        }
        protected async override Task <BuildResult> OnBuild(ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
        {
            if (Project.References.Count == 0 || !GtkDesignInfo.HasDesignedObjects(Project))
            {
                return(await base.OnBuild(monitor, configuration, operationContext));
            }

            Generator gen = new Generator();

            if (!await gen.Run(monitor, Project, configuration))
            {
                BuildResult gr = new BuildResult();
                foreach (string s in gen.Messages)
                {
                    gr.AddError(DesignInfo.GuiBuilderProject.File, 0, 0, null, s);
                }
                return(gr);
            }

            BuildResult res = await base.OnBuild(monitor, configuration, operationContext);

            if (gen.Messages != null)
            {
                foreach (string s in gen.Messages)
                {
                    res.AddWarning(DesignInfo.GuiBuilderProject.File, 0, 0, null, s);
                }

                if (gen.Messages.Length > 0)
                {
                    DesignInfo.ForceCodeGenerationOnBuild();
                }
            }

            if (res.Failed && !Platform.IsWindows && !Platform.IsMac)
            {
                // Some gtk# packages don't include the .pc file unless you install gtk-sharp-devel
                if (Project.AssemblyContext.GetPackage("gtk-sharp-2.0") == null)
                {
                    string msg = GettextCatalog.GetString(
                        "ERROR: MonoDevelop could not find the Gtk# 2.0 development package. " +
                        "Compilation of projects depending on Gtk# libraries will fail. " +
                        "You may need to install development packages for gtk-sharp-2.0.");
                    monitor.Log.WriteLine();
                    monitor.Log.WriteLine(BrandingService.BrandApplicationName(msg));
                }
            }

            return(res);
        }
 void LoadBranding()
 {
     try {
         var textColStr = BrandingService.GetString("AboutBox", "TextColor");
         if (textColStr != null)
         {
             Gdk.Color.Parse(textColStr, ref textColor);
         }
         var bgColStr = BrandingService.GetString("AboutBox", "BackgroundColor");
         if (bgColStr != null)
         {
             Gdk.Color.Parse(bgColStr, ref bgColor);
         }
     } catch (Exception ex) {
         LoggingService.LogError("Error loading about box branding", ex);
     }
 }
示例#20
0
        protected override BuildResult Build(IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
        {
            DotNetProject project = (DotNetProject)entry;
            GtkDesignInfo info    = GtkDesignInfo.FromProject(project);

            // The code generator must run in the GUI thread since it needs to
            // access to Gtk classes
            Generator gen = new Generator();

            lock (gen) {
                Gtk.Application.Invoke(delegate { gen.Run(monitor, project, configuration); });
                Monitor.Wait(gen);
            }

            BuildResult res = base.Build(monitor, entry, configuration);

            if (gen.Messages != null)
            {
                foreach (string s in gen.Messages)
                {
                    res.AddWarning(info.GuiBuilderProject.File, 0, 0, null, s);
                }

                if (gen.Messages.Length > 0)
                {
                    info.ForceCodeGenerationOnBuild();
                }
            }

            if (res.Failed && !Platform.IsWindows && !Platform.IsMac)
            {
                // Some gtk# packages don't include the .pc file unless you install gtk-sharp-devel
                if (project.AssemblyContext.GetPackage("gtk-sharp-2.0") == null)
                {
                    string msg = GettextCatalog.GetString(
                        "ERROR: MonoDevelop could not find the Gtk# 2.0 development package. " +
                        "Compilation of projects depending on Gtk# libraries will fail. " +
                        "You may need to install development packages for gtk-sharp-2.0.");
                    monitor.Log.WriteLine();
                    monitor.Log.WriteLine(BrandingService.BrandApplicationName(msg));
                }
            }

            return(res);
        }
示例#21
0
        public void RegisterMainRepository(UpdateLevel level, bool enable)
        {
            string url = GetMainRepositoryUrl(level);

            if (!Repositories.ContainsRepository(url))
            {
                var rep = Repositories.RegisterRepository(null, url, false);
                rep.Name = BrandingService.BrandApplicationName("MonoDevelop Extension Repository");
                if (level != UpdateLevel.Stable)
                {
                    rep.Name += " (" + level + " channel)";
                }
                if (!enable)
                {
                    Repositories.SetRepositoryEnabled(url, false);
                }
            }
        }
        public AboutMonoDevelopTabPage()
        {
            BorderWidth = 0;

            aboutPictureScrollBox = new ScrollBox();

            PackStart(aboutPictureScrollBox, false, false, 0);
            using (var stream = BrandingService.GetStream("AboutImageSep.png"))
                imageSep = new Pixbuf(stream);
            PackStart(new Gtk.Image(imageSep), false, false, 0);

            var label = new Label();

            label.Markup = string.Format(
                "<b>{0}</b>\n    {1}",
                GettextCatalog.GetString("Version"),
                BuildVariables.PackageVersion == BuildVariables.PackageVersionLabel ? BuildVariables.PackageVersionLabel : String.Format("{0} ({1})",
                                                                                                                                         BuildVariables.PackageVersionLabel,
                                                                                                                                         BuildVariables.PackageVersion));

            var hBoxVersion = new HBox();

            hBoxVersion.PackStart(label, false, false, 5);
            this.PackStart(hBoxVersion, false, true, 0);

            label        = null;
            label        = new Label();
            label.Markup = GettextCatalog.GetString("<b>License</b>\n    {0}", GettextCatalog.GetString("Released under the GNU Lesser General Public License."));
            var hBoxLicense = new HBox();

            hBoxLicense.PackStart(label, false, false, 5);
            this.PackStart(hBoxLicense, false, true, 5);

            label        = null;
            label        = new Label();
            label.Markup = GettextCatalog.GetString("<b>Copyright</b>\n    (c) 2004-{0} by MonoDevelop contributors", DateTime.Now.Year);
            var hBoxCopyright = new HBox();

            hBoxCopyright.PackStart(label, false, false, 5);
            this.PackStart(hBoxCopyright, false, true, 5);

            this.ShowAll();
        }
示例#23
0
        public void GetPathValueTest(string path, string baseUrl, int index, string value)
        {
            var reqMock = Mock.Of <IRequest>(x => x.PathInfo == path);
            var conf    = new ServerConfiguration()
            {
                BaseUrl = baseUrl
            };

            var confManagerMock = Mock.Of <IServerConfigurationManager>(x => x.Configuration == conf);

            var service = new BrandingService(
                new NullLogger <BrandingService>(),
                confManagerMock,
                Mock.Of <IHttpResultFactory>())
            {
                Request = reqMock
            };

            Assert.Equal(value, service.GetPathValue(index).ToString());
        }
示例#24
0
        void HandleToFile(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog(GettextCatalog.GetString("Select Policy File"));

            dlg.TransientFor    = this;
            dlg.InitialFileName = currentSet.Id + ".mdpolicy";
            dlg.Action          = MonoDevelop.Components.FileChooserAction.Save;
            dlg.AddFilter(BrandingService.BrandApplicationName(GettextCatalog.GetString("MonoDevelop policy files")), "*.mdpolicy");
            dlg.AddAllFilesFilter();
            dlg.CurrentFolder = ExportProjectPolicyDialog.DefaultFileDialogPolicyDir;
            if (dlg.Run())
            {
                try {
                    currentSet.SaveToFile(dlg.SelectedFile);
                    ExportProjectPolicyDialog.DefaultFileDialogPolicyDir = dlg.SelectedFile.ParentDirectory;
                } catch (Exception ex) {
                    MessageService.ShowError(GettextCatalog.GetString("The policy set could not be saved"), ex.Message, ex);
                }
            }
        }
        public override MigrationType ShouldMigrateProject()
        {
            if (!IdeApp.IsInitialized)
            {
                return(MigrationType.Ignore);
            }

            if (Migration.HasValue)
            {
                return(Migration.Value);
            }

            var buttonBackupAndMigrate = new AlertButton(GettextCatalog.GetString("Back up and migrate"));
            var buttonMigrate          = new AlertButton(GettextCatalog.GetString("Migrate"));
            var buttonIgnore           = new AlertButton(GettextCatalog.GetString("Ignore"));
            var response = MessageService.AskQuestion(
                GettextCatalog.GetString("Migrate Project?"),
                BrandingService.BrandApplicationName(GettextCatalog.GetString(
                                                         "One or more projects must be migrated to a new format. " +
                                                         "After migration, it will not be able to be opened in " +
                                                         "older versions of MonoDevelop.\n\n" +
                                                         "If you choose to back up the project before migration, a copy of the project " +
                                                         "file will be saved in a 'backup' directory in the project directory.")),
                buttonIgnore, buttonMigrate, buttonBackupAndMigrate);

            // If we get an unexpected response, the default should be to *not* migrate
            if (response == buttonBackupAndMigrate)
            {
                Migration = MigrationType.BackupAndMigrate;
            }
            else if (response == buttonMigrate)
            {
                Migration = MigrationType.Migrate;
            }
            else
            {
                Migration = MigrationType.Ignore;
            }

            return(Migration.Value);
        }
示例#26
0
		void CheckFileWatcher ()
		{
			string watchesFile = "/proc/sys/fs/inotify/max_user_watches";
			try {
				if (File.Exists (watchesFile)) {
					string val = File.ReadAllText (watchesFile);
					int n = int.Parse (val);
					if (n <= 9000) {
						string msg = "Inotify watch limit is too low (" + n + ").\n";
						msg += "MonoDevelop will switch to managed file watching.\n";
						msg += "See http://monodevelop.com/Inotify_Watches_Limit for more info.";
						LoggingService.LogWarning (BrandingService.BrandApplicationName (msg));
						Runtime.ProcessService.EnvironmentVariableOverrides["MONO_MANAGED_WATCHER"] = 
							Environment.GetEnvironmentVariable ("MONO_MANAGED_WATCHER");
						Environment.SetEnvironmentVariable ("MONO_MANAGED_WATCHER", "1");
					}
				}
			} catch (Exception e) {
				LoggingService.LogWarning ("There was a problem checking whether to use managed file watching", e);
			}
		}
示例#27
0
        public ExportProjectPolicyDialog(IPolicyProvider policyProvider)
        {
            this.Build();
            this.policyProvider = policyProvider;

            fileEntry.Action      = FileChooserAction.Save;
            fileEntry.DefaultPath = DefaultFileDialogPolicyDir;
            if (policyProvider is SolutionFolderItem)
            {
                fileEntry.Path = ((SolutionFolderItem)policyProvider).Name + ".mdpolicy";
            }
            else if (policyProvider is Solution)
            {
                fileEntry.Path = ((Solution)policyProvider).Name + ".mdpolicy";
            }

            fileEntry.FileFilters.AddFilter(BrandingService.BrandApplicationName(GettextCatalog.GetString("MonoDevelop policy files")), "*.mdpolicy");
            fileEntry.FileFilters.AddAllFilesFilter();

            fileEntry.PathChanged += delegate {
                UpdateWidgets();
            };
            entryName.Changed += delegate {
                UpdateWidgets();
            };

            tree = new PoliciesListSummaryTree();
            policiesScroll.Add(tree);
            tree.Show();

            tree.SetPolicies(policyProvider.Policies);
            if (!tree.HasPolicies)
            {
                tree.Message       = GettextCatalog.GetString("No policies");
                buttonOk.Sensitive = false;
            }

            UpdateWidgets();
        }
示例#28
0
 static void ShowHelp(bool shortHelp)
 {
     if (shortHelp)
     {
         Console.WriteLine();
         Console.WriteLine("Run `mdtool --help` to show usage information.");
         Console.WriteLine();
         return;
     }
     Console.WriteLine();
     Console.WriteLine(BrandingService.BrandApplicationName("MonoDevelop Tool Runner"));
     Console.WriteLine();
     Console.WriteLine("Usage: mdtool [options] <tool> ... : Runs a tool.");
     Console.WriteLine("       mdtool setup ... : Runs the setup utility.");
     Console.WriteLine("       mdtool -q : Lists available tools.");
     Console.WriteLine();
     Console.WriteLine("Options:");
     Console.WriteLine("  --verbose (-v)   Increases log verbosity. Can be used multiple times.");
     Console.WriteLine("  --no-reg-update  Skip updating addin registry. Faster but results in");
     Console.WriteLine("                   random errors if registry is not up to date.");
     ShowAvailableTools();
 }
示例#29
0
        //this is a popup so it behaves like other splashes on Windows, i.e. doesn't show up as a second window in the taskbar.
        public SplashScreenForm() : base(WindowType.Popup)
        {
            AppPaintable         = true;
            this.Decorated       = false;
            this.WindowPosition  = WindowPosition.Center;
            this.TypeHint        = Gdk.WindowTypeHint.Splashscreen;
            this.showVersionInfo = BrandingService.GetBool("SplashScreen", "ShowVersionInfo") ?? true;

            var file = BrandingService.GetFile("SplashScreen.png");

            if (file != null)
            {
                bitmap = Xwt.Drawing.Image.FromFile(file);
            }
            else
            {
                bitmap = Xwt.Drawing.Image.FromResource("SplashScreen.png");
            }

            this.Resize((int)bitmap.Width, (int)bitmap.Height);
            MessageService.PopupDialog += HandlePopupDialog;
        }
示例#30
0
        Pango.Layout TextLayout(Pango.Context context)
        {
            var layout = new Pango.Layout(context);

            layout.FontDescription = Pango.FontDescription.FromString(Platform.IsMac ? Styles.WelcomeScreen.FontFamilyMac : Styles.WelcomeScreen.FontFamilyWindows);
            layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels(15);
            layout.Width = Pango.Units.FromPixels(420);
            layout.Wrap  = Pango.WrapMode.Word;

            Pango.AttrRise rise = new Pango.AttrRise(Pango.Units.FromPixels(7));
            layout.Attributes = new Pango.AttrList();
            layout.Attributes.Insert(rise);

            string description = BrandingService.GetString("FirstRunDescription");

            if (description != null)
            {
                description = description.Replace("\\n", "\n");
            }
            layout.SetText(description ?? "No Text Set");
            return(layout);
        }