# Path: meld/misc.py
#     def select(rlist, wlist, xlist, timeout):
# def shelljoin( command ):
#     def quote(s):
# def run_dialog( text, parent=None, messagetype=gtk.MESSAGE_WARNING, buttonstype=gtk.BUTTONS_OK, extrabuttons=()):
# def open_uri(uri, timestamp=0):
# def position_menu_under_widget(menu, widget):
# def make_tool_button_widget(label):
# def gdk_to_cairo_color(color):
# def all_equal(alist):
# def shorten_names(*names):
#             def firstpart(alist):
# def read_pipe_iter(command, errorstream, yield_interval=0.1, workdir=None):
#         def __init__(self):
#         def __del__(self):
#         def __call__(self):
# def write_pipe(command, text, error=None):
# def commonprefix(dirs):
# def copy2(src, dst):
# def copytree(src, dst):
# def shell_escape(glob_pat):
# def shell_to_regex(pat):
#     class sentinel(object):
# 
# Path: meld/paths.py
# def locale_dir(*args): # i18n files
# def help_dir(*args): # help
# def share_dir(*args):
# def ui_dir(*args):
# def icon_dir(*args):


import os
import textwrap
import gtk
import pango
from gettext import gettext as _
from meld import misc
from meld import paths
from . import gnomeglade
            margin)
        self.textview.set_show_right_margin(
            self.parent.prefs.vc_show_commit_margin)

        self.previousentry.set_active(-1)
        self.textview.grab_focus()
        response = self.widget.run()
        if response == gtk.RESPONSE_OK:
            buf = self.textview.get_buffer()
            msg = buf.get_text(*buf.get_bounds(), include_hidden_chars=False)
            if self.parent.prefs.vc_break_commit_message:
                paragraphs = msg.split("\n\n")
                msg = "\n\n".join(textwrap.fill(p, margin) for p in paragraphs)
            self.parent._command_on_selected(
                self.parent.vc.commit_command(msg))
            if msg.strip():
                self.previousentry.prepend_history(msg)
        self.widget.destroy()

    def on_previousentry_activate(self, gentry):
        idx = gentry.get_active()
        if idx != -1:
            model = gentry.get_model()
            buf = self.textview.get_buffer()
            buf.set_text(model[idx][1])


class PushDialog(gnomeglade.Component):

    def __init__(self, parent):

# Path: meld/misc.py
#     def select(rlist, wlist, xlist, timeout):
# def shelljoin( command ):
#     def quote(s):
# def run_dialog( text, parent=None, messagetype=gtk.MESSAGE_WARNING, buttonstype=gtk.BUTTONS_OK, extrabuttons=()):
# def open_uri(uri, timestamp=0):
# def position_menu_under_widget(menu, widget):
# def make_tool_button_widget(label):
# def gdk_to_cairo_color(color):
# def all_equal(alist):
# def shorten_names(*names):
#             def firstpart(alist):
# def read_pipe_iter(command, errorstream, yield_interval=0.1, workdir=None):
#         def __init__(self):
#         def __del__(self):
#         def __call__(self):
# def write_pipe(command, text, error=None):
# def commonprefix(dirs):
# def copy2(src, dst):
# def copytree(src, dst):
# def shell_escape(glob_pat):
# def shell_to_regex(pat):
#     class sentinel(object):
# 
# Path: meld/paths.py
# def locale_dir(*args): # i18n files
# def help_dir(*args): # help
# def share_dir(*args):
# def ui_dir(*args):
# def icon_dir(*args):


# Path: meld/ui/vcdialogs.py
import os
import textwrap
import gtk
import pango
from gettext import gettext as _
from meld import misc
from meld import paths
from . import gnomeglade

            margin)
        self.textview.set_show_right_margin(
            self.parent.prefs.vc_show_commit_margin)

        self.previousentry.set_active(-1)
        self.textview.grab_focus()
        response = self.widget.run()
        if response == gtk.RESPONSE_OK:
            buf = self.textview.get_buffer()
            msg = buf.get_text(*buf.get_bounds(), include_hidden_chars=False)
            if self.parent.prefs.vc_break_commit_message:
                paragraphs = msg.split("\n\n")
                msg = "\n\n".join(textwrap.fill(p, margin) for p in paragraphs)
            self.parent._command_on_selected(
                self.parent.vc.commit_command(msg))
            if msg.strip():
                self.previousentry.prepend_history(msg)
        self.widget.destroy()

    def on_previousentry_activate(self, gentry):
        idx = gentry.get_active()
        if idx != -1:
            model = gentry.get_model()
            buf = self.textview.get_buffer()
            buf.set_text(model[idx][1])


class PushDialog(gnomeglade.Component):

    def __init__(self, parent):

        gnomeglade.Component.__init__(self, paths.ui_dir("vcview.ui"),