Skip to content

Set user status - #3639

Merged
FlexW merged 1 commit into
masterfrom
feature/set-user-status
Sep 9, 2021
Merged

FlexW merged 1 commit into
masterfrom
feature/set-user-status

Conversation

@FlexW

@FlexW FlexW commented Aug 9, 2021 •

Copy link
Copy Markdown

Fixes a part of #2318
Related #3045

Set the user status from the main dialog:
2021-08-09T16:27:57,546758995+02:00

A dialog to set a custom user status:
2021-08-09T16:28:23,106635973+02:00

Emoji picker:
2021-08-09T16:28:43,991585358+02:00

Note to myself: Upgrade to Qt 5.15 before this can be merged.

@FlexW
FlexW force-pushed the feature/set-user-status branch 2 times, most recently from 874f7cf to d5675a9 Compare August 9, 2021 15:10
@jancborchardt

jancborchardt commented Aug 9, 2021 •

Copy link
Copy Markdown
Member

Very cool! As usual, mostly detail feedback on design:

  • "Set user status" should be first in action menu
  • Wording: "Set status" rather than "Set user status", like on Android

In the dialog:

  • Can the text of the "Online status" buttons have the icons on the left?
  • The status message emoji button would look better square?
  • There should be less whitespace between custom status message input and the 5 suggestions as they belong together
  • Is it possible to not make the 5 suggestions be styled like buttons, because that’s a bit much?
  • And possibly the suggestions could be left-aligned? → Align the button text/icon to the left is not easily possible in Qml. We would need to design our own button. I would prefer to avoid that now because it is too much work for the added value.
  • Is it possible to style "Set status message" as a sort of primary button? Otherwise all buttons look the same.

Comment thread src/gui/emojimodel.cpp Outdated
Comment thread src/gui/SetUserStatusView.qml Outdated
Comment thread src/gui/SetUserStatusView.qml Outdated
Comment thread src/gui/EmojiPicker.qml
Comment thread src/gui/userstatusdialogmodel.h Outdated
@FlexW
FlexW force-pushed the feature/set-user-status branch from 127d2ad to cbad873 Compare August 13, 2021 10:14
@FlexW

FlexW commented Aug 17, 2021

Copy link
Copy Markdown
Author

@jancborchardt Does that work?

2021-08-17T17:07:33,220311602+02:00

Align the button text/icon to the left is not easily possible in Qml. We would need to design our own button. I would prefer to avoid that now because it is too much work for the added value.

@FlexW
FlexW force-pushed the feature/set-user-status branch 5 times, most recently from cbafdf3 to 2dd8012 Compare August 18, 2021 10:02
@FlexW
FlexW marked this pull request as ready for review August 18, 2021 10:03
@FlexW
FlexW force-pushed the feature/set-user-status branch from 2dd8012 to c00bbda Compare August 18, 2021 10:51
@jancborchardt

Copy link
Copy Markdown
Member

@FlexW very nice! :) I converted the feedback above into checkboxes, can you check off if that’s done?

And the dialog could use a little bit more vertical whitespace between the logical sections and on the top, like so:
status desktop

@FlexW
FlexW force-pushed the feature/set-user-status branch from c00bbda to 87677a8 Compare August 19, 2021 11:52
@FlexW

FlexW commented Aug 19, 2021

Copy link
Copy Markdown
Author

@jancborchardt done

2021-08-19T13:56:17,748066766+02:00

@FlexW
FlexW force-pushed the feature/set-user-status branch from 87677a8 to 33874b3 Compare August 19, 2021 11:58

@jancborchardt jancborchardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nice! :)

@FlexW
FlexW force-pushed the feature/set-user-status branch 3 times, most recently from be0d4d9 to ccb1665 Compare August 19, 2021 13:04

@mgallien mgallien left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect more review rounds after this one

Comment thread src/gui/EmojiPicker.qml Outdated
Comment thread src/gui/EmojiPicker.qml Outdated
Comment thread src/gui/tray/UserLine.qml
Comment thread src/gui/EmojiPicker.qml Outdated
Comment thread src/gui/EmojiPicker.qml

