Skip to content

Commit

Permalink
add empty dialog for settings
Browse files Browse the repository at this point in the history
-
Ticket: AUT-2324
  • Loading branch information
hawser86 committed Oct 13, 2023
1 parent 2a4493b commit 5c3a3eb
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ const addNewWindowCommandToDefaultMenus = () => {
}
};

const addSettingsCommandToDefaultMenus = () => {
const settingsMenuItemDefinition = {
label: 'Settings',
accelerator: 'CommandOrControl+,',
click: () => {
BrowserWindow.getAllWindows().forEach(window => window.webContents.send('show-settings'));
}
};

const appMenu = Menu.getApplicationMenu();
const fileMenu = appMenu.items.find(item => item.label === 'File');
fileMenu.submenu.insert(1, new MenuItem(settingsMenuItemDefinition));
Menu.setApplicationMenu(appMenu);
};

const addGoogleCloudSdkExecutablesToPATH = () => {
if (process.platform === 'darwin') {
const possibleGcloudPaths = [
Expand All @@ -90,6 +105,7 @@ const addGoogleCloudSdkExecutablesToPATH = () => {

app.on('ready', () => {
addNewWindowCommandToDefaultMenus();
addSettingsCommandToDefaultMenus();
createWindow();
});

Expand Down
2 changes: 2 additions & 0 deletions src/renderer/components/app/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,7 @@ <h1 class="e-layout__title">GAP Secret Editor</h1>
/>

<feedback-dialog ref="feedbackDialog" />

<settings-dialog />
</div>
</div>
2 changes: 2 additions & 0 deletions src/renderer/components/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import BackupSelector from '../backup-selector/backup-selector';
import SaveConfirmationDialog from '../save-confirmation-dialog/save-confirmation-dialog';
import AutoUpdateConfirmation from '../auto-update-confirmation/auto-update-confirmation';
import FeedbackDialog from '../feedback-dialog/feedback-dialog';
import SettingsDialog from '../settings-dialog/settings-dialog';
import ErrorState from '../error-state/error-state';

const logger = log.scope('app');
Expand All @@ -28,6 +29,7 @@ export default {
SaveConfirmationDialog,
AutoUpdateConfirmation,
FeedbackDialog,
SettingsDialog,
ErrorState
},
data: () => ({
Expand Down
17 changes: 17 additions & 0 deletions src/renderer/components/settings-dialog/settings-dialog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div>
<e-dialog
:opened="dialogOpened"
v-on="{ 'dialog.close': () => { dialogOpened = false } }"
headline="Settings"
>
winter is coming

<div class="e-dialog__footer">
<div class="e-grid e-grid-small">
<div class="e-cell e-cell-small">
<div class="e-btn e-btn-primary" @click="save()">Save</div>
</div>
</div>
</div>
</e-dialog>
</div>
19 changes: 19 additions & 0 deletions src/renderer/components/settings-dialog/settings-dialog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ipcRenderer } from 'electron';

export default {
name: 'settings-dialog',
template: require('./settings-dialog.html'),
data: () => ({
dialogOpened: false
}),
methods: {
save() {
console.log('save');
}
},
mounted() {
ipcRenderer.on('show-settings', async () => {
this.dialogOpened = true;
});
}
};

0 comments on commit 5c3a3eb

Please sign in to comment.