@@ -40,7 +40,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
40
40
) ,
41
41
label : 'Open File' ,
42
42
accelerator : 'CmdOrCtrl+O' ,
43
- click ( ) : void {
43
+ click : ( ) => {
44
44
void getOpenFileListener ( mainWindow ) ( ) ;
45
45
} ,
46
46
} ,
@@ -51,7 +51,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
51
51
) ,
52
52
label : 'Save' ,
53
53
accelerator : 'CmdOrCtrl+S' ,
54
- click ( ) : void {
54
+ click : ( ) => {
55
55
webContents . send ( AllowedFrontendChannels . SaveFileRequest , {
56
56
saveFile : true ,
57
57
} ) ;
@@ -70,7 +70,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
70
70
'icons/follow-up-white.png' ,
71
71
'icons/follow-up-black.png' ,
72
72
) ,
73
- click ( ) : void {
73
+ click : ( ) => {
74
74
setLoadingState ( mainWindow . webContents , true ) ;
75
75
logger . info ( 'Preparing data for follow-up export' ) ;
76
76
webContents . send (
@@ -85,7 +85,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
85
85
'icons/com-list-black.png' ,
86
86
) ,
87
87
label : 'Compact component list' ,
88
- click ( ) : void {
88
+ click : ( ) => {
89
89
setLoadingState ( mainWindow . webContents , true ) ;
90
90
logger . info ( 'Preparing data for compact component list export' ) ;
91
91
webContents . send (
@@ -100,7 +100,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
100
100
'icons/det-list-black.png' ,
101
101
) ,
102
102
label : 'Detailed component list' ,
103
- click ( ) : void {
103
+ click : ( ) => {
104
104
setLoadingState ( mainWindow . webContents , true ) ;
105
105
logger . info (
106
106
'Preparing data for detailed component list export' ,
@@ -117,7 +117,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
117
117
'icons/yaml-black.png' ,
118
118
) ,
119
119
label : 'SPDX (yaml)' ,
120
- click ( ) : void {
120
+ click : ( ) => {
121
121
setLoadingState ( mainWindow . webContents , true ) ;
122
122
logger . info ( 'Preparing data for SPDX (yaml) export' ) ;
123
123
webContents . send (
@@ -132,7 +132,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
132
132
'icons/json-black.png' ,
133
133
) ,
134
134
label : 'SPDX (json)' ,
135
- click ( ) : void {
135
+ click : ( ) => {
136
136
setLoadingState ( mainWindow . webContents , true ) ;
137
137
logger . info ( 'Preparing data for SPDX (json) export' ) ;
138
138
webContents . send (
@@ -149,7 +149,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
149
149
'icons/about-black.png' ,
150
150
) ,
151
151
label : 'Project Metadata' ,
152
- click ( ) : void {
152
+ click : ( ) => {
153
153
if ( isFileLoaded ( getGlobalBackendState ( ) ) ) {
154
154
webContents . send (
155
155
AllowedFrontendChannels . ShowProjectMetadataPopup ,
@@ -166,7 +166,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
166
166
'icons/statictics-black.png' ,
167
167
) ,
168
168
label : 'Project Statistics' ,
169
- click ( ) : void {
169
+ click : ( ) => {
170
170
if ( isFileLoaded ( getGlobalBackendState ( ) ) ) {
171
171
webContents . send (
172
172
AllowedFrontendChannels . ShowProjectStatisticsPopup ,
@@ -183,7 +183,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
183
183
'icons/restore-black.png' ,
184
184
) ,
185
185
label : 'Set Path to Sources' ,
186
- click ( ) : void {
186
+ click : ( ) => {
187
187
getSelectBaseURLListener ( mainWindow ) ( ) ;
188
188
} ,
189
189
} ,
@@ -194,7 +194,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
194
194
) ,
195
195
label : 'Quit' ,
196
196
accelerator : 'CmdOrCtrl+Q' ,
197
- click ( ) : void {
197
+ click : ( ) => {
198
198
app . quit ( ) ;
199
199
} ,
200
200
} ,
@@ -258,6 +258,59 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
258
258
accelerator : 'CmdOrCtrl+A' ,
259
259
role : 'selectAll' ,
260
260
} ,
261
+ { type : 'separator' } ,
262
+ {
263
+ icon : getIconBasedOnTheme (
264
+ 'icons/magnifying-glass-white.png' ,
265
+ 'icons/magnifying-glass-black.png' ,
266
+ ) ,
267
+ label : 'Search Attributions' ,
268
+ accelerator : 'CmdOrCtrl+Shift+A' ,
269
+ click : ( ) => {
270
+ if ( isFileLoaded ( getGlobalBackendState ( ) ) ) {
271
+ webContents . send ( AllowedFrontendChannels . SearchAttributions ) ;
272
+ }
273
+ } ,
274
+ } ,
275
+ {
276
+ icon : getIconBasedOnTheme (
277
+ 'icons/magnifying-glass-white.png' ,
278
+ 'icons/magnifying-glass-black.png' ,
279
+ ) ,
280
+ label : 'Search Signals' ,
281
+ accelerator : 'CmdOrCtrl+Shift+S' ,
282
+ click : ( ) => {
283
+ if ( isFileLoaded ( getGlobalBackendState ( ) ) ) {
284
+ webContents . send ( AllowedFrontendChannels . SearchSignals ) ;
285
+ }
286
+ } ,
287
+ } ,
288
+ {
289
+ icon : getIconBasedOnTheme (
290
+ 'icons/search-white.png' ,
291
+ 'icons/search-black.png' ,
292
+ ) ,
293
+ label : 'Search All Resources' ,
294
+ accelerator : 'CmdOrCtrl+Shift+R' ,
295
+ click : ( ) => {
296
+ if ( isFileLoaded ( getGlobalBackendState ( ) ) ) {
297
+ webContents . send ( AllowedFrontendChannels . SearchResources ) ;
298
+ }
299
+ } ,
300
+ } ,
301
+ {
302
+ icon : getIconBasedOnTheme (
303
+ 'icons/search-white.png' ,
304
+ 'icons/search-black.png' ,
305
+ ) ,
306
+ label : 'Search Linked Resources' ,
307
+ accelerator : 'CmdOrCtrl+Shift+L' ,
308
+ click : ( ) => {
309
+ if ( isFileLoaded ( getGlobalBackendState ( ) ) ) {
310
+ webContents . send ( AllowedFrontendChannels . SearchLinkedResources ) ;
311
+ }
312
+ } ,
313
+ } ,
261
314
] ,
262
315
} ,
263
316
{
@@ -338,31 +391,24 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
338
391
'icons/github-black.png' ,
339
392
) ,
340
393
label : 'Open on GitHub' ,
341
- click : async ( ) : Promise < void > => {
342
- await shell . openExternal (
343
- 'https://github.com/opossum-tool/opossumUI' ,
344
- ) ;
345
- } ,
394
+ click : ( ) =>
395
+ shell . openExternal ( 'https://github.com/opossum-tool/opossumUI' ) ,
346
396
} ,
347
397
{
348
398
icon : getIconBasedOnTheme (
349
399
'icons/notice-white.png' ,
350
400
'icons/notice-black.png' ,
351
401
) ,
352
402
label : 'OpossumUI Notices' ,
353
- click : async ( ) : Promise < void > => {
354
- await shell . openPath ( getPathOfNoticeDocument ( ) ) ;
355
- } ,
403
+ click : ( ) => shell . openPath ( getPathOfNoticeDocument ( ) ) ,
356
404
} ,
357
405
{
358
406
icon : getIconBasedOnTheme (
359
407
'icons/chromium-white.png' ,
360
408
'icons/chromium-black.png' ,
361
409
) ,
362
410
label : 'Chromium Notices' ,
363
- click : async ( ) : Promise < void > => {
364
- await shell . openPath ( getPathOfChromiumNoticeDocument ( ) ) ;
365
- } ,
411
+ click : ( ) => shell . openPath ( getPathOfChromiumNoticeDocument ( ) ) ,
366
412
} ,
367
413
] ,
368
414
} ,
@@ -375,29 +421,26 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
375
421
'icons/user-guide-black.png' ,
376
422
) ,
377
423
label : "User's Guide" ,
378
- click : async ( ) : Promise < void > => {
379
- await shell . openExternal (
424
+ click : ( ) =>
425
+ shell . openExternal (
380
426
'https://github.com/opossum-tool/OpossumUI/blob/main/USER_GUIDE.md' ,
381
- ) ;
382
- } ,
427
+ ) ,
383
428
} ,
384
429
{
385
430
icon : getIconBasedOnTheme (
386
431
'icons/log-white.png' ,
387
432
'icons/log-black.png' ,
388
433
) ,
389
434
label : 'Open log files folder' ,
390
- click : async ( ) : Promise < void > => {
391
- await shell . openPath ( app . getPath ( 'logs' ) ) ;
392
- } ,
435
+ click : ( ) => shell . openPath ( app . getPath ( 'logs' ) ) ,
393
436
} ,
394
437
{
395
438
icon : getIconBasedOnTheme (
396
439
'icons/update-white.png' ,
397
440
'icons/update-black.png' ,
398
441
) ,
399
442
label : 'Check for updates' ,
400
- click ( ) : void {
443
+ click : ( ) => {
401
444
webContents . send ( AllowedFrontendChannels . ShowUpdateAppPopup , {
402
445
showUpdateAppPopup : true ,
403
446
} ) ;
0 commit comments