Skip to content
Snippets Groups Projects
Commit 89a8f133 authored by jonymt's avatar jonymt
Browse files

[*] added comments

parent 3302c1e6
No related branches found
No related tags found
1 merge request!16Features 2510
Pipeline #844 passed with stage
in 2 minutes and 54 seconds
......@@ -80,7 +80,7 @@ public:
Q_INVOKABLE void executeCommand(const QString& command);
void getWalletInfo(const QString& asWalletName);
/// Request about new netowrk list
void getNetworkList();
signals:
......
......@@ -3,7 +3,7 @@
DapSettingsNetworkModel::DapSettingsNetworkModel(QObject *parent) : QAbstractListModel(parent),
m_CurrentIndex(-1)
{
m_NetworkList = QStringList() << "First" << "Second" << "Third" << "Forth";
}
DapSettingsNetworkModel& DapSettingsNetworkModel::getInstance()
......
......@@ -9,9 +9,8 @@ class DapSettingsNetworkModel : public QAbstractListModel
{
Q_OBJECT
// Q_PROPERTY(QString CurrentNetwork READ getCurrentNetwork WRITE setCurrentNetwork NOTIFY currentNetworkChanged)
public:
/// Enumeration display role
enum DisplayRole {
DisplayName = Qt::UserRole
};
......@@ -23,20 +22,34 @@ private:
public:
explicit DapSettingsNetworkModel(QObject *parent = nullptr);
/// Get instance of this object
/// @return instance
static DapSettingsNetworkModel &getInstance();
/// Overload methods
int rowCount(const QModelIndex& parent) const;
QVariant data(const QModelIndex& index, int role) const;
QHash<int, QByteArray> roleNames() const;
/// Get current network which was selected
/// @return name of current network
Q_INVOKABLE QString getCurrentNetwork() const;
/// Get current index which was selected
/// @return index of current network
Q_INVOKABLE int getCurrentIndex() const;
public slots:
/// Set new network list
/// @param List of network
void setNetworkList(const QStringList& aNetworkList);
/// Set current network which was selected in combobox
/// @param name of network
/// @param index of network
void setCurrentNetwork(QString CurrentNetwork, int CurrentIndex);
signals:
/// Signal about changing current network
/// @param name of network which was selected
void currentNetworkChanged(QString currentNetwork);
};
......
......@@ -31,24 +31,6 @@ DapUiQmlScreenSettingsForm {
section.property: "name"
section.criteria: ViewSection.FullString
section.delegate: Component {
Rectangle {
width: parent.width
height: 30 * pt
color: "#DFE1E6"
Text {
anchors.fill: parent
anchors.leftMargin: 18 * pt
verticalAlignment: Qt.AlignVCenter
text: section
font.family: "Roboto"
font.pixelSize: 12 * pt
color: "#5F5F63"
}
}
}
section.delegate: DapUiQmlScreenSettingsSection {}
}
}
import QtQuick 2.0
Component {
Rectangle {
width: parent.width
height: 30 * pt
color: "#DFE1E6"
Text {
anchors.fill: parent
anchors.leftMargin: 18 * pt
verticalAlignment: Qt.AlignVCenter
text: section
font.family: "Roboto"
font.pixelSize: 12 * pt
color: "#5F5F63"
}
}
}
......@@ -17,7 +17,6 @@ DapUiQmlWidgetSettingsNetworkForm {
currentIndex: dapSettingsNetworkModel.getCurrentIndex()
onCurrentTextChanged: {
console.debug(currentText);
if(dapSettingsNetworkModel.getCurrentIndex() !== currentIndex) {
dapSettingsNetworkModel.setCurrentNetwork(currentText, currentIndex);
}
......
......@@ -62,5 +62,6 @@
<file>DapUiQmlWidgetSettingsNetworkForm.ui.qml</file>
<file>DapUiQmlScreenSettings.qml</file>
<file>DapUiQmlScreenSettingsForm.ui.qml</file>
<file>DapUiQmlScreenSettingsSection.qml</file>
</qresource>
</RCC>
......@@ -105,9 +105,11 @@ public slots:
/// Get history
/// @return QList data history
QVariant getHistory() const;
/// Get network list
/// @return Network list
QStringList getNetworkList() const;
/// Change current network
/// @param name of network whcih was selected
void changeCurrentNetwork(const QString& aNetwork);
private slots:
......
......@@ -17,6 +17,8 @@ private:
public:
explicit DapChainNetworkHandler(QObject *parent = nullptr);
/// Get network list
/// @return Network list
QStringList getNetworkList();
};
......
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