Example #1
0
class CheckinSucceededView(QWidget):
	def __init__(self, parent=None):
		QWidget.__init__(self, parent)
		self.form = Ui_Checkin_Success_Form()
		self.form.setupUi(self)
		self.ok_button = self.form.ok_button
		self.venue_name_label = self.form.venue_name_label
		self.venue_address_label = self.form.venue_address_label
		self.checkin_date_label = self.form.checkin_date_label
		self.image_label = self.form.venue_icon_label
		self.hide()
		self.icon_pixmap = QPixmap()
		
		QObject.connect(self.ok_button, SIGNAL("clicked()"), self.hide)
		
	def checkin_succeeded(self, foursquare_obj):
		checkin_history = foursquare_obj.history(l=1)
		last_checkin = checkin_history['checkins']
		last_checkin = last_checkin[0]
		self.venue_name_label.setText(last_checkin['venue']['name'])
		self.venue_address_label.setText(last_checkin['venue']['address'])
		self.checkin_date_label.setText(str(last_checkin['created']))
		icon_url = last_checkin['venue']['primarycategory']['iconurl']
		icon_fp = urllib2.urlopen(icon_url)
		icon_data = icon_fp.read()
		icon_pixmap = QPixmap()
		icon_pixmap.loadFromData(icon_data)
		self.image_label.setPixmap(icon_pixmap)
		self.show()
Example #2
0
	def __init__(self, parent=None):
		QWidget.__init__(self, parent)
		self.form = Ui_Checkin_Success_Form()
		self.form.setupUi(self)
		self.ok_button = self.form.ok_button
		self.venue_name_label = self.form.venue_name_label
		self.venue_address_label = self.form.venue_address_label
		self.checkin_date_label = self.form.checkin_date_label
		self.image_label = self.form.venue_icon_label
		self.hide()
		self.icon_pixmap = QPixmap()
		
		QObject.connect(self.ok_button, SIGNAL("clicked()"), self.hide)