Index: ClientApp/CParallelsAboutDialog.cpp
===================================================================
--- ClientApp/CParallelsAboutDialog.cpp (revision 30818)
+++ ClientApp/CParallelsAboutDialog.cpp (working copy)
@@ -21,6 +21,8 @@
#include "CClientAppUtils.h"
#include "StringTable.h"
#include "CApplication.h"
+#include "CServerManager.h"
+#include "CServerWrap.h"
#include "../Build/Current-gen.ver"
#include "Libraries/Logging/Logging.h"
@@ -48,11 +50,11 @@
QString productName;
if ( PARALLELS_APP->isServerMode() ) {
productName = QObject::tr( "Server" );
- title = ID_TEXT_PRODUCT_NAME_SERVER;
+ title = QObject::tr(ID_TEXT_PRODUCT_NAME_SERVER);
}
else {
productName = QObject::tr( "Desktop" );
- title = ID_TEXT_PRODUCT_NAME_DESKTOP;
+ title = QObject::tr(ID_TEXT_PRODUCT_NAME_DESKTOP);
}
////////////////////////////////////////////////////////////////////////////////
@@ -124,7 +126,7 @@
CWidgetUtils::setNormalFont( m_DlgUI.m_lblCopyrightText );
CWidgetUtils::setNormalFont( m_DlgUI.m_lblTrademarks );
CWidgetUtils::setNormalFont( m_DlgUI.m_lblLicenseText );
- CWidgetUtils::setNormalFont( m_DlgUI.m_lblUser );
+ CWidgetUtils::setNormalFont( m_DlgUI.m_lblLicenses );
CWidgetUtils::setNormalFont( m_DlgUI.m_lblTechSupport );
CWidgetUtils::setNormalFont( m_DlgUI.m_supportRef );
QString refTxt = m_DlgUI.m_supportRef->text();
@@ -136,13 +138,8 @@
// Set fixed size
////////////////////////////////////////////////////////////////////////////////
- int height = 450;
-#ifdef _MAC_
- height = 470;
-#endif
+ layout()->setSizeConstraint( QLayout::SetFixedSize );
- setFixedSize( QSize( width(), height ).expandedTo( minimumSizeHint() ) );
-
#ifdef _MAC_
////////////////////////////////////////////////////////////////////////////////
// Move to screen center
@@ -163,3 +160,59 @@
///////////////////////////////////////////////////////////////////////////////
+void CParallelsAboutDialog::fillLicensingData()
+{
+ int nSrvCount = SERVER_MNG->countServers();
+ QString sLabelText;
+
+ for(int idx=0; idx < nSrvCount; ++idx)
+ {
+ CServerWrap *pServer = SERVER_MNG->getServer(idx);
+ if(!pServer || pServer->getState() != CServerWrap::Connected )
+ continue;
+
+ SdkHandleWrap hLicenseHandle = pServer->requestLicenseInfo();
+
+ PRL_UINT32 iBufLength = 100;
+ PRL_CHAR sLicenseKey[100];
+ PRL_RESULT nRetCode = PrlLic_GetLicenseKey(hLicenseHandle, sLicenseKey, &iBufLength);
+ if (PRL_FAILED(nRetCode))
+ {
+ LOG_MESSAGE(DBG_FATAL, "Couldn't extract dispatcher license info (key). Error code: %.8X", nRetCode);
+ continue;
+ }
+
+ iBufLength = 100;
+ PRL_CHAR sUserName[100];
+ nRetCode = PrlLic_GetUserName(hLicenseHandle, sUserName, &iBufLength);
+ if (PRL_FAILED(nRetCode))
+ {
+ LOG_MESSAGE(DBG_FATAL, "Couldn't extract dispatcher license info (user name). Error code: %.8X", nRetCode);
+ continue;
+ }
+
+ // if label text is empty, then this is the entry for the first online
+ // server in list and there's no need to put newline. Otherwise, we put
+ // newline to nicely separate info for each online server
+ if( !sLabelText.isEmpty() )
+ sLabelText.append("
");
+
+ // nothing failed, so let's write it
+ sLabelText.append( QString("%1 ").arg(QString::fromUtf8(sUserName)) );
+ if( PARALLELS_APP->isServerMode() )
+ sLabelText.append(QString(": %1
").arg(pServer->getServerName()));
+ sLabelText.append( "Key: "+QString::fromUtf8(sLicenseKey) );
+ }
+
+ m_DlgUI.m_lblLicenses->setText( sLabelText );
+}
+
+void CParallelsAboutDialog::showEvent( QShowEvent* )
+{
+ fillLicensingData();
+// int width = m_DlgUI.frame_2->width();
+// m_DlgUI.m_lblTrademarks->setFixedSize( width, m_DlgUI.m_lblTrademarks->heightForWidth(width) );
+ updateGeometry();
+// setFixedSize( sizeHint() );
+}
+
Index: ClientApp/CParallelsAboutDialog.h
===================================================================
--- ClientApp/CParallelsAboutDialog.h (revision 30818)
+++ ClientApp/CParallelsAboutDialog.h (working copy)
@@ -36,6 +36,15 @@
private:
void initDialog ();
+ /**
+ * Fills corresponding label with licensing data for
+ * each server
+ */
+ void fillLicensingData();
+ /**
+ * Show event handler
+ */
+ void showEvent( QShowEvent* );
private slots:
void onMoreInfo ();
Index: ClientApp/dialogs/CParallelsAboutDialog.ui
===================================================================
--- ClientApp/dialogs/CParallelsAboutDialog.ui (revision 30818)
+++ ClientApp/dialogs/CParallelsAboutDialog.ui (working copy)
@@ -9,25 +9,32 @@
0
0
422
- 493
+ 512
Form
-
+
0
-
+
0
+
+ 0
+
+
+ 0
+
+
+ 0
+
-
-
- 5
- 0
+
0
0
@@ -43,9 +50,7 @@
-
-
- 5
- 5
+
0
0
@@ -57,18 +62,10 @@
QFrame::Plain
-
- 9
-
-
- 9
-
-
-
- 5
- 0
+
0
0
@@ -86,9 +83,7 @@
-
-
- 5
- 0
+
0
0
@@ -106,9 +101,7 @@
-
-
- 5
- 0
+
0
0
@@ -139,9 +132,7 @@
-
-
- 5
- 5
+
0
0
@@ -181,9 +172,7 @@
-
-
- 5
- 0
+
0
0
@@ -202,18 +191,10 @@
-
-
- 0
-
-
- 4
-
-
-
- 5
- 0
+
0
0
@@ -229,24 +210,42 @@
-
-
-
-
- 5
- 0
- 0
- 0
-
-
-
-
- 11
-
-
-
- User
-
-
+
+
-
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 20
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 11
+
+
+
+ User
+
+
+
+
@@ -263,9 +262,7 @@
-
-
- 5
- 0
+
0
0
@@ -284,18 +281,25 @@
-
-
- 0
-
6
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
-
-
- 5
- 0
+
0
0
@@ -313,15 +317,13 @@
-
-
- 5
- 1
+
0
0
- 13
+ PointingHandCursor
Qt::NoFocus
@@ -367,12 +369,21 @@
-
-
- 9
-
6
+
+ 9
+
+
+ 9
+
+
+ 9
+
+
+ 9
+
-