Skip to content

johnperry-math/GtkAdaQuoter

Repository files navigation

GtkAdaQuoter

A "short-term" project to learn some GtkAda, while also obtaining a useful tool in the process. I even ended up contributing quite a bit of material based on this to the Ada Programming wikibook's section on GtkAda.

What it does

  • Reads from a json-formatted file (currently hardcoded to ~/signatures/all_signatures.json).
    • Expects an array of quote objects.
    • For each object, expects a field for quotation, and optional fields for author, source, and speaker.
  • Pops up a window with the quotes arranged in rows, different fields in columns.
  • Allows one to:
    • add a row beneath the currently highlighted row;
    • delete the currently highlighted row;
    • save all the quotes to a file determined by a file chooser dialog.

To do

  • Figure out how to wrap quotation text while editing the text.
  • Improve Unicode character handling with more points, or bring in an external library.

Done!

  • Add a file chooser dialog for opening the file.

  • Add a "quit" button with mnemonic.

  • Add icons to buttons. Figure out why buttons won't display icons.

    • Turns out this is due to a design decision by GTK developers, Who Know Better Than You (TM).
  • Choose better default window dimensions.

  • Decent behavior when the default input file isn't found.

  • Decent behavior when the input file chooser dialog is canceled.

  • Better default column widths. OBE by configuration file

  • Enable a configuration file to remember:

    • column widths;
    • previously-used paths for opening, saving;
      • Decided to rely on usability of GTK's file chooser.
    • window dimensions.
  • Enable a Ctrl-Q shortcut.

  • Enable a Ctrl-W shortcut.

  • Enable drag-and-drop reordering of quotes.

  • Enable Unicode character handling for the characters I use most.

  • Fix button alignment. Figure out why the button bar does not expand to window edges.

    • Turns out this is due to GTK's unintuitive GTK_Attach_Options. I managed to get it to hit the edges (see commented code) but it's not pretty.
  • Fix the bug that arises when tabbing away from an active but un-edited cell.

    • Turns out GTK really wants the GTK_Tree_View to grab focus after setting the focus on a particular cell, and for some reason the Tab button doesn't do this properly.
  • Fix the bug where closing the window raises GTK alarms.

  • When editing is complete, enable automatic navigation to next cell.

  • Wrap quotation text.

See also

The JsonQuoter submodule is used to obtain, manipulate, and store the quotes.

License

Public domain, insofar as this is compatible with the libraries used.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages