Skip to content

Commit

Permalink
Use "None" and "Not registered", plus help updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pljones committed Feb 13, 2022
1 parent 7aa492c commit 0eb4436
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
20 changes: 10 additions & 10 deletions src/serverdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ CServerDlg::CServerDlg ( CServer* pNServP, CServerSettings* pNSetP, const bool b
cbxDirectoryType->setAccessibleName ( strDirectoryTypeAN );

QString strDirectoryTypeWT = "<b>" + tr ( "Directory" ) + ":</b> " +
tr ( "Select '%1' to leave your server unregistered." ).arg ( DirectoryTypeToString ( AT_NONE ) ) + "<br>" +
tr ( "Select one of the genres to register in that server list." ) + "<br>" +
tr ( "Or select '%1' and specify a custom directory address on the "
"Options tab to select a custom server list." )
tr ( "Select '%1' not to register your server with a directory." ).arg ( DirectoryTypeToString ( AT_NONE ) ) +
"<br>" + tr ( "Select one of the genres to register with that directory." ) + "<br>" +
tr ( "Or select '%1' and specify a Custom Directory address on the "
"Options tab to register with a custom directory." )
.arg ( DirectoryTypeToString ( AT_CUSTOM ) ) +
"<br>" +
"<br><br>" +
tr ( "For any value except '%1', this server registers "
"with a directory so that a %2 user can select this server "
"in the client connect dialog server list when they choose that directory." )
.arg ( DirectoryTypeToString ( AT_NONE ) )
.arg ( APP_NAME ) +
"<br>" +
"<br><br>" +
tr ( "The registration of the server is renewed periodically "
"to make sure that all servers in the connect dialog server list are "
"actually available." );
Expand Down Expand Up @@ -183,9 +183,9 @@ CServerDlg::CServerDlg ( CServer* pNServP, CServerSettings* pNSetP, const bool b
"This will prevent recording until a new value is selected." ) );

// custom directory
QString strCustomDirectory = "<b>" + tr ( "Custom Directory" ) + ":</b> " +
tr ( "The custom directory is the IP address or URL of the directory "
"server at which the server list of the connection dialog is managed." );
QString strCustomDirectory = "<b>" + tr ( "Custom Directory address" ) + ":</b> " +
tr ( "The Custom Directory address is the address of the directory "
"holding the server list to which this server should be added." );

lblCustomDirectory->setWhatsThis ( strCustomDirectory );
edtCustomDirectory->setWhatsThis ( strCustomDirectory );
Expand Down Expand Up @@ -732,7 +732,7 @@ void CServerDlg::UpdateGUIDependencies()
}
}

if ( eSvrRegStatus == SRS_UNREGISTERED )
if ( eSvrRegStatus == SRS_NOT_REGISTERED )
{
lblRegSvrStatus->setText ( strStatus );
}
Expand Down
2 changes: 1 addition & 1 deletion src/serverdlgbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
<item>
<widget class="QLabel" name="lblCustomDirectory">
<property name="text">
<string>Custom Directory Server Address</string>
<string>Custom Directory address</string>
</property>
</widget>
</item>
Expand Down
18 changes: 9 additions & 9 deletions src/serverlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
ServerListFileName ( strServerListFileName ),
strDirectoryAddress ( "" ),
bIsDirectoryServer ( false ),
eSvrRegStatus ( SRS_UNREGISTERED ),
eSvrRegStatus ( SRS_NOT_REGISTERED ),
strMinServerVersion ( "" ), // disable version check with empty version
pConnLessProtocol ( pNConLProt ),
iSvrRegRetries ( 0 )
Expand Down Expand Up @@ -244,7 +244,7 @@ void CServerListManager::SetServerName ( const QString& strNewName )
if ( ServerList[0].strName != strNewName )
{
ServerList[0].strName = strNewName;
SetRegistered ( eSvrRegStatus != SRS_UNREGISTERED );
SetRegistered ( eSvrRegStatus != SRS_NOT_REGISTERED );
}
}

Expand All @@ -253,7 +253,7 @@ void CServerListManager::SetServerCity ( const QString& strNewCity )
if ( ServerList[0].strCity != strNewCity )
{
ServerList[0].strCity = strNewCity;
SetRegistered ( eSvrRegStatus != SRS_UNREGISTERED );
SetRegistered ( eSvrRegStatus != SRS_NOT_REGISTERED );
}
}

