Commit Graph

38 Commits

Author SHA1 Message Date
Zuul 5b577fd116 Merge "Fix urwid > 2.4.2 compatibility" 2024-02-27 15:31:59 +00:00
Aleksei Stepanov c9b58583d2 Fix urwid > 2.4.2 compatibility
1. `Columns` widget use FIXED pack method for items
   if they declare sizing as fixed.
2. `Columns` are implicitly declared as FIXED
   if all contents sizes are known or can be calculated without external size information.
3. `Text` is explicitly FIXED and FLOW widget
   (widget knows its size from contents).

Fix: explicit declare that widgets are FLOW-only
Change-Id: Ic0de5957ed47fadf2f0f02b235178eb03ecd1b04
2024-02-26 21:32:47 +01:00
Aleksei Stepanov 9846bcacf3 Drop prehistoric hack for urwid.GridFlow
1. Mentioned PR was merged > 8 years ago.
2. Issue with widget focusing on keypress is invalid:
   arrow keys should point on widgets as it positioned
   (if button at the next row - "right" button is ignored).

Change-Id: I6fecae34576196b63074a4b0db438aab3da3fd65
2024-02-26 11:04:21 +01:00
James E. Blair 0f5079ded3 Make TextButtons have a cursor
All of our selectable widgets should have a cursor; if we use
SelectableIcon instead of a plain Text widget as the basis for
the TextButton, we will have one.

Change-Id: I490c7317a2d43727700066918b0b486d1a9cdc6b
2021-10-08 18:12:51 -07:00
James E. Blair e867dec44b Correctly locate cursor in hypertext widgets
The gertty-specific hypertext widget did not handle cursor positioning,
so selectable text did not behave like buttons.  This is an inconsistent
UI and causes problems for screen readers.

Change-Id: Iede3f663775fc169a757751acc1fe752dc00f544
2021-10-01 09:26:22 -07:00
Clint Byrum 559f6152c6 Fix crash on python3
Python3 does not allow comparing int's to None directly.

Change-Id: Id9e889284096e407d59c3938ecd07427ba42e350
2018-11-25 10:09:33 -08:00
James E. Blair 1f25c9b450 Make change list searchable
Change-Id: I5edc1a9082dc81dfd06dc00f42abf05f0b03dc26
2016-05-02 11:01:42 -05:00
Cody A.W. Somerville c7ed7ab38a Make 'title' attribute available on dialog widgets
Gertty uses WidgetWraps around the LineBox widget for popup widgets. Add
LineBoxTitlePropertyMixin which adds property and setter for title attribute,
accessing the underlying title_widget on the wrapped LineBox widget.

We use the popup method in the controller to display these dialogs. It uses an
Overlay widget to display our dialog widget on top of the current view. If the
widget to be displayed by the Overlay widget has title attribute, copy it to
the Overlay widget.

Change-Id: I4c6ecbc7ed87867cd67cd93c1125384dd5d4b9af
2016-05-02 10:59:22 -05:00
James E. Blair 5232cbd805 Display a message when interactively syncing
When a foreground sync is happening (because of a search for
a specific change number, including via "gertty --open") display
a message telling the user what's going on.

Change-Id: I4c12c73ec92cba8a8b3f3d69f036d1442323787e
2016-01-15 09:12:12 -08:00
James E. Blair cfa725cf1e Add project topics
Adds project topics so that projects may be grouped together.

Change-Id: I0216d802ccc0586ffce0182c2c8806d5df54cc2f
2016-01-06 14:18:55 -08:00
Matthias Runge 9b931602a6 Fix list index out of range
When clicking with the mouse in rows without links, gertty
crashes.

Change-Id: I0005d76a6804cbdd2d366c6e07f15c1316cfed90
2015-12-21 18:02:48 +00:00
James E. Blair 6f9e0ceb2f Add help entries for kill, yank, isearch
Change-Id: I13c074a5f67ff9ce3ef5c6819b72507ceadcfd4c
2015-12-04 13:08:05 -08:00
James E. Blair eae2e60084 Add navigation to interactive search
Change-Id: I04de45c7b4c73d1c927d442784614adea7a16381
2015-12-04 13:08:05 -08:00
James E. Blair 0d0f0f6dcd Add interactive search to diff view
Add a simple interactive search to the diff view.  This is bound
to C-s by default.  It highlights text, but does not yet navigate.

