After opening config file saving would be performed to this file (if not 'Save as...')

Readme update
master
Dmitry Isaenko 2019-10-20 00:19:28 +03:00
parent 9ae020f9b1
commit 1eb8b0e346
2 changed files with 10 additions and 4 deletions

View File

@ -6,6 +6,10 @@
LogiLed is a Logitech G513 Carbon GUI driver for adjusting backlight and effects.
![Screenshot 1](https://live.staticflickr.com/65535/48925778631_57bb44c8fc_o.png)
![Screenshot 2](https://live.staticflickr.com/65535/48925778596_ccbe7d9212_o.png)
![Screenshot 3](https://live.staticflickr.com/65535/48925974837_c4a183a0d5_o.png)
#### License
[GNU General Public License v3](https://www.gnu.org/licenses/gpl-3.0.html)

View File

@ -99,19 +99,21 @@ public class MainController implements Initializable {
* For 'Open' button
* */
private void openConfig(){
File congigFile = getOpenFileChooser();
if (congigFile == null)
File configFile = getOpenFileChooser();
if (configFile == null)
return;
else
recentPath = congigFile.getParentFile().getAbsolutePath();
recentPath = configFile.getParentFile().getAbsolutePath();
ObjectMapper mapper = new ObjectMapper();
SettingsFileFormat setup;
try{
setup = mapper.readerFor(SettingsFileFormat.class).readValue(new FileInputStream(congigFile));
setup = mapper.readerFor(SettingsFileFormat.class).readValue(new FileInputStream(configFile));
KeysLedsController.setConfig(setup.getKeyLedRule());
EffectsController.setConfig(setup.getEffectHumanReadable());
GameModeController.setConfig(setup.getGameModeKeyCodes());
openedConfigFile = configFile;
}
catch (IOException e){
ServiceWindow.getErrorNotification(rb.getString("error_any_title"), rb.getString("error_any_body"));