Expand All @@ -262,7 +262,7 @@ void CServerListManager::SetServerCountry ( const QLocale::Country eNewCountry )
if ( ServerList[0].eCountry != eNewCountry )
{
ServerList[0].eCountry = eNewCountry;
SetRegistered ( eSvrRegStatus != SRS_UNREGISTERED );
SetRegistered ( eSvrRegStatus != SRS_NOT_REGISTERED );
}
}

Expand Down Expand Up @@ -353,7 +353,7 @@ void CServerListManager::SetIsDirectoryServer()
void CServerListManager::Unregister()
{
// if not currently registered, nothing needs doing
if ( DirectoryType == AT_NONE || ( DirectoryType == AT_CUSTOM && strDirectoryAddress.isEmpty() ) || eSvrRegStatus == SRS_UNREGISTERED )
if ( DirectoryType == AT_NONE || ( DirectoryType == AT_CUSTOM && strDirectoryAddress.isEmpty() ) || eSvrRegStatus == SRS_NOT_REGISTERED )
{
return;
}
Expand Down Expand Up @@ -387,7 +387,7 @@ void CServerListManager::Register()
if ( DirectoryType == AT_NONE || ( DirectoryType == AT_CUSTOM && strDirectoryAddress.isEmpty() ) || eSvrRegStatus == SRS_REGISTERED )
{
// there are edge cases during registration...
// maybe ! ( SRS_UNREGISTERED || SRS_BAD_ADDRESS )
// maybe ! ( SRS_NOT_REGISTERED || SRS_BAD_ADDRESS )
return;
}

Expand Down Expand Up @@ -854,7 +854,7 @@ void CServerListManager::SetRegistered ( const bool bIsRegister )
// any time
QMutexLocker locker ( &Mutex );

if ( !bIsRegister && eSvrRegStatus == SRS_UNREGISTERED )
if ( !bIsRegister && eSvrRegStatus == SRS_NOT_REGISTERED )
{
// not wanting to set registered, not registered, nothing to do
return;
Expand All @@ -863,7 +863,7 @@ void CServerListManager::SetRegistered ( const bool bIsRegister )
if ( bIsDirectoryServer )
{
// this IS the directory, no network message to worry about
SetSvrRegStatus ( bIsRegister ? SRS_REGISTERED : SRS_UNREGISTERED );
SetSvrRegStatus ( bIsRegister ? SRS_REGISTERED : SRS_NOT_REGISTERED );
return;
}

Expand Down Expand Up @@ -895,7 +895,7 @@ void CServerListManager::SetRegistered ( const bool bIsRegister )
else
{
// unregister server if it is registered - regardless of success of parse
SetSvrRegStatus ( SRS_UNREGISTERED );
SetSvrRegStatus ( SRS_NOT_REGISTERED );

if ( bDirectoryAddressValid )
{
Expand Down
8 changes: 4 additions & 4 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ inline QString DirectoryTypeToString ( EDirectoryType eAddrType )
switch ( eAddrType )
{
case AT_NONE:
return QCoreApplication::translate ( "CServerDlg", "Unregistered" );
return QCoreApplication::translate ( "CServerDlg", "None" );

case AT_ANY_GENRE2:
return QCoreApplication::translate ( "CClientSettingsDlg", "Any Genre 2" );
Expand Down Expand Up @@ -605,7 +605,7 @@ inline QString DirectoryTypeToString ( EDirectoryType eAddrType )
// Server registration state ---------------------------------------------
enum ESvrRegStatus
{
SRS_UNREGISTERED,
SRS_NOT_REGISTERED,
SRS_BAD_ADDRESS,
SRS_REQUESTED,
SRS_TIME_OUT,
Expand All @@ -620,8 +620,8 @@ inline QString svrRegStatusToString ( ESvrRegStatus eSvrRegStatus )
{
switch ( eSvrRegStatus )
{
case SRS_UNREGISTERED:
return QCoreApplication::translate ( "CServerDlg", "Unregistered" );
case SRS_NOT_REGISTERED:
return QCoreApplication::translate ( "CServerDlg", "Not registered" );

case SRS_BAD_ADDRESS:
return QCoreApplication::translate ( "CServerDlg", "Bad address" );
Expand Down

0 comments on commit 0eb4436

Please sign in to comment.