Minor changes
This commit is contained in:
parent
2ca72976c9
commit
e42ed846be
|
@ -2,10 +2,8 @@
|
|||
namespace NeoLayoutViewer{
|
||||
class ConfigManager {
|
||||
|
||||
//public Gee.HashMap<string,string> config = new Gee.HashMax<string,string>();
|
||||
//public Gee.HashMap<string,string> config { get; set; default = new Gee.HashMap<string, string>();};
|
||||
public Gee.HashMap<string,string> config;// { get; set; };
|
||||
private Gee.HashMap<string,string> description;// allows to comment config entrys.
|
||||
public Gee.HashMap<string,string> config;
|
||||
private Gee.HashMap<string,string> description;// allow optional commenting config entrys.
|
||||
|
||||
public ConfigManager(string conffile) {
|
||||
this.config = new Gee.HashMap<string, string>();
|
||||
|
@ -28,17 +26,17 @@ namespace NeoLayoutViewer{
|
|||
return config;
|
||||
}
|
||||
|
||||
/*
|
||||
Standardwerte der Einstellungen. Sie werden in eine Konfigurationsdatei geschrieben, falls
|
||||
diese Datei nicht vorhanden ist.
|
||||
*/
|
||||
|
||||
private void addSetting(string name, string val, string? comment){
|
||||
config.set(name, val);
|
||||
if( comment != null )
|
||||
description.set(name, comment);
|
||||
}
|
||||
|
||||
/*
|
||||
Standardwerte der Einstellungen. Sie werden in eine Konfigurationsdatei geschrieben, falls
|
||||
diese Datei nicht vorhanden ist.
|
||||
Standard values. This vaules will be written in the config file if no config file found.
|
||||
*/
|
||||
public void add_defaults(){
|
||||
//config.set("show_shortcut","<Mod4><Super_L>N", "Toggle the visibility of the window.");
|
||||
addSetting("show_shortcut","<Ctrl><Alt>Q", "Toggle the visibility of the window.");
|
||||
|
|
|
@ -16,7 +16,6 @@ namespace NeoLayoutViewer{
|
|||
*/
|
||||
private Gee.List<Keybinding> bindings = new Gee.ArrayList<Keybinding>();
|
||||
private Gee.List<ModifierKeybinding> modifier_bindings = new Gee.ArrayList<ModifierKeybinding>();
|
||||
private Gee.List<ModifierKeybinding> modifier_timeout_store = new Gee.ArrayList<ModifierKeybinding>();
|
||||
/**
|
||||
* locked modifiers used to grab all keys whatever lock key
|
||||
* is pressed.
|
||||
|
@ -272,7 +271,7 @@ namespace NeoLayoutViewer{
|
|||
}
|
||||
|
||||
if(xevent->type == X.EventType.KeyPress) {
|
||||
uint event_mods = xevent.xkey.state;
|
||||
//uint event_mods = xevent.xkey.state;
|
||||
foreach(ModifierKeybinding binding in modifier_bindings) {
|
||||
if(xevent->xkey.keycode == binding.keycode) {
|
||||
//neo_win.external_key_press(binding.ebene,(int)event_mods);
|
||||
|
@ -286,8 +285,7 @@ namespace NeoLayoutViewer{
|
|||
}
|
||||
|
||||
if(xevent->type == X.EventType.KeyRelease) {
|
||||
uint event_mods = xevent.xkey.state;
|
||||
|
||||
//uint event_mods = xevent.xkey.state;
|
||||
foreach(ModifierKeybinding binding in modifier_bindings) {
|
||||
if(xevent->xkey.keycode == binding.keycode) {
|
||||
//neo_win.external_key_release(0,(int)event_mods);
|
||||
|
|
22
main.vala
22
main.vala
|
@ -2,21 +2,25 @@ using X;
|
|||
|
||||
namespace NeoLayoutViewer{
|
||||
|
||||
public NeoWindow neo_win;
|
||||
public AppStatusIcon neo_tray;
|
||||
public KeybindingManager manager;
|
||||
public ConfigManager configm;
|
||||
|
||||
public static int main (string[] args) {
|
||||
string sebene;
|
||||
string slayer;
|
||||
if( args.length<2) {
|
||||
sebene="1";
|
||||
slayer="1";
|
||||
}else{
|
||||
sebene=args[1];
|
||||
slayer=args[1];
|
||||
}
|
||||
|
||||
Gtk.init (ref args);
|
||||
|
||||
var configm = new ConfigManager("neo_layout_viewer.conf");
|
||||
|
||||
var neo_win = new NeoWindow (sebene, configm.getConfig());
|
||||
var neo_tray = new AppStatusIcon(neo_win);
|
||||
var manager = new KeybindingManager(neo_win);
|
||||
configm = new ConfigManager("neo_layout_viewer.conf");
|
||||
neo_win = new NeoWindow (slayer, configm.getConfig());
|
||||
neo_tray = new AppStatusIcon(neo_win);
|
||||
manager = new KeybindingManager(neo_win);
|
||||
|
||||
manager.bind(configm.getConfig().get("show_shortcut"), ()=>{neo_win.toggle();});
|
||||
manager.bind(configm.getConfig().get("move_shortcut"), ()=>{neo_win.numkeypad_move(0);});
|
||||
|
@ -24,7 +28,7 @@ namespace NeoLayoutViewer{
|
|||
//neo_win.show_all ();
|
||||
//neo_win.hide_all();
|
||||
|
||||
//move window (Fehlerquelle: config von configm, nicht neo_win. Derzeit gleiches Objekt.)
|
||||
//move window (Fehlerquelle: config von configm ist im allgemeinen nicht gleich neo_win.config?! Derzeit gleiches Objekt.)
|
||||
|
||||
Gtk.main ();
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ namespace NeoLayoutViewer{
|
|||
|
||||
private void about_clicked() {
|
||||
var about = new AboutDialog();
|
||||
about.set_version("0.21");
|
||||
about.set_version("0.25");
|
||||
about.set_program_name("Neo2.0 Ebenenanzeige");
|
||||
about.set_comments("Erleichtert das Nachschlagen von Tastenkombinationen.\n\n Olaf Schulz\n yggtrash-AT-googlemail.com ");
|
||||
about.set_comments(@"Erleichtert das Nachschlagen von Tastenkombinationen im Neo 2.0-Layout.\n\n Olaf Schulz\n yggtrash-AT-googlemail.com\n\n\nTastenkombinationen:\n Beenden - q\n Ein-/Ausblenden - $(neo_win.config.get("show_shortcut"))\n Bewegen - $(neo_win.config.get("move_shortcut"))\n");
|
||||
about.set_copyright("GPLv3");
|
||||
about.run();
|
||||
about.hide();
|
||||
|
|
Loading…
Reference in New Issue