def fetch_time_summary(self): GtkThread( target=self.time_summary.sync_data, args=(self.week.get_selected_date(), ), target_cb=gtk_thread_cb( lambda t: self.time_summary.emit("data_update_end")), ).start()
def on_back_to_today(self, ev_box, ev_btn): self.week.set_selected_date(datetime.now()) self.week.emit("selected_date_changed") self.time_entries.date_obj = self.week.get_selected_date() GtkThread( target=self.time_entries.sync_data, target_cb=gtk_thread_cb( lambda t: self.time_entries.emit("data_update_end")), ).start()
def fetch_new_time_entries(self): self.week.emit("selected_date_changed") self.time_entries.date_obj = self.week.get_selected_date() self.time_entries.emit('data_update_bgn') GtkThread( target=self.time_entries.sync_data, target_cb=gtk_thread_cb( lambda t: self.time_entries.emit('data_update_end') ), ).start()
def on_back_to_today_kb(self, *args): self.week.set_selected_date(datetime.now()) self.week.emit("selected_date_changed") self.time_entries.date_obj = self.week.get_selected_date() self.time_entries.emit('data_update_bgn') GtkThread( target=self.time_entries.sync_data, target_cb=gtk_thread_cb( lambda t: self.time_entries.emit('data_update_end') ), ).start()
def bind_data(self): self.get_widget("label_user_fullname")\ .set_markup(self.user.get_full_name()) self.get_widget("label_user_email").set_markup(self.user.data["email"]) self.get_widget("label_user_avatar").set_from_pixbuf( self.user.get_avatar_img_as_pixbuf()) self.get_widget("label_user_avatar").set_from_pixbuf( self.user.get_avatar_img_as_pixbuf(), ) GtkThread( target=self.user.download_user_avatar, target_cb=gtk_thread_cb( lambda t: self.user.emit("avatar_download_end")), ).start()
def fetch_base_data(self): ''' Description: Yes. We are blocking on purpose to avoid user trying interacting with some part of the UI and see no reaction. We will slowly move the parts to be more and more asynchronous. ''' self.user.sync_data() self.assignments.sync_data() self.time_entries.emit('data_update_bgn') GtkThread( target=self.time_entries.sync_data, target_cb=gtk_thread_cb( lambda t: self.time_entries.emit('data_update_end') ), ).start()