msaltnet / T.Viewer

Cross Platform Tizen Log Viewer
https://blog.msalt.net/313
MIT License
16 stars 7 forks source link

[Feature] Menu 정리 #36

Closed msaltnet closed 4 years ago

msaltnet commented 4 years ago

Menu에는 어떤 기능들이 들어가야 할까 어떻게 정리해야 할까. 적당히 고민해서 정리하자.

msaltnet commented 4 years ago

템플릿 생성해서 오버라이딩

const { dialog } = require('electron');
const electron = require('electron');

const template = [
    {
        label: 'File',
        submenu: [
            {
                role: 'quit'
            }
        ]
    },
    {
        label: 'Help',
        submenu: [
            {
                label: 'User Guide',
                click () { 
                    electron.shell.openExternal('https://github.com/msaltnet/T.Viewer/wiki/%EC%A3%BC%EC%9A%94-%EA%B8%B0%EB%8A%A5-%EB%B0%8F-%EC%82%AC%EC%9A%A9%EB%B2%95');
                }
            },
            {
                type: 'separator'
            },
            {
                label: 'Source Code',
                click () { 
                    electron.shell.openExternal('https://github.com/msaltnet/T.Viewer');
                }
            },
            {
                label: 'OSS Notice',
                click () { 
                    dialog.showMessageBox({
                        type: "info",
                        title: "OSS Notice",
                        message: "Open Source Sorftware Notice",
                        detail: "\nOSS Notice | T.Viewer\nCopyright (c) 2019, msalt.net Jeong Seongmoon\n\nThis application use Open Source Software (OSS). You can find the source code of these open source project, along with applicable license information, below. We are deeply grateful to these developers for their work and contributions.\n\nAce Editor\n  - https://github.com/ajaxorg/ace\n  - Copyright (c) 2010, Ajax.org B.V.\n  - BSD License\n\nVue\n  - https://github.com/vuejs/vue\n  - Copyright (c) 2013-present, Yuxi (Evan) You\n  - MIT License\n\nVuetify\n  - https://github.com/vuetifyjs/vuetify\n  - Copyright (c) 2016-2020 John Jeremy Leider\n  - MIT License\n\ncore-js\n  - https://github.com/zloirock/core-js\n  - Copyright (c) 2014-2020 Denis Pushkarev\n  - MIT License"
                    });
                }
            },
            {
                label: 'About',
                click () { 
                    dialog.showMessageBox({
                        type: "info",
                        title: "T.Viewer",
                        message: "T.Viewer",
                        detail: "Version: 1.0.0\nDate: 2020. 7. 31"
                    });
                }
            }
        ]
    }
];

module.exports = template;

const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
msaltnet commented 4 years ago

ab73625