1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 20:10:11 +03:00

Reame, Context menu, Blackbox tab fix

This commit is contained in:
Scavanger 2024-04-26 16:25:36 -03:00
parent 2efebecb61
commit 5e66e9e1b0
4 changed files with 40 additions and 13 deletions

View file

@ -20,32 +20,32 @@ everything, the hardware is not working, or you have any other _support_ problem
## Installation
Depending on the target operating system, _INAV Configurator_ is distributed as a _standalone_ application or Chrome App.
_INAV Configurator_ is distributed as a _standalone_ application.
### Windows
1. Visit [release page](https://github.com/iNavFlight/inav-configurator/releases)
2. Download Configurator for Windows platform (win32 or win64 is present)
2. Download Configurator for Windows platform (ia32 or win64 is present)
3. Install
* Extract ZIP archive and run the INAV Configurator app from the unpacked folder
* OR just use the setup program `INAV Configurator.msi`
* OR just use the setup program `INAV-Configurator_win32_arch_x.y.z.msi`, **arch** is your computer architecture (ia32 (32bit) or x64 (64bit)), **x.y.z** is the INAV Configurator version number.
4. Configurator is not signed, so you have to allow Windows to run untrusted applications. There might be a monit for it during the first run
### Linux
1. Visit [release page](https://github.com/iNavFlight/inav-configurator/releases)
2. Download Configurator for Linux platform (linux32 and linux64 are present)
* **.rpm** is the Fedora installation file. Just download and install using `sudo dnf localinstall /path/to/INAV-Configurator_linux64-x.y.z-x86_64.rpm` or open it with a package manager (e.g. via Files)
* **.deb** is the Debian/Ubuntu installation file. Just download and install using `sudo apt install /path/to/INAV-Configurator_linux64_x.y.z.deb` or open it with a package manager (e.g. via the File Manager)
2. Download Configurator for Linux platform (only linux64 is present)
* **.rpm** is the Fedora installation file. Just download and install using `sudo dnf localinstall /path/to/INAV-Configurator_linux_x64-x.y.z.rpm` or open it with a package manager (e.g. via Files)
* **.deb** is the Debian/Ubuntu installation file. Just download and install using `sudo apt install /path/to/INAV-Configurator_linux_x64_x.y.z.deb` or open it with a package manager (e.g. via the File Manager)
* **.zip** is a universal archive. Download and continue with these instructions to install
3. Change to the directory containing the downloaded **zip** file
4. download [this](https://raw.githubusercontent.com/iNavFlight/inav-configurator/master/assets/linux/inav-configurator.desktop) file to the same directory. Its filename should be `inav-configurator.desktop`.
5. Extract **zip** archive
```
unzip INAV-Configurator_linuxNN_x.y.z.tar.gz -d /tmp/
unzip INAV-Configurator_linux_arch_x.y.z.zip -d /tmp/
```
**NN** is the bits of your OS. **x.y.z** is the INAV Configurator version number.
**arch** is your computer architecture (x64, armv7l, ...), **x.y.z** is the INAV Configurator version number.
6. If this is the first time installing INAV Configurator, create a home for its files
```
@ -93,21 +93,27 @@ Options:
See [Electron Forge CLI Documentation](https://www.electronforge.io/cli#options-2) for details
Note: Not all architectures are available for all platforms. For example, ia32 (32bit) support is not available for Linux.
Tested architectures:
- Windows: x64 and ia32
- Linux: x64 and armv7l
- MacOS: x64 and arm64
To build the setup program for windows, you have to install [WiX Toolset V3](https://github.com/wixtoolset/wix3/releases) and add the `bin` folder to you `PATH`, e.g.
```C:\Program Files (x86)\WiX Toolset v3.14\bin```
To build deb and rpm packages for Linux, you have to install the following packages:
- Ubuntu/Debian: `dpkg, fakeroot, rpmbuild, build-essential, libudev-dev`
- Ubuntu/Debian: `dpkg, fakeroot, rpm, build-essential, libudev-dev`
- OpenSuse/Fedora: `dpkg, fakeroot, rpmbuild, systemd-devel, devel-basis (zypper install -t pattern devel_basis), zip`
Example (note the double -- ):
``` npm run make -- --arch="x64" ```
```npm run make -- --arch="x64"```
### Running with debug | Inspector
To be able to open Inspector, set envorinment variable `NODE_ENV` to `develpoment` or set the flag directly when run `npm start`:
```NODE_ENV=development npm start```
```NODE_ENV=development npm start``` or ```$env:NODE_ENV="development" | npm start``` for Windows PowerShell
Or use vscode and start a debug session `Debug Configurator` (Just hit F5!)

View file

@ -1,4 +1,4 @@
const { app, BrowserWindow, ipcMain } = require('electron');
const { app, BrowserWindow, ipcMain, Menu, MenuItem } = require('electron');
const windowStateKeeper = require('electron-window-state');
const path = require('path');
const Store = require('electron-store');
@ -76,6 +76,26 @@ function createWindow() {
},
});
mainWindow.webContents.on('context-menu', (_, props) => {
const menu = new Menu() ;
menu.append(new MenuItem({ label: "Undo", role: "undo", accelerator: 'CmdOrCtrl+Z', visible: props.isEditable }));
menu.append(new MenuItem({ label: "Redo", role: "redo", accelerator: 'CmdOrCtrl+Y', visible: props.isEditable }));
menu.append(new MenuItem({ type: "separator", visible: props.isEditable }));
menu.append(new MenuItem({ label: 'Cut', role: 'cut', accelerator: 'CmdOrCtrl+X', visible: props.isEditable && props.selectionText }));
menu.append(new MenuItem({ label: 'Copy', role: 'copy', accelerator: 'CmdOrCtrl+C', visible: props.selectionText }));
menu.append(new MenuItem({ label: 'Paste', role: 'paste', accelerator: 'CmdOrCtrl+V', visible: props.isEditable }));
menu.append(new MenuItem({ label: "Select all", role: 'selectAll', accelerator: 'CmdOrCtrl+A', visible: props.isEditable}));
menu.items.forEach(item => {
if (item.visible) {
menu.popup();
return;
}
});
});
mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
event.preventDefault();
selectBluetoothCallback = callback;

View file

@ -152,7 +152,6 @@
<div class="legend"></div>
</li>
</ul><bbr />
<a class="require-msc-ready regular-button onboardLoggingRebootMsc" href="#" i18n="cliMscBtn"></a>
</div>
</div>
</div>

View file

@ -1,9 +1,11 @@
'use strict';
const { dialog } = require("@electron/remote");
const path = require('path');
const MSPCodes = require('./../js/msp/MSPCodes');
const MSP = require('./../js/msp');
const mspHelper = require("./../js/msp/MSPHelper");
const { GUI, TABS } = require('./../js/gui');
const FC = require('./../js/fc');
const CONFIGURATOR = require('./../js/data_storage');