Skip to content

created show user profile dialogh #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 10, 2023
Merged

created show user profile dialogh #555

merged 4 commits into from
Oct 10, 2023

Conversation

Arfs6
Copy link
Contributor

@Arfs6 Arfs6 commented Aug 10, 2023

No description provided.

@Arfs6
Copy link
Contributor Author

Arfs6 commented Aug 10, 2023

No description ... :)
Created a dialog that shows a user profile and connected it with the show user profile option in the user menu.
files edited:
src/controlloer/maincontroller.py: Created showUserProfile method and connected it with view.details. Which is the show user profile option in the user menu. The method calls the appropriate handler to handle the event.
src/controller/mastodon/handler.py: Created showUserProfile method and enabled it in the menus dict. The method gets the currently focused item and retrieves all users in it. Then the user is asked to select one of the users if they are more than one and the selected user is displayed.
for the reblogged statuses, I'll like to add the user that reblogged, but I haven't figured it out yet.
And this methods works as long as the focused item has an account key. i.e. it will work in notification with users mentioned in it.
src/wxUI/dialogs/mastodon/dialog.py: added no_user dialog to display when the focused item has no users.
src/wxUI/dialogs/mastodon/showUserProfile.py: [New file] contains a dialog for the user to select a user from multiple users and another dialog to show a users profile. The ShowUserProfile dialog doesn't support created_at, bot, discoverable and private yet. I would add it shortly.

@Arfs6
Copy link
Contributor Author

Arfs6 commented Aug 12, 2023

Just added fields for created_at (when the user joined mastodon), locked (private account), bot and discoverable.
Two things I'll like to discuss about before implementing.

  1. Adding the user actions button perhaps as a button to the dialog. This way, a user can just follow someone or perform other actions directly from the dialog.
  2. Adding a button to open the user's followers, following and statuses as a buffer. I am supposed to add the count of all of it, but why not make it a button the user can click and open it in a separate buffer?

@manuelcortez
Copy link
Member

Sounds a good idea (placing both the user actions button and probably another button that opens up the timeline dialog). If I am not mistaken, you should be able to use pubsub to invoque the action for opening both dialogs so the button should be relatively simple to handle.

@Arfs6
Copy link
Contributor Author

Arfs6 commented Aug 13, 2023

Pubsub to open the dialog? I haven't seen it. Should I create one?
The handler that opens a user's timeline selects a user, then the type of buffer to open. Since in the show user profile dialog, a user is already selected, the remaining thing is to select the type of buffer to open. So, I'll display the post, following and followers count as a button. When a user clicks it, then it will spawn the buffer.
But for the actions, I'll create a pubsub message for it. It will open the actions dialog.
I'll try and finish this next weekends or when I have time during the weekdays.

@Arfs6
Copy link
Contributor Author

Arfs6 commented Aug 27, 2023

I just pushed the updates.
This branch is ready for merging when you're ready.
edited: src/controller/mainController.py - Changed the execute_action method to support kwargs.
Created openPostTimeline, openFollowersTimeline and openFollowing timeline methods. They all call the appropriate mastodon.handler method.
edited: src/controller/mastodon/handler.py - created openPostTimeline, openFollowersTimeline and openFollowingTimeline. Used for openning timelines :)
Changed openTimeline to use the above methods for creating the buffers.ment, so edited
edited: src/wxUI/dialogs/mastodon/showUserProfile.py - Created actions button. When clicked, it will send a pubsub message to execute controller.follow(). Which will open the actions dialog. The issue with this is, the user needs to select a user if there are multiple users. Since a user profile is already opened, it shouldn't be like this. I didn't go to that rabbit hole because I think the actions dialog needs some restructuring.
Created three more buttons: posts, followers and following. All for displaying it's count and opening the corresponding buffer. It uses pubsub to execute the created controller methods above. This will directly create a buffer, no need of any further selection.

@manuelcortez manuelcortez merged commit e6ad42d into MCV-Software:next-gen Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants