Username, Debugger off by default

This commit is contained in:
portree_kid 2020-06-23 21:19:12 +02:00
parent 4b1ee70da5
commit c221699b16
5 changed files with 67 additions and 5 deletions

View File

@ -2,6 +2,10 @@
import { app, BrowserWindow } from 'electron' import { app, BrowserWindow } from 'electron'
const { ipcMain } = require('electron')
ipcMain.on('OpenDebugger', (event, arg) => {
mainWindow.webContents.openDevTools()
})
/** /**
* Set `__static` path to static files in production * Set `__static` path to static files in production
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
@ -29,7 +33,6 @@ function createWindow () {
width: 1000 width: 1000
}) })
mainWindow.loadURL(winURL) mainWindow.loadURL(winURL)
mainWindow.webContents.openDevTools()
mainWindow.onerror = function (message, source, lineno, colno, error) { mainWindow.onerror = function (message, source, lineno, colno, error) {
console.error(error) console.error(error)

View File

@ -79,9 +79,17 @@
<el-col :span="7"> <el-col :span="7">
<span class="label">Coordinates :</span> <span class="label">Coordinates :</span>
</el-col> </el-col>
<el-popover
placement="top-start"
title="E-Mail"
width="200"
trigger="hover"
content="D.DDD, DMS, DM supported"
>
<el-col :span="17"> <el-col :span="17">
<el-input placeholder="Please input" v-model="coordinates" :disabled="!editing"></el-input> <el-input placeholder="Please input" v-model="coordinates" :disabled="!editing"></el-input>
</el-col> </el-col>
</el-popover>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="7"> <el-col :span="7">

View File

@ -38,7 +38,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="7" class="label">Test Directory</el-col> <el-col :span="7" class="label">Export Directory</el-col>
<el-col :span="15" class="file-label">{{ test_directory }}</el-col> <el-col :span="15" class="file-label">{{ test_directory }}</el-col>
<el-col :span="2"> <el-col :span="2">
<directory-select @input="testDirectorySelect"></directory-select> <directory-select @input="testDirectorySelect"></directory-select>
@ -53,10 +53,42 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="7" class="label">Author : </el-col> <el-popover
placement="top-start"
title="E-Mail"
width="200"
trigger="hover"
content="Only used as a committer/author for Github. This e-mail is only visible via GIT."
>
<el-col :span="7" class="label">Author E-Mail : </el-col>
<el-col :span="17"> <el-col :span="17">
<el-input placeholder="Please input your email" v-model="email"></el-input> <el-input placeholder="Please input your email" v-model="email"></el-input>
</el-col> </el-col>
</el-popover>
</el-row>
<el-row>
<el-popover
placement="top-start"
title="Goto"
width="200"
trigger="hover"
content="This is saved to the file and is therefore distributed via Terrasync."
>
<el-col :span="7" class="label">Author Name : </el-col>
<el-col :span="17">
<el-input placeholder="Please input your Name" v-model="email"></el-input>
</el-col>
</el-popover>
</el-row>
<el-row>
<el-col :span="7" class="label"></el-col>
<el-col :span="17">
<el-button @click="debug" class="button">
<i class="fas fa-bug"></i> Debugger
</el-button>
</el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
@ -65,6 +97,9 @@
<script lang="js"> <script lang="js">
import FileSelect from './FileSelect' import FileSelect from './FileSelect'
import DirectorySelect from './DirectorySelect' import DirectorySelect from './DirectorySelect'
const { ipcRenderer } = require('electron')
export default { export default {
name: 'settings-panel', name: 'settings-panel',
components: { DirectorySelect, FileSelect }, components: { DirectorySelect, FileSelect },
@ -88,6 +123,9 @@
testDirectorySelect: function (testDirectory) { testDirectorySelect: function (testDirectory) {
console.log(testDirectory) console.log(testDirectory)
this.$store.commit('TEST_DIRECTORY', testDirectory.path) this.$store.commit('TEST_DIRECTORY', testDirectory.path)
},
debug: function () {
ipcRenderer.send('OpenDebugger', 'ping')
} }
}, },
computed: { computed: {
@ -101,6 +139,16 @@
this.$store.commit('SET_EMAIL', newValue) this.$store.commit('SET_EMAIL', newValue)
} }
}, },
name: {
// getter
get: function () {
return this.$store.state.Settings.settings.name
},
// setter
set: function (newValue) {
this.$store.commit('SET_NAME', newValue)
}
},
phi_url: { phi_url: {
// getter // getter
get: function () { get: function () {

View File

@ -77,7 +77,7 @@ exports.writeGroundnetXML = function (fDir, icao, featureList) {
var frequencies = []; var frequencies = [];
var version = new Date().toUTCString() + ' by FlightgearAirports'; var version = new Date().toUTCString() + ' by FlightgearAirports';
var email = store.default.state.Settings.settings.email; var email = store.default.state.Settings.settings.name;
@ -158,7 +158,7 @@ exports.writeGroundnetXML = function (fDir, icao, featureList) {
var unicomList = store.default.state.Frequencies.items.filter(f => f.type === 'UNICOM').map(mapFrequency); var unicomList = store.default.state.Frequencies.items.filter(f => f.type === 'UNICOM').map(mapFrequency);
var xmlObj = { groundnet: { version: version, email: email, var xmlObj = { groundnet: { version: version, name: name,
'frequencies': { APPROACH: approachList, DEPARTURE: departureList, AWOS: awosList, CLEARANCE: clearanceList, GROUND: groundList, TOWER: towerList, UNICOM: unicomList }, 'frequencies': { APPROACH: approachList, DEPARTURE: departureList, AWOS: awosList, CLEARANCE: clearanceList, GROUND: groundList, TOWER: towerList, UNICOM: unicomList },
parkingList: { Parking: parkings }, TaxiNodes: { node: uniqueNodes }, TaxiWaySegments: { arc: arcList } } }; parkingList: { Parking: parkings }, TaxiNodes: { node: uniqueNodes }, TaxiWaySegments: { arc: arcList } } };

View File

@ -33,6 +33,9 @@ const mutations = {
'SET_EMAIL' (state, email) { 'SET_EMAIL' (state, email) {
state.settings.email = email state.settings.email = email
}, },
'SET_NAME' (state, name) {
state.settings.name = name
},
'SET_PHI_URL' (state, phi_url) { 'SET_PHI_URL' (state, phi_url) {
state.settings.phi_url = phi_url state.settings.phi_url = phi_url
}, },