~jamestait/gwibber/fix-845374

« back to all changes in this revision

Viewing changes to gwibber/microblog/plugins/identica/gtk/identica/__init__.py

Initial conversion to PyGI/Gtk3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import gtk, webkit, gnomekeyring
 
1
import gnomekeyring
 
2
from gi.repository import GLib, Gtk, WebKit
2
3
import urllib, urllib2, json, urlparse, uuid
3
4
from oauth import oauth
4
5
 
5
 
from gtk import Builder
6
6
import gwibber.microblog
7
7
from gwibber.microblog.util import resources
8
8
import gettext
11
11
    gettext.bind_textdomain_codeset('gwibber','UTF-8')
12
12
gettext.textdomain('gwibber')
13
13
 
14
 
gtk.gdk.threads_init()
 
14
GLib.threads_init()
15
15
 
16
16
sigmeth = oauth.OAuthSignatureMethod_HMAC_SHA1()
17
17
 
18
18
 
19
 
class AccountWidget(gtk.VBox):
 
19
class AccountWidget(Gtk.VBox):
20
20
  """AccountWidget: A widget that provides a user interface for configuring identi.ca accounts in Gwibber
21
21
  """
22
22
  
23
23
  def __init__(self, account=None, dialog=None):
24
24
    """Creates the account pane for configuring identi.ca accounts"""
25
 
    gtk.VBox.__init__( self, False, 20 )
26
 
    self.ui = gtk.Builder()
 
25
    Gtk.VBox.__init__( self, False, 20 )
 
26
    self.ui = Gtk.Builder()
27
27
    self.ui.set_translation_domain ("gwibber")
28
28
    self.ui.add_from_file (resources.get_ui_asset("gwibber-accounts-identica.ui"))
29
29
    self.ui.connect_signals(self)
58
58
  def on_statusnet_auth_clicked(self, widget, data=None):
59
59
    self.winsize = self.window.get_size()
60
60
 
61
 
    web = webkit.WebView()
 
61
    web = WebKit.WebView()
62
62
    web.get_settings().set_property("enable-plugins", False)
63
63
    web.load_html_string(_("<p>Please wait...</p>"), "file:///")
64
64
 
81
81
 
82
82
    web.connect("title-changed", self.on_statusnet_auth_title_change)
83
83
 
84
 
    scroll = gtk.ScrolledWindow()
 
84
    scroll = Gtk.ScrolledWindow()
85
85
    scroll.add(web)
86
86
 
87
87
    self.pack_start(scroll, True, True, 0)
208
208
      self.ui.get_object("vbox_advanced").show()
209
209
 
210
210
    if title.get_title() == "Failure":
211
 
      d = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR,
212
 
        gtk.BUTTONS_OK, _("Authorization failed. Please try again."))
 
211
      d = Gtk.MessageDialog(None, Gtk.DIALOG_MODAL, Gtk.MESSAGE_ERROR,
 
212
        Gtk.BUTTONS_OK, _("Authorization failed. Please try again."))
213
213
      if d.run(): d.destroy()
214
214
 
215
215
      web.hide()