Exemple #1
0
        public NewWorkspaceDialog(bool project)
        {
            this.TransientFor = MainClass.MainWindow;
            this.Build();

            this.feRoot              = new FileEntry();
            this.feRoot.Name         = "feRoot";
            this.feRoot.IsFolder     = true;
            this.feRoot.BrowserTitle = "Root Directory";
            this.table2b.Attach(this.feRoot, 1, 2, 1, 2);
            Gtk.Table.TableChild w3 = ((Gtk.Table.TableChild)(this.table2b [this.feRoot]));
            w3.YOptions = ((Gtk.AttachOptions)(4));
            feRoot.ShowAll();

            skinthemecontrol1 = new SkinThemeControl();
            vbox3.PackEnd(skinthemecontrol1, false, true, 0);
            skinthemecontrol1.ShowAll();
            expander1.Activated += OnConfigureGeometry;


            feOutput          = new FileMaskEntry(MainClass.Settings.WorkspaceMaskDirectory, MainClass.Workspace, this);
            feOutput.IsFolder = true;
            //Console.WriteLine(" MainClass.Paths.WorkDir-> {0}", MainClass.Paths.WorkDir);
            if (!System.IO.Directory.Exists(MainClass.Paths.WorkDir))
            {
                try{
                    System.IO.Directory.CreateDirectory(MainClass.Paths.WorkDir);
                }catch (Exception ex) {
                    Moscrif.IDE.Tool.Logger.Error(MainClass.Languages.Translate("work_dir_not_creat"));
                    Moscrif.IDE.Tool.Logger.Error(ex.Message);
                }
            }

            feRoot.DefaultPath   = MainClass.Paths.WorkDir;
            feOutput.DefaultPath = MainClass.Paths.WorkDir;
            feOutput.VisiblePath = System.IO.Path.Combine(MainClass.Settings.WorkspaceMaskDirectory[0], "output");

            if (project)
            {
                vbox3.Visible      = true;
                trmProject.Visible = true;
                skinthemecontrol1.SetLabelWidth(85);
            }
            else
            {
                this.Resize(450, 90);
            }
            table2.Attach(feOutput, 1, 2, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 5, 0);

            this.project = project;
        }
Exemple #2
0
        public GeneralWidget(Project project, Gtk.Window parent)
        {
            parentWindow = parent;
            this.Build();

            feOutput          = new FileMaskEntry(MainClass.Settings.WorkspaceMaskDirectory, this.project, parentWindow);
            feOutput.IsFolder = true;


            Pango.FontDescription fd = PangoContext.FontDescription.Copy();
            fd.Weight = Pango.Weight.Bold;

            //Pango.FontDescription customFont = Pango.FontDescription.FromString("Courier 16");//Pango.FontDescription.FromString(MainClass.Settings.ConsoleTaskFont);
            //customFont.Weight = Pango.Weight.Bold;

            //checkbutton1.ModifyFont(customFont );

            this.project = project;
            if (MainClass.Workspace != null)
            {
                worksName.LabelProp = MainClass.Workspace.Name;
                worksDir.LabelProp  = MainClass.Workspace.RootDirectory;

                prjName.LabelProp     = this.project.ProjectName;
                prjDir.LabelProp      = this.project.RelativeAppFilePath;
                prjFullPath.LabelProp = this.project.AbsolutProjectDir;
            }
            if (!this.project.NewSkin)
            {
                foreach (Devices.Device d in this.project.DevicesSettings)
                {
                    d.Includes.Skin.Name  = "";
                    d.Includes.Skin.Theme = "";
                }
                this.project.NewSkin = true;
            }
            //checkbutton1.Active =this.project.NewSkin;
            //checkbutton1.Visible =false;
            //checkbutton1.HideAll();//ShowAll()
            Gdk.Pixbuf default_pixbuf = null;
            string     file           = System.IO.Path.Combine(MainClass.Paths.ResDir, "stock-menu.png");

            popupCondition = new Gtk.Menu();

            if (System.IO.File.Exists(file))
            {
                default_pixbuf = new Gdk.Pixbuf(file);

                btnPopUp              = new Gtk.Button(new Gtk.Image(default_pixbuf));
                btnPopUp.TooltipText  = MainClass.Languages.Translate("insert_condition_name");
                btnPopUp.Relief       = Gtk.ReliefStyle.None;
                btnPopUp.CanFocus     = false;
                btnPopUp.WidthRequest = btnPopUp.HeightRequest = 22;

                btnPopUp.Clicked += delegate {
                    popupCondition.Popup(null, null, new Gtk.MenuPositionFunc(GetPosition), 3, Gtk.Global.CurrentEventTime);
                    //popupCondition.Popup();
                };
                hbox1.PackEnd(btnPopUp, false, false, 0);
                //table1.Attach(btnPopUp,2, 3, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink,0,0);
            }
            ReloadPanel();

            /*AddMenuItem(MainClass.Settings.Platform.Name);
             * AddMenuItem(MainClass.Settings.Resolution.Name);
             *
             * if (project.ConditoinsDefine != null){
             *      foreach (Condition cd in project.ConditoinsDefine) {
             *
             *              AddMenuItem(cd.Name);
             *      }
             * }
             *
             * popupCondition.ShowAll();*/

            table1.Attach(feOutput, 1, 3, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            if (String.IsNullOrEmpty(project.ProjectOutput))
            {
                if (!String.IsNullOrEmpty(MainClass.Workspace.OutputDirectory))
                {
                    string fullOutput = MainClass.Workspace.OutputMaskToFullPath;

                    if (!System.IO.Directory.Exists(fullOutput))
                    {
                        try {
                            System.IO.Directory.CreateDirectory(fullOutput);
                        }catch { }
                    }

                    feOutput.DefaultPath = fullOutput;
                    feOutput.VisiblePath = MainClass.Workspace.OutputDirectory;
                }
                else
                {
                    feOutput.DefaultPath = project.AbsolutProjectDir;
                }
            }
            else
            {
                string fullProjectOutput = project.OutputMaskToFullPath;
                feOutput.DefaultPath = fullProjectOutput;
                feOutput.VisiblePath = project.ProjectOutput;
            }

            if (String.IsNullOrEmpty(project.ProjectArtefac))
            {
                string name = System.IO.Path.GetFileNameWithoutExtension(project.RelativeAppFilePath);
                projectArtefact        = String.Format("{0}_$({1})_$({2})", name, MainClass.Settings.Platform.Name, MainClass.Settings.Resolution.Name);
                project.ProjectArtefac = projectArtefact;
            }
            else
            {
                projectArtefact = project.ProjectArtefac;
            }

            entrName.Text                  = projectArtefact;
            entrFacebookApi.Text           = project.FacebookAppID;
            entrFacebookApi.KeyPressEvent += delegate(object o, KeyPressEventArgs args) {
                if (!MainClass.LicencesSystem.CheckFunction("facebook", parentWindow))
                {
                    entrFacebookApi.Text = project.FacebookAppID;
                    return;
                }
            };

            entrName.Changed += delegate(object sender, EventArgs e) {
                if (checkChange)
                {
                    CheckMessage();
                }
            };
        }