83 Commits

Author SHA1 Message Date
James E. Blair
2efa0606f7 Add an option to disable the breadcrumb footer
Change-Id: I4092cd05fca8c808165f27b73e9a5f501bc97405
2016-05-02 10:59:22 -05:00
James E. Blair
e7fcc988d3 Add extra columns to change list if there is room
Use a fixed estimate of the amount of space needed for each column
and then if there is extra space, consider adding the Branch and
Topic columns to the change list.

Change-Id: I90ee7f3e1953468a9e81cc508c2c444e1af50efc
2016-05-02 10:59:22 -05:00
James E. Blair
37ef05652d Use short titles in breadcrumbs
When possible, try to shorten the screen title to the shortest
length possible while still being descriptive enough to help
the user navigate.

Also, make the space for the ellipses available for use for
titles that do not need them.

Change-Id: I82e08ac60451e81c2e5a51f8595fb19234f23859
2016-05-02 10:59:22 -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
Cody A.W. Somerville
b009075467 Add navigation breadcrumb footer
This change adds a navigational breadcrumb trail to the bottom of the interface
to allow the user to easily keep track of their location in Gertty.

Change-Id: I40de19084bf66d095c14ac7a4a901f293b30b9be
2016-05-02 10:59:22 -05:00
Jenkins
3561617b2c Merge "Handle more than one change result when searching" 2016-03-10 16:39:32 +00:00
James E. Blair
3b29386bdc Handle more than one change result when searching
...by change ID.

Change-Id: Ie8fb11bf0a52b13870db5d4f9c407f775b93e939
2016-03-09 09:28:10 -08:00
James E. Blair
7c0220d4e3 Add support for customized dashboard sorting
And suggest 'reversed last seen' as a sort order for the Recently
Seen dashboard.

Change-Id: I99a72b58f4135649167f1230f3847809ad807786
2016-02-10 07:57:02 -08:00
James E. Blair
068e83b9ed Add debug-sync option
This is basically just so a developer can turn down the chatty
sync operations that are normally going on and just see the
minimum interactive sync operations.  It's not something that
should be used normally (reviews may not be uploaded, etc).

Change-Id: I9b891366783a18c2896ac759ed4cb855beff906b
2016-02-10 07:56:59 -08:00
Cody A.W. Somerville
dce1155653 Add missing import of 'six' to app.py
app.py makes reference to six.b without importing module.

Change-Id: I7e89ecc8dddccff35dfd5990d339068ae58f23cf
2016-01-21 22:59:57 -05:00
James E. Blair
c23b0b04f6 Always sync a specfically queried change
If a change is opened by id and already exists locally, perform
a high-priority background sync of the change to make sure it's
up to date.  This should help avoid the problem where a user
returns to a change in an unsubscribed project and it appears out
of date.

If the change doesn't exist locally, it is synced in the foreground
so that case is already covered.

Change-Id: Idb5daa4309b712e39eb7cde56afcb94fdb41f179
2016-01-15 09:12:19 -08: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
9ae126da1e Add option to disable mouse support
Change-Id: Icb075699441774989810671e48106a9de3926b92
2016-01-15 09:12:04 -08:00
James E. Blair
1222a7f927 Add support for external commands
If you run "gertty --open <URL>" it will instruct a running
Gertty to open the change at that URL.

Change-Id: Ie82aa53f497717e7355646d6d6fd12473ececad0
2016-01-15 09:12:01 -08:00
Jay Pipes
74877d2499 Allow gertty to run in Py3K environments
In environments without py27, gertty was unable to run. This patch
addresses all the Py3K issues discovered when getting gertty running in
a py34-only environment.

Change-Id: I32a06f9768bdeaf8e95ddf9a9e54c79059fbaa2f
2016-01-15 09:10:31 -08:00
James E. Blair
dc960b0cda Cache counts of project changes
So that the project list page is more responsive, cache counts of
open and unreviewed changes for projects.

Change-Id: I270f4009d6c7cca9d9868a181db94f779662b643
2016-01-06 14:18:55 -08:00
Jenkins
7a041b0d19 Merge "Match links by url instead of domain." 2015-12-17 22:29:08 +00:00
James E. Blair
540c8dd7cc Support multiple key input
Change-Id: I0cd0884e0e1f4f0fa82f93e5f7438ff00c5a992a
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
Wouter van Kesteren
4d268e5679 Match links by url instead of domain.
Exherbo has a setup where gerrit is at
https://galileo.mailstation.de/gerrit/ and jenkins is at
https://galileo.mailstation.de/jenkins/. gertty falsely thinks that the
jenkins link is a change and when clicked it weirdly starts to sync
random projects for 10 minutes before telling me that the change is not
found. This patch fixes it by matching on the full url.

Change-Id: I4261fce74d6cfaec736e478747592b001d82400d
2015-12-03 15:22:38 +01:00
James E. Blair
b0f595b1c1 Separate search and refine search commands
Being able to refine a search query is useful, but so is being able
to quickly open a specific change from anywhere.  Separate these
commands.  C-o opens a blank search input; M-o opens a search input
pre-filled with th ecurrent query in list view.

