Example #1
0
class CheckinView(QFrame):
	def __init__(self, parent = None, foursquare_manager=None):
		QFrame.__init__(self, parent)
		self.form = Ui_Checkin_Form()
		self.form.setupUi(self)
		
		self.foursquare_manager = foursquare_manager
		self.recent_checkins = None
		self.setObjectName("checkin_view")
		
		self.recent_checkins_view = self.form.recent_checkins_view
		
		self.vid_text_field = self.form.vid_field
		self.checkin_button = self.form.checkin_button
	
		QObject.connect(self.recent_checkins_view, SIGNAL("currentRowChanged(int)"), self.handle_row_click)
		
	def handle_row_click(self):
		current_row = self.recent_checkins_view.currentRow()
		if self.recent_checkins is not None:
			self.vid_text_field.setText(str(self.recent_checkins[current_row]['venue']['id']))

	def update_checkin_list(self):
		history = self.foursquare_manager.foursquare_obj.history(l=20)
		self.recent_checkins = history['checkins']
		self.recent_checkins_view.clear()
		venue_counter = 0
		for item in self.recent_checkins:
			date_in_us_fmt = item['created'][0:item['created'].find("+0000")]
			details = item['venue']['name']+" ("+str(item['venue']['id'])+"), "+date_in_us_fmt+"GMT"
			self.recent_checkins_view.addItem(details)
			venue_counter += 1
Example #2
0
	def __init__(self, parent = None, foursquare_manager=None):
		QFrame.__init__(self, parent)
		self.form = Ui_Checkin_Form()
		self.form.setupUi(self)
		
		self.foursquare_manager = foursquare_manager
		self.recent_checkins = None
		self.setObjectName("checkin_view")
		
		self.recent_checkins_view = self.form.recent_checkins_view
		
		self.vid_text_field = self.form.vid_field
		self.checkin_button = self.form.checkin_button
	
		QObject.connect(self.recent_checkins_view, SIGNAL("currentRowChanged(int)"), self.handle_row_click)