Padraig - looks good to me, tested it all and the behavior is much more consistent. Its really useful to be able to get the text out of the various Detail tabs. Some comments:

In :

     605 +        def __on_textview_focus_in(self, widget, event):
     606 +                char_count = widget.get_buffer().get_char_count()
     607 +                if char_count > 0:
     608 +                        self.w_selectall_menuitem.set_sensitive(True)
     609 +                else:
     610 +                        self.w_selectall_menuitem.set_sensitive(False)
     611 +                bounds = widget.get_buffer().get_selection_bounds()
     612 +                if bounds:
613 + offset1 = bounds[0].get_offset() 614 + offset2 = bounds[1].get_offset() 615 + if abs(offset2 - offset1) == char_count:
     616 +                                
self.w_selectall_menuitem.set_sensitive(False)
     617 +                        self.w_deselect_menuitem.set_sensitive(True)
     618 +                        self.w_copy_menuitem.set_sensitive(True)
     619 +                else:
     620 +                        self.w_deselect_menuitem.set_sensitive(False)

Is this char_count check on offset still valid in multi byte char sets ? Same question for __on_searchentry_focus_in() and 1979

    1971 +        def __enable_disable_entry_selection(self, widget):
    1972 +                char_count = widget.get_text_length()
    1973 +                bounds = widget.get_selection_bounds()
    1974 +                if bounds:
1842 1975                          #enable selection functions
1843 1976                          self.w_cut_menuitem.set_sensitive(True)
1844 1977                          self.w_copy_menuitem.set_sensitive(True)
1845 1978                          self.w_clear_menuitem.set_sensitive(True)
    1979 +                        if char_count == abs(bounds[1] - bounds[0]):
    1980 +                                
self.w_selectall_menuitem.set_sensitive(False)
    1981 +                        else:
    1982 +                                
self.w_selectall_menuitem.set_sensitive(True)
    1983 +                        self.w_deselect_menuitem.set_sensitive(True)


In:

1649 1711          def __on_copy(self, widget):
1650      -                self.w_searchentry_dialog.copy_clipboard()
    1712 +                focus_widget = self.w_main_window.get_focus()
    1713 +                if focus_widget == self.w_searchentry:
    1714 +                        self.w_searchentry.copy_clipboard()
    1715 +                        self.w_paste_menuitem.set_sensitive(True)
    1716 +                else:
    1717 +                        focus_widget.get_buffer().copy_clipboard(
    1718 +                            self.w_main_clipboard)

You should do the same check as you use in __on_select_all() to check if in the else clause you are dealing with a text_view widget explicitly.

JR


Padraig O'Briain wrote:
The webrev, http://cr.opensolaris.org/~padraig/ips-8594-v5/, fixes
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents

This webrev adds standard shortcuts for Cut, Copy and Paste menu items.
The variable w_searchentry_dialog is renamed to w_searchentry as it is a GtkEntry not a dialog. The Copy menu item is available whenever text is selected, even text in pages in notebook.
Paste is available only when there is text in the clipboard.
Select All operates on text entry field and textview fields.

Padraig
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to