refactor: Protocals text and update tanslate text.
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "windows/LoginDialog.h"
|
||||
#include "screensaver/ScreenSaverWindow.h"
|
||||
#include "utilities/GetLockScreenTimeHelper.h"
|
||||
#include "utilities/GetProtocalHelper.h"
|
||||
|
||||
#include "appvals/AppGlobalValues.h"
|
||||
#include "json/jsonobject.h"
|
||||
@@ -243,8 +244,8 @@ DialogResult DialogManager::requestSelectProtocal()
|
||||
SelectDialog dialog(mTopWidget);
|
||||
setTopWidget(&dialog);
|
||||
dialog.setWindowModality(Qt::WindowModal);
|
||||
dialog.setValues(JsonObject::Instance()->protocals());
|
||||
dialog.setSelectedValue(JsonObject::Instance()->defaultProtocal());
|
||||
dialog.setValues(GetProtocalHelper::getProtocalList());
|
||||
dialog.setSelectedValue(GetProtocalHelper::getProtocalStr());
|
||||
int ret = dialog.exec();
|
||||
releaseTopWidget(&dialog);
|
||||
return DialogResult(ret,dialog.getSelectedValue());
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "forms/select/PatientInformation.h"
|
||||
#include "json/jsonobject.h"
|
||||
|
||||
#include "utilities/GetProtocalHelper.h"
|
||||
|
||||
#include <QButtonGroup>
|
||||
|
||||
StartScanProcessDialog::StartScanProcessDialog(QWidget *aParent) :
|
||||
@@ -35,26 +37,28 @@ void StartScanProcessDialog::initButtons()
|
||||
buttonGroup->addButton(mUI->mOnlyLeftButton, LONE);
|
||||
buttonGroup->addButton(mUI->mOnlyRightButton, RONE);
|
||||
|
||||
QString protocol = JsonObject::Instance()->defaultProtocal();
|
||||
if(protocol == "LSTAND")
|
||||
int protocol = GetProtocalHelper::getProtocal();
|
||||
switch (protocol)
|
||||
{
|
||||
case LSTAND:
|
||||
mUI->mLeftToRightButton->setChecked(true);
|
||||
mScanProtocal = LSTAND;
|
||||
}
|
||||
else if(protocol == "RSTAND")
|
||||
{
|
||||
break;
|
||||
case RSTAND:
|
||||
mUI->mRightToLeftButton->setChecked(true);
|
||||
mScanProtocal = RSTAND;
|
||||
}
|
||||
else if(protocol == "LONE")
|
||||
{
|
||||
break;
|
||||
case LONE:
|
||||
mUI->mOnlyLeftButton->setChecked(true);
|
||||
mScanProtocal = LONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
case RONE:
|
||||
mUI->mOnlyRightButton->setChecked(true);
|
||||
mScanProtocal = RONE;
|
||||
break;
|
||||
default:
|
||||
mUI->mLeftToRightButton->setChecked(true);
|
||||
mScanProtocal = LSTAND;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,36 +21,7 @@
|
||||
#include "log/UserOperationLog.h"
|
||||
#include "utilities/DiskInfoWorker.h"
|
||||
#include "utilities/GetLockScreenTimeHelper.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
const int MINIMUM_LOCKTIME = 30;
|
||||
|
||||
QString toTimeString(int aSeconds)
|
||||
{
|
||||
if(aSeconds == 0)
|
||||
{
|
||||
return "-";
|
||||
}
|
||||
|
||||
if(aSeconds < 3600)
|
||||
{
|
||||
return QString("%1%2%3 %4%5%6 ").arg(QString::number((aSeconds % 3600) / 600))
|
||||
.arg(QString::number((aSeconds % 600) / 60))
|
||||
.arg(QObject::tr("Min"))
|
||||
.arg(QString::number((aSeconds % 60) / 10))
|
||||
.arg(QString::number(aSeconds % 10))
|
||||
.arg(QObject::tr("Sec"));
|
||||
}
|
||||
|
||||
return QString("%1%2%3 %4%5%6 ").arg(QString::number(aSeconds / 36000))
|
||||
.arg(QString::number((aSeconds / 3600) % 10))
|
||||
.arg(QObject::tr("Hour"))
|
||||
.arg(QString::number((aSeconds % 3600) / 600))
|
||||
.arg(QString::number((aSeconds % 600) / 60))
|
||||
.arg(QObject::tr("Min"));
|
||||
}
|
||||
}
|
||||
#include "utilities/GetProtocalHelper.h"
|
||||
|
||||
GeneralForm::GeneralForm(QWidget* aParent)
|
||||
: QWidget(aParent)
|
||||
@@ -114,7 +85,7 @@ GeneralForm::GeneralForm(QWidget* aParent)
|
||||
scanProtocalHeaderLayout->addWidget(scanProtocolLabel);
|
||||
scanProtocalHeaderLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
|
||||
ListBox* scanProtocolButton = new ListBox(scanProtocolHeader);
|
||||
scanProtocolButton->setText(tr(JsonObject::Instance()->defaultProtocal().toStdString().c_str()));
|
||||
scanProtocolButton->setText(GetProtocalHelper::getProtocalStr());
|
||||
scanProtocalHeaderLayout->addWidget(scanProtocolButton);
|
||||
scanProtocalHeaderLayout->addSpacerItem(new QSpacerItem(1220, 20, QSizePolicy::Fixed));
|
||||
|
||||
@@ -201,8 +172,6 @@ GeneralForm::GeneralForm(QWidget* aParent)
|
||||
});
|
||||
connect(lockTime, &QToolButton::clicked, [=]()
|
||||
{
|
||||
//take effect
|
||||
//int second = JsonObject::Instance()->lockScreenTimeout().toInt();
|
||||
DialogResult result = DialogManager::Default()->requestSelectLockScreenTime();
|
||||
if (result.ResultCode == false)
|
||||
{
|
||||
@@ -211,24 +180,6 @@ GeneralForm::GeneralForm(QWidget* aParent)
|
||||
QString lockTimeStr = result.ResultData.toString();
|
||||
lockTime->setText(lockTimeStr);
|
||||
GetLockScreenTimeHelper::setLockScreenTime(lockTimeStr);
|
||||
//second = result.ResultData.toInt();
|
||||
//LOG_USER_OPERATION(QString("Set Screen Lock Time to %1 seconds").arg(second))
|
||||
// if(second == 0)
|
||||
// {
|
||||
// JsonObject::Instance()->setLockScreenTimeout(QString::number(second));
|
||||
// lockTime->setText(toTimeString(second));
|
||||
// Locker::getInstance()->setTimer(-1);
|
||||
// Locker::getInstance()->setIsEnable(false);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// if (MINIMUM_LOCKTIME < second)
|
||||
// {
|
||||
// JsonObject::Instance()->setLockScreenTimeout(QString::number(second));
|
||||
// Locker::getInstance()->setTimer(second * 1000);
|
||||
// Locker::getInstance()->setIsEnable(true);
|
||||
// lockTime->setText(toTimeString(second));
|
||||
// }
|
||||
|
||||
});
|
||||
|
||||
@@ -259,7 +210,7 @@ GeneralForm::GeneralForm(QWidget* aParent)
|
||||
screenSaverLabel->setText(tr("Screen Saver"));
|
||||
diskLabel->setText(tr("Disk Storage"));
|
||||
anonyButton->setChecked(JsonObject::Instance()->getAnonymousMode());
|
||||
scanProtocolButton->setText(tr(JsonObject::Instance()->defaultProtocal().toStdString().c_str()));
|
||||
scanProtocolButton->setText(GetProtocalHelper::getProtocalStr());
|
||||
updateStorageSize();
|
||||
updateStorageUsed();
|
||||
});
|
||||
@@ -280,8 +231,8 @@ GeneralForm::GeneralForm(QWidget* aParent)
|
||||
{
|
||||
QString pro = result.ResultData.toString();
|
||||
//take effect
|
||||
JsonObject::Instance()->setDefaultProtocal(pro);
|
||||
scanProtocolButton->setText(tr(JsonObject::Instance()->defaultProtocal().toStdString().c_str()));
|
||||
GetProtocalHelper::setProtocal(pro);
|
||||
scanProtocolButton->setText(GetProtocalHelper::getProtocalStr());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ void JsonObject::init()
|
||||
mProtocalList = QString::fromLocal8Bit(QByteArray::fromRawData(protocals.c_str(), protocals.size())).split(";");
|
||||
}
|
||||
|
||||
mDefaultProtocal = getJsonString("protocol", "default");
|
||||
mDefaultProtocal = QString(getJsonString("protocol", "default")).toInt();
|
||||
|
||||
first = cJSON_GetObjectItem((cJSON*)json_root, "general");
|
||||
second = cJSON_GetObjectItem(first, "lockScreenTimes");
|
||||
@@ -236,14 +236,14 @@ QStringList JsonObject::protocals()
|
||||
return mProtocalList;
|
||||
}
|
||||
|
||||
QString JsonObject::defaultProtocal()
|
||||
int JsonObject::defaultProtocal()
|
||||
{
|
||||
return mDefaultProtocal;
|
||||
}
|
||||
|
||||
void JsonObject::setDefaultProtocal(const QString& str)
|
||||
void JsonObject::setDefaultProtocal(int str)
|
||||
{
|
||||
setJsonString("protocol", "default", str.toStdString().c_str());
|
||||
setJsonString("protocol", "default", QString::number(str).toStdString().c_str());
|
||||
mDefaultProtocal = str;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,8 +66,8 @@ public:
|
||||
|
||||
|
||||
QStringList protocals();
|
||||
QString defaultProtocal();
|
||||
void setDefaultProtocal(const QString& str);
|
||||
int defaultProtocal();
|
||||
void setDefaultProtocal(int str);
|
||||
|
||||
QStringList lockScreenTimes();
|
||||
|
||||
@@ -155,7 +155,6 @@ private:
|
||||
QString mDefaultLanguage;
|
||||
QString mInstitutionName;
|
||||
QString mInstitutionAddr;
|
||||
QString mDefaultProtocal;
|
||||
QString mInterfaceName;
|
||||
QString mGateway;
|
||||
|
||||
@@ -166,6 +165,7 @@ private:
|
||||
QStringList mScreenSaverInfoList;
|
||||
|
||||
int mLockScreenTime;
|
||||
int mDefaultProtocal;
|
||||
int mOperationLogExpireDays;
|
||||
int mPatientListExpireDays;
|
||||
|
||||
|
||||
@@ -90,10 +90,6 @@
|
||||
<source>Logout</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Reset password to "123456" ?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Inner error, can't find reference user!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -150,6 +146,22 @@
|
||||
<source>Input User name</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you want to logout the current user?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm Password</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Password and confirm password do not match!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Reset to default password?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AccountTableForm</name>
|
||||
@@ -256,11 +268,6 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>DeviceManager</name>
|
||||
<message>
|
||||
<source>Patient can leave.
|
||||
</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data is currently being transmitted, please shut down later.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -281,6 +288,36 @@
|
||||
<source>Initialize Failed.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Start auto locate failed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>DMS connection error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Dms connection error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The data quality is low, please restart the data scan.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>progress:%1%</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Patient can leave.
|
||||
progress:%1%</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data quality assessment in progress
|
||||
progress:99%</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>DicomCfgDialog</name>
|
||||
@@ -339,10 +376,6 @@
|
||||
<source>Form</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>AE</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Server Ip</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -355,6 +388,10 @@
|
||||
<source>Server Port</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Local AE</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EditPatientDialog</name>
|
||||
@@ -609,6 +646,18 @@
|
||||
<source>Subnet Mask</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ip Address is not valid</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Subnet Mask is not valid</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Gateway is not valid</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Keyboard</name>
|
||||
@@ -850,6 +899,18 @@
|
||||
<source>Shut down failed, please push emergency button to shutdown.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Please execute the empty scan, assist with system calibration, when empty scan is completed, the system should operate normally.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Warning</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>There are %1 days left until the next empty scan. Please remind users to conduct the empty scan in time.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MppsSettingsDialog</name>
|
||||
@@ -1109,19 +1170,47 @@
|
||||
<source>Patient ID:</source>
|
||||
<translation type="unfinished">ID:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RSTAND</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LSTAND</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LONE</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RONE</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<source>Min</source>
|
||||
<source>Never</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Sec</source>
|
||||
<source> Minutes</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Hour</source>
|
||||
<source>LeftToRight</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RightToLeft</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Left</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Right</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
@@ -1288,6 +1377,26 @@
|
||||
<source>Shut Down</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Stop Scan Process</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Left side scan initiated, auto positioning in progress.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Right side scan initiated, auto positioning in progress.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data scanning, please keep the current position and don't move.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Data exporting, patient can leave the holder</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ScanSearchCriteriaForm</name>
|
||||
@@ -1637,6 +1746,22 @@
|
||||
<source>Log Date:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Operation Date</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Operation Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>User</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Operation</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WarningMessageWidget</name>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
72
src/utilities/GetProtocalHelper.cpp
Normal file
72
src/utilities/GetProtocalHelper.cpp
Normal file
@@ -0,0 +1,72 @@
|
||||
#include "GetProtocalHelper.h"
|
||||
|
||||
#include "json/jsonobject.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
QStringList GetProtocalHelper::getProtocalList()
|
||||
{
|
||||
QStringList protocalList = JsonObject::Instance()->protocals();
|
||||
QStringList result;
|
||||
foreach(QString protocal, protocalList)
|
||||
{
|
||||
result << switchProtocalIntToProtocalString(protocal.toInt());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int GetProtocalHelper::getProtocal()
|
||||
{
|
||||
return JsonObject::Instance()->defaultProtocal();
|
||||
}
|
||||
|
||||
QString GetProtocalHelper::getProtocalStr()
|
||||
{
|
||||
return switchProtocalIntToProtocalString(getProtocal());
|
||||
}
|
||||
|
||||
void GetProtocalHelper::setProtocal(const QString& aProtocal)
|
||||
{
|
||||
JsonObject::Instance()->setDefaultProtocal(switchProtocalStringToProtocalInt(aProtocal));
|
||||
}
|
||||
|
||||
QString GetProtocalHelper::switchProtocalIntToProtocalString(int aProtocal)
|
||||
{
|
||||
switch(aProtocal)
|
||||
{
|
||||
case 0 :
|
||||
return QObject::tr("LeftToRight");
|
||||
case 1 :
|
||||
return QObject::tr("RightToLeft");
|
||||
case 2 :
|
||||
return QObject::tr("Left");
|
||||
case 3 :
|
||||
return QObject::tr("Right");
|
||||
default:
|
||||
return QObject::tr("LeftToRight");
|
||||
}
|
||||
}
|
||||
|
||||
int GetProtocalHelper::switchProtocalStringToProtocalInt(const QString& aPortocal)
|
||||
{
|
||||
if(aPortocal == QObject::tr("LeftToRight"))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if(aPortocal == QObject::tr("RightToLeft"))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if(aPortocal == QObject::tr("Left"))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if(aPortocal == QObject::tr("LeftToRight"))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
22
src/utilities/GetProtocalHelper.h
Normal file
22
src/utilities/GetProtocalHelper.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef GETPROTOCALHELPER_H
|
||||
#define GETPROTOCALHELPER_H
|
||||
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
class GetProtocalHelper
|
||||
{
|
||||
public:
|
||||
GetProtocalHelper() = delete ;
|
||||
|
||||
static QStringList getProtocalList();
|
||||
static QString getProtocalStr();
|
||||
static int getProtocal();
|
||||
static void setProtocal(const QString& aPortocal);
|
||||
|
||||
private:
|
||||
static QString switchProtocalIntToProtocalString(int aPortocal);
|
||||
static int switchProtocalStringToProtocalInt(const QString& aPortocal);
|
||||
};
|
||||
|
||||
#endif // GETPROTOCALHELPER_H
|
||||
Reference in New Issue
Block a user