Change-Id: Ic795bb5d18911590237b6595f812e10fd4baa1ce
2015-12-04 13:08:05 -08:00
James E. Blair c8d81b7693 Add a simple kill ring
Create a global app kill ring and a custom edit widget that can
kill and yank from it.  Also, add Emacs beginning/end of line
keys to the default keymap.

Change-Id: I18d8d47694c89ede4dcec7eaf5d3fb2210ef4438
2015-12-04 13:08:00 -08:00
Jeremy Stanley 4cc4eae367 Make ButtonDialog scrollable
When there are more rows than will fit in a ButtonDialog Linebox,
having them wrapped within a ListBox makes it possible to scroll
through them rather than merely displaying the last lines.

Change-Id: Id38fb999e2eceda03bc15d0928765acb936dd8c8
2015-05-16 15:40:32 +00:00
James E. Blair cdd6bd2399 Add a key to return to the project list
To facilitate escaping from a deep stack of screens, add a key
to clear the history and return to the main project list.  Bind
this to meta-home by default.

Change-Id: Ic98e47d7a3a17271bf21230ec4bac184f691ced3
2015-04-08 15:35:51 -04:00
James E. Blair 35f5af52e7 Add held changes
This feature detects when Gertty is about to upload a review with
a positive vote after someone else has left a negative vote while
Gertty was offline.  This prevents a situation where it appears
a user is ignoring negative feedback from others.  The local user
is alerted and has the option to re-evaluate their review before
proceeding.

Change-Id: I838acaae6d12a2f8557bfd5a16837784c97c031a
2015-04-06 07:45:58 -07:00
James E. Blair b4043c176b Add support for editing commit message
Change-Id: Ice60e8ba0a08864ce2025af85ab1152aae9d88f8
2014-08-31 15:40:40 -07:00
James E. Blair 6815021f3f Add a configurable keymap
Multiple keymaps may be added in either Gertty itself or in config
files, individual keys may be overriden in the standard map, and
the map can be selected via config file or command line option
just as palettes are.

Change the help text to be dynamically generated based on the
current keymap.

Change-Id: I5f8e63897fab3aa14493465256b5d4516cf47dcd
2014-08-29 15:43:25 -07:00
James E. Blair f4118833af Add test results to top of change view
Add an option to commentlinks to indicate they are test results
and use that to collect results and display them at the top of the
change view.  The value of 'test-results' is used as the job key
when creating the table (so that only the most recent result for
a given job run on the latest patchset is included).  This is
particularly effective along with the hide-comment system to hide
the results from the comment stream.

Change-Id: I54a787914aab18ad2a2a5ca4cc79dd66add2c588
2014-08-23 10:58:16 -07:00
James E. Blair 3d93f7a13a Make the commit message box hypertext
So that commentlinks run on it.

Change-Id: Iab75f35807a6978ddad6f2c0b485f9aa953fec6d
2014-08-18 15:38:14 -07:00
James E. Blair e6102553ea Add a command to return to the change list
When viewing a change, map the key 'u' to return to the most recent
list of changes.  Normally this is the same as ESC, however, if
the user has followed a series of dependent changes, this will
pop the stack all the way back to the the list of changes to review.

Change-Id: I49f4f41f4b476e25f1bb83e92601597024c8c659
2014-08-01 15:49:30 -07:00
James E. Blair cff0b0cc9a Fix crash on mouse click in change view
The name of the initial focus method in the hypertext widget
changed from focusItemLeft to focusFirstItem.  This would cause
a crash if the mouse was clicked in the change screen when an
item in the hypertext widget was not already focused.

Change-Id: I046115f43bdd41640ebdaf45198ff3ae4770bb97
2014-07-14 22:19:03 -07:00
James E. Blair 37cfa0b9bb Make the open change dialog a search
The "Open change" dialog now supports the full search syntax (which
is still just a placeholder).  It is also slightly more robust
about dealing with non-local changes when offline.  The same checks
are now applied to inter-change links.

