Skip to content
Snippets Groups Projects
Commit 874735be authored by littletux89@gmail.com's avatar littletux89@gmail.com
Browse files

[-] Commented code removed, errors in qml code fixed.

parent d7d27fd5
No related branches found
No related tags found
1 merge request!11Cellframe clone
Showing
with 22 additions and 124 deletions
......@@ -93,9 +93,6 @@ void DapCommandController::requestWalletData()
void DapCommandController::processChangedLog()
{
// QStringList tempLogModel;
// for(int x{0}; x < aLogModel.count(); ++x)
// tempLogModel.append(aLogModel.at(x).toString());
emit onChangeLogModel();
}
......@@ -294,8 +291,7 @@ void DapCommandController::getNetworkList()
void DapCommandController::setNodeStatus(const bool aIsOnline)
{
/*DapRpcServiceReply *reply =*/ m_DAPRpcSocket->invokeRemoteMethod("RPCServer.setNodeStatus", aIsOnline);
// connect(reply, SIGNAL(finished()), this, SLOT(processGetNodeStatus()));
m_DAPRpcSocket->invokeRemoteMethod("RPCServer.setNodeStatus", aIsOnline);
}
void DapCommandController::executeCommand(const QString &command)
......
......@@ -3,9 +3,7 @@
DapScreenDialog::DapScreenDialog(QObject *parent) : QObject(parent)
{
m_proxyModel = new QSortFilterProxyModel;
// m_proxyModel->setSourceModel(&DapUiQmlWidgetModel::getInstance());
m_proxyModel->setFilterRegExp(QRegExp("true"));
// m_proxyModel->setFilterRole(VisibleRole);
}
QSortFilterProxyModel *DapScreenDialog::proxyModel() const
......
......@@ -3,9 +3,7 @@
DapScreenDialogChangeWidget::DapScreenDialogChangeWidget(QObject *parent) : QObject(parent)
{
m_proxyModel = new QSortFilterProxyModel(this);
// m_proxyModel->setSourceModel(&DapUiQmlWidgetModel::getInstance());
m_proxyModel->setFilterRegExp(QRegExp("false"));
// m_proxyModel->setFilterRole(VisibleRole);
}
QSortFilterProxyModel *DapScreenDialogChangeWidget::proxyModel() const
......
......@@ -110,7 +110,6 @@ void DapServiceController::processGetNodeLogs(const QStringList &aNodeLogs)
if(aNodeLogs.isEmpty())
return;
int xx = DapLogModel::getInstance().rowCount();
QRegularExpression re("(?<=])\\s");
for (auto const & log : aNodeLogs)
{
......@@ -136,7 +135,6 @@ void DapServiceController::getNodeLogs() const
void DapServiceController::clearLogModel()
{
DapLogModel::getInstance().clear();
int z = DapLogModel::getInstance().rowCount();
emit logCompleted();
}
......@@ -218,10 +216,6 @@ void DapServiceController::processGetWalletInfo(const QString &asWalletName, con
qInfo() << QString("processGetWalletInfo(%1, %2)").arg(asWalletName).arg(asWalletAddress);
DapChainWallet wallet("", asWalletName, asWalletAddress, aBalance, aTokens);
DapChainWalletsModel::getInstance().append(wallet);
for (QString s : aBalance) {
qDebug() << s;
}
}
void DapServiceController::processExecuteCommandInfo(const QString &result)
......
......@@ -12,7 +12,6 @@
#include "DapScreenDialog.h"
#include "DapScreenDialogChangeWidget.h"
#include "DapSettings.h"
#include "DapSettingsCipher.h"
#include "DapServiceClient.h"
#include "DapServiceController.h"
#include "DapLogger.h"
......@@ -99,7 +98,6 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("pt", 1.3);
engine.load(QUrl("qrc:/screen/main.qml"));
qDebug() << engine.rootObjects().isEmpty();
if (engine.rootObjects().isEmpty())
return -1;
......
......@@ -86,7 +86,7 @@
<file>screen/Settings/DapUiQmlWidgetSettingsNetwork.qml</file>
<file>screen/Settings/DapUiQmlWidgetSettingsNetworkForm.ui.qml</file>
<file>screen/StatusBar/DapUiQmlWidgetStatusBar.qml</file>
<file>screen/StatusBar/DapUiQmlWidgetStatusBarButton.ui.qml</file>
<file>screen/StatusBar/DapUiQmlWidgetStatusBarButtonForm.ui.qml</file>
<file>screen/StatusBar/DapUiQmlWidgetStatusBarComboBoxWallet.qml</file>
<file>screen/StatusBar/DapUiQmlWidgetStatusBarComboBoxWalletForm.ui.qml</file>
<file>screen/VPN/DapUiQmlScreenVpn.qml</file>
......
......@@ -84,9 +84,3 @@ DapUiQmlScreenMainWindowForm {
}
}
}
/*##^## Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/
......@@ -22,10 +22,3 @@ Page {
}
}
}
/*##^## Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/
......@@ -7,7 +7,6 @@ import NodeNetworkExplorer 1.0
Page {
Rectangle {
anchors.fill: parent;
// color: "#3b3353";
}
RowLayout {
......
......@@ -101,7 +101,6 @@ DapUiQmlScreenHistoryForm {
Text {
id: dapNumberWallet
// width: parent.width / 2
anchors.fill: parent
color: "#4F5357"
text: numberWallet
......@@ -243,8 +242,3 @@ DapUiQmlScreenHistoryForm {
visible: false
}
}
/*##^## Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/
......@@ -50,9 +50,3 @@ DapUiQmlWidgetStatusBarComboBox {
highlighted: parent.highlightedIndex === index
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/
......@@ -5,7 +5,6 @@ import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.3
Rectangle {
// property alias addWalletPressed: statusBarAddWalletButton.pressed
Rectangle {
anchors.fill: parent
anchors.bottomMargin: 1
......@@ -62,7 +61,7 @@ Rectangle {
}
}
DapUiQmlWidgetStatusBarButton {
DapUiQmlWidgetStatusBarButtonForm {
id: statusBarAddWalletButton
width: 130 * pt
anchors.right: parent.right
......@@ -79,9 +78,3 @@ Rectangle {
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/
import QtQuick 2.4
DapUiQmlScreenVpnForm {
imageServer.source: modelTest.get(modelTest.index(comboboxServer.currentIndex, 0)).icon
}
......@@ -8,6 +8,10 @@ Item {
width: 400
height: 600
property ListModel modelTest: modelTest
property ComboBox comboboxServer: comboboxServer
property alias imageServer: imageServer
Text {
anchors.left: parent.left
anchors.top: parent.top
......@@ -44,7 +48,6 @@ Item {
}
}
Switch {
id: control
anchors.verticalCenter: parent.verticalCenter
......@@ -87,6 +90,18 @@ Item {
}
}
ListModel {
id: modelTest
ListElement {
name: "first"
icon: "qrc:/res/icons/defaul_icon.png"
}
ListElement {
name: "second"
icon: "qrc:/res/icons/defaul_icon.png"
}
}
ComboBox {
id: comboboxServer
anchors.horizontalCenter: parent.horizontalCenter
......@@ -96,11 +111,7 @@ Item {
height: 48 * pt
textRole: "name"
model: ListModel {
id: modelTest
ListElement {name: "first"; icon: "qrc:/res/icons/defaul_icon.png" }
ListElement {name: "second"; icon: "qrc:/res/icons/defaul_icon.png" }
}
model: modelTest
background: Rectangle {
anchors.fill: parent
......@@ -130,7 +141,6 @@ Item {
anchors.left: parent.left
anchors.leftMargin: 22 * pt
anchors.verticalCenter: parent.verticalCenter
source: modelTest.get(modelTest.index(comboboxServer.currentIndex, 0)).icon
width: 24 * pt
height: 24 * pt
}
......@@ -144,6 +154,5 @@ Item {
font.pixelSize: 16 * pt
}
}
}
}
......@@ -8,11 +8,7 @@ DapChainWalletTokenItem::DapChainWalletTokenItem(const QString& aWalletAddress,
}
DapChainWalletTokenItem::DapChainWalletTokenItem(const QString& aWalletAddress, const DapChainWalletTokenData& aData, QObject* parent) :
QObject(parent)/*
m_wallet(aWalletAddress),
m_name(aData.Name),
m_balance(aData.Balance),
m_emission(aData.Emission)*/
QObject(parent)
{
m_wallet = aWalletAddress;
m_name = aData.Name;
......
#include "DapSettingsCipher.h"
DapSettingsCipher::DapSettingsCipher(const DapSettings& settings)
: DapSettings(), m_settings(settings)
{
setFileName(settings.getFileName());
}
QByteArray DapSettingsCipher::encrypt(const QByteArray &byteArray) const
{
// TODO: implement encryption to next iteration.
// return m_settings.encrypt(byteArray);
}
QByteArray DapSettingsCipher::decrypt(const QByteArray &byteArray) const
{
// TODO: implement decryption to next iteration.
// return m_settings.decrypt(byteArray);
}
DapSettingsCipher &DapSettingsCipher::getInstance(const DapSettings& settings)
{
static DapSettingsCipher instance(settings);
return instance;
}
#ifndef DAPSETTINGSCIPHER_H
#define DAPSETTINGSCIPHER_H
#include <QObject>
#include "DapSettings.h"
class DapSettingsCipher : public DapSettings
{
Q_OBJECT
protected:
const DapSettings &m_settings;
DapSettingsCipher(const DapSettings& settings);
public:
virtual QByteArray encrypt(const QByteArray &byteArray) const;
virtual QByteArray decrypt(const QByteArray &byteArray) const;
/// Removed as part of the implementation of the pattern sington.
DapSettingsCipher(const DapSettingsCipher&) = delete;
DapSettingsCipher& operator= (const DapSettingsCipher &) = delete;
/// Get an instance of a class.
/// @return Instance of a class.
Q_INVOKABLE static DapSettingsCipher &getInstance(const DapSettings& settings);
};
#endif // DAPSETTINGSCIPHER_H
......@@ -17,7 +17,6 @@ SOURCES +=\
$$PWD/DapHalper.cpp \
$$PWD/DapHistoryType.cpp \
$$PWD/DapSettings.cpp \
$$PWD/DapSettingsCipher.cpp \
$$PWD/DapLogMessage.cpp \
$$PWD/DapLogModel.cpp \
$$PWD/DapChainWallet.cpp
......@@ -27,7 +26,6 @@ HEADERS +=\
$$PWD/DapHalper.h \
$$PWD/DapHistoryType.h \
$$PWD/DapSettings.h \
$$PWD/DapSettingsCipher.h \
$$PWD/DapLogMessage.h \
$$PWD/DapLogModel.h \
$$PWD/DapChainWallet.h \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment