Use add instead of add_with_viewport

The add method adds a viewport where necessary when adding a
child to a scrolled window.  The add_with_viewport method is
deprecated.
This commit is contained in:
Nick Hall 2015-05-22 17:48:33 +01:00
parent dd68fbf75d
commit cd1a6ba45a
34 changed files with 37 additions and 37 deletions

View File

@ -1371,7 +1371,7 @@ class ClipboardWindow(ManagedWindow):
mtv = MultiTreeView(self.dbstate, self.uistate, _("Clipboard"))
scrolledwindow = self.top.get_object('scrolledwindow86')
scrolledwindow.remove(objectlist)
scrolledwindow.add_with_viewport(mtv)
scrolledwindow.add(mtv)
self.object_list = ClipboardListView(self.dbstate, mtv)
self.object_list.get_selection().connect('changed',
self.set_clear_btn_sensitivity)

View File

@ -110,7 +110,7 @@ class EditTagList(ManagedWindow):
self.namemodel = ListModel(view, columns)
slist = Gtk.ScrolledWindow()
slist.add_with_viewport(view)
slist.add(view)
slist.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
top.vbox.pack_start(slist, 1, 1, 5)

View File

@ -612,7 +612,7 @@ class EditRule(ManagedWindow):
# put the grid into a scrollable area:
scrolled_win = Gtk.ScrolledWindow()
scrolled_win.add_with_viewport(grid)
scrolled_win.add(grid)
scrolled_win.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
scrolled_win.show()
self.notebook.append_page(scrolled_win, Gtk.Label(label=class_obj.name))

View File

@ -127,7 +127,7 @@ class ErrorView(object):
scroll.set_size_request(-1, 60)
tb_frame.add(scroll)
scroll.add_with_viewport(tb_label)
scroll.add(tb_label)
tb_expander = Gtk.Expander(label='<span weight="bold">%s</span>' % _("Error Detail"))
tb_expander.set_use_markup(True)

View File

@ -178,7 +178,7 @@ class ProgressMeter(object):
text.set_border_width(6)
text.set_editable(False)
self.message_area = text
area.add_with_viewport(text)
area.add(text)
area.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
self.__dialog.vbox.add(area)
self.message_area_ok = Gtk.Button.new_with_mnemonic(_('_OK'))

View File

@ -221,7 +221,7 @@ class Bookmarks :
self.namemodel_cols = len(name_titles)
slist = Gtk.ScrolledWindow()
slist.add_with_viewport(self.namelist)
slist.add(self.namelist)
slist.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
box.pack_start(slist, 1, 1, 5)
bbox = Gtk.ButtonBox(orientation=Gtk.Orientation.VERTICAL)

View File

@ -399,7 +399,7 @@ class OrganizeTagsDialog(object):
self.namemodel = ListModel(self.namelist, name_titles)
slist = Gtk.ScrolledWindow()
slist.add_with_viewport(self.namelist)
slist.add(self.namelist)
slist.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
box.pack_start(slist, 1, 1, 5)
bbox = Gtk.ButtonBox(orientation=Gtk.Orientation.VERTICAL)

View File

@ -995,7 +995,7 @@ class GrampletPane(Gtk.ScrolledWindow):
self.eventb = Gtk.EventBox()
self.hbox = Gtk.Box(homogeneous=True)
self.eventb.add(self.hbox)
self.add_with_viewport(self.eventb)
self.add(self.eventb)
self.set_kinetic_scrolling(True)
self.set_capture_button_press(True)
# Set up drag and drop

View File

@ -80,7 +80,7 @@ class AgeOnDateGramplet(Gramplet):
vbox.pack_start(hbox, False, True, 0)
vbox.pack_start(button, False, True, 0)
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(vbox)
self.gui.get_container_widget().add(vbox)
vbox.show_all()
def post_init(self):

View File

