| 67 | } |
| 68 | |
| 69 | bool BoxedApp::saveApp() { |
| 70 | if (this->iniFilePath.length()==0) { |
| 71 | BString appDir = GlobalSettings::getAppFolder(this->container); |
| 72 | if (!Fs::doesNativePathExist(appDir)) { |
| 73 | if (!Fs::makeNativeDirs(appDir)) { |
| 74 | return false; |
| 75 | } |
| 76 | } |
| 77 | for (int i=0;i<10000;i++) { |
| 78 | BString iniPath = appDir.stringByApppendingPath(BString::valueOf(i) + ".ini"); |
| 79 | if (!Fs::doesNativePathExist(iniPath)) { |
| 80 | this->iniFilePath = iniPath; |
| 81 | break; |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | ConfigFile config(iniFilePath); |
| 86 | config.writeString(B("Name"), this->name); |
| 87 | config.writeString(B("Link"), this->link); |
| 88 | config.writeString(B("Cmd"), this->cmd); |
| 89 | config.writeString(B("Icon"), this->iconPath); |
| 90 | config.writeString(B("Path"), this->path); |
| 91 | config.writeString(B("Resolution"),this->resolution); |
| 92 | config.writeInt(B("BPP"),this->bpp); |
| 93 | config.writeInt(B("Fullscreen"),this->fullScreen); |
| 94 | config.writeInt(B("VSync"), this->vsync); |
| 95 | config.writeBool(B("DpiAware"), this->dpiAware); |
| 96 | config.writeBool(B("DDrawOverride"), this->ddrawOverride); |
| 97 | config.writeBool(B("EnableDXVK"), this->enableDXVK); |
| 98 | config.writeBool(B("DisableHideCursor"), this->disableHideCursor); |
| 99 | config.writeBool(B("ForceRelativeMouse"), this->forceRelativeMouse); |
| 100 | config.writeBool(B("AutoRefresh"), this->autoRefresh); |
| 101 | config.writeString(B("AllowedGlExt"),this->glExt); |
| 102 | config.writeInt(B("Scale"),this->scale); |
| 103 | config.writeInt(B("ScaleQuality"),this->scaleQuality); |
| 104 | config.writeInt(B("CpuAffinity"),this->cpuAffinity); |
| 105 | config.writeInt(B("PollRate"), this->pollRate); |
| 106 | config.writeInt(B("SkipFramesFPS"), this->skipFramesFPS); |
| 107 | config.writeInt(B("OpenGL"), this->openGlType); |
| 108 | config.writeBool(B("IsWine"), this->isWine); |
| 109 | config.writeInt(B("uid"), this->uid); |
| 110 | config.writeInt(B("euid"), this->euid); |
| 111 | |
| 112 | BString key; |
| 113 | for (int i = 0; i < (int)this->args.size(); i++) { |
| 114 | key = "Arg"; |
| 115 | key += (i + 1); |
| 116 | config.writeString(key, this->args[i]); |
| 117 | } |
| 118 | config.saveChanges(); |
| 119 | return true; |
| 120 | } |
| 121 | |
| 122 | void BoxedApp::createAutomation() { |
| 123 | BString path = GlobalSettings::getAutomationFolder(this->container); |
no test coverage detected