Exemple #1
0
 public NcaInfoWindowManager(string path, Window window, LoggerWindowManager logger)
 {
     Path   = path;
     Window = window;
     Logger = logger;
     FwInfo = new FirmwareInfo(Path);
     if (FwInfo.SystemVersionNca != null)
     {
         Logger.Log($"Opened Firmware {FwInfo.VersionInfo.VersionString}");
     }
 }
Exemple #2
0
        public static void Init()
        {
            Application.Init();
            DarkScheme = new ColorScheme()
            {
                Normal    = Terminal.Gui.Attribute.Make(Color.Black, Color.Gray),
                Disabled  = Terminal.Gui.Attribute.Make(Color.Black, Color.Gray),
                HotFocus  = Terminal.Gui.Attribute.Make(Color.Black, Color.Gray),
                HotNormal = Terminal.Gui.Attribute.Make(Color.Black, Color.Gray),
            };
            var Top = Application.Top;

            FirmwareWin = new Window("Firmware")
            {
                X           = 0,
                Y           = 1,
                Width       = Dim.Percent(50),
                Height      = Dim.Fill(),
                ColorScheme = DarkScheme,
            };

            InfoWin = new Window("Info")
            {
                X           = Pos.Right(FirmwareWin),
                Y           = 1,
                Width       = Dim.Fill(),
                Height      = Dim.Percent(50),
                ColorScheme = DarkScheme,
            };

            LoggerWin = new Window("Log")
            {
                X           = Pos.Right(FirmwareWin),
                Y           = Pos.Bottom(InfoWin),
                Width       = Dim.Fill(),
                Height      = Dim.Fill(),
                ColorScheme = DarkScheme,
            };

            LoggerWM = new LoggerWindowManager(LoggerWin);

            Menu = new MenuBar(new MenuBarItem [] {
                new MenuBarItem("Tools", new MenuItem [] {
                    new MenuItem("Open New FW", "", OpenNewDir),
                    new MenuItem("Extract All", "", null),
                }),
                new MenuBarItem("Settings", new MenuItem[] {
                    new MenuItem("Clear Log", "", LoggerWM.Clear),
                    new MenuItem("Quit", "", Application.RequestStop),
                })
            })
            {
                ColorScheme = DarkScheme,
            };

            Top.Add(FirmwareWin);
            Top.Add(InfoWin);
            Top.Add(LoggerWin);
            Top.Add(Menu);

            ReloadActiveNcas();

            Application.Run();
        }