mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
Refactored FilePicker (#1045)
This commit is contained in:
@@ -16344,6 +16344,16 @@ speechSynthesis.getVoices();
|
||||
}
|
||||
};
|
||||
|
||||
$app.methods.getAndDisplayScreenshotFromFile = async function () {
|
||||
var filePath = await AppApi.OpenFileSelectorDialog(await AppApi.GetVRChatPhotosLocation(), ".png", "PNG Files (*.png)|*.png");
|
||||
if (filePath === "") {
|
||||
return;
|
||||
}
|
||||
|
||||
this.screenshotMetadataResetSearch();
|
||||
this.getAndDisplayScreenshot(filePath);
|
||||
};
|
||||
|
||||
$app.methods.getAndDisplayScreenshot = function (
|
||||
path,
|
||||
needsCarouselFiles = true
|
||||
|
||||
@@ -133,7 +133,14 @@ export default class extends baseClass {
|
||||
this.downloadAndSaveJson(row.name, row.data);
|
||||
},
|
||||
|
||||
restoreVrcRegistryFromFile(json) {
|
||||
async restoreVrcRegistryFromFile() {
|
||||
var filePath = await AppApi.OpenFileSelectorDialog(null, ".json", "JSON Files (*.json)|*.json");
|
||||
if (filePath === "") {
|
||||
return;
|
||||
}
|
||||
|
||||
var json = await AppApi.ReadVrcRegJsonFile(filePath);
|
||||
|
||||
try {
|
||||
var data = JSON.parse(json);
|
||||
if (!data || typeof data !== 'object') {
|
||||
|
||||
@@ -4,7 +4,7 @@ mixin screenshotMetadata()
|
||||
span(style="margin-left:5px;color:#909399;font-family:monospace") {{ $t('dialog.screenshot_metadata.drag') }}
|
||||
br
|
||||
br
|
||||
el-button(size="small" icon="el-icon-folder-opened" @click="AppApi.OpenScreenshotFileDialog()") {{ $t('dialog.screenshot_metadata.browse') }}
|
||||
el-button(size="small" icon="el-icon-folder-opened" @click="getAndDisplayScreenshotFromFile()") {{ $t('dialog.screenshot_metadata.browse') }}
|
||||
el-button(size="small" icon="el-icon-picture-outline" @click="getAndDisplayLastScreenshot()") {{ $t('dialog.screenshot_metadata.last_screenshot') }}
|
||||
el-button(size="small" icon="el-icon-copy-document" @click="copyImageToClipboard(screenshotMetadataDialog.metadata.filePath)") {{ $t('dialog.screenshot_metadata.copy_image') }}
|
||||
el-button(size="small" icon="el-icon-folder" @click="openImageFolder(screenshotMetadataDialog.metadata.filePath)") {{ $t('dialog.screenshot_metadata.open_folder') }}
|
||||
|
||||
@@ -174,7 +174,7 @@ mixin settings()
|
||||
el-button(type="danger" @click="deleteVrcRegistry" size="small") {{ $t('dialog.registry_backup.reset') }}
|
||||
div
|
||||
el-button(@click="promptVrcRegistryBackupName" size="small") {{ $t('dialog.registry_backup.backup') }}
|
||||
el-button(@click="AppApi.OpenVrcRegJsonFileDialog()" size="small") {{ $t('dialog.registry_backup.restore_from_file') }}
|
||||
el-button(@click="restoreVrcRegistryFromFile" size="small") {{ $t('dialog.registry_backup.restore_from_file') }}
|
||||
|
||||
|
||||
//- dialog: Enable primary password
|
||||
|
||||
Reference in New Issue
Block a user