@ -49,7 +49,7 @@ class Ancestor(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
self.gui.WIDGET.show()
def build_gui(self):

View File

@ -43,7 +43,7 @@ class CalendarGramplet(Gramplet):
self.gui.get_container_widget().remove(self.gui.textview)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
vbox.pack_start(self.gui.calendar, False, False, 0)
self.gui.get_container_widget().add_with_viewport(vbox)
self.gui.get_container_widget().add(vbox)
vbox.show_all()
#self.gui.calendar.show()

View File

@ -55,7 +55,7 @@ class Descendant(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
self.gui.WIDGET.show()
def build_gui(self):

View File

@ -60,7 +60,7 @@ class PythonEvaluation(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
def build_gui(self):
"""
@ -97,7 +97,7 @@ class PythonEvaluation(Gramplet):
swin = Gtk.ScrolledWindow()
swin.set_shadow_type(Gtk.ShadowType.IN)
tview = Gtk.TextView()
swin.add_with_viewport(tview)
swin.add(tview)
self.top.pack_start(swin, True, True, 6)
return tview.get_buffer()

View File

@ -70,7 +70,7 @@ class FanChartDescGramplet(FanChartDescGrampsGUI, Gramplet):
self.set_fan(FanChartDescWidget(self.dbstate, self.uistate, self.on_popup))
# Replace the standard textview with the fan chart widget:
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.fan)
self.gui.get_container_widget().add(self.fan)
# Make sure it is visible:
self.fan.show()

View File

@ -75,7 +75,7 @@ class FanChartGramplet(FanChartGrampsGUI, Gramplet):
self.set_fan(FanChartWidget(self.dbstate, self.uistate, self.on_popup))
# Replace the standard textview with the fan chart widget:
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.fan)
self.gui.get_container_widget().add(self.fan)
# Make sure it is visible:
self.fan.show()

View File

@ -47,7 +47,7 @@ class Filter(Gramplet):
self.__filter_clicked)
self.widget = self.filter.get_widget()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.widget)
self.gui.get_container_widget().add(self.widget)
self.widget.show_all()
def __filter_clicked(self):

View File

@ -30,7 +30,7 @@ class Gallery(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
def build_gui(self):
"""

View File

@ -63,7 +63,7 @@ class Leak(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
flags = gc.DEBUG_UNCOLLECTABLE|gc.DEBUG_SAVEALL
if hasattr(gc, "DEBUG_OBJECTS"):
@ -86,7 +86,7 @@ class Leak(Gramplet):
self.list = Gtk.TreeView()
self.list.set_headers_visible(True)
self.list.connect('button-press-event', self._button_press)
self.scroll.add_with_viewport(self.list)
self.scroll.add(self.list)
#make a model
self.modeldata = []
self.model = Gtk.ListStore(int, str)

View File

@ -29,7 +29,7 @@ class MediaPreview(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
def build_gui(self):
"""

View File

@ -31,7 +31,7 @@ class MetadataViewer(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
self.gui.WIDGET.show()
self.connect_signal('Media', self.update)

View File

@ -33,7 +33,7 @@ class Notes(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
self.gui.WIDGET.show()
def build_gui(self):

View File

@ -37,7 +37,7 @@ class PersonDetails(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
self.uistate.connect('nameformat-changed', self.update)
def build_gui(self):

View File

@ -34,7 +34,7 @@ class PlaceDetails(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
def build_gui(self):
"""

View File

@ -31,7 +31,7 @@ class RepositoryDetails(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
def build_gui(self):
"""

View File

@ -52,7 +52,7 @@ class SoundGen(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
def build_gui(self):
"""

View File

@ -33,7 +33,7 @@ class ToDo(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
self.gui.WIDGET.show()
def build_gui(self):

View File

@ -36,7 +36,7 @@ class ToDoGramplet(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
self.gui.WIDGET.show()
def build_gui(self):

View File

@ -75,7 +75,7 @@ class WelcomeGramplet(Gramplet):
def init(self):
self.gui.WIDGET = self.build_gui()
self.gui.get_container_widget().remove(self.gui.textview)
self.gui.get_container_widget().add_with_viewport(self.gui.WIDGET)
self.gui.get_container_widget().add(self.gui.WIDGET)
self.gui.WIDGET.show()
def build_gui(self):

View File

@ -73,7 +73,7 @@ class CategorySidebar(BaseSidebar):
self.window = Gtk.ScrolledWindow()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.window.add_with_viewport(vbox)
self.window.add(vbox)
self.window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
self.window.show()

View File

@ -59,7 +59,7 @@ class DropdownSidebar(BaseSidebar):
self.window = Gtk.ScrolledWindow()
grid = Gtk.Grid()
self.window.add_with_viewport(grid)
self.window.add(grid)
self.window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
self.window.show()

View File

@ -61,7 +61,7 @@ class ExpanderSidebar(BaseSidebar):
self.window = Gtk.ScrolledWindow()
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.window.add_with_viewport(vbox)
self.window.add(vbox)
self.window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
self.window.show()

View File

@ -104,7 +104,7 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView):
self.scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC,
Gtk.PolicyType.AUTOMATIC)
self.fan.show_all()
self.scrolledwindow.add_with_viewport(self.fan)
self.scrolledwindow.add(self.fan)
return self.scrolledwindow

View File

@ -102,7 +102,7 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView):
self.scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC,
Gtk.PolicyType.AUTOMATIC)
self.fan.show_all()
self.scrolledwindow.add_with_viewport(self.fan)
self.scrolledwindow.add(self.fan)
return self.scrolledwindow

View File

@ -595,7 +595,7 @@ class PedigreeView(NavigationView):
event_box.connect("button-release-event", self.cb_bg_button_release)
#Signal for controll motion-notify when left mouse button pressed
event_box.connect("motion-notify-event", self.cb_bg_motion_notify_event)
self.scrolledwindow.add_with_viewport(event_box)
self.scrolledwindow.add(event_box)
self.table = Gtk.Grid()
# force LTR layout of the tree, even though the text might be RTL!
@ -1191,7 +1191,7 @@ class PedigreeView(NavigationView):
vadjustment=None)
frame.set_shadow_type(Gtk.ShadowType.NONE)
frame.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER)
frame.add_with_viewport(label)
frame.add(label)
table_widget.attach(frame, x_pos, y_pos, 1, 1)
table_widget.show_all()