Skip to content

Commit

Permalink
Merge pull request #2459 from KomodoPlatform/dev
Browse files Browse the repository at this point in the history
v0.7.2 Release Candidate
  • Loading branch information
smk762 authored Jun 24, 2024
2 parents 1952847 + 1e6c540 commit 056f76f
Show file tree
Hide file tree
Showing 23 changed files with 161 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Please describe what you expected to happen.
**Operating Environment(s):**
- OS: [e.g. Windows/OSX/Linux. If Linux, include distro. ]
- OS version: [e.g. 7/10/11, 10.13/10.15, 18.04/20.04 ]
- Komodo Wallet Version: [e.g. 0.7.1]
- Komodo Wallet Desktop Version: [e.g. 0.7.2]
- Build branch: [e.g. master/dev]


Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/atomicdex-desktop-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
DEX_PROJECT_NAME: "komodo-wallet"
DEX_DISPLAY_NAME: "Komodo Wallet"
DEX_COMPANY: "KomodoPlatform"
DEX_VERSION: "0.7.1"
DEX_VERSION: "0.7.2"
DEX_WEBSITE: "https://atomicdex.io/"

jobs:
Expand Down Expand Up @@ -367,7 +367,7 @@ jobs:

windows-release:
name: Win Build/Release
runs-on: windows-latest
runs-on: windows-2019

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -445,7 +445,7 @@ jobs:

windows-debug:
name: Win Build/Debug
runs-on: windows-latest
runs-on: windows-2019

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/atomicdex-desktop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
DEX_PROJECT_NAME: "komodo-wallet"
DEX_DISPLAY_NAME: "Komodo Wallet"
DEX_COMPANY: "KomodoPlatform"
DEX_VERSION: "0.7.1"
DEX_VERSION: "0.7.2"
DEX_WEBSITE: "https://atomicdex.io/"
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/b/vcpkg_cache
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
Expand Down Expand Up @@ -68,13 +68,13 @@ jobs:
host: 'mac'

- name: windows-release
os: windows-latest
os: windows-2019
qt: '5.15.2'
type: 'Release'
host: 'windows'

- name: windows-debug
os: windows-latest
os: windows-2019
qt: '5.15.2'
type: 'Debug'
host: 'windows'
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include(vcpkg_prerequisites)
include(qt_prerequisites)
include(cfg_hash)

project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.7.1)
project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.7.2)
message(STATUS "${PROJECT_NAME} is version ${PROJECT_VERSION}")

include(cmake_default_options)
Expand Down Expand Up @@ -60,13 +60,13 @@ endif ()
##! We fetch our dependencies
if (APPLE)
FetchContent_Declare(mm2
URL https://sdk.devbuilds.komodo.earth/main/mm2_b0fd99e-mac-x86-64.zip)
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.0.0-beta/mm2-b0fd99e84-Darwin-Release.zip)
elseif (UNIX AND NOT APPLE)
FetchContent_Declare(mm2
URL https://sdk.devbuilds.komodo.earth/main/mm2_b0fd99e-linux-x86-64.zip)
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.0.0-beta/mm2-b0fd99e84-Linux-Release.zip)
else ()
FetchContent_Declare(mm2
URL https://sdk.devbuilds.komodo.earth/main/mm2_b0fd99e-win-x86-64.zip)
URL https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.0.0-beta/mm2-b0fd99e84-Win64.zip)
endif ()

#FetchContent_Declare(qmaterial URL https://github.com/KomodoPlatform/Qaterial/archive/last-clang-working-2.zip)
Expand Down
1 change: 1 addition & 0 deletions assets/config/cfg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"notification_enabled": true,
"spamfilter_enabled": false,
"postorder_enabled": false,
"use_static_rpcpass": false,
"current_currency": "USD",
"current_fiat": "USD",
Expand Down
2 changes: 1 addition & 1 deletion atomic_defi_design/Dex/Constants/General.qml
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ QtObject {
}
return diffPrefix(received) +
(fiat === API.app.settings_pg.current_fiat ? API.app.settings_pg.current_fiat_sign : API.app.settings_pg.current_currency_sign)
+ " " + (amount < 1E5 ? formatDouble(parseFloat(amount), precision, true) : nFormatter(parseFloat(amount), 2))
+ " " + (amount < 1E5 ? formatDouble(parseFloat(amount), precision, true) : nFormatter(parseFloat(amount), precision))
}

function formatPercent(value, show_prefix=true) {
Expand Down
49 changes: 45 additions & 4 deletions atomic_defi_design/Dex/Exchange/Trade/OrderBook/List.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Item
id: _control

property bool isAsk
property bool isVertical: false
width: parent.width
height: parent.height

Expand All @@ -29,7 +28,11 @@ Item

onContentHeightChanged:
{
if (isVertical) _tm.start();
if (isAsk){
// Duplication is intended. Sometimes data takes too long to load so slowscroll is a backup.
slowscroll_timer.start();
quickscroll_timer.start()
}
}

delegate: Item
Expand All @@ -47,12 +50,50 @@ Item

Timer
{
id: _tm
interval: 2000
id: slowscroll_timer
interval: 1500
onTriggered:
{
orderbook_list.positionViewAtEnd()
}
}
Timer
{
id: quickscroll_timer
interval: 500
onTriggered:
{
orderbook_list.positionViewAtEnd()
}
}
onModelChanged: {
if (isAsk) quickscroll_timer.start()
}
}

