Example #1
0
        private void InitModules()
        {
            QtVersionManager versionManager = QtVersionManager.The();
            string           qtVersion      = qtProject.GetQtVersion();
            string           install_path   = versionManager.GetInstallPath(qtVersion);

            for (int i = 0; i < moduleMap.Count; ++i)
            {
                ModuleMapItem item = moduleMap[i];
                item.initialValue     = qtProject.HasModule(item.moduleId);
                item.checkbox.Checked = item.initialValue;
                moduleMap[i]          = item;

                // Disable if module not installed
                QtModuleInfo info          = QtModules.Instance.ModuleInformation(item.moduleId);
                string       libraryPrefix = info.LibraryPrefix;
                if (libraryPrefix.StartsWith("Qt"))
                {
                    libraryPrefix = "Qt5" + libraryPrefix.Substring(2);
                }
                string             full_path = install_path + "\\lib\\" + libraryPrefix + ".lib";
                System.IO.FileInfo fi        = new System.IO.FileInfo(full_path);
                item.checkbox.Enabled = fi.Exists;
                if (fi.Exists == false)
                {
                    // Don't disable item if qtVersion not available
                    if (qtVersion != null)
                    {
                        item.checkbox.Checked = false;
                    }
                }
            }
        }
Example #2
0
 private void InitModules()
 {
     for (int i = 0; i < moduleMap.Count; ++i)
     {
         ModuleMapItem item = moduleMap[i];
         item.initialValue     = qtProject.HasModule(item.moduleId);
         item.checkbox.Checked = item.initialValue;
         moduleMap[i]          = item;
     }
 }
        private void InitModules()
        {
            var versionManager = QtVersionManager.The();
            var qtVersion      = qtProject.GetQtVersion();
            var installPath    = versionManager.GetInstallPath(qtVersion);

            var modulesList = getQtLibs(qtProject.GetQtVersion());

            //var projectModules = new List<string>();
            for (int i = 0; i < moduleMap.Count; ++i)
            {
                var item = moduleMap[i];
                item.initialValue     = qtProject.HasModule(item.moduleId);
                item.checkbox.Checked = item.initialValue;
                moduleMap[i]          = item;

                // Disable if module not installed
                var info          = QtModules.Instance.ModuleInformation(item.moduleId);
                var libraryPrefix = info.LibraryPrefix;
                if (libraryPrefix.StartsWith("Qt"))
                {
                    libraryPrefix = "Qt5" + libraryPrefix.Substring(2);
                }
                var fullPath = installPath + "\\lib\\" + libraryPrefix + ".lib";
                var isExists = System.IO.File.Exists(fullPath);
                item.checkbox.Enabled = isExists;
                //foreach (var module in modulesList)
                //{
                //    if (comparePath(fullPath, module) && item.initialValue && isExists)
                //    {
                //        projectModules.Add(module);
                //    }
                //}
                // Don't disable item if qtVersion not available
                if (!isExists && qtVersion != null)
                {
                    item.checkbox.Checked = false;
                }
            }

            var projectLibs = getUsedLibs(qtProject.Project);

            modulesListBox.Items.Clear();
            foreach (var item in modulesList)
            {
                var libName = System.IO.Path.GetFileName(item);
                modulesListBox.Items.Add(libraryPathToName(item), projectLibs.Contains(libName));
            }
        }
Example #4
0
        private static void AddModules(QtProject qtPrj, ProFileOption optionQT, ProFileOption optionCONFIG)
        {
            foreach (var moduleInfo in QtModules.Instance.GetAvailableModuleInformation())
            {
                if (!qtPrj.HasModule(moduleInfo.ModuleId))
                {
                    continue;
                }

                if (moduleInfo.proVarQT != null)
                {
                    optionQT.List.Add(moduleInfo.proVarQT);
                }
                if (moduleInfo.proVarCONFIG != null)
                {
                    optionCONFIG.List.Add(moduleInfo.proVarCONFIG);
                }
            }
        }
Example #5
0
        private void InitModules()
        {
            var versionManager = QtVersionManager.The();
            var qtVersion      = qtProject.GetQtVersion();
            var install_path   = versionManager.GetInstallPath(qtVersion) ?? string.Empty;

            for (var i = 0; i < moduleMap.Count; ++i)
            {
                var item = moduleMap[i];
                item.initialValue     = qtProject.HasModule(item.moduleId);
                item.checkbox.Checked = item.initialValue;
                moduleMap[i]          = item;

                // Disable if module not installed
                var info        = QtModules.Instance.ModuleInformation(item.moduleId);
                var versionInfo = versionManager.GetVersionInfo(qtVersion);
                if (info != null && versionInfo != null)
                {
                    var libraryPrefix = info.LibraryPrefix;
                    if (libraryPrefix.StartsWith("Qt", StringComparison.Ordinal))
                    {
                        libraryPrefix = "Qt5" + libraryPrefix.Substring(2);
                    }
                    var full_path = Path.Combine(install_path, "lib",
                                                 string.Format("{0}{1}.lib", libraryPrefix, versionInfo.LibInfix()));
                    var fi = new System.IO.FileInfo(full_path);
                    item.checkbox.Enabled = fi.Exists;
                    if (fi.Exists == false)
                    {
                        // Don't disable item if qtVersion not available
                        if (qtVersion != null)
                        {
                            item.checkbox.Checked = false;
                        }
                    }
                }
                else
                {
                    item.checkbox.Checked = false;
                }
            }
        }
Example #6
0
        private static void AddModules(QtProject qtPrj, ProFileOption optionQT, ProFileOption optionCONFIG)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            foreach (var module in QtModules.Instance.GetAvailableModules())
            {
                if (!qtPrj.HasModule(module.Id))
                {
                    continue;
                }

                if (module.proVarQT != null)
                {
                    optionQT.List.Add(module.proVarQT);
                }
                if (module.proVarCONFIG != null)
                {
                    optionCONFIG.List.Add(module.proVarCONFIG);
                }
            }
        }