Skip to content
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

OSInfo improvements #178

Closed
wants to merge 5 commits into from
Closed

OSInfo improvements #178

wants to merge 5 commits into from

Conversation

Zuko
Copy link
Contributor

@Zuko Zuko commented Oct 11, 2013

More information about OS in Server Information and User Information.

Screens:
win7_zuko win_xp

murmur

@mkrautz
Copy link
Contributor

mkrautz commented Oct 12, 2013

We should be careful of changing the OSInfo getOS and getOSVersion methods. They're used for our usage stats (src/mumble/Usage.cpp), but also in other things where long strings might look stupid, such as the User-Agent for Mumble's HTTP requests (src/mumble/Network.cpp; Network::prepareRequest).

Now, for Unix-like systems, I believe getOS and getOSVersion can return some pretty long strings already, so take that with a grain of salt. I'm actually more wary of breaking the Windows stats.

In this situation, I think it would be preferable to have a new set of methods that return "full" or "user displayable" version strings instead. Perhaps something like getOSDisplayableName, getOSDisplayableVersion. Suggestions are welcome.

@Zuko
Copy link
Contributor Author

Zuko commented Oct 13, 2013

You are right, working on it.

@Zuko
Copy link
Contributor Author

Zuko commented Oct 14, 2013

Done

@@ -7,6 +7,7 @@ message Version {
optional string release = 2;
optional string os = 3;
optional string os_version = 4;
optional string os_displayable_version = 5;
Copy link
Member

Choose a reason for hiding this comment

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

I don’t think there is a need to transmit displayable strings!?
Instead, the identifying strings are already provided - which the client can translate to human readable form.
The server does not need to know about human readable strings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I cant get all informations from version string.
17 paź 2013 00:51 "Jan Klass" notifications@github.com napisał(a):

In src/Mumble.proto:

@@ -7,6 +7,7 @@ message Version {
optional string release = 2;
optional string os = 3;
optional string os_version = 4;

  • optional string os_displayable_version = 5;

I don’t think there is a need to transmit displayable strings!?
Instead, the identifying strings are already provided - which the client
can translate to human readable form.
The server does not need to know about human readable strings.


Reply to this email directly or view it on GitHubhttps://github.com//pull/178/files#r7018948
.

Copy link
Member

Choose a reason for hiding this comment

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

Is Version used to send server and user version info?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no other message, so yes.

@mkrautz
Copy link
Contributor

mkrautz commented Oct 25, 2013

Drop the caching in getOSDisplayableVersion.

Move the ifdef Q_OS_WIN for getOSDisplayableVersion inside the method.
Make getOSDisplayableVersion return an empty/null QString (return QString(), or whatever fits the code) for non Q_OS_WIN.

If getOSDisplayableVersion is empty, don't include it when transmitting the Version protobufs.

Remove the Q_OS_WIN ifdef in UserInformation.cpp.
Also in UserInformation.cpp, use mpv.has_os_displayable_version() instead of checking for emptiness.

A question: in your screnshots, your Polish version has Polish strings for the displayable version. I don't see any code in the current pull request that does that - and I think we should keep the strings transmitted over the wire in English. (I think the code as-is is fine in this regard.)

My own comments:

I think this change makes sense. As a server admin (or just power user), you will sometimes help
other people on the server with Mumble or other computer-related issues. In this case, it can
sometimes be useful to know the exact version of the OS they're running.

I'm fine with the "displayable version" being the only string shown in UserInfo if it is present in the Version protobuf, but I also think it'd be nice if we could show the OS and OSVersion values somewhow. A tooltip would be my preferred choice, but I guess that's a bit tough to do with the current structure, so let's wait with that.

I'd like to know what other devs think about the change before we land it, though.

For example, on Unix-like systems, I believe the OSVersion field is already pretty free-form. Maybe we should drop os_displayable_version from the protobuf, and simply use the same mechanism for Windows? Or alternatively, transition the Unix code over to os_displayable_version.

@Zuko
Copy link
Contributor Author

Zuko commented Oct 28, 2013

  • all mkrautz suggested changes are done.

osdispver.append(osv);

return osdispver;
#elif defined(Q_OS_MAC)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please just use a single #else clause (drop Q_OS_MAC) and return QString();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

two return's? one from indef and one without? I don't get it ;/
EDIT. nvm I'm stupid ;D

Copy link
Contributor

Choose a reason for hiding this comment

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

    QString OSInfo::getOSDisplayableVersion() {
#ifdef Q_OS_WIN
        // your current code
        return osdispver;
#else
        return QString();
#endif
    }

@mkrautz
Copy link
Contributor

mkrautz commented Oct 28, 2013

Seems good to me now, with the few nits I just added.

I will try to ping the others to see what they think.

if (ovi.wProductType == VER_NT_WORKSTATION)
osdispver = QLatin1String("Windows 8.1");
else
osdispver = QLatin1String("Windows Server 2012 R2");
Copy link
Contributor

Choose a reason for hiding this comment

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

formating

Default value
tipabu added a commit to tipabu/mumble that referenced this pull request Nov 8, 2013
… Coupled with the changes from mumble-voip#178, Win 8.1 should be correctly detected and displayed.
@ghost ghost assigned mkrautz Dec 7, 2013
@Zuko
Copy link
Contributor Author

Zuko commented Dec 15, 2013

bump? 👍 🎱

@mkrautz
Copy link
Contributor

mkrautz commented Jan 11, 2014

Landed as 8f0ae69.

Sorry for the long wait.

Slightly modified to add some additional error handling and remove the new field of the Version protobuf, which was deemed overkill in the end.

@mkrautz mkrautz closed this Jan 11, 2014
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.

None yet

5 participants