Skip to content

Commit

Permalink
1.9.32
Browse files Browse the repository at this point in the history
  • Loading branch information
tongvanlinh committed Apr 2, 2024
1 parent a367c1a commit dd57d80
Show file tree
Hide file tree
Showing 25 changed files with 248 additions and 99 deletions.
6 changes: 3 additions & 3 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleShortVersionString</key>
<string>1.9.31</string>
<string>1.9.32</string>
<key>CFBundleGetInfoString</key>
<string>${PRODUCT_NAME} 1.9.31</string>
<string>${PRODUCT_NAME} 1.9.32</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSCameraUsageDescription</key>
Expand All @@ -35,7 +35,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleVersion</key>
<string>1.9.31</string>
<string>1.9.32</string>
<key>CFBundleIconName</key>
<string>AppIcon</string>
<key>UIPrerenderedIcon</key>
Expand Down
20 changes: 20 additions & 0 deletions Models/AppSetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,26 @@ void AppSetting::setEnableDebug(bool enableDebugMode)
}
}

bool AppSetting::enableColab()
{
if(NunchukSettings::contains("enableColab")){
enableColab_ = NunchukSettings::value("enableColab").toBool();
}
else{
NunchukSettings::setValue("enableColab", enableColab_);
}
return enableColab_;
}

void AppSetting::setEnableColab(bool enableColab)
{
if (enableColab_ != enableColab){
enableColab_ = enableColab;
NunchukSettings::setValue("enableColab", enableColab_);
emit enableColabChanged();
}
}

bool AppSetting::isStarted()
{
return isStarted_ || NunchukSettings::commonValue("isStarted").toBool();
Expand Down
7 changes: 6 additions & 1 deletion Models/AppSetting.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class AppSetting : public NunchukSettings
Q_PROPERTY(QString currency READ currency WRITE setCurrency NOTIFY currencyChanged)
Q_PROPERTY(QString currencySymbol READ currencySymbol NOTIFY currencyChanged)
Q_PROPERTY(bool isFirstTimeOnboarding READ isFirstTimeOnboarding WRITE setIsFirstTimeOnboarding NOTIFY isFirstTimeOnboardingChanged)
Q_PROPERTY(bool enableColab READ enableColab WRITE setEnableColab NOTIFY enableColabChanged)

public:
enum class Chain : int {
Expand Down Expand Up @@ -227,6 +228,9 @@ class AppSetting : public NunchukSettings
bool enableDebug();
void setEnableDebug(bool enableDebugMode);

bool enableColab();
void setEnableColab(bool enableColab);

bool isStarted();
Q_INVOKABLE void setIsStarted(bool isStarted, bool isSetting);

Expand Down Expand Up @@ -283,7 +287,7 @@ class AppSetting : public NunchukSettings
bool enableMultiDeviceSync_;
bool isStarted_;
bool isFirstTimeOnboarding_;

bool enableColab_ {false};
signals:
void unitChanged();
void mainnetServerChanged();
Expand Down Expand Up @@ -322,6 +326,7 @@ class AppSetting : public NunchukSettings
void enableMultiDeviceSyncChanged();
void currencyChanged();
void isFirstTimeOnboardingChanged();
void enableColabChanged();
};

#endif // APPSETTING_H
21 changes: 21 additions & 0 deletions Models/Chats/ClientController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,27 @@ bool ClientController::isByzantinePro() const
return ret;
}

bool ClientController::isFinneyPro() const
{
QString type = slug();
bool ret = qUtils::strCompare(type, "finney_pro_testnet")
|| qUtils::strCompare(type, "finney_pro");
return ret;
}

bool ClientController::isFinneyStandard() const
{
QString type = slug();
bool ret = qUtils::strCompare(type, "finney_testnet")
|| qUtils::strCompare(type, "finney");
return ret;
}

bool ClientController::isFinney() const
{
return isFinneyPro() || isFinneyStandard();
}

