innir/gtranscribe

deprecation warnings

pabs3 opened this issue · 2 comments

pabs3 commented

gtranscribe appears to do some things that are now deprecated:

/usr/bin/gtranscribe:54: PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See: https://wiki.gnome.org/PyGObject/Threading
  GObject.threads_init()
/usr/bin/gtranscribe:65: Warning: The property GtkImage:stock is deprecated and shouldn't be used anymore. It will be removed in a future version.
  builder.add_from_file(get_data_file(PROJECT_ROOT_DIRECTORY, 'ui',
/usr/bin/gtranscribe:65: Warning: The property GtkImageMenuItem:use-stock is deprecated and shouldn't be used anymore. It will be removed in a future version.
  builder.add_from_file(get_data_file(PROJECT_ROOT_DIRECTORY, 'ui',
/usr/bin/gtranscribe:65: Warning: The property GtkSettings:gtk-menu-images is deprecated and shouldn't be used anymore. It will be removed in a future version.
  builder.add_from_file(get_data_file(PROJECT_ROOT_DIRECTORY, 'ui',
/usr/bin/gtranscribe:65: Warning: The property GtkImageMenuItem:image is deprecated and shouldn't be used anymore. It will be removed in a future version.
  builder.add_from_file(get_data_file(PROJECT_ROOT_DIRECTORY, 'ui',
/usr/bin/gtranscribe:108: DeprecationWarning: Gtk.Action.set_sensitive is deprecated
  self.play_action.set_sensitive(False)
/usr/bin/gtranscribe:358: DeprecationWarning: This method will be removed in a future version of Python. Use 'locale.format_string()' instead.
  return u'%s\xd7' % locale.format('%.1f', value)
pabs3 commented

This appears when opening the file dialog:

/usr/lib/python3/dist-packages/gi/overrides/Gtk.py:614: Warning: The property GtkSettings:gtk-button-images is deprecated and shouldn't be used anymore. It will be removed in a future version.
  self.add_button(text, response)

This appears after selecting a file and pressing open:

/usr/bin/gtranscribe:202: DeprecationWarning: Gtk.ToggleAction.set_active is deprecated
  self.play_action.set_active(False)
/usr/bin/gtranscribe:211: PyGIDeprecationWarning: GObject.idle_add is deprecated; use GLib.idle_add instead
  GObject.idle_add(self.update_file, audiofile)

This appears when pressing play for the first time:

/usr/bin/gtranscribe:271: DeprecationWarning: Gtk.ToggleAction.get_active is deprecated
  if action.get_active():
/usr/bin/gtranscribe:272: DeprecationWarning: Gtk.Image.set_from_stock is deprecated
  self.icon_play.set_from_stock(Gtk.STOCK_MEDIA_PAUSE, 2)
/usr/bin/gtranscribe:167: PyGIDeprecationWarning: GObject.timeout_add is deprecated; use GLib.timeout_add instead
  self._update_id = GObject.timeout_add(50, self.play_loop)

This appears when pressing pause for the first time:

/usr/bin/gtranscribe:172: PyGIDeprecationWarning: GObject.source_remove is deprecated; use GLib.source_remove instead
  GObject.source_remove(self._update_id)
/usr/bin/gtranscribe:285: PyGIDeprecationWarning: GObject.idle_add is deprecated; use GLib.idle_add instead
  GObject.idle_add(self.play_loop, True)

This appears when pressing any of the UI parts that change the current location in the audio file for the first time:

/usr/bin/gtranscribe:376: PyGIDeprecationWarning: GObject.idle_add is deprecated; use GLib.idle_add instead
  GObject.idle_add(self.play_loop, True, False)

This appears when opening a text file:

/usr/lib/python3/dist-packages/gi/overrides/Gtk.py:614: Warning: The property GtkSettings:gtk-button-images is deprecated and shouldn't be used anymore. It will be removed in a future version.
  self.add_button(text, response)
/usr/bin/gtranscribe:450: PyGIDeprecationWarning: GObject.idle_add is deprecated; use GLib.idle_add instead
  GObject.idle_add(self.text_view.scroll_mark_onscreen,
innir commented

These deprecation warnings should all be fixed with commits 7a9c06d and 0e26be2. I just want to fix #13 before I release a new version.