Skip to content

Commit

Permalink
Switch default log save location to "Log Files" on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Dec 1, 2023
1 parent 246013b commit 73c2d32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const USER_ASSETS = path.join(app.getPath("userData"), "userAssets");
export const LEGACY_ASSETS = path.join(app.getPath("userData"), "frcData");
export const LAST_OPEN_FILE = path.join(app.getPath("temp"), "akit-log-path.txt");
export const VIDEO_CACHE = path.join(app.getPath("temp"), "advantagescope-videos");
export const OPEN_DEFAULT_PATH =
export const DEFAULT_LOGS_FOLDER =
process.platform === "win32" ? "C:\\Users\\Public\\Documents\\FRC\\Log Files" : undefined;
export const WINDOW_ICON = process.platform === "darwin" ? undefined : path.join(__dirname, "../icons/window-icon.png");
export const DEFAULT_PREFS: Preferences = {
Expand Down
9 changes: 5 additions & 4 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ import { MERGE_MAX_FILES } from "../shared/log/MergeConstants";
import { UnitConversionPreset } from "../shared/units";
import { jsonCopy } from "../shared/util";
import {
DEFAULT_LOGS_FOLDER,
DEFAULT_PREFS,
DOWNLOAD_CONNECT_TIMEOUT_MS,
DOWNLOAD_PASSWORD,
DOWNLOAD_REFRESH_INTERVAL_MS,
DOWNLOAD_RETRY_DELAY_MS,
DOWNLOAD_USERNAME,
LAST_OPEN_FILE,
OPEN_DEFAULT_PATH,
PATHPLANNER_CONNECT_TIMEOUT_MS,
PATHPLANNER_DATA_TIMEOUT_MS,
PATHPLANNER_PING_DELAY_MS,
Expand Down Expand Up @@ -776,7 +776,8 @@ function downloadSave(files: string[]) {
selectPromise = dialog.showOpenDialog(downloadWindow, {
title: "Select save location for robot logs",
buttonLabel: "Save",
properties: ["openDirectory", "createDirectory", "dontAddToRecent"]
properties: ["openDirectory", "createDirectory", "dontAddToRecent"],
defaultPath: DEFAULT_LOGS_FOLDER
});
} else {
let extension = path.extname(files[0]).slice(1);
Expand Down Expand Up @@ -946,7 +947,7 @@ function setupMenu() {
title: "Select a robot log file to open",
properties: ["openFile"],
filters: [{ name: "Robot logs", extensions: ["rlog", "wpilog", "dslog", "dsevents"] }],
defaultPath: OPEN_DEFAULT_PATH
defaultPath: DEFAULT_LOGS_FOLDER
})
.then((files) => {
if (files.filePaths.length > 0) {
Expand All @@ -965,7 +966,7 @@ function setupMenu() {
message: "Up to " + MERGE_MAX_FILES.toString() + " files can be opened together",
properties: ["openFile", "multiSelections"],
filters: [{ name: "Robot logs", extensions: ["rlog", "wpilog", "dslog", "dsevents"] }],
defaultPath: OPEN_DEFAULT_PATH
defaultPath: DEFAULT_LOGS_FOLDER
});
let files = filesResponse.filePaths;
if (files.length === 0) {
Expand Down

0 comments on commit 73c2d32

Please sign in to comment.