Change-Id: I49d0f076354322a2652de515d476548926a99182
2015-11-08 15:28:06 -08:00
Jenkins
0b9380edce Merge "Redisplay after spawning browser" 2015-08-07 15:39:59 +00:00
Jenkins
2cfded253e Merge "Supply a default query on search" 2015-08-07 15:39:44 +00:00
Jeremy Stanley
e89ea6a6a2 Redisplay after spawning browser
After launching a browser child process, gertty's display may no
longer be current (e.g., when using a console-based browser).
Redisplay the screen contents following browser execution as a
prophylactic measure.

Note: you can test this by invoking `BROWSER=lynx gertty` with lynx
installed (but really, can you call it a computer if it doesn't have
lynx installed?!?).

Change-Id: I929e6ec4252b3e4c7c8c425a87cc8be7c0434828
2015-07-17 13:59:41 +00:00
James E. Blair
c69d9e9536 Supply a default query on search
When opening the search dialog from a change list, use the current
query as the default value.  This lets you iterate on a query
without needing to type or copy it repeatedly.  However, it does
mean that you need to clear out the field if you want a completely
different query.

Change-Id: I1f31db1cde0b86c5a7b214866f1df686dd901c7c
2015-07-02 17:25:42 -07:00
James Polley
31af7ed182 Show all held changes in held-changes view
I commented on a review while offline yesterday. When I came online,
someone had provided a -2. Being a more-negative comment than mine, this
held my change, and added a warning in the top-right to tell me I had a
held change.

However, I couldn't *see* the held change in held-changes view, because
it only shows me open changes - and this particular change was abandoned
after the -2.

This change makes held-changes view show all held changes,not just open
held changes.

An alternative here might be to not warn the user about held changes if
they have been abandoned; but that could be confusing if my comment had
been "I think this shouldn't be abandoned because"....

Change-Id: I5165f50af30b51ae29f2639dd5fd4185b02aa1fa
2015-07-02 12:08:43 +10:00
David Stanek
5ecfdd506d Removes the need to pass around the app object
The Database and SearchParser classes didn't really need the app object.
They just needed to use some of its properties. Instead those properties
are just being passed in.

Change-Id: Iabdd0072a8f74e6b9346fe03c15cfa00810e1c4a
2015-06-09 23:50:50 -04:00
David Stanek
0b16cbb8c4 Refactor: move getRepo out of the App object
The getRepo method really doesn't have much to do with the application
object. Since it's really a utiltiy method for dealing with git repos
I've moved it to gertty.gitrepo.

Change-Id: Ic3349430c456ee184bbf57b6e5b7de4f940b4cc1
2015-06-09 23:50:43 -04:00
Jenkins
d5b37413c3 Merge "Be more verbose on non-tagged versions" 2015-05-27 16:01:34 +00:00
James E. Blair
94bfcd13f4 Add ability to review multiple changes at once
Add a process mark to the change list so that multiple changes may
be selected at once for further operations.  Allow multiple changes
to be reviwed at once by selecting them with the process mark and
then pressing the usual review command key.  The categories are
simply taken from the first change in the list for simplicity.
This should be fine most of the time, but if the changes have
different categories available to them, or the user has different
access levels, this may not behave as intended.

Change-Id: I04a790d91b27b270cf1269c7bcb39c12d857ab32
2015-05-27 08:53:22 -07:00
James E. Blair
ad5a6f68c1 Support regexes in search
Implement support for regular expressions in search terms.

Change-Id: I090d23f50b0ce8e61b6257bea9f84a49aaf57553
2015-05-26 15:35:11 -07:00
Jeremy Stanley
80e4d87ddb Be more verbose on non-tagged versions
The release version string from PBR indicates if you're running a
non-tagged commit by adding post (for older PBR releases) or dev
components to the version. Use it for clarity.

Change-Id: Icb39543cf4f0ac69737c1e5d8f8a4a8ef1e7d716
2015-05-04 13:27:56 +00:00
Christoph Gysin
bfeabc58b4 flake8: Fix F821,F841
This commit fixes the following flake8 issues:

F821 undefined name 'name'
F841 local variable 'name' is assigned to but never used

It also silences the false-positives caused by parser.py and
tokenizer.py.

Change-Id: Icdc42f47f5f1f383054d8dfdeed6509fc478637b
2015-04-12 16:36:42 -04: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
dbe0f37b04 Do not clear history when opening a dashboard
A user may want to bring up a dashboard to search for a change
during the process of reviewing one or more changes.  Therefore,
do not assume that the screen history should be cleared when
displaying a dashboard.  This way the user may resume their
previous task.

Change-Id: Iffdd56fedae2b20ebd680c41c3086d7558e1ba0b
2015-04-07 08:39:39 -07:00
James E. Blair
86866f4b32 Support searching by URL
Support copy/pasting a URL into the search box, if it matches the
hostname of the Gerrit server, parse it and extract the change
number and open that change.

