Renamed showUserProfile to user_details to keep compatibility with invisible interface and naming pattern of functions

This commit is contained in:
Manuel Cortez 2023-10-10 17:43:31 -06:00
parent b3e0b21ee7
commit d56c8b4372
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790
8 changed files with 14 additions and 9 deletions

View File

@ -140,7 +140,7 @@ class Controller(object):
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.delete, self.view.delete)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.follow, menuitem=self.view.follow)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.send_dm, self.view.dm)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.showUserProfile, self.view.details)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.user_details, self.view.details)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.get_more_items, menuitem=self.view.load_previous_items)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.clear_buffer, menuitem=self.view.clear)
widgetUtils.connect_event(self.view, widgetUtils.MENU, self.remove_buffer, self.view.deleteTl)
@ -1101,13 +1101,13 @@ class Controller(object):
if handler:
handler.update_profile(buffer.session)
def showUserProfile(self, *args):
def user_details(self, *args):
"""Displays a user's profile."""
log.debug("Showing user profile...")
buffer = self.get_best_buffer()
handler = self.get_handler(type=buffer.session.type)
if handler and hasattr(handler, 'showUserProfile'):
handler.showUserProfile(buffer)
if handler and hasattr(handler, 'user_details'):
handler.user_details(buffer)
def openPostTimeline(self, *args, user=None):
"""Opens selected user's posts timeline

View File

@ -304,7 +304,7 @@ class Handler(object):
log.debug(f"Updating users profile with: {updated_data}")
call_threaded(session.api_call, "account_update_credentials", _("Update profile"), report_success=True, **updated_data)
def showUserProfile(self, buffer):
def user_details(self, buffer):
"""Displays user profile in a dialog.
This works as long as the focused item hass a 'account' key."""
if not hasattr(buffer, 'get_item'):

View File

@ -35,4 +35,5 @@ accountConfiguration = string(default="control+win+shift+o")
update_buffer = string(default="control+win+shift+u")
ocr_image = string(default="win+alt+o")
open_in_browser = string(default="alt+control+win+return")
add_alias=string(default="")
add_alias=string(default="")
vote=string(default="alt+win+shift+v")

View File

@ -54,4 +54,5 @@ accountConfiguration = string(default="control+win+shift+o")
update_buffer = string(default="control+win+shift+u")
ocr_image = string(default="win+alt+o")
open_in_browser = string(default="alt+control+win+return")
add_alias=string(default="")
add_alias=string(default="")
vote=string(default="alt+win+shift+v")

View File

@ -57,3 +57,4 @@ ocr_image = string(default="win+alt+o")
open_in_browser = string(default="alt+control+win+return")
add_alias=string(default="")
find = string(default="control+win+{")
vote=string(default="alt+win+shift+v")

View File

@ -57,3 +57,4 @@ ocr_image = string(default="win+alt+o")
open_in_browser = string(default="alt+control+win+return")
add_alias=string(default="")
find = string(default="control+win+{")
vote=string(default="alt+win+shift+v")

View File

@ -57,4 +57,5 @@ accountConfiguration = string(default="control+win+shift+o")
update_buffer = string(default="control+win+shift+u")
ocr_image = string(default="win+alt+o")
open_in_browser = string(default="alt+control+win+return")
add_alias=string(default="")
add_alias=string(default="")
vote=string(default="alt+win+shift+v")

View File

@ -15,7 +15,7 @@ actions = {
"remove_from_favourites": _(u"Remove post from favorites"),
"toggle_like": _("Add/remove post from favorites"),
"follow": _(u"Open the user actions dialogue"),
# "user_details": _(u"See user details"),
"user_details": _(u"See user details"),
"view_item": _(u"Show post"),
"exit": _(u"Quit"),
"open_timeline": _(u"Open user timeline"),