bool ClientController::isByzantinePremier() const
{
QString type = slug();
Expand Down
3 changes: 3 additions & 0 deletions Models/Chats/ClientController.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ class ClientController final : public QObject
bool isByzantineStandard() const;
bool isByzantinePremier() const;
bool isByzantinePro() const;
bool isFinneyPro() const;
bool isFinneyStandard() const;
bool isFinney() const;
bool isByzantine() const;
bool isHoneyBadger() const;
bool isIronHand() const;
Expand Down
14 changes: 11 additions & 3 deletions Models/Chats/QNunchukRoomModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ QNunchukRoom::QNunchukRoom(Room *r):
}
qmlRegisterType<FileTransferInfo>();
qRegisterMetaType<FileTransferInfo>();
connect(AppSetting::instance(), &AppSetting::enableColabChanged, this, &QNunchukRoom::isIgnoredCollabWalletChanged);
}

QNunchukRoom::~QNunchukRoom()
Expand All @@ -76,8 +77,15 @@ QNunchukRoom::~QNunchukRoom()
bool QNunchukRoom::isIgnoredCollabWallet() const
{
bool isByzantineAccount = CLIENT_INSTANCE->isByzantine();
bool isContainsGroup = AppModel::instance()->walletList() ? AppModel::instance()->walletList()->existGroupWallet() : false;
return (isContainsGroup || isByzantineAccount);
bool isFinneyAccount = CLIENT_INSTANCE->isFinney();
bool ret {false};
if (isByzantineAccount || isFinneyAccount) {
ret = true;
}
else {
ret = !AppSetting::instance()->enableColab();
}
return ret;
}

