Commit graph

254 commits

Author SHA1 Message Date
brian m. carlson
8b5640fae1
Move utilities to their own directory.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-10-12 18:30:05 +00:00
brian m. carlson
d692439a08
Move exceptions to their own file.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-10-12 18:27:56 +00:00
brian m. carlson
071825a302
Move filemanip into the lib directory.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-10-12 18:15:24 +00:00
brian m. carlson
24964673d0
Load libraries from lib directory.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-10-12 18:11:56 +00:00
brian m. carlson
d583df2b38
Add a README file.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-10-12 17:38:32 +00:00
brian m. carlson
dce0800a7d
filemanip: back up all files with git.
This includes the checksum, lock, version, and schema files.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-09-24 23:34:16 +00:00
brian m. carlson
bae44f4791
Repair records with an odd number of fields.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-09-11 00:18:10 +00:00
brian m. carlson
3629419c76
Add a --validate option.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-09-10 23:46:54 +00:00
brian m. carlson
4dca266c80
Make F5, F6, and F9 work in a MenuView.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-01-16 01:18:43 +00:00
brian m. carlson
df51411b2d
Make F6 and F9 work for Browse All Records.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-01-16 01:14:46 +00:00
brian m. carlson
d3d5ea543e
Add some stub documentation.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-01-16 00:48:36 +00:00
brian m. carlson
ad8ea078c9
Don't add view to list for non-urwid views.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2013-01-10 01:19:17 +00:00
brian m. carlson
c5553e167c Use rerender when handling deleted items.
This fixes a bug that caused an extra F1 for each record that has been deleted.
2012-11-30 01:22:30 +00:00
brian m. carlson
728d59387d Don't re-add views to list on rerender. 2012-11-30 01:13:14 +00:00
brian m. carlson
ad42b1b3fa Use colors with better contrast for deleted items. 2012-11-30 00:59:05 +00:00
brian m. carlson
9cf2ef45db
Fold on indent automatically.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-24 19:26:27 +00:00
brian m. carlson
5d0c7b4e24
Remove unused text formatting function.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 02:09:57 +00:00
brian m. carlson
d71cf8a65d
Have all RecordListViews share rerendering code.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 02:08:28 +00:00
brian m. carlson
c776450e25
Fix crashes on empty record lists.
This fixes two crashes that can occur with empty record lists.  One is when the
remove key is pressed, and the other is if the view is re-rendered.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 01:55:21 +00:00
brian m. carlson
061439d559
Rename function with more sensible name.
Since the remove key now toggles whether the record is deleted, the name of the
function should reflect that.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 01:46:41 +00:00
brian m. carlson
4554c6f8d0
Have the remove key toggle deletion.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 01:44:51 +00:00
brian m. carlson
902937c307
Always rerender the shortcuts and header.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 01:43:09 +00:00
brian m. carlson
52acc7834b
Fix re-rendering of lists of database contents.
This fixes re-rendering of the record list when using Browse Databases; the text
is no longer incorrectly formatted after entering and leaving a record.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 01:22:13 +00:00
brian m. carlson
d106099540
Remove unused function.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 01:14:10 +00:00
brian m. carlson
e7c3860985
Highlight deletions in Browse All Records mode.
This changes existing code to use the _render_records function, which handles
highlighting appropriately.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 01:09:07 +00:00
brian m. carlson
e698a321b6
Remove unused code.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 00:52:15 +00:00
brian m. carlson
05607f38aa
Do not reference nonexistent variables.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-22 00:47:00 +00:00
brian m. carlson
9dd30b900e
Map browse-all to Ctrl-F.
Urwid does not correctly signal the difference between Shift-Ctrl-B and Ctrl-B
(it reports them all as Ctrl-B), so a different key combination must be used.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-17 00:34:12 +00:00
brian m. carlson
7726e34fc0 Merge branch 'master' of hodgp.no-ip.org:~/checkouts/newfol 2012-11-15 02:37:33 +00:00
brian m. carlson
5112698665 Get correct item number for selected record. 2012-11-14 20:09:37 -06:00
brian m. carlson
058c7f9489 Allow multi-line editing in text boxes.
This commit fixes a regression where the Enter key was not inserting a newline
in text boxes.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-11-14 19:04:45 -06:00
brian m. carlson
ff1c3752e9
Rework record deletion code.
We used to attempt to remove deleted records from the listing as soon as we
deleted them.  This caused all sorts of rendering bugs (usually involving not
removing the record from the list) which in turn led to users retrying the
operation, which led to them unintentionally deleting multiple records.

Now the deleted records are marked by a color change and are removed from the
database automatically when it is written to disk.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-10-20 16:24:27 +00:00
brian m. carlson
fd87df193e
Allow setting deleted attribute on records.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-10-20 16:24:02 +00:00
brian m. carlson
da15701dfe
Add a deleted attribute to records.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-10-20 15:30:25 +00:00
brian m. carlson
62efe7f324
Temporarily disable entry deletion.
This is really broken at the moment, to the extent it can delete the wrong item,
so disable it until it's fixed.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-10-20 14:24:34 +00:00
brian m. carlson
e98e218330 Rerender search results like the original rendering.
This fixes a bug where when the user selects a record to view from the search
results and then goes back to the search results, the search result list was
rendered with equal-width columns instead of automatically-adjusted columns.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-09-13 18:37:36 -05:00
brian m. carlson
ee31d08de1
Unify record rendering.
Previously, we had two different code paths for rendering records that were
search results.  This unifies them by converting one representation of selected
items into another representation of selected items and calling one function
that uses the latter.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-08-19 17:25:02 +00:00
brian m. carlson
a08f710d20
Pass the correct argument to get_key_text.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-08-19 16:39:55 +00:00
brian m. carlson
920be23a2c
Fix inverted test.
This commit fixes an inverted test that resulted in up and down being treated
like select or next.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-08-19 01:37:00 +00:00
brian m. carlson
b61178dd94
Fix display of records in editor.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-07-17 00:23:57 +00:00
brian m. carlson
3a7fd076e9 Restore read-only editing of search results.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-07-12 20:11:57 -05:00
brian m. carlson
87f787b973 Default to editor-ro if editor-rw is not available.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-07-12 19:40:34 -05:00
brian m. carlson
4142981bce Merge branch 'master' of git://git.crustytoothpaste.net/bmc/repo/newfol 2012-07-12 19:34:25 -05:00
brian m. carlson
6a64e29369
Add read-write editing in editor.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-07-12 23:47:55 +00:00
brian m. carlson
caaf2e82af
Ignore tags files.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-07-12 22:55:56 +00:00
brian m. carlson
e3ea2eb1dd
Add Ctrl-F6 as tertiary next.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-07-11 00:16:25 +00:00
brian m. carlson
ff54485ba4 Fix off-by-one bug generating an identity mapping.
This is code that wasn't fixed due to the Record change.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-05-03 19:39:05 -05:00
brian m. carlson
03cdc5d974 Merge branch 'master' of hodgp.no-ip.org:~/checkouts/newfol 2012-05-03 03:45:20 +00:00
brian m. carlson
70d157fdda
newfol: refactor RecordListViews.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-04-26 22:54:00 +00:00
brian m. carlson
2ae9d12c0e
Add and use a RecordListView class.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
2012-03-20 23:34:18 +00:00