Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements in GUI wallet #10

Merged
merged 8 commits into from
Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Debug/
/win/xdag/xdag.vcxproj.user
/win/xdagwallet/xdagwallet.vcxproj.user
/win/ipch
/win/xdagwallet/xdagwallet.aps
13 changes: 12 additions & 1 deletion client/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ static int xdag_command(char *cmd, FILE *out)
fprintf(out, "%d mining threads running\n", g_xdag_mining_threads);
} else if (sscanf(cmd, "%d", &nthreads) != 1 || nthreads < 0) {
fprintf(out, "Illegal number.\n");

} else {
xdag_mining_start(g_is_miner ? ~nthreads : nthreads);
fprintf(out, "%d mining threads running\n", g_xdag_mining_threads);
Expand Down Expand Up @@ -426,7 +427,7 @@ static int xdag_command(char *cmd, FILE *out)
fprintf(out, "%s\n", get_state());
} else if (!strcmp(cmd, "stats")) {
if (g_is_miner) {
fprintf(out, "your hashrate MHs: %.2lf\n", g_xdag_extstats.hashrate_s / (1024 * 1024));
fprintf(out, "your hashrate MHs: %.2lf\n", xdagGetHashRate());
} else {
fprintf(out, "Statistics for ours and maximum known parameters:\n"
" hosts: %u of %u\n"
Expand Down Expand Up @@ -896,3 +897,13 @@ int xdag_show_state(xdag_hash_t hash)

return (*g_xdag_show_state)(state, balance, address);
}

void xdagSetCountMiningTread(int miningThreadsCount)
{
xdag_mining_start(~miningThreadsCount);
}

double xdagGetHashRate()
{
return g_xdag_extstats.hashrate_s / (1024 * 1024);
}
3 changes: 3 additions & 0 deletions client/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ extern int (*g_xdag_show_state)(const char *state, const char *balance, const ch

extern int xdag_do_xfer(void *out, const char *amount, const char *address);

extern void xdagSetCountMiningTread(int miningThreadsCount);
extern double xdagGetHashRate();

#ifdef __cplusplus
};
#endif
Expand Down
8 changes: 4 additions & 4 deletions win/xdag/xdag.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,27 +119,27 @@
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
43 changes: 43 additions & 0 deletions win/xdagwallet/PasswordDlg.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

// cheatcoinwalletDlg.cpp : implementation file
//

#include "stdafx.h"
#include "resource.h"
#include "PasswordDlg.h"
#include "../../client/main.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// Password dialog

CPasswordDlg::CPasswordDlg() : CDialogEx(IDD_DIALOG_PASSWORD)
{
}

void CPasswordDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT_PASSWORD, _password);
DDX_Text(pDX, IDC_STATIC_PASSWORD_PROMT, _passwordPromt);
}

BEGIN_MESSAGE_MAP(CPasswordDlg, CDialogEx)
ON_BN_CLICKED(IDOK, &CPasswordDlg::OnBnClickedOk)
ON_WM_ACTIVATE()
END_MESSAGE_MAP()

BOOL CPasswordDlg::OnInitDialog()
{
CDialog::OnInitDialog();
UpdateData(false);
return TRUE;
}

void CPasswordDlg::OnBnClickedOk()
{
UpdateData(true);
CDialogEx::OnOK();
}
31 changes: 31 additions & 0 deletions win/xdagwallet/PasswordDlg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// cheatcoinwalletDlg.h : header file
//

#pragma once

#include "afxwin.h"
#include "afxdialogex.h"

class CPasswordDlg : public CDialogEx
{
public:
CPasswordDlg();

// Dialog Data
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_DIALOG1 };
#endif

protected:
virtual BOOL OnInitDialog();
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
private:
CString _passwordPromt;
CString _password;
afx_msg void OnBnClickedOk();

public:
void SetPasswordPromt(CString passwordPromt) { _passwordPromt = passwordPromt; }
CString GetPassword() { return _password; }
};
Binary file removed win/xdagwallet/res/Toolbar.bmp
Binary file not shown.
Binary file removed win/xdagwallet/res/Toolbar256.bmp
Binary file not shown.
Binary file modified win/xdagwallet/res/xdagwallet.ico
Binary file not shown.
67 changes: 35 additions & 32 deletions win/xdagwallet/resource.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by cheatcoinwallet.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_XDAGWALLET_DIALOG 102
#define IDP_SOCKETS_INIT_FAILED 103
#define IDR_MAINFRAME 128
#define IDD_DIALOG1 130
#define IDC_EDIT1 1000
#define IDC_EDIT2 1001
#define IDC_BUTTON1 1002
#define IDC_EDIT3 1003
#define IDC_EDIT4 1004
#define IDC_EDIT5 1005
#define IDC_EDIT6 1006
#define IDC_BUTTON2 1007
#define IDC_STATIC8 1008
#define IDC_STATIC1 1009

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 132
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1010
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by xdagwallet.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_XDAGWALLET_DIALOG 102
#define IDP_SOCKETS_INIT_FAILED 103
#define IDR_MAINFRAME 128
#define IDD_DIALOG_PASSWORD 130
#define IDC_EDIT_PASSWORD 1000
#define IDC_EDIT_MINING_THREADS 1001
#define IDC_BUTTON_CONNECT 1002
#define IDC_EDIT_BALANCE 1003
#define IDC_EDIT_ACCOUNT_ADDRESS 1004
#define IDC_EDIT_TRANSFER_AMOUNT 1005
#define IDC_EDIT_TRANSFER_TO 1006
#define IDC_BUTTON_XFER 1007
#define IDC_STATIC_STATE 1008
#define IDC_BUTTON_APPLY 1009
#define IDC_EDIT_POOL_ADDRESS 1010
#define IDC_EDIT_HASHRATE 1011
#define IDC_STATIC_PASSWORD_PROMT 1012

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 132
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1011
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Loading