Example #1
0
        private void UpdateVSFiles()
        {
            _data.UEProject = QuteResolver.GetProjectInfo(txtProjectPath.Text);

            var gen = _data.GetGenerateCmd();

            if (!File.Exists(gen))
            {
                throw new QuteException("Error: Could not find file '" + gen + "'.");
            }

            var startInfo = new ProcessStartInfo {
                WindowStyle = ProcessWindowStyle.Normal,
                FileName    = _data.GetGenerateCmd(),
                Arguments   = _data.UEProject.Path
            };

            var process = new Process {
                StartInfo = startInfo
            };

            process.Start();
            process.WaitForExit();
            Console.WriteLine("Visual Studio project files were generated.");
        }
Example #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Console.SetOut(new QuteConsoleWriter(txtLog, Color.LightGray));
            Console.SetError(new QuteConsoleWriter(txtLog, Color.Red));

            var kits = QuteResolver.GetKits();

            foreach (var kit in kits)
            {
                comboKits.Items.Add(kit);
                if (kit.Name.Trim().Equals(AppSettings.KitName.Trim(), StringComparison.InvariantCultureIgnoreCase) &&
                    kit.Id.Trim().Equals(AppSettings.KitId.Trim(), StringComparison.InvariantCultureIgnoreCase))
                {
                    comboKits.SelectedItem = kit;
                }
            }

            //If the program is run in a project directory, set active project to the first *.uproject file found.
            var dir = Directory.GetCurrentDirectory();

            if (Directory.Exists(dir))
            {
                foreach (var file in Directory.GetFiles(dir, "*.uproject"))
                {
                    txtProjectPath.Text = file;
                    txtProjectPath_TextChanged(null, null);
                    break;
                }
            }

            checkAlwaysUpdateVS.Checked = AppSettings.AlwaysUpdateVS;
        }
Example #3
0
 private void txtProjectPath_Leave(object sender, EventArgs e)
 {
     try {
         _data.UEProject = QuteResolver.GetProjectInfo(txtProjectPath.Text);
     } catch {
         // Suppress errors
     }
 }
Example #4
0
 private void btnProjInfo_Click(object sender, EventArgs e)
 {
     try {
         var info = QuteResolver.GetProjectInfo(txtProjectPath.Text);
         Console.WriteLine("Name: {0}\nEngine: {1}", info.Name, info.Engine);
     } catch (QuteException ex) {
         Console.Error.WriteLine(ex.Message);
     }
 }
Example #5
0
        private bool OpenInQt()
        {
            try {
                _data.UEProject = QuteResolver.GetProjectInfo(txtProjectPath.Text);
            } catch (QuteException ex) {
                Console.Error.WriteLine(ex.Message);
                return(false);
            }

            var qtProjFile = Path.Combine(_data.GetProjectFilesDir(), _data.UEProject.Name + ".pro");

            if (!File.Exists(qtProjFile))
            {
                Console.Error.WriteLine("Qt project files were not found. Did you generate them?");
                return(false);
            }

            try {
                var filePath = AppSettings.QtPath ?? "";
                var fileName = Path.GetFileName(filePath);

                if (!File.Exists(filePath) || !fileName.Equals("qtcreator.exe", StringComparison.InvariantCultureIgnoreCase))
                {
                    filePath = QuteResolver.GetDetectedQtCreatorPath();
                }
                if (!File.Exists(filePath) || !fileName.Equals("qtcreator.exe", StringComparison.InvariantCultureIgnoreCase))
                {
                    filePath = BrowseQtCreatorPath();
                    if (filePath == null)
                    {
                        return(false);
                    }
                }

                if (File.Exists(filePath))
                {
                    AppSettings.QtPath = filePath;
                    var startInfo = new ProcessStartInfo {
                        FileName  = filePath,
                        Arguments = Path.Combine(_data.GetProjectFilesDir(), _data.UEProject.Name + ".pro")
                    };

                    var process = new Process {
                        StartInfo = startInfo,
                    };

                    process.Start();
                    return(true);
                }
            } catch (Exception ex) {
                Console.Error.WriteLine(ex.Message);
            }
            return(false);
        }
Example #6
0
        private void btnQtFiles_Click(object sender, EventArgs e)
        {
            try {
                _data.UEProject = QuteResolver.GetProjectInfo(txtProjectPath.Text);
                _data.ValidateEUPaths();

                if (checkAlwaysUpdateVS.Checked)
                {
                    UpdateVSFiles();
                }

                QuteExporter.ExportProject(_data);
            } catch (Exception ex) {
                Console.Error.WriteLine(ex.Message);
            }
        }
Example #7
0
        private void btnDetectUEPath_Click(object sender, EventArgs e)
        {
            var path = QuteResolver.GetDetectedUEPath();

            if (path != null && Directory.Exists(path))
            {
                if (txtUEPath.Text != path)
                {
                    txtUEPath.Text = path;
                    Console.WriteLine("Unreal Engine path changed to '{0}'.", path);
                }
            }
            else
            {
                Console.Error.WriteLine("Error: Could not auto-detect Unreal Engine installation path.");
            }
        }
Example #8
0
        private void btnBuildConfig_Click(object sender, EventArgs e)
        {
            try {
                _data.UEProject = QuteResolver.GetProjectInfo(txtProjectPath.Text);
                _data.ValidateEUPaths();

                if (comboKits.SelectedItem is QuteResolver.Kit)
                {
                    QuteExporter.ExportConfiguration(_data, listBuild.CheckedItems.OfType <QuteExporter.Build>());
                }
                else
                {
                    Console.Error.WriteLine("Error: No Qt Kit is selected.");
                }
            } catch (QuteException ex) {
                Console.Error.WriteLine(ex.Message);
            }
        }
Example #9
0
        private void btnDetectQtPath_Click(object sender, EventArgs e)
        {
            string path;

            try {
                path = QuteResolver.GetDetectedQtCreatorPath();
            } catch {
                path = null;
            }
            if (path != null && File.Exists(path))
            {
                if (path != txtQtPath.Text)
                {
                    txtQtPath.Text = path;
                    Console.WriteLine("Qt Creator location changed to '{0}'.", path);
                }
            }
            else
            {
                Console.Error.WriteLine("Error: Could not auto-detect Qt Creator location.");
            }
        }
Example #10
0
        private void SetupAndLaunch()
        {
            try {
                _data.UEProject = QuteResolver.GetProjectInfo(txtProjectPath.Text);
                _data.ValidateEUPaths();
                if (!(comboKits.SelectedItem is QuteResolver.Kit))
                {
                    Console.Error.WriteLine("Error: No Qt Kit is selected.");
                }

                UpdateVSFiles();
                QuteExporter.ExportConfiguration(_data, listBuild.CheckedItems.OfType <QuteExporter.Build>());
                QuteExporter.ExportProject(_data);

                if (OpenInQt())
                {
                    Application.Exit();
                }
            } catch (QuteException ex) {
                Console.Error.WriteLine(ex.Message);
            }
        }
Example #11
0
 public SettingsForm()
 {
     InitializeComponent();
     if (AppSettings.FirstTime)
     {
         try {
             txtUEPath.Text = QuteResolver.GetDetectedUEPath();
         } catch {
             txtUEPath.Text = "";
         }
         try {
             txtQtPath.Text = QuteResolver.GetDetectedQtCreatorPath();
         } catch {
             txtQtPath.Text = "";
         }
     }
     else
     {
         txtUEPath.Text = AppSettings.UEPath;
         txtQtPath.Text = AppSettings.QtPath;
     }
     UEPath        = txtUEPath.Text;
     QtCreatorPath = txtQtPath.Text;
 }