Example #1
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 #2
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 #3
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;
 }