SetUserStatusDialogModel::SetUserStatusDialogModel(QObject *parent)
: QObject(parent)
, _dateTimeProvider(new DateTimeProvider)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use std::make_unique<DateTimeProvider>()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the benefit?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the object dynamically allocated by std::make_unique<DateTimeProvider>() is already managed by an instance of std::unique_ptr so it can never leak
direct usage of new can lead to a leak if there is something happening like an exception being fired between the call to new and the call to the constructor of the std::unique_ptr

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure because that is the implementation of std::make_unique() in my stl:

  /// std::make_unique for single objects
  template<typename _Tp, typename... _Args>
    inline typename _MakeUniq<_Tp>::__single_object
    make_unique(_Args&&... __args)
    { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }

Seems to be just that what I do.

, _userStatusJob(std::move(userStatusJob))
, _userStatus("no-id", "", "😀",
UserStatus::OnlineStatus::Online, false, {})
, _dateTimeProvider(new DateTimeProvider)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use std::make_unique<DateTimeProvider>()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment

Comment thread src/gui/setuserstatusdialogmodel.cpp Outdated

Q_LOGGING_CATEGORY(lcUserStatusDialogModel, "nextcloud.gui.userstatusdialogmodel", QtInfoMsg)

SetUserStatusDialogModel::SetUserStatusDialogModel(QObject *parent)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will leave the object in a working state or an invalid one ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid. But it's needed to make it available for Qml.

Comment thread src/gui/setuserstatusdialogmodel.cpp Outdated
Comment thread src/gui/setuserstatusdialogmodel.cpp Outdated
Comment thread src/libsync/ocsuserstatusconnector.cpp
Comment thread src/gui/ErrorBox.qml
@allexzander

Copy link
Copy Markdown
Contributor

@FlexW Left a few comments. Some of them could be outdated as I have been reviewing it commit-by-commit. Feel free to ignore those. The functionality seems to be working. Tested locally.

@FlexW
FlexW force-pushed the feature/set-user-status branch 2 times, most recently from db5f453 to 0794266 Compare September 1, 2021 11:12
@FlexW
FlexW requested a review from mgallien September 1, 2021 11:14
@tobiasKaminsky tobiasKaminsky linked an issue Sep 3, 2021 that may be closed by this pull request
@FlexW
FlexW force-pushed the feature/set-user-status branch from 0794266 to aa7f148 Compare September 3, 2021 13:43
Comment thread src/gui/EmojiPicker.qml Outdated
Comment thread src/gui/userstatusselectormodel.h
@FlexW
FlexW force-pushed the feature/set-user-status branch 6 times, most recently from ade8341 to aebea6b Compare September 8, 2021 08:52
@FlexW

FlexW commented Sep 8, 2021

Copy link
Copy Markdown
Author

/rebase

Comment thread src/gui/socketapi/socketapi.cpp
@allexzander
allexzander self-requested a review September 8, 2021 15:03

@allexzander allexzander left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than emoji not being displayed in the button and minor issues, I think it is good to go as version 1.

Signed-off-by: Felix Weilbach <[email protected]>
@FlexW
FlexW force-pushed the feature/set-user-status branch from c1d6e77 to 8a8d488 Compare September 9, 2021 09:21
@nextcloud-desktop-bot

Copy link
Copy Markdown

AppImage file: Nextcloud-PR-3639-8a8d488454405356b5d11f63bebff2d69be43b02-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@FlexW
FlexW merged commit ea6a56d into master Sep 9, 2021
@FlexW
FlexW deleted the feature/set-user-status branch September 9, 2021 09:52
@FlexW FlexW added this to the 3.3.4 milestone Sep 9, 2021
@mgallien mgallien modified the milestones: 3.3.4, 3.4.0 Sep 20, 2021
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.

Status feature in the desktop client

6 participants