Connections {
target: API.app.trading_pg;

function onMarketModeChanged()
{
if (isAsk)
{
quickscroll_timer.start()
}
}
function onOrderbookChanged()
{
if (isAsk)
{
quickscroll_timer.start()
}
}
function onMarketPairsChanged()
{
if (isAsk)
{
quickscroll_timer.start()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Widget
List
{
isAsk: true
isVertical: true
Layout.fillHeight: true
Layout.fillWidth: true
}
Expand Down
6 changes: 5 additions & 1 deletion atomic_defi_design/Dex/Exchange/Trade/ProView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ RowLayout
General.prettifyJSON(response.result), false)

General.prevent_coin_disabling.restart()
tradingInfo.currentIndex = 1
// Show the orders tab unless settings say otherwise
if (API.app.settings_pg.postorder_enabled)
{
tradingInfo.currentIndex = 1
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion atomic_defi_design/Dex/Exchange/Trade/SimpleView/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ Item
target: exchange_trade
function onOrderPlaced()
{
currentSubPage = subPages.Orders
if (API.app.settings_pg.postorder_enabled)
{
currentSubPage = subPages.Orders
}
}
}

Expand Down
26 changes: 26 additions & 0 deletions atomic_defi_design/Dex/Settings/SettingModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,32 @@ Qaterial.Dialog
}
}
}

// Post-order placement toggle
RowLayout
{
width: parent.width - 30
anchors.horizontalCenter: parent.horizontalCenter
height: 50

DexLabel
{
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
font: DexTypo.subtitle1
text: qsTr("Show orders after placement")
}

Item { Layout.fillWidth: true }

DexSwitch
{
Layout.alignment: Qt.AlignVCenter
Component.onCompleted: checked = API.app.settings_pg.postorder_enabled
onCheckedChanged: API.app.settings_pg.postorder_enabled = checked
}
}

}
}
Item
Expand Down
5 changes: 4 additions & 1 deletion atomic_defi_design/Dex/Wallet/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,10 @@ Item
content.anchors.leftMargin: enabled ? 23 : 48
content.anchors.rightMargin: 23

onClicked: Qt.openUrlExternally("https://vote.komodoplatform.com/")
onClicked: {
let url = "https://vote.komodoplatform.com/" + api_wallet_page.ticker.toLowerCase() + "/";
Qt.openUrlExternally(url);
}

Row
{
Expand Down
2 changes: 1 addition & 1 deletion cmake/project.metadata.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(DEX_DISPLAY_NAME "Komodo Wallet")
set(DEX_MAINTENANCE_TOOL_NAME "Komodo Wallet Maintenance Tool")
set(DEX_COMPANY "KomodoPlatform")
set(DEX_WEBSITE "https://atomicdex.io/")
set(DEX_VERSION "0.7.1")
set(DEX_VERSION "0.7.2")
set(DEX_SUPPORT_PAGE "https://support.komodoplatform.com/support/home")
set(DEX_DISCORD "https://komodoplatform.com/discord")
set(DEX_TWITTER "https://twitter.com/AtomicDEX")
Expand Down
20 changes: 20 additions & 0 deletions src/core/atomicdex/config/app.cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ namespace
config_json_data["available_signs"] = config.available_currency_signs;
config_json_data["notification_enabled"] = config.notification_enabled;
config_json_data["spamfilter_enabled"] = config.spamfilter_enabled;
config_json_data["postorder_enabled"] = config.postorder_enabled;
config_json_data["static_rpcpass_enabled"] = config.static_rpcpass_enabled;

file.close();
Expand Down Expand Up @@ -85,6 +86,15 @@ namespace atomic_dex
config.spamfilter_enabled = true;
}

if (j.contains("postorder_enabled"))
{
j.at("postorder_enabled").get_to(config.postorder_enabled);
}
else
{
config.postorder_enabled = true;
}

if (j.contains("static_rpcpass_enabled"))
{
j.at("static_rpcpass_enabled").get_to(config.static_rpcpass_enabled);
Expand All @@ -105,6 +115,16 @@ namespace atomic_dex
}
}

void
change_postorder_status(cfg& config, bool is_enabled)
{
if (config.postorder_enabled != is_enabled)
{
config.postorder_enabled = is_enabled;
upgrade_cfg(config);
}
}

