inotify: fix logic when processing inotify events

The conditional in process_default() ensures that `event.name` is not
None and is a not a zero-length string but the check was flipped.

Signed-off-by: David Aguilar <davvid@gmail.com>
widgets.main: rework the menu actions

s/menu_(\w+)/$1_action/g and rename `new_repository` to
`new_repository_action` for consistency.

Reorder the File menu and add an icon for "Open Recent" so that
everything lines up.

Signed-off-by: David Aguilar <davvid@gmail.com>
widgets: do not set window modality without a parent

Dialogs with a modality of Qt.WindowModal must always have a parent.
When these are run from the top-level, e.g. via `git cola grep`, then
the parent is `None` and we should not use Qt.WindowModal.

Signed-off-by: David Aguilar <davvid@gmail.com>
qtutils: rename open_dialog() to open_file()

Signed-off-by: David Aguilar <davvid@gmail.com>
core: add an encode wrapper for os.walk()

Signed-off-by: David Aguilar <davvid@gmail.com>
browse: GitTreeWidget does not need `ref` in its constructor

Signed-off-by: David Aguilar <davvid@gmail.com>
qtutils: add reload_icon(), add_icon(), and remove_icon()

Signed-off-by: David Aguilar <davvid@gmail.com>
qtutils: add open_files() function

Add a convenient wrapper around QFileDialog.getOpenFileNames().

Signed-off-by: David Aguilar <davvid@gmail.com>
main: add "Apply Patches" to the file menu

Add a new "Apply Patches" dialog that can be triggered from the file
menu.  This replaces the drag+drop functionality that was originally in
the main interface and moves it into a dedicated dialog.

Closes #215

Suggested-by: Kevin Kofler <Kevin@tigcc.ticalc.org>
Signed-off-by: David Aguilar <davvid@gmail.com>
doc: update v1.9.4 release notes

Signed-off-by: David Aguilar <davvid@gmail.com>
cola: add "git cola am" sub-command

Add a command-line entry point to the "Apply Patches" dialog.

Related-to: #215
Signed-off-by: David Aguilar <davvid@gmail.com>
git-cola: defer module imports so that PyQt4 can be found on Mac OS X

The sys.path setup happens in cola.app so we must defer importing any
other cola modules until after it has been imported.

Closes #221

Reported-by: Alexander Kozienko <a.s.kozienko@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
ssh-askpass-darwin: style fixups

Signed-off-by: David Aguilar <davvid@gmail.com>
ssh-askpass-darwin: redirect osascript errors to /dev/null

Signed-off-by: David Aguilar <davvid@gmail.com>
ssh-askpass-darwin: account for newer versions of Mac OS X

The osascript snippet we use to prompt the user for their password has
different output on Mac OS X 10.9 Mavericks (and possibly others).

The output can start with either:
	"button returned:OK, "
or
	"text returned:<password>".

We were only accounting for the latter form.  Account for the new-style
output with an additional sed expression.

Signed-off-by: David Aguilar <davvid@gmail.com>
widgets.patch: use super() where appropriate

Signed-off-by: David Aguilar <davvid@gmail.com>
xbase: use super() in __init__()

Signed-off-by: David Aguilar <davvid@gmail.com>
widgets.standard: add a DraggableTreeWidget class

The DraggableTreeWidget class allows drag-and-drop reordering of its
items.

Signed-off-by: David Aguilar <davvid@gmail.com>
widgets.patch: use DraggableTreeWidget

Adjust the base class to DraggableTreeWidget so that we can inherit its
ability to drag-and-drop reorder items.

Signed-off-by: David Aguilar <davvid@gmail.com>
git-xbase: use DraggableTreeWidget

Adjust the base class to DraggableTreeWidget so that we can inherit its
ability to drag-and-drop reorder items.

Signed-off-by: David Aguilar <davvid@gmail.com>