Change-Id: I0b74b4783742e909db4a2d8d3317061a67201ee8
2015-04-06 07:45:58 -07:00
James E. Blair
110ee234d0 Add checkout and cherry-pick to change list
Add the checkout and cherry-pick commands directly to the change
list.  This is motivated by a desire to be able to re-base and
create patch series quickly directly from a list of changes.

Change-Id: I22d3014673479db4381daad715b1c4ced3bcf340
2015-04-06 07:45:58 -07: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
a5d049e20b Do not display InsecurePlatformWarning
The current requests module issues InsecurePlatformWarning on what
seems like every request.  Perform duplicate suppresion on all
warning messages.  Additionally, never display this message to the
user because there is almost nothing the user can do about it,
and annoying them is not going to help.  Log the message once.

Also move the InsecureRequestWarning suppression to use the same
new system.  Log it once if ssl verification is disabled.  Display
the warning if it is not disabled.

Change-Id: Icc84596dbc5f0e36a1af5c56215380b0f405613f
2015-03-23 17:31:45 -07:00
James E. Blair
f9bce34e4a Display warnings as a popup
Rather than having them write to stderr uncontrolled, display
warnings (ie, from the python module "warnings") in a popup.

Change-Id: I17f4754d357efbe47943851d7d9aa162d0e61800
2015-03-23 17:31:43 -07:00
James E. Blair
6a812bdb7a Handle change id in simple searches
Accept the full change id in addition to the change number as a
simple search query.  Also be more lenient about leading or trailing
whitespace (which is useful when copy/pasting change ids when
searching).

Change-Id: If8e6186e3487a468ef945408fe46bd8c57875a3b
2015-03-23 17:31:41 -07:00
James E. Blair
9d99e078f1 Display times in local tz
By default, display times using the local timezone.  Add timezone
info to time displays where space permits.  Add an option to restore
the current behavior where times are displayed in UTC.

Change-Id: I6035b6277dc49774537a762b2946c56a3b8dec17
Co-Authored-By: Bradley Jones <jones.bradley@me.com>
2015-03-11 09:42:03 -07:00
James E. Blair
db9b6407b6 Hide webbrowser output
On my terminal, opening a web browser link always produces the output
"GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed"

This is apparently a bug in mozilla:

https://bugzilla.mozilla.org/show_bug.cgi?id=833117

However, the python webbrowser module could mask it by redirecting outputs.
In fact, it does so for some types of browsers, but apparently not xdg-open.
Create a new webbrowser subclass that redirects output and register it as
the appropriate way to use xdg-open so that the message is hidden.

Change-Id: I018673a2773a3bc21d7d7c1facccba91eafe1174
2015-03-10 09:54:06 -07:00
Jay Pipes
823c587a12 Add INFO log level potential with --verbose flag
Simply adds a new -v/--verbose CLI option which configures logging at
the INFO log level. Also changes the debug logging in sync.get() to log
a non-200 HTTP return code, which fixes the Storyboard story 2000084,
where a ValueError was being raised by trying to JSON-decode a non-200
response body.

Change-Id: Ieabc606e0570ddf3d3af67bb926cad79b0e87591
Closes-story: 2000084
2015-02-27 15:01:14 -08:00
James E. Blair
6711e20dc3 Always refresh the screen on pop
When going back a screen, always refresh the screen since something
may have changed while it was not displayed.  Also, refactor the
refresh methods to indicate whether something is of interest so
that if there is more than one refresh triggering event queued, we
still only refresh the screen once (if it is interested).

This should correct the problem where if you review a change and
go back to the change or project listings, the displayed numbers
are incorrect.

Change-Id: I97875831c4bd47f5e38992c38302b47809c785d5
2015-01-07 15:29:52 -08:00
Jenkins
dcf30c93f0 Merge "Nicer exit on CTRL-c" 2014-11-19 23:45:13 +00:00
Jenkins
428ef2d029 Merge "Selectively refresh screen" 2014-11-19 23:37:08 +00:00
Cedric Brandily
c633b39067 Nicer exit on CTRL-c
This change avoids stacktrace print on exit using CTRL-c

Change-Id: I03401625c26d6d2b6301c8d6a60ed4a581741768
2014-11-06 12:17:55 +01:00
James E. Blair
4aec66f5bb Selectively refresh screen
When sync events produce results that modify the local db state,
record those events and have the screen widgets use that info
to decide whether to refresh (if relevant data are updated).

In practice this should mean far fewer screen refreshes (which
require costly db queries and manifest as UI pauses).

Change-Id: Iefca75ef3d727236b8e4d1199fd4301d25822fef
2014-10-31 11:33:50 -07:00
Jan Kundrát
79389c91a6 Unify small vs. capital letters in help output for consistency
Change-Id: Ib9641836a0c43d84916d2a4c512d767769fcf02a
2014-09-26 11:39:42 +02:00