Change-Id: I3edf6dd66dc95b60eb7507ece813376f08815f80
2014-07-12 20:23:50 -07:00
Jenkins 20dab2fb74 Merge "Add ctrl-o to help dialog" 2014-06-16 17:42:56 +00:00
Mark McLoughlin 48f8165e37 Add ctrl-o to help dialog
Change-Id: Iebbe1f6d033651412b4138cd48e7eba6e15ba316
2014-06-04 12:04:44 +01:00
James E. Blair cb884d8598 Add patchset selection in diff
Change-Id: Ibd544e9619e5c495fe57b4c49eacd585df48f2cf
2014-05-30 08:44:22 -07:00
James E. Blair 349c5b2a62 Correct a problem with tables at very small widths
Gertty would crash if the screen was narrower than the widest column
in a table.  This corrects that.

Change-Id: Ie0a2c6fae16c7c484edb6724fa5dd5f79065e94f
2014-05-30 08:44:22 -07:00
James E. Blair 844634b2f6 Add hyperlinks
Add a 'link' commentlink substitution type that is a hyperlink
which will open the link in the user's web browser.  A built-in
configuration will apply this automaticlly to most http(s)?://
links (using a very simple and not entirely correct regex).

My current commentlink section in my config is as follows:

  commentlinks:
    - match: "^- (?P<job>.*?) (?P<url>.*?) : (?P<result>.*?) (?P<rest>.*)$"
      replacements:
        - link:
            text: "{job:<42}"
            url: "{url}"
        - text:
            color: "test-{result}"
            text: "{result} "
        - text: "{rest}"

In order to support the Zuul commentlink syntax.

Change-Id: Ifceee547c116fdcc15b50a2f73a0ddfe2e98af84
2014-05-30 08:44:22 -07:00
James E. Blair 3252d29400 Add jump to change
Add a dialog that prompts for a change number and syncs that change
if needed then immediately opens the change.

Change-Id: Ic2d4f41ad9bd944c2540e8d71bdd3e730bb96117
2014-05-27 09:09:40 -07:00
Matthew Oliver ea56380187 Add '?' as another way show help dialog
Gertty maps the <F1> key to show the help dialog. In gnome-terminal
<F1> maps to the terminals help, capturing the <F1> before it
gets to gertty.

This change adds an additional help key <?> which will also display
the help dialog.

Change-Id: I97396c517f21774f0f5c94645169c83b76af2157
2014-05-08 11:42:09 +10:00
James E. Blair d3db343b39 Let yes/no dialog accept 'y' or 'n' as input
Change-Id: I6680e13c55568f42e07f62eeb496bc7d23a322f7
2014-05-05 13:46:55 -07:00
James E. Blair 9de2c568df Add colors and adjust alignment to revision file table
Change-Id: I986bb04b31f1b7370bb561d520bfb39900409642
2014-05-05 13:46:54 -07:00
James E. Blair 1b9094ab7d Fix comment handling when exiting diff view
Make sure that the revision row is updated with the current comment
count when after leaving the diff view.  Also, don't include draft
comments in the comment count (they are displayed separately).

When exiting the diff view with the esc key while inside of a comment
box, be sure to save that comment before leaving.

Change-Id: I16fe96dc37101d97317b19fdcc38be6729bed551
2014-05-05 13:46:54 -07:00
James E. Blair 29e947f8d6 Standardize on 'focused' in text attrs
Rather than 'selected' or 'reversed' which includes an assumption
about exactly how the text will be displayed.

Change-Id: I91606492494b2f7f7d5028be9e2e8782bb55c5a5
2014-05-05 13:46:54 -07:00
James E. Blair 68c51ffdb7 Add a Quit dialog
Remove the contextlib pipe close feature -- file descriptors are
closed on program exit anyway.  Letting that happen normally
actually makes exiting with CTRL-C nicer (fewer race conditions).

Map "CTRL-Q" to the quit command, but pop up a yes/no dialog.

Refactor the MessageDialog into a ButtonDialog base class that
can serve MessageDialog and YesNoDialog.

Add global help text that is prepended to each screen's help text
to deal with the growing number of global commands.

Change-Id: I455344cb20fb19032a3964d602fc886e19f256e5
2014-05-02 19:43:07 -07:00
James E. Blair 1d6b0fd881 Initial commit
Change-Id: Ie79f257c46a2c50abdd7ce63bfeceaad976ca878
2014-04-29 16:28:49 -07:00