Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add form for a basic QSO information #1

Open
seporaitis opened this issue Dec 21, 2018 · 0 comments
Open

Add form for a basic QSO information #1

seporaitis opened this issue Dec 21, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@seporaitis
Copy link
Owner

A form should take in:

  • timestamp (date + time)
  • mode
  • band
  • callsign
  • rst sent
  • rst rcvd
@seporaitis seporaitis self-assigned this Dec 21, 2018
@seporaitis seporaitis added the enhancement New feature or request label Dec 21, 2018
seporaitis added a commit that referenced this issue Dec 21, 2018
Part of #1 

After investigating Newt as an option for terminal UI, decided not to go with it:

* it severely lacks documentation - the only documentation I could find was [this](http://delphi.pd.infn.it/~saccarol/tutorial.html) and it is very lacking. One other option was to look at the examples of php or python bindings and translate them back to C, which is a bit backwards.
* Newt has some limitations around window handling - e.g. windows are modal and only one can be active at one time - which makes it great for a sequence of form windows (e.g. installer, configuration), but not so great for interfaces where you need multiple different forms tiled around the screen.

Ncurses is much more low level than Newt and even if there is CDK that could provide pre-made widgets - it lacks documentation as well. Anyhow, Ncurses itself is established enough and has various documentation bits and tutorials and videos on youtube about its usage that in the end it should be enough to be able to squeeze what I want from it.* Switch back to ncurses.

* Add editorconfig

* add newline to gitignore
seporaitis added a commit that referenced this issue Dec 21, 2018
Part of #1 

This change adds an absolute basic QSO form based on ncurses. It does nothing but print the inputs as text above the form when ENTER key is pressed.
seporaitis added a commit that referenced this issue Dec 21, 2018
Part of #1 

This adds `nodelay(stdscr, TRUE)` which makes `getch` non-blocking. This is useful in the context of showing accurate time information in the qsoform.
seporaitis added a commit that referenced this issue Dec 21, 2018
Part of #1 

This is just a proof-of-concept bold labels above input fields:

![screenshot from 2018-12-21 21-51-37](https://user-images.githubusercontent.com/141768/50365041-a2f2bc80-056a-11e9-8958-7d3210bbc0f9.png)

The code is intentionally **not** the nicest, but until I have a fully functional UI, I don't think I'll be refactoring it significantly.
seporaitis added a commit that referenced this issue Dec 21, 2018
Part of #1 

This moves QSO form inputs (but not the labels, 😭 ) to an ncurses _form window_, which simplifies the field location handling as the top-left corner is based on a subwindow instead of screen.
seporaitis added a commit that referenced this issue Dec 21, 2018
Part of #1 

This moves qso form labels "closer to" qsoform initialization making the `main` a _tiny_ bit cleaner.
seporaitis added a commit that referenced this issue Dec 23, 2018
Part of #1 

This adds some structure to the qso form code and introduces some potential code style rules:
- things on screen will be called _components_
- components will live in their own files
- structures, enums will be named using lower camel case (e.g. `qsoFormComponent`)
- main structure holding the state of the component will be named accordingly (`fooBarComponent`)
- all components should have at least
  - `newFooBarComponent` that allocates memory for the component
  - `initFooBarComponent` that initializes the component
  - `freeFooBarComponent` that denitializes and frees up the memory held by component
- additional functions for component
  - `refreshFooBarComponent` - called just before the ncurses refresh/update.
  - `processFooBarComponentInput` - process input.
seporaitis added a commit that referenced this issue Dec 23, 2018
Part of #1 

Following up on #15 convert qso list code into a separate component.

This leaves only handling of new qso submission in `main` - it requires interaction between `qsoFormComponent` and `qsoListComponent`. I do not yet have a solution to this problem, so leaving it there, but it should be solved soon.
seporaitis added a commit that referenced this issue Dec 24, 2018
## Description

Part of #1 

Make the QSO list and form utilize the full height of the terminal instead of using just top 25 lines.

## Motivation and Context

There are no other features implemented yet that would need the space so this just makes the app look more serious.

## How Has This Been Tested?

Ran `src/lhl` and filled in qso list with random data and verified nothing goes out of bounds.

## Screenshots (if appropriate):

![screenshot from 2018-12-24 13-08-03](https://user-images.githubusercontent.com/141768/50400329-d194b100-077d-11e9-997f-c8255fba9571.png)

## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
  - [ ] I have updated the documentation accordingly.
- [ ] I have updated **HISTORY** document.
  - [ ] I have referenced pull request and/or issue next to the change.
- [ ] I have read the **CONTRIBUTING** document.
- [x] All new and existing tests passed.
  - [ ] I have added tests to cover my changes.
seporaitis added a commit that referenced this issue Dec 26, 2018
## Description
Part of #1. Allow scroll up and down of the qso list.

## Motivation and Context
This is required to have more than a couple of tens of qsos and be able to scroll back and forth with them.

## How Has This Been Tested?
Added about 60 qsos and scrolled up and down.

## Screenshots (if appropriate):

[![asciicast](https://asciinema.org/a/NwWvPW9EqyVqiv72D7WcLdoFY.svg)](https://asciinema.org/a/NwWvPW9EqyVqiv72D7WcLdoFY)

## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
  - [ ] I have updated the documentation accordingly.
- [ ] I have updated **HISTORY** document.
  - [ ] I have referenced pull request and/or issue next to the change.
- [x] I have read the **CONTRIBUTING** document.
- [x] All new and existing tests passed.
  - [ ] I have added tests to cover my changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant