Add progress loading icon to QtQuick server row

Authored by Kanedias on Jan 7 2018, 1:45 PM.



This adds loading icon in the same place where unread notification count
resides. These two will never interfer with each other because loading
is always finished when unread count is displayed.

Connection state enum had to be moved from namespace to Server class
because of QML support: QML only supports "nested" class enums or
namespace enums of new C++11 style (enum classes). Signals and typos
were transformed to new syntax and fixed along the way.

There are still some quirks that I'm unsure how to fix:

  • Loading icon is pixelated when it rotates - strange given it's SVG
  • Loading icon appears smoothly but disappears instantaneously because of QML destroy() behaviour.

Diff Detail

R7 Konversation
Lint OK
No Unit Test Coverage
Kanedias requested review of this revision.Jan 7 2018, 1:45 PM
Kanedias created this revision.
hein added a comment.Jan 8 2018, 9:34 AM

Nice idea!

I think from an API perspective it'd be nicer to expose the enum to Qt Quick via a ConnectionState uninstantiable class though, then it'd be used in QML via e.g. Konversation.ConnectionState.SSConnected.

I wish I could remember why it has those SS prefixes - might be nice to just drop them for QML. Konversation.ConnectionState.Connected reads very nice IMHO.

Hi Eike!

Marco proposed to push this style of BusyIndicator further to qqc2-desktop-integration, I'll update this revision once I'm done there.
And yes, I'll update enum accordingly, thanks :)

Kanedias updated this revision to Diff 25571.Jan 17 2018, 10:09 PM

Add namespace-level enum, fixes for Eike comments

@hein , I managed to do this! Via namespace-level enums

Some notes:

  • I upstreamed QQC2.BusyIndicator style to qqc2-desktop-style master
  • By my experience (and according to Martin) qqc2-desktop-style should be installed to /usr to be actually usable by applications, my other attempts failed
  • Hope you don't mind some cleanups and comments where code flow seemed difficult
hein accepted this revision.Jan 18 2018, 10:00 AM

Let's nix the console.log() calls (unlike qDebug those don't go no-op in a rlease build), otherwise looks ready to go. Great work!

This revision is now accepted and ready to land.Jan 18 2018, 10:00 AM
Kanedias closed this revision.Jan 18 2018, 8:42 PM
In D9708#192750, @hein wrote:

Let's nix the console.log() calls (unlike qDebug those don't go no-op in a rlease build), otherwise looks ready to go. Great work!

I ripped them out, thanks!