Skip to content

Instantly share code, notes, and snippets.

@sergeylukin
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergeylukin/bc2bb4941ee8b3b85791 to your computer and use it in GitHub Desktop.
Save sergeylukin/bc2bb4941ee8b3b85791 to your computer and use it in GitHub Desktop.
Programs browser for DOS 6.22

Browser

browser.exe displays programs found in current directory's subdirectories in an easy to look through interface. Programs meta information (name, description, screenshots references) is stored in browser.yaml file found in programs' directory.

Here is UI prototype:

+----------------------------+-------------------------------------------------+
|                            |                                                 |
|  +----------+ +---------+  |  Property:                                      |
|  |  Recent  | |   All   |  |  Value                                          |
|  +----------+ +---------+  |                                                 |
|                            |  Property:                                      |
|  Prog1                     |  Value                                          |
|  Prog2                     |                                                 |
|                            |  Screenshots:                                   |
|                            |                                                 |
|                            |  +-------------------------------------------+  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  |                                           |  |
|                            |  +-------------------------------------------+  |
|                            |                                                 |
|                            |  < Previous                             Next >  |
|                            |                                                 |
+----------------------------+-------------------------------------------------+

Browser startup flow

  • Build the list of nodes (a valid "node" is a directory with browser.yaml file in YAML format). If there is no browser.yaml file in the node's directory, ignore the node entirely.

  • Read configuration from each node (if configuration is unreadable, paint node's title in Nodes list view in red and display an error message in Node page view when this node is selected)

  • Render UI

Sample directory contents

browser.exe
prog1\
  program1.exe
  browser.yaml
prog2\
  program2.exe
  browser.yaml

Node configuration

Each valid node should contain a browser.yaml in following format:

title: Program 1

description: |
  First paragraph, first line
  First paragraph, second line

  Second paragraph, first line
  Second paragraph, second line

# Path to the program executable file relatively to current file's path
executable: program.exe

screenshots: ["image1.jpg", "image2.jpg"]

UI components

Interface consists of 2 panes - Nodes list and Node page.

Nodes list is active by default. Active pane's border is brighter. Press TAB to switch between panes.

  • ####Nodes list

    Nodes list is a sideblock that consists of:

    • 2 tabs/buttons

      • Recent

        Sorts nodes list by LAST_EXECUTED_TIMESTAMP flag value in descending order and updates the nodes list view.

        LAST_EXECUTED_TIMESTAMP flag is assigned to every node internally and is updated every time a node is executed with current systems's timestamp.

      • All

        Sorts nodes list alphabetically and updates the nodes list view.

    • List of nodes

      Each node can be activated by pressing ENTER while a node is selected (selection is done by pressing Up, Down, PgUp and PgDown keys). When a node is activated, whatever is specified in executable property of browser.yaml configuration file relatively to the node's path should be executed. So if node's absolute path is C:\prog1 and excutable is foo\bar.exe then following should be executed: C:\prog1\foo\bar.exe

  • Node page

    Can be scrolled using Up, Down, PgUp and PgDown keys.

    Lists properties and values fetched from browser.yaml file separated by line break.

    Following properties are special:

    • screenshots

      Contains array of images path relative to node's path. Only one image should be displayed at once.

      Next and Previous buttons should replace images accordingly; If there is no next/previous image, button should be disabled (with grey color or not being displayed at all).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment