def on_drag_data_received(self, widget, context, x, y, selection, info, time): text, image_file = DnDSelection.parse(info, selection, True) if text or image_file: updatewindow = UpdateWindow(self) if text: updatewindow.text_buffer.set_text(text) else: updatewindow.set_upload_media(image_file)
def on_drag_drop(self, widget, context, x, y, time, *args): if self.dnd.text or self.dnd.file: account = widget.api.account updatewindow = UpdateWindow(self.scrolled_window.liststore, source=account.source, account=account.user_name) if self.dnd.text: updatewindow.text_buffer.set_text(self.dnd.text) elif self.dnd.file: updatewindow.set_upload_media(self.dnd.file) self.dnd.clear()
def on_dbus_signal(self, proxy, sender_name, signal_name, params): if signal_name == "ActionInvoked": notify_id, action_string = params.unpack() action_array = action_string.split(' ') action = action_array[0] entry_base64 = ' '.join(action_array[1:]) if entry_base64: # for a GNOME Classic bug entry_pickle = base64.b64decode(entry_base64) entry_dict = pickle.loads(entry_pickle) if action == 'reply': entry_dict['status_body'] = entry_dict['popup_body'] UpdateWindow(self.liststore, entry_dict, entry_dict['source'], entry_dict['user_account']) elif action == 'open': uri = entry_dict['permalink'].replace('gfeedline://', 'https://') webbrowser.open(uri)
def on_activate(self, menuitem, entry_id): entry_dict = self._get_entry_from_dom(entry_id) account = self.api.account UpdateWindow(self.parent.liststore, entry_dict, account.source, account.user_name)
def on_menuitem_update_activate(self, menuitem): UpdateWindow(self.liststore)