void
change_spamfilter_status(cfg& config, bool is_enabled)
{
Expand Down
2 changes: 2 additions & 0 deletions src/core/atomicdex/config/app.cfg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace atomic_dex
std::vector<std::string> recommended_fiat;
std::vector<std::string> possible_currencies;
bool notification_enabled;
bool postorder_enabled{false};
bool spamfilter_enabled{false};
bool static_rpcpass_enabled{false};
};
Expand All @@ -40,6 +41,7 @@ namespace atomic_dex
void change_currency(cfg& config, const std::string& new_currency);
void change_fiat(cfg& config, const std::string& new_fiat);
void change_notification_status(cfg& config, bool is_enabled);
void change_postorder_status(cfg& config, bool is_enabled);
void change_spamfilter_status(cfg& config, bool is_enabled);
void change_static_rpcpass_status(cfg& config, bool is_enabled);
[[nodiscard]] bool is_this_currency_a_fiat(const cfg& config, const std::string& currency);
Expand Down
1 change: 1 addition & 0 deletions src/core/atomicdex/constants/dex.constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace atomic_dex
g_second_primary_dex_coin,
"BTC-segwit",
"DGB-segwit",
"VOTE2024",
};
inline const std::vector<std::string> g_faucet_coins{
"DOC",
Expand Down
2 changes: 2 additions & 0 deletions src/core/atomicdex/models/qt.portfolio.model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ namespace atomic_dex
bool
portfolio_model::update_activation_status()
{
// This feels a bit heavy handed. There should be a better way to do this.
// Function may be unused.
const auto& mm2_system = this->m_system_manager.get_system<mm2_service>();
const auto coins = this->m_system_manager.get_system<portfolio_page>().get_global_cfg()->get_enabled_coins();

Expand Down
14 changes: 14 additions & 0 deletions src/core/atomicdex/pages/qt.settings.page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@ namespace atomic_dex
}
}

bool atomic_dex::settings_page::is_postorder_enabled() const
{
return m_config.postorder_enabled;
}

void settings_page::set_postorder_enabled(bool is_enabled)
{
if (m_config.postorder_enabled != is_enabled)
{
change_postorder_status(m_config, is_enabled);
emit onPostOrderEnabledChanged();
}
}

bool atomic_dex::settings_page::is_notification_enabled() const
{
return m_config.notification_enabled;
Expand Down
4 changes: 4 additions & 0 deletions src/core/atomicdex/pages/qt.settings.page.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace atomic_dex
Q_PROPERTY(QString current_fiat READ get_current_fiat WRITE set_current_fiat NOTIFY onFiatChanged)
Q_PROPERTY(bool notification_enabled READ is_notification_enabled WRITE set_notification_enabled NOTIFY onNotificationEnabledChanged)
Q_PROPERTY(bool spamfilter_enabled READ is_spamfilter_enabled WRITE set_spamfilter_enabled NOTIFY onSpamFilterEnabledChanged)
Q_PROPERTY(bool postorder_enabled READ is_postorder_enabled WRITE set_postorder_enabled NOTIFY onPostOrderEnabledChanged)
Q_PROPERTY(bool static_rpcpass_enabled READ is_static_rpcpass_enabled WRITE set_static_rpcpass_enabled NOTIFY onStaticRpcPassEnabledChanged)
Q_PROPERTY(QVariant custom_token_data READ get_custom_token_data WRITE set_custom_token_data NOTIFY customTokenDataChanged)
Q_PROPERTY(bool fetching_custom_token_data_busy READ is_fetching_custom_token_data_busy WRITE set_fetching_custom_token_data_busy NOTIFY customTokenDataStatusChanged)
Expand Down Expand Up @@ -94,6 +95,8 @@ namespace atomic_dex
bool set_zhtlc_status(nlohmann::json data);
[[nodiscard]] bool is_spamfilter_enabled() const;
void set_spamfilter_enabled(bool is_enabled);
[[nodiscard]] bool is_postorder_enabled() const;
void set_postorder_enabled(bool is_enabled);
void set_current_currency(const QString& current_currency);
void set_current_fiat(const QString& current_fiat);
[[nodiscard]] bool is_fetching_custom_token_data_busy() const;
Expand Down Expand Up @@ -143,6 +146,7 @@ namespace atomic_dex
void onFiatSignChanged();
void onFiatChanged();
void onNotificationEnabledChanged();
void onPostOrderEnabledChanged();
void onSpamFilterEnabledChanged();
void onStaticRpcPassEnabledChanged();
void customTokenDataChanged();
Expand Down
2 changes: 1 addition & 1 deletion src/core/atomicdex/pages/qt.wallet.page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ namespace atomic_dex

nlohmann::json json_data = mm2::template_request("withdraw", true);
mm2::to_json(json_data, withdraw_req);
SPDLOG_DEBUG("final json: {}", json_data.dump(4));

batch.push_back(json_data);

std::string amount_std = amount.toStdString();
Expand Down
Loading

0 comments on commit 056f76f

Please sign in to comment.