open settings link in default browser, working on filling out the settings

This commit is contained in:
trippjoe 2022-03-29 14:27:30 -04:00
parent 8c794482d9
commit b28b3df98b
3 changed files with 19 additions and 5 deletions

View file

@ -6,6 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="../../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<script defer src="../js/settings.js"></script>
<title>Settings</title>
</head>
@ -17,11 +18,11 @@
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab"
aria-controls="profile" aria-selected="false">Profile</button>
aria-controls="profile" aria-selected="false">Updates</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab"
aria-controls="contact" aria-selected="false">Contact</button>
aria-controls="contact" aria-selected="false">Links</button>
</li>
</ul>
<div class="tab-content" id="myTabContent">
@ -29,10 +30,14 @@
home tab data here
</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
profile tab data here
<button type="button" class="btn btn-primary" onclick="send('checkUpdates')">Check for Updates</button>
</div>
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
contact tab data here
<div class="list-group">
<a href="https://github.com/open-goal/jak-project" target="_blank" rel="noopener noreferrer"
class="list-group-item list-group-item-action">Github Repository</a>
<a href="#" class="list-group-item list-group-item-action">Discord Server</a>
</div>
</div>
</div>

View file

@ -1,4 +1,4 @@
const { app, BrowserWindow, ipcMain, Notification } = require('electron');
const { app, BrowserWindow, ipcMain, Notification, shell } = require('electron');
const path = require('path');
const isDev = !app.isPackaged;
const { launchGame, buildGame, isoSeries, fetchMasterRelease } = require('./js/utils/utils.js');
@ -77,6 +77,10 @@ ipcMain.on('settings', () => {
settingsWindow.once('ready-to-show', () => {
settingsWindow.show();
});
settingsWindow.webContents.setWindowOpenHandler(({ url }) => {
shell.openExternal(url);
return { action: 'deny' };
});
});
// opening the config page in a child window

View file

@ -0,0 +1,5 @@
const { send, receive, handleStatus, handleConsole } = window.electronAPI;
function checkUpdates() {
send('checkUpdates');
}