예제 #1
0
 def __init__(self, parent, application):
     """Initialize a :class:`SearchDialog` instance."""
     gaupol.BuilderDialog.__init__(self, "search-dialog.ui")
     self.application = application
     self._handle_page_changes = True
     self._match_doc = None
     self._match_page = None
     self._match_row = None
     self._match_span = None
     self.max_history = 10
     self._pattern_entry = None
     self.patterns = []
     self._replacement_entry = None
     self.replacements = []
     self._statuslabel = gaupol.FloatingLabel()
     self._was_next = None
     self._read_history("patterns")
     self._read_history("replacements")
     self._init_dialog(parent)
     self._init_text_view()
     self._init_pattern_combo()
     self._init_replacement_combo()
     self._init_keys()
     self._init_values()
     self._init_signal_handlers()
     self._init_sensitivities()
     self._overlay.add_overlay(self._statuslabel)
     self._overlay.show_all()
     self._statuslabel.set_text(None)
예제 #2
0
 def __init__(self, application):
     """Initialize a :class:`SearchDialog` object."""
     gaupol.BuilderDialog.__init__(self, "search-dialog.ui")
     self._handle_page_changes = True
     self._match_doc = None
     self._match_page = None
     self._match_row = None
     self._match_span = None
     self._pattern_entry = self._pattern_combo.get_child()
     self._replacement_entry = self._replacement_combo.get_child()
     self._statuslabel = gaupol.FloatingLabel()
     self._was_next = None
     self.application = application
     self.patterns = []
     self.replacements = []
     self._read_history("patterns")
     self._read_history("replacements")
     self._init_text_view()
     self._init_pattern_combo()
     self._init_replacement_combo()
     self._init_keys()
     self._init_values()
     self._init_signal_handlers()
     self._init_sensitivities()
     self._overlay.add_overlay(self._statuslabel)
     self._overlay.show_all()
     self._statuslabel.set_text(None)
     self._dialog.set_transient_for(None)
     self._dialog.set_type_hint(Gdk.WindowTypeHint.NORMAL)
     self._dialog.set_default_response(Gtk.ResponseType.CLOSE)
예제 #3
0
    def _init_notebook(self, paned):
        """Initialize the notebook."""
        self.notebook = Gtk.Notebook()
        self.notebook.set_scrollable(True)
        self.notebook.set_show_border(False)
        self.notebook.drag_dest_set(flags=Gtk.DestDefaults.ALL,
                                    targets=None,
                                    actions=Gdk.DragAction.COPY)

        self.notebook.drag_dest_add_uri_targets()
        aeidon.util.connect(self, "notebook", "drag-data-received")
        aeidon.util.connect(self, "notebook", "page-reordered")
        callback = self._on_notebook_switch_page
        self.notebook.connect_after("switch-page", callback)
        orientation = Gtk.Orientation.HORIZONTAL
        self.notebook_separator = Gtk.Separator(orientation=orientation)
        vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        vbox.pack_start(self.notebook_separator,
                        expand=False,
                        fill=False,
                        padding=0)

        overlay = Gtk.Overlay()
        overlay.add(self.notebook)
        self.statuslabel = gaupol.FloatingLabel()
        overlay.add_overlay(self.statuslabel)
        vbox.pack_start(overlay, expand=True, fill=True, padding=0)

        paned.add2(vbox)
예제 #4
0
 def setup_method(self, method):
     self.window = Gtk.Window()
     gaupol.style.load_css(self.window)
     self.window.set_default_size(800, 480)
     self.window.connect("delete-event", Gtk.main_quit)
     self.overlay = Gtk.Overlay()
     self.overlay.add(Gtk.Label())
     self.window.add(self.overlay)
     self.label = gaupol.FloatingLabel()
     self.overlay.add_overlay(self.label)
     self.window.show_all()
예제 #5
0
 def setup_method(self, method):
     # We need an application to load our custom CSS.
     # See Application._init_css.
     self.application = self.new_application()
     self.window = Gtk.Window()
     self.window.set_default_size(800, 480)
     self.window.connect("delete-event", Gtk.main_quit)
     self.overlay = Gtk.Overlay()
     self.overlay.add(Gtk.Label())
     self.window.add(self.overlay)
     self.label = gaupol.FloatingLabel()
     self.overlay.add_overlay(self.label)
     self.window.show_all()