bool QNunchukRoom::isNunchukByzantineRoom() const
Expand Down Expand Up @@ -1055,7 +1063,7 @@ void QNunchukRoom::downloadHistorical()
for (auto e = m_room->messageEvents().begin(); e != m_room->messageEvents().end(); ++e){
nunchukConsumeEvent(**e);
}
if(!isIgnoredCollabWallet() && !roomWallet()) {
if(!roomWallet()) {
Conversation init;
init.timestamp = -100;
init.messageType = (int)ENUNCHUCK::ROOM_EVT::INITIALIZE;
Expand Down
3 changes: 2 additions & 1 deletion Models/Chats/QNunchukRoomModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class QNunchukRoom: public QObject
Q_PROPERTY(int roomType READ roomType CONSTANT)
Q_PROPERTY(QStringList talkersName READ talkersName NOTIFY usersChanged)
Q_PROPERTY(QStringList talkersAvatar READ talkersAvatar NOTIFY usersChanged)
Q_PROPERTY(bool isIgnoredCollabWallet READ isIgnoredCollabWallet CONSTANT)
Q_PROPERTY(bool isIgnoredCollabWallet READ isIgnoredCollabWallet NOTIFY isIgnoredCollabWalletChanged)

public:
QNunchukRoom(Room* r);
Expand Down Expand Up @@ -276,6 +276,7 @@ public slots:
void signalFinishedGetPendingTxs(QRoomTransactionModelPtr txs);
void pinTransactionChanged();
void roomNeedTobeLeaved(const QString& id);
void isIgnoredCollabWalletChanged();
};
Q_DECLARE_METATYPE(Conversation)
Q_DECLARE_METATYPE(nunchuk::RoomTransaction)
Expand Down
25 changes: 17 additions & 8 deletions Models/Premiums/QGroupDashboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,15 +438,24 @@ bool QGroupDashboard::isLocked() const
bool QGroupDashboard::registerKeyDone()
{
QJsonObject payload = alertJson()["payload"].toObject();
QStringList register_key_xfps = payload["register_key_xfps"].toVariant().toStringList();
bool ret = m_registered_key_xfps.size() == register_key_xfps.size() && m_registered_key_xfps.size() > 0;
if (ret) {
QtConcurrent::run([this](){
DismissAlert();
GetAlertsInfo();
});
if (payload.contains("register_key_xfps")) {
QStringList register_key_xfps = payload["register_key_xfps"].toVariant().toStringList();
bool ret = m_registered_key_xfps.size() == register_key_xfps.size() && m_registered_key_xfps.size() > 0;
if (ret) {
QtConcurrent::run([this](){
DismissAlert();
GetAlertsInfo();
});
}
else if (register_key_xfps.size() == 0) {
QtConcurrent::run([this](){
DismissAlert();
GetAlertsInfo();
});
}
return ret;
}
return ret;
return false;
}

bool QGroupDashboard::registerKeyNext()
Expand Down
1 change: 1 addition & 0 deletions Models/Premiums/QGroupWalletDummyTx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ void QGroupWalletDummyTx::requestUpdateDummyTx(const QMap<QString, QString> &sig
{
if (dashboard->flow() == (int)AlertEnum::E_Alert_t::GROUP_WALLET_SETUP) {
dashboard->setConfigFlow("accessing-wallet-configuration");
dashboard->registerKeyDone();
QEventProcessor::instance()->sendEvent(E::EVT_SHOW_GROUP_WALLET_CONFIG_REQUEST);
AppModel::instance()->showToast(0, "The key has been claimed", EWARNING::WarningType::SUCCESS_MSG);
}
Expand Down
2 changes: 2 additions & 0 deletions QAppEngine/QEventProcessor/Common/QCommonDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#define QAPP_WIDTH_EXPECTED 1280
#define QAPP_HEIGHT_EXPECTED 910
#define QAPP_GAP_HEIGHT 120
#define QAPP_WIDTH_MIN QAPP_WIDTH_EXPECTED
#define QAPP_HEIGHT_MIN (QAPP_HEIGHT_EXPECTED - QAPP_GAP_HEIGHT)
#define QWINDOW_HEIGHT_PREFER (QAPP_HEIGHT_EXPECTED + QAPP_GAP_HEIGHT)
#define QWINDOW_WIDTH_PREFER (QAPP_WIDTH_EXPECTED + QAPP_GAP_HEIGHT)

Expand Down
8 changes: 4 additions & 4 deletions QAppEngine/QEventProcessor/QEventProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ void QEventProcessor::initialized()
QObject::connect(m_viewer, SIGNAL(heightChanged(int)), this, SLOT(onHeightChanged(int)));
m_ctxProperties.clear();
m_qmlObj.clear();
QEventProcessor::instance()->setViewerSize(QAPP_WIDTH_EXPECTED, QAPP_HEIGHT_EXPECTED);
this->registerCtxProperty("QAPP_DEVICE_WIDTH", QAPP_WIDTH_EXPECTED);
this->registerCtxProperty("QAPP_DEVICE_HEIGHT", QAPP_HEIGHT_EXPECTED);
this->registerCtxProperty("QMLHandle", QVariant::fromValue(this));
Expand Down Expand Up @@ -187,11 +186,12 @@ void QEventProcessor::onWidthChanged(int w)
void QEventProcessor::onHeightChanged(int h)
{
if(h > m_currentSize.height()){
DBG_INFO << "FULL SIZE REQUEST" << h;
DBG_INFO << "FULL SIZE REQUEST" << h << (double)h/(double)QAPP_HEIGHT_EXPECTED;
this->updateCtxProperty("QAPP_DEVICE_HEIGHT", m_viewer->geometry().height());
this->updateCtxProperty("QAPP_DEVICE_HEIGHT_RATIO", qMin(1.0, (double)h/(double)QAPP_HEIGHT_EXPECTED));
}
else{
DBG_INFO << "ORIGIN SIZE REQUEST" << h;
DBG_INFO << "ORIGIN SIZE REQUEST" << h ;
this->updateCtxProperty("QAPP_DEVICE_HEIGHT", m_currentSize.height());
}
}
Expand Down Expand Up @@ -235,7 +235,7 @@ void QEventProcessor::unRegisterQML(QObject *objPropose)
bool QEventProcessor::setViewerSize(int width, int height)
{
m_viewer->setMinimumSize(QSize(width, height));
// m_viewer->setMaximumSize(QSize(width, height));
this->updateCtxProperty("QAPP_DEVICE_HEIGHT_RATIO", qMin(1.0, (double)height/(double)QAPP_HEIGHT_EXPECTED));
m_currentSize = QSize(width, height);
return true;
}
Expand Down
14 changes: 10 additions & 4 deletions Qml/Components/RightPannel/Setting/QSettingAccountSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@ import "./../../customizes/Buttons"
import "../../../../localization/STR_QML.js" as STR

Item {
Flickable{
width: 651; height: 910
contentWidth: 651; contentHeight: _netAcc.childrenRect.height
anchors.fill: parent
Flickable {
anchors.fill: parent
contentWidth: parent.width
contentHeight: _netAcc.childrenRect.height
visible: ClientController.isNunchukLoggedIn === true
interactive: _netAcc.childrenRect.height > 890
interactive: contentHeight > height
clip: true
flickableDirection: Flickable.VerticalFlick
ScrollBar.vertical: ScrollBar { active: true }

Column{
id:_netAcc
anchors{
Expand Down
67 changes: 47 additions & 20 deletions Qml/Components/RightPannel/Setting/QSettingDeveloperSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,57 @@ Item {
font.weight: Font.Bold
text: STR.STR_QML_588
}
Row {
spacing: 0
QText {
width: 627-84
text: STR.STR_QML_589
color: "#000000"
font.pixelSize: 16
font.family: "Lato"
anchors.verticalCenter: parent.verticalCenter
Column {
spacing: 24
Row {
spacing: 0
QText {
width: 627-84
text: STR.STR_QML_1281
color: "#000000"
font.pixelSize: 16
font.family: "Lato"
anchors.verticalCenter: parent.verticalCenter
}
QSwitchTypeB {
id: collaboratorswitch
width: 84
height: 48
switchOn: AppSetting.enableColab
anchors.verticalCenter: parent.verticalCenter
onSwitchOnChanged: {
applySettings()
}
function applySettings(){
AppSetting.enableColab = collaboratorswitch.switchOn
}
}
}
QSwitchTypeB {
id: developerswitch
width: 84
height: 48
switchOn: AppSetting.enableDebugMode
anchors.verticalCenter: parent.verticalCenter
property bool anyChanged: (AppSetting.enableDebugMode !== developerswitch.switchOn)
onSwitchOnChanged: {
applySettings()
Row {
spacing: 0
QText {
width: 627-84
text: STR.STR_QML_589
color: "#000000"
font.pixelSize: 16
font.family: "Lato"
anchors.verticalCenter: parent.verticalCenter
}
function applySettings(){
AppSetting.enableDebugMode = developerswitch.switchOn
QSwitchTypeB {
id: developerswitch
width: 84
height: 48
switchOn: AppSetting.enableDebugMode
anchors.verticalCenter: parent.verticalCenter
onSwitchOnChanged: {
applySettings()
}
function applySettings(){
AppSetting.enableDebugMode = developerswitch.switchOn
}
}
}

}

}
Expand Down
3 changes: 2 additions & 1 deletion Qml/Components/customizes/Chats/QConversationDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ Item {
id: initConversationComponent
Item {
width: conversationRoot.width
height: contentInit.height
height: visible ? contentInit.height : 0
visible: !RoomWalletData.isIgnoredCollabWallet
Column {
id: contentInit
spacing: 8
Expand Down
2 changes: 1 addition & 1 deletion Qml/Components/customizes/Chats/QConversationPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ Row {
source: bgfooter
QTextField {
id: messageField
width: parent.width - 108
width: parent.width - (!RoomWalletData.isIgnoredCollabWallet ? 108 : 48)
height: 48
anchors.left: parent.left
anchors.leftMargin: 24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Rectangle {
}
else{
if(signerType === NUNCHUCKTYPE.FOREIGN_SOFTWARE || signerType === NUNCHUCKTYPE.NFC){
return helpComp;
return isDummy ? null : helpComp;
}
if(isLocaluser || isDummy){
if(signerType === NUNCHUCKTYPE.AIRGAP || signerType === NUNCHUCKTYPE.UNKNOWN ) {
Expand Down
Loading

0 comments on commit dd57d80

Please sign in to comment.