[pitivi] All around: fix positional arguments warnings
- From: Jean-François Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] All around: fix positional arguments warnings
- Date: Tue, 17 Dec 2013 01:42:37 +0000 (UTC)
commit 7061503cf39e7147fbcf0200004ac58d38756bd3
Author: Mathieu Duponchelle <mduponchelle1 gmail com>
Date: Wed Dec 4 17:23:04 2013 +0100
All around: fix positional arguments warnings
They appeared with pygobject 3.11.
Hope none flied under the radar.
pitivi/application.py | 2 +-
pitivi/clipproperties.py | 4 +-
pitivi/effects.py | 2 +-
pitivi/mainwindow.py | 99 +++++++++++++++++++++--------------------
pitivi/mediafilespreviewer.py | 18 ++++----
pitivi/medialibrary.py | 17 ++++---
pitivi/project.py | 10 ++--
pitivi/render.py | 8 ++--
pitivi/tabsmanager.py | 4 +-
pitivi/timeline/layer.py | 16 +++---
pitivi/timeline/timeline.py | 18 ++++----
pitivi/transitions.py | 6 +-
pitivi/utils/widgets.py | 15 +++---
pitivi/viewer.py | 8 ++--
14 files changed, 114 insertions(+), 113 deletions(-)
---
diff --git a/pitivi/application.py b/pitivi/application.py
index 8de363a..7019800 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -294,7 +294,7 @@ class GuiPitivi(InteractivePitivi):
self._showGui()
def _showStartupError(self, message, detail):
- dialog = Gtk.MessageDialog(type=Gtk.MessageType.ERROR,
+ dialog = Gtk.MessageDialog(message_type=Gtk.MessageType.ERROR,
buttons=Gtk.ButtonsType.OK)
dialog.set_markup("<b>" + message + "</b>")
dialog.format_secondary_text(detail)
diff --git a/pitivi/clipproperties.py b/pitivi/clipproperties.py
index 16fd05b..f08f46d 100644
--- a/pitivi/clipproperties.py
+++ b/pitivi/clipproperties.py
@@ -178,7 +178,7 @@ class EffectProperties(Gtk.Expander, Loggable):
self.treeview_scrollwin.set_shadow_type(Gtk.ShadowType.ETCHED_IN)
self.storemodel = Gtk.ListStore(bool, str, str, str, object)
- self.treeview = Gtk.TreeView(self.storemodel)
+ self.treeview = Gtk.TreeView(model=self.storemodel)
self.treeview_scrollwin.add(self.treeview)
self.treeview.set_property("rules_hint", True)
self.treeview.set_property("has_tooltip", True)
@@ -223,7 +223,7 @@ class EffectProperties(Gtk.Expander, Loggable):
# Prepare the main container widgets and lay out everything
self._vcontent = Gtk.VPaned()
- self._table = Gtk.Table(3, 1, False)
+ self._table = Gtk.Table(n_rows=3, n_columns=1, homogeneous=False)
self._table.attach(self.treeview_scrollwin, 0, 1, 0, 1)
self._table.attach(self._toolbar, 0, 1, 2, 3, yoptions=Gtk.AttachOptions.FILL)
self._vcontent.pack1(self._table, resize=True, shrink=False)
diff --git a/pitivi/effects.py b/pitivi/effects.py
index 9994642..2851392 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -393,7 +393,7 @@ class EffectListWidget(Gtk.VBox, Loggable):
# Store
self.storemodel = Gtk.ListStore(str, str, int, object, object, str, GdkPixbuf.Pixbuf)
- self.view = Gtk.TreeView(self.storemodel)
+ self.view = Gtk.TreeView(model=self.storemodel)
self.view.props.headers_visible = False
self.view.get_selection().set_mode(Gtk.SelectionMode.SINGLE)
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 523f44b..a9dd736 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -157,7 +157,7 @@ def create_stock_icons():
pmdir = get_pixmap_dir()
for stockid, path in pixmaps.iteritems():
pixbuf = GdkPixbuf.Pixbuf.new_from_file(os.path.join(pmdir, path))
- iconset = Gtk.IconSet(pixbuf)
+ iconset = Gtk.IconSet.new_from_pixbuf(pixbuf)
factory.add(stockid, iconset)
factory.add_default()
@@ -311,12 +311,12 @@ class PitiviMainWindow(Gtk.Window, Loggable):
"F11", _("View the main window on the whole screen"), self._fullScreenCb),
]
- self.main_actions = Gtk.ActionGroup("mainwindow")
+ self.main_actions = Gtk.ActionGroup(name="mainwindow")
self.main_actions.add_actions(actions)
- self.undock_action = Gtk.Action("WindowizeViewer", _("Undock Viewer"),
- _("Put the viewer in a separate window"), None)
+ self.undock_action = Gtk.Action(name="WindowizeViewer", label=_("Undock Viewer"),
+ tooltip=_("Put the viewer in a separate window"), stock_id=None)
self.main_actions.add_action(self.undock_action)
- self.toggle_actions = Gtk.ActionGroup("mainwindowtoggles")
+ self.toggle_actions = Gtk.ActionGroup(name="mainwindowtoggles")
self.toggle_actions.add_toggle_actions(toggleactions)
important_actions = ("Undo", "SaveProject", "RenderProject")
@@ -366,7 +366,7 @@ class PitiviMainWindow(Gtk.Window, Loggable):
"""
self.set_title("%s" % (APPNAME))
self.set_icon_name("pitivi")
- vbox = Gtk.VBox(False)
+ vbox = Gtk.VBox(homogeneous=False)
self.add(vbox)
vbox.show()
@@ -382,7 +382,7 @@ class PitiviMainWindow(Gtk.Window, Loggable):
self._main_toolbar_box.show_all()
# Auto-hiding fullscreen toolbar
self._main_toolbar_height = self.toolbar.get_preferred_height()[1]
- self._fullscreen_toolbar_win = Gtk.Window(Gtk.WindowType.POPUP)
+ self._fullscreen_toolbar_win = Gtk.Window(type=Gtk.WindowType.POPUP)
self._fullscreen_toolbar_win.resize(self.get_screen().get_width(), self._main_toolbar_height)
self._fullscreen_toolbar_win.set_transient_for(self)
self._fullscreen_toolbar_win.connect("enter-notify-event", self._slideFullscreenToolbarIn)
@@ -416,7 +416,7 @@ class PitiviMainWindow(Gtk.Window, Loggable):
self.title_editor = TitleEditor(instance, self.uimanager)
self.context_tabs.append_page(self.clipconfig, Gtk.Label(label=_("Clip configuration")))
self.context_tabs.append_page(self.trans_list, Gtk.Label(label=_("Transitions")))
- self.context_tabs.append_page(self.title_editor.widget, Gtk.Label(_("Title editor")))
+ self.context_tabs.append_page(self.title_editor.widget, Gtk.Label(label=_("Title editor")))
self.context_tabs.connect("switch-page", self.title_editor.tab_switched)
self.clipconfig.show()
self.trans_list.show()
@@ -759,11 +759,11 @@ class PitiviMainWindow(Gtk.Window, Loggable):
if not self.app.projectManager.closeRunningProject():
return # The user has not made a decision, don't do anything
- chooser = Gtk.FileChooserDialog(_("Open File..."),
- self,
- action=Gtk.FileChooserAction.OPEN,
- buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
- Gtk.STOCK_OPEN, Gtk.ResponseType.OK))
+ chooser = Gtk.FileChooserDialog(title=_("Open File..."),
+ transient_for=self,
+ action=Gtk.FileChooserAction.OPEN)
+ chooser.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
+ Gtk.STOCK_OPEN, Gtk.ResponseType.OK)
chooser.set_select_multiple(False)
# TODO: Remove this set_current_folder call when GTK bug 683999 is fixed
chooser.set_current_folder(self.settings.lastProjectFolder)
@@ -853,11 +853,11 @@ class PitiviMainWindow(Gtk.Window, Loggable):
def _projectManagerSaveProjectFailedCb(self, projectManager, uri, exception=None):
project_filename = unquote(uri.split("/")[-1])
- dialog = Gtk.MessageDialog(self,
- Gtk.DialogFlags.MODAL,
- Gtk.MessageType.ERROR,
- Gtk.ButtonsType.OK,
- _('Unable to save project "%s"') % project_filename)
+ dialog = Gtk.MessageDialog(transient_for=self,
+ modal=True,
+ message_type=Gtk.MessageType.ERROR,
+ buttons=Gtk.ButtonsType.OK,
+ text=_('Unable to save project "%s"') % project_filename)
if exception:
dialog.set_property("secondary-use-markup", True)
dialog.set_property("secondary-text", unquote(str(exception)))
@@ -888,11 +888,11 @@ class PitiviMainWindow(Gtk.Window, Loggable):
else:
save = Gtk.STOCK_SAVE_AS
- dialog = Gtk.Dialog("",
- self, Gtk.DialogFlags.MODAL,
- (_("Close without saving"), Gtk.ResponseType.REJECT,
+ dialog = Gtk.Dialog(title="",
+ transient_for=self, modal=True)
+ dialog.add_buttons(_("Close without saving"), Gtk.ResponseType.REJECT,
Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
- save, Gtk.ResponseType.YES))
+ save, Gtk.ResponseType.YES)
# Even though we set the title to an empty string when creating dialog,
# seems we really have to do it once more so it doesn't show "pitivi"...
dialog.set_title("")
@@ -926,14 +926,14 @@ class PitiviMainWindow(Gtk.Window, Loggable):
"your changes will be lost.")
# put the text in a vbox
- vbox = Gtk.VBox(False, SPACING * 2)
+ vbox = Gtk.VBox(homogeneous=False, spacing=SPACING * 2)
vbox.pack_start(primary, True, True, 0)
vbox.pack_start(secondary, True, True, 0)
# make the [[image] text] hbox
image = Gtk.Image.new_from_stock(Gtk.STOCK_DIALOG_QUESTION,
Gtk.IconSize.DIALOG)
- hbox = Gtk.HBox(False, SPACING * 2)
+ hbox = Gtk.HBox(homogeneous=False, spacing=SPACING * 2)
hbox.pack_start(image, False, True, 0)
hbox.pack_start(vbox, True, True, 0)
hbox.set_border_width(SPACING)
@@ -977,11 +977,11 @@ class PitiviMainWindow(Gtk.Window, Loggable):
def _projectManagerRevertingToSavedCb(self, projectManager, unused_project):
if self.app.current_project.hasUnsavedModifications():
- dialog = Gtk.MessageDialog(self,
- Gtk.DialogFlags.MODAL,
- Gtk.MessageType.WARNING,
- Gtk.ButtonsType.NONE,
- _("Revert to saved project version?"))
+ dialog = Gtk.MessageDialog(transient_for=self,
+ modal=True,
+ message_type=Gtk.MessageType.WARNING,
+ buttons=Gtk.ButtonsType.NONE,
+ text=_("Revert to saved project version?"))
dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.NO,
Gtk.STOCK_REVERT_TO_SAVED, Gtk.ResponseType.YES)
dialog.set_resizable(False)
@@ -997,11 +997,11 @@ class PitiviMainWindow(Gtk.Window, Loggable):
def _projectManagerNewProjectFailedCb(self, projectManager, uri, exception):
project_filename = unquote(uri.split("/")[-1])
- dialog = Gtk.MessageDialog(self,
- Gtk.DialogFlags.MODAL,
- Gtk.MessageType.ERROR,
- Gtk.ButtonsType.OK,
- _('Unable to load project "%s"') % project_filename)
+ dialog = Gtk.MessageDialog(transient_for=self,
+ modal=True,
+ message_type=Gtk.MessageType.ERROR,
+ buttons=Gtk.ButtonsType.OK,
+ text=_('Unable to load project "%s"') % project_filename)
dialog.set_property("secondary-use-markup", True)
dialog.set_property("secondary-text", unquote(str(exception)))
dialog.set_transient_for(self)
@@ -1013,11 +1013,12 @@ class PitiviMainWindow(Gtk.Window, Loggable):
self._missingUriOnLoading = True
uri = asset.get_id()
new_uri = None
- dialog = Gtk.Dialog(_("Locate missing file..."),
- self,
- Gtk.DialogFlags.MODAL,
- buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
- Gtk.STOCK_OPEN, Gtk.ResponseType.OK))
+ dialog = Gtk.Dialog(title=_("Locate missing file..."),
+ transient_for=self,
+ modal=True)
+
+ dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
+ Gtk.STOCK_OPEN, Gtk.ResponseType.OK)
dialog.set_border_width(SPACING * 2)
dialog.get_content_area().set_spacing(SPACING)
dialog.set_transient_for(self)
@@ -1208,11 +1209,11 @@ class PitiviMainWindow(Gtk.Window, Loggable):
## other
def _showExportDialog(self, project):
self.log("Export requested")
- chooser = Gtk.FileChooserDialog(_("Export To..."),
- self,
- action=Gtk.FileChooserAction.SAVE,
- buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
- Gtk.STOCK_SAVE, Gtk.ResponseType.OK))
+ chooser = Gtk.FileChooserDialog(title=_("Export To..."),
+ transient_for=self,
+ action=Gtk.FileChooserAction.SAVE)
+ chooser.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
+ Gtk.STOCK_SAVE, Gtk.ResponseType.OK)
chooser.set_select_multiple(False)
chooser.props.do_overwrite_confirmation = True
@@ -1255,11 +1256,11 @@ class PitiviMainWindow(Gtk.Window, Loggable):
def _showSaveAsDialog(self, project):
self.log("Save URI requested")
- chooser = Gtk.FileChooserDialog(_("Save As..."),
- self,
- action=Gtk.FileChooserAction.SAVE,
- buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
- Gtk.STOCK_SAVE, Gtk.ResponseType.OK))
+ chooser = Gtk.FileChooserDialog(title=_("Save As..."),
+ transient_for=self,
+ action=Gtk.FileChooserAction.SAVE)
+ chooser.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
+ Gtk.STOCK_SAVE, Gtk.ResponseType.OK)
asset = GES.Formatter.get_default()
filt = Gtk.FileFilter()
diff --git a/pitivi/mediafilespreviewer.py b/pitivi/mediafilespreviewer.py
index ce17eb6..2379d54 100644
--- a/pitivi/mediafilespreviewer.py
+++ b/pitivi/mediafilespreviewer.py
@@ -97,7 +97,7 @@ class PreviewWidget(Gtk.VBox, Loggable):
# Play button
self.bbox = Gtk.HBox()
- self.play_button = Gtk.ToolButton(Gtk.STOCK_MEDIA_PLAY)
+ self.play_button = Gtk.ToolButton.new_from_stock(Gtk.STOCK_MEDIA_PLAY)
self.play_button.connect("clicked", self._on_start_stop_clicked_cb)
self.bbox.pack_start(self.play_button, False, True, 0)
@@ -112,9 +112,9 @@ class PreviewWidget(Gtk.VBox, Loggable):
self.bbox.pack_start(self.seeker, True, True, 0)
# Zoom buttons
- self.b_zoom_in = Gtk.ToolButton(Gtk.STOCK_ZOOM_IN)
+ self.b_zoom_in = Gtk.ToolButton.new_from_stock(Gtk.STOCK_ZOOM_IN)
self.b_zoom_in.connect("clicked", self._on_zoom_clicked_cb, 1)
- self.b_zoom_out = Gtk.ToolButton(Gtk.STOCK_ZOOM_OUT)
+ self.b_zoom_out = Gtk.ToolButton.new_from_stock(Gtk.STOCK_ZOOM_OUT)
self.b_zoom_out.connect("clicked", self._on_zoom_clicked_cb, -1)
self.bbox.pack_start(self.b_zoom_in, False, True, 0)
self.bbox.pack_start(self.b_zoom_out, False, True, 0)
@@ -132,7 +132,7 @@ class PreviewWidget(Gtk.VBox, Loggable):
vbox = Gtk.VBox()
vbox.set_spacing(SPACING)
self.l_error = Gtk.Label(label=_("Pitivi can not preview this file."))
- self.b_details = Gtk.Button(_("More info"))
+ self.b_details = Gtk.Button.new_with_label(_("More info"))
self.b_details.connect('clicked', self._on_b_details_clicked_cb)
vbox.pack_start(self.l_error, True, True, 0)
vbox.pack_start(self.b_details, False, False, 0)
@@ -407,11 +407,11 @@ class PreviewWidget(Gtk.VBox, Loggable):
def _on_b_details_clicked_cb(self, unused_button):
mess = self.preview_cache_errors.get(self.current_selected_uri, None)
if mess is not None:
- dialog = Gtk.MessageDialog(None,
- Gtk.DialogFlags.MODAL,
- Gtk.MessageType.WARNING,
- Gtk.ButtonsType.OK,
- str(mess))
+ dialog = Gtk.MessageDialog(transient_for=None,
+ modal=True,
+ message_type=Gtk.MessageType.WARNING,
+ buttons=Gtk.ButtonsType.OK,
+ text=str(mess))
dialog.set_icon_name("pitivi")
dialog.set_title(_("Error while analyzing a file"))
dialog.run()
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index e9afdd5..2e173e1 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -179,7 +179,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
# TreeView
# Displays icon, name, type, length
- self.treeview = Gtk.TreeView(self.modelFilter)
+ self.treeview = Gtk.TreeView(model=self.modelFilter)
self.treeview_scrollwin.add(self.treeview)
self.treeview.connect("button-press-event", self._treeViewButtonPressEventCb)
self.treeview.connect("button-release-event", self._treeViewButtonReleaseEventCb)
@@ -220,7 +220,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
namecol.add_attribute(txtcell, "markup", COL_LENGTH)
# IconView
- self.iconview = Gtk.IconView(self.modelFilter)
+ self.iconview = Gtk.IconView(model=self.modelFilter)
self.iconview_scrollwin.add(self.iconview)
self.iconview.connect("button-press-event", self._iconViewButtonPressEventCb)
self.iconview.connect("button-release-event", self._iconViewButtonReleaseEventCb)
@@ -281,7 +281,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
("InsertEnd", Gtk.STOCK_COPY, _("Insert at _End of Timeline"),
"Insert", None, self._insertEndCb),
)
- self.selection_actions = Gtk.ActionGroup("medialibraryselection")
+ self.selection_actions = Gtk.ActionGroup(name="medialibraryselection")
self.selection_actions.add_actions(selection_actions)
self.selection_actions.set_sensitive(False)
uiman.insert_action_group(self.selection_actions, 0)
@@ -444,13 +444,14 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
chooser_action = Gtk.FileChooserAction.OPEN
dialogtitle = _("Select One or More Files")
- close_after = Gtk.CheckButton(_("Close after importing files"))
+ close_after = Gtk.CheckButton(label=_("Close after importing files"))
close_after.set_active(self.app.settings.closeImportDialog)
- self._importDialog = Gtk.FileChooserDialog(dialogtitle, None,
- chooser_action,
- (Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE,
- Gtk.STOCK_ADD, Gtk.ResponseType.OK))
+ self._importDialog = Gtk.FileChooserDialog(title=dialogtitle, transient_for=None,
+ action=chooser_action)
+
+ self._importDialog.add_buttons(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE,
+ Gtk.STOCK_ADD, Gtk.ResponseType.OK)
self._importDialog.set_icon_name("pitivi")
self._importDialog.props.extra_widget = close_after
self._importDialog.set_default_response(Gtk.ResponseType.OK)
diff --git a/pitivi/project.py b/pitivi/project.py
index 5a2416f..5942d9e 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -187,9 +187,9 @@ class ProjectManager(Signallable, Loggable):
@param time_diff: the difference, in seconds, between file mtimes
"""
- dialog = Gtk.Dialog("", None, 0,
- (_("Ignore backup"), Gtk.ResponseType.REJECT,
- _("Restore from backup"), Gtk.ResponseType.YES))
+ dialog = Gtk.Dialog(title="", transient_for=None)
+ dialog.add_buttons(_("Ignore backup"), Gtk.ResponseType.REJECT,
+ _("Restore from backup"), Gtk.ResponseType.YES)
# Even though we set the title to an empty string when creating dialog,
# seems we really have to do it once more so it doesn't show "pitivi"...
dialog.set_title("")
@@ -211,13 +211,13 @@ class ProjectManager(Signallable, Loggable):
primary.props.label = message
# put the text in a vbox
- vbox = Gtk.VBox(False, SPACING * 2)
+ vbox = Gtk.VBox(homogeneous=False, spacing=SPACING * 2)
vbox.pack_start(primary, True, True, 0)
# make the [[image] text] hbox
image = Gtk.Image.new_from_stock(Gtk.STOCK_DIALOG_QUESTION,
Gtk.IconSize.DIALOG)
- hbox = Gtk.HBox(False, SPACING * 2)
+ hbox = Gtk.HBox(homogeneous=False, spacing=SPACING * 2)
hbox.pack_start(image, False, True, 0)
hbox.pack_start(vbox, True, True, 0)
hbox.set_border_width(SPACING)
diff --git a/pitivi/render.py b/pitivi/render.py
index 761230d..dd1164a 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -795,14 +795,14 @@ class RenderDialog(Loggable):
"file a bug report. See the details below for some basic "
"information that may help identify the problem.")
- dialog = Gtk.MessageDialog(self.window, Gtk.DialogFlags.MODAL,
- Gtk.MessageType.ERROR, Gtk.ButtonsType.OK,
- primary_message)
+ dialog = Gtk.MessageDialog(transient_for=self.window, modal=True,
+ message_type=Gtk.MessageType.ERROR, buttons=Gtk.ButtonsType.OK,
+ text=primary_message)
dialog.set_property("secondary-text", secondary_message)
expander = Gtk.Expander()
expander.set_label(_("Details"))
- details_label = Gtk.Label(str(error) + "\n\n" + str(details))
+ details_label = Gtk.Label(label=str(error) + "\n\n" + str(details))
details_label.set_line_wrap(True)
details_label.set_selectable(True)
expander.add(details_label)
diff --git a/pitivi/tabsmanager.py b/pitivi/tabsmanager.py
index 9de1e15..fd41c08 100644
--- a/pitivi/tabsmanager.py
+++ b/pitivi/tabsmanager.py
@@ -60,7 +60,7 @@ class BaseTabs(Gtk.Notebook):
position = notebook.page_num(child)
notebook.remove_page(position)
setattr(self.settings, child_name + "docked", True)
- label = Gtk.Label(child_name)
+ label = Gtk.Label(label=child_name)
self.insert_page(child, label, original_position)
self._set_child_properties(child, label)
@@ -109,7 +109,7 @@ class BaseTabs(Gtk.Notebook):
# Delete the tab from the original notebook (since it was not
# torn off by GTK) and add its contents to our newly created window
self.remove_page(original_position)
- notebook.append_page(child, Gtk.Label(child_name))
+ notebook.append_page(child, Gtk.Label(label=child_name))
else:
return notebook
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index 0601b0b..4c6cdbe 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -56,7 +56,7 @@ class BaseLayerControl(Gtk.VBox, Loggable):
# that is used for list items in TreeView.
self.SELECTED_COLOR = context.get_background_color(Gtk.StateFlags.SELECTED)
- table = Gtk.Table(rows=2, columns=2)
+ table = Gtk.Table(n_rows=2, n_columns=2)
table.set_border_width(2)
table.set_row_spacings(3)
table.set_col_spacings(3)
@@ -125,19 +125,19 @@ class BaseLayerControl(Gtk.VBox, Loggable):
# Popup Menu
self.popup = Gtk.Menu()
- layer_delete = Gtk.ImageMenuItem(_("_Delete layer"))
+ layer_delete = Gtk.ImageMenuItem.new_with_label(_("_Delete layer"))
layer_delete.connect("activate", self._deleteLayerCb)
layer_delete.set_image(Gtk.Image.new_from_icon_name("edit-delete", Gtk.IconSize.MENU))
- self.layer_up = Gtk.ImageMenuItem(_("Move layer up"))
+ self.layer_up = Gtk.ImageMenuItem.new_with_label(_("Move layer up"))
self.layer_up.connect("activate", self._moveLayerCb, -1)
self.layer_up.set_image(Gtk.Image.new_from_icon_name("go-up", Gtk.IconSize.MENU))
- self.layer_down = Gtk.ImageMenuItem(_("Move layer down"))
+ self.layer_down = Gtk.ImageMenuItem.new_with_label(_("Move layer down"))
self.layer_down.connect("activate", self._moveLayerCb, 1)
self.layer_down.set_image(Gtk.Image.new_from_icon_name("go-down", Gtk.IconSize.MENU))
- self.layer_first = Gtk.ImageMenuItem(_("Move layer to top"))
+ self.layer_first = Gtk.ImageMenuItem.new_with_label(_("Move layer to top"))
self.layer_first.connect("activate", self._moveLayerCb, -2)
self.layer_first.set_image(Gtk.Image.new_from_icon_name("go-top", Gtk.IconSize.MENU))
- self.layer_last = Gtk.ImageMenuItem(_("Move layer to bottom"))
+ self.layer_last = Gtk.ImageMenuItem.new_with_label(_("Move layer to bottom"))
self.layer_last.connect("activate", self._moveLayerCb, 2)
self.layer_last.set_image(Gtk.Image.new_from_icon_name("go-bottom", Gtk.IconSize.MENU))
@@ -290,7 +290,7 @@ class VideoLayerControl(BaseLayerControl):
opacity = Gtk.Label(label=_("Opacity:"))
# Opacity scale
- opacity_adjust = Gtk.Adjustment(value=100, upper=100, step_incr=5, page_incr=10)
+ opacity_adjust = Gtk.Adjustment(value=100, upper=100, step_increment=5, page_increment=10)
opacity_scale = Gtk.Scale.new(Gtk.Orientation.HORIZONTAL, adjustment=opacity_adjust)
opacity_scale.set_value_pos(Gtk.PositionType.LEFT)
opacity_scale.set_digits(0)
@@ -316,7 +316,7 @@ class AudioLayerControl(BaseLayerControl):
panning = Gtk.Label(label=_("Pan:"))
# Volume scale
- panning_adjust = Gtk.Adjustment(value=0, lower=-100, upper=100, step_incr=5, page_incr=10)
+ panning_adjust = Gtk.Adjustment(value=0, lower=-100, upper=100, step_increment=5, page_increment=10)
panning_scale = Gtk.Scale.new(Gtk.Orientation.HORIZONTAL, adjustment=panning_adjust)
panning_scale.set_value_pos(Gtk.PositionType.LEFT)
panning_scale.set_digits(0)
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 0f7b75a..0d971da 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1003,9 +1003,9 @@ class Timeline(Gtk.VBox, Zoomable, Loggable):
"period", NEXTKEYFRAME, self._nextKeyframeCb),
)
- actiongroup = Gtk.ActionGroup("timelinepermanent")
- self.selection_actions = Gtk.ActionGroup("timelineselection")
- self.playhead_actions = Gtk.ActionGroup("timelineplayhead")
+ actiongroup = Gtk.ActionGroup(name="timelinepermanent")
+ self.selection_actions = Gtk.ActionGroup(name="timelineselection")
+ self.playhead_actions = Gtk.ActionGroup(name="timelineplayhead")
actiongroup.add_actions(actions)
@@ -1021,8 +1021,8 @@ class Timeline(Gtk.VBox, Zoomable, Loggable):
def _packScrollbars(self, vbox):
self.hadj = Gtk.Adjustment()
self.vadj = Gtk.Adjustment()
- self._vscrollbar = Gtk.VScrollbar(self.vadj)
- self._hscrollBar = Gtk.HScrollbar(self.hadj)
+ self._vscrollbar = Gtk.VScrollbar(adjustment=self.vadj)
+ self._hscrollBar = Gtk.HScrollbar(adjustment=self.hadj)
self.ruler = ScaleRuler(self, self.hadj)
self.hadj.connect("value-changed", self._updateScrollPosition)
@@ -1280,10 +1280,10 @@ class Timeline(Gtk.VBox, Zoomable, Loggable):
Returns a list containing the full path and the mimetype if successful,
returns none otherwise.
"""
- chooser = Gtk.FileChooserDialog(_("Save As..."), self.app.gui,
- action=Gtk.FileChooserAction.SAVE,
- buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
- Gtk.STOCK_SAVE, Gtk.ResponseType.OK))
+ chooser = Gtk.FileChooserDialog(title=_("Save As..."), transient_for=self.app.gui,
+ action=Gtk.FileChooserAction.SAVE)
+ chooser.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
+ Gtk.STOCK_SAVE, Gtk.ResponseType.OK)
chooser.set_icon_name("pitivi")
chooser.set_select_multiple(False)
chooser.set_current_name(_("Untitled"))
diff --git a/pitivi/transitions.py b/pitivi/transitions.py
index a248585..3435452 100644
--- a/pitivi/transitions.py
+++ b/pitivi/transitions.py
@@ -66,7 +66,7 @@ class TransitionsListWidget(Signallable, Gtk.VBox, Loggable):
self.searchbar.pack_end(self.searchEntry, True, True, 0)
self.props_widgets = Gtk.VBox()
- borderTable = Gtk.Table(rows=2, columns=3)
+ borderTable = Gtk.Table(n_rows=2, n_columns=3)
self.border_mode_normal = Gtk.RadioButton(group=None, label=_("Normal"))
self.border_mode_loop = Gtk.RadioButton(group=self.border_mode_normal, label=_("Loop"))
@@ -79,7 +79,7 @@ class TransitionsListWidget(Signallable, Gtk.VBox, Loggable):
# The ypadding is a hack to make the slider widget align with the radiobuttons.
borderTable.attach(self.borderScale, 2, 3, 0, 2, ypadding=SPACING * 2)
- self.invert_checkbox = Gtk.CheckButton(_("Reverse direction"))
+ self.invert_checkbox = Gtk.CheckButton(label=_("Reverse direction"))
self.invert_checkbox.set_border_width(SPACING)
self.props_widgets.add(borderTable)
@@ -107,7 +107,7 @@ class TransitionsListWidget(Signallable, Gtk.VBox, Loggable):
# See also http://python.6.n6.nabble.com/Cannot-shrink-width-of-scrolled-textview-tp1945060.html
#self.iconview_scrollwin.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
- self.iconview = Gtk.IconView(self.storemodel)
+ self.iconview = Gtk.IconView(model=self.storemodel)
self.iconview.set_pixbuf_column(COL_ICON)
# We don't show text because we have a searchbar and the names are ugly
#self.iconview.set_text_column(COL_NAME_TEXT)
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index 3bbed51..17cf513 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -487,10 +487,9 @@ class PathWidget(Gtk.FileChooserButton, DynamicWidget):
def __init__(self, action=Gtk.FileChooserAction.OPEN, default=None):
DynamicWidget.__init__(self, default)
- self.dialog = Gtk.FileChooserDialog(
- action=action,
- buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_CLOSE,
- Gtk.ResponseType.CLOSE))
+ self.dialog = Gtk.FileChooserDialog(action=action)
+ self.dialong.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_CLOSE,
+ Gtk.ResponseType.CLOSE)
self.dialog.set_default_response(Gtk.ResponseType.OK)
Gtk.FileChooserButton.__init__(self, self.dialog)
self.dialog.connect("response", self._responseCb)
@@ -726,7 +725,7 @@ class GstElementSettingsWidget(Gtk.VBox, Loggable):
else:
props = [prop for prop in GObject.list_properties(self.element) if not prop.name in self.ignore]
if not props:
- table = Gtk.Table(rows=1, columns=1)
+ table = Gtk.Table(n_rows=1, n_columns=1)
widget = Gtk.Label(label=_("No properties."))
widget.set_sensitive(False)
table.attach(widget, 0, 1, 0, 1, yoptions=Gtk.AttachOptions.FILL)
@@ -735,9 +734,9 @@ class GstElementSettingsWidget(Gtk.VBox, Loggable):
return
if default_btn:
- table = Gtk.Table(rows=len(props), columns=4)
+ table = Gtk.Table(n_rows=len(props), n_columns=4)
else:
- table = Gtk.Table(rows=len(props), columns=3)
+ table = Gtk.Table(n_rows=len(props), n_columns=3)
table.set_row_spacings(SPACING)
table.set_col_spacings(SPACING)
@@ -1053,7 +1052,7 @@ class ZoomBox(Gtk.HBox, Zoomable):
zoom_fit_icon.set_from_stock(Gtk.STOCK_ZOOM_FIT, Gtk.IconSize.BUTTON)
zoom_fit_btn_hbox = Gtk.HBox()
zoom_fit_btn_hbox.pack_start(zoom_fit_icon, False, True, 0)
- zoom_fit_btn_hbox.pack_start(Gtk.Label(_("Zoom")), False, True, 0)
+ zoom_fit_btn_hbox.pack_start(Gtk.Label(label=_("Zoom")), False, True, 0)
zoom_fit_btn.add(zoom_fit_btn_hbox)
zoom_fit_btn.connect("clicked", self._zoomFitCb)
diff --git a/pitivi/viewer.py b/pitivi/viewer.py
index 06a44b0..0514964 100644
--- a/pitivi/viewer.py
+++ b/pitivi/viewer.py
@@ -213,13 +213,13 @@ class PitiviViewer(Gtk.VBox, Loggable):
boxalign.add(bbox)
self.pack_start(boxalign, False, True, 0)
- self.goToStart_button = Gtk.ToolButton(Gtk.STOCK_MEDIA_PREVIOUS)
+ self.goToStart_button = Gtk.ToolButton.new_from_stock(Gtk.STOCK_MEDIA_PREVIOUS)
self.goToStart_button.connect("clicked", self._goToStartCb)
self.goToStart_button.set_tooltip_text(_("Go to the beginning of the timeline"))
self.goToStart_button.set_sensitive(False)
bbox.pack_start(self.goToStart_button, False, True, 0)
- self.back_button = Gtk.ToolButton(Gtk.STOCK_MEDIA_REWIND)
+ self.back_button = Gtk.ToolButton.new_from_stock(Gtk.STOCK_MEDIA_REWIND)
self.back_button.connect("clicked", self._backCb)
self.back_button.set_tooltip_text(_("Go back one second"))
self.back_button.set_sensitive(False)
@@ -230,13 +230,13 @@ class PitiviViewer(Gtk.VBox, Loggable):
bbox.pack_start(self.playpause_button, False, True, 0)
self.playpause_button.set_sensitive(False)
- self.forward_button = Gtk.ToolButton(Gtk.STOCK_MEDIA_FORWARD)
+ self.forward_button = Gtk.ToolButton.new_from_stock(Gtk.STOCK_MEDIA_FORWARD)
self.forward_button.connect("clicked", self._forwardCb)
self.forward_button.set_tooltip_text(_("Go forward one second"))
self.forward_button.set_sensitive(False)
bbox.pack_start(self.forward_button, False, True, 0)
- self.goToEnd_button = Gtk.ToolButton(Gtk.STOCK_MEDIA_NEXT)
+ self.goToEnd_button = Gtk.ToolButton.new_from_stock(Gtk.STOCK_MEDIA_NEXT)
self.goToEnd_button.connect("clicked", self._goToEndCb)
self.goToEnd_button.set_tooltip_text(_("Go to the end of the timeline"))
self.goToEnd_button.set_sensitive(False)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]