PosTab
authorfsb4000 <fsb4000@yandex.ru>
Mon, 17 Nov 2014 13:12:23 +0000 (19:12 +0600)
committerfsb4000 <fsb4000@yandex.ru>
Mon, 17 Nov 2014 13:12:23 +0000 (19:12 +0600)
Перенесена PoSTab из Peerunity кошелька. + перевод на русский
Вот коммиты которые переносил:

https://github.com/Peerunity/Peerunity/commit/c8eda6083428b7375cc7792664acbba0e485cf8c

https://github.com/Peerunity/Peerunity/commit/941474511107ac9f827fdd12c635c96907b4a394

https://github.com/Peerunity/Peerunity/commit/e645dda155ba55f7d9e0062a991a338918c1719a

https://github.com/Peerunity/Peerunity/commit/7d19131208be800bede5b4a78c0032d28ad34b6e

https://github.com/Peerunity/Peerunity/commit/93c9c036695b4b886f682597f73432f8b0aa4e36

19 files changed:
MSVC/mynovacoinqt/mynovacoinqt.vcxproj
MSVC/mynovacoinqt/mynovacoinqt.vcxproj.filters
novacoin-qt.pro
src/kernelrecord.cpp [new file with mode: 0644]
src/kernelrecord.h [new file with mode: 0644]
src/qt/bitcoingui.cpp
src/qt/bitcoingui.h
src/qt/guiconstants.h
src/qt/locale/bitcoin_ru.ts
src/qt/mintingfilterproxy.cpp [new file with mode: 0644]
src/qt/mintingfilterproxy.h [new file with mode: 0644]
src/qt/mintingtablemodel.cpp [new file with mode: 0644]
src/qt/mintingtablemodel.h [new file with mode: 0644]
src/qt/mintingview.cpp [new file with mode: 0644]
src/qt/mintingview.h [new file with mode: 0644]
src/qt/walletmodel.cpp
src/qt/walletmodel.h
src/wallet.cpp
src/wallet.h

index 719d122..7780327 100644 (file)
@@ -1,4 +1,4 @@
-\feff<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -292,6 +292,9 @@ C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2-64\qtbase\bin\lrelease C:\
     <ClCompile Include="..\..\src\qt\askpassphrasedialog.cpp" />
     <ClCompile Include="..\..\src\qt\bitcoin.cpp" />
     <ClCompile Include="..\..\src\qt\bitcoinaddressvalidator.cpp" />
+    <ClCompile Include="..\..\src\qt\mintingfilterproxy.cpp" />
+    <ClCompile Include="..\..\src\qt\mintingtablemodel.cpp" />
+    <ClCompile Include="..\..\src\qt\mintingview.cpp" />
     <ClCompile Include="..\..\src\qt\trafficgraphwidget.cpp" />
     <ClCompile Include="..\..\src\qt\bitcoinamountfield.cpp" />
     <ClCompile Include="..\..\src\qt\bitcoingui.cpp" />
@@ -725,6 +728,61 @@ C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2-64\qtbase\bin\lrelease C:\
       <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build\moc_qrcodedialog.cpp;%(Outputs)</Outputs>
       <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build\moc_qrcodedialog.cpp;%(Outputs)</Outputs>
     </CustomBuild>
+    <ClInclude Include="..\..\src\kernelrecord.h" />
+    <CustomBuild Include="..\..\src\qt\mintingfilterproxy.h">
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\qt\mintingfilterproxy.h;%(AdditionalInputs)</AdditionalInputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\qt\mintingfilterproxy.h;%(AdditionalInputs)</AdditionalInputs>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtCore ..\..\src\qt\mintingfilterproxy.h -o build\moc_mintingfilterproxy.cpp</Command>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2-64\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtCore ..\..\src\qt\mintingfilterproxy.h -o build\moc_mintingfilterproxy.cpp</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MOC ..\..\src\qt\mintingfilterproxy.h</Message>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">MOC ..\..\src\qt\mintingfilterproxy.h</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build\moc_mintingfilterproxy.cpp;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build\moc_mintingfilterproxy.cpp;%(Outputs)</Outputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\qt\mintingfilterproxy.h;%(AdditionalInputs)</AdditionalInputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\qt\mintingfilterproxy.h;%(AdditionalInputs)</AdditionalInputs>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtCore ..\..\src\qt\mintingfilterproxy.h -o build\moc_mintingfilterproxy.cpp</Command>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2-64\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtCore ..\..\src\qt\mintingfilterproxy.h -o build\moc_mintingfilterproxy.cpp</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MOC ..\..\src\qt\mintingfilterproxy.h</Message>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MOC ..\..\src\qt\mintingfilterproxy.h</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build\moc_mintingfilterproxy.cpp;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build\moc_mintingfilterproxy.cpp;%(Outputs)</Outputs>
+    </CustomBuild>
+    <CustomBuild Include="..\..\src\qt\mintingtablemodel.h">
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\qt\mintingtablemodel.h;%(AdditionalInputs)</AdditionalInputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\qt\mintingtablemodel.h;%(AdditionalInputs)</AdditionalInputs>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtCore ..\..\src\qt\mintingtablemodel.h -o build\moc_mintingtablemodel.cpp</Command>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2-64\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtCore ..\..\src\qt\mintingtablemodel.h -o build\moc_mintingtablemodel.cpp</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MOC ..\..\src\qt\mintingtablemodel.h</Message>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">MOC ..\..\src\qt\mintingtablemodel.h</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build\moc_mintingtablemodel.cpp;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build\moc_mintingtablemodel.cpp;%(Outputs)</Outputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\qt\mintingtablemodel.h;%(AdditionalInputs)</AdditionalInputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\qt\mintingtablemodel.h;%(AdditionalInputs)</AdditionalInputs>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtCore ..\..\src\qt\mintingtablemodel.h -o build\moc_mintingtablemodel.cpp</Command>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2-64\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtCore ..\..\src\qt\mintingtablemodel.h -o build\moc_mintingtablemodel.cpp</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MOC ..\..\src\qt\mintingtablemodel.h</Message>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MOC ..\..\src\qt\mintingtablemodel.h</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build\moc_mintingtablemodel.cpp;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build\moc_mintingtablemodel.cpp;%(Outputs)</Outputs>
+    </CustomBuild>
+    <CustomBuild Include="..\..\src\qt\mintingview.h">
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\qt\mintingview.h;%(AdditionalInputs)</AdditionalInputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\src\qt\mintingview.h;%(AdditionalInputs)</AdditionalInputs>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtCore ..\..\src\qt\mintingview.h -o build\moc_mintingview.cpp</Command>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2-64\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtCore ..\..\src\qt\mintingview.h -o build\moc_mintingview.cpp</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">MOC ..\..\src\qt\mintingview.h</Message>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">MOC ..\..\src\qt\mintingview.h</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build\moc_mintingview.cpp;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build\moc_mintingview.cpp;%(Outputs)</Outputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\src\qt\mintingview.h;%(AdditionalInputs)</AdditionalInputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\src\qt\mintingview.h;%(AdditionalInputs)</AdditionalInputs>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2/qtbase/include/QtCore ..\..\src\qt\mintingview.h -o build\moc_mintingview.cpp</Command>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2-64\qtbase\bin\moc.exe  -DUNICODE -DWIN32 -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/mkspecs/win32-msvc2012 -IC:/MyProjects/Novacoin/MSVC/mynovacoinqt -IC:/MyProjects/Novacoin/src -IC:/MyProjects/Novacoin/src/json -IC:/MyProjects/Novacoin/src/qt -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtWidgets -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtNetwork -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtGui -IC:/MyProjects/Deps/qt-everywhere-opensource-src-5.3.2-64/qtbase/include/QtCore ..\..\src\qt\mintingview.h -o build\moc_mintingview.cpp</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MOC ..\..\src\qt\mintingview.h</Message>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MOC ..\..\src\qt\mintingview.h</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build\moc_mintingview.cpp;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build\moc_mintingview.cpp;%(Outputs)</Outputs>
+    </CustomBuild>
     <ClInclude Include="..\..\src\qt\qtipcserver.h" />
     <CustomBuild Include="..\..\src\qt\qvalidatedlineedit.h">
       <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\qt\qvalidatedlineedit.h;%(AdditionalInputs)</AdditionalInputs>
@@ -990,6 +1048,9 @@ C:\MyProjects\Deps\qt-everywhere-opensource-src-5.3.2-64\qtbase\bin\lrelease C:\
     <ClCompile Include="build\moc_transactiontablemodel.cpp" />
     <ClCompile Include="build\moc_transactionview.cpp" />
     <ClCompile Include="build\moc_walletmodel.cpp" />
+    <ClCompile Include="build\moc_mintingview.cpp" />
+    <ClCompile Include="build\moc_mintingtablemodel.cpp" />
+    <ClCompile Include="build\moc_mintingfilterproxy.cpp" />
     <CustomBuild Include="build\overviewpage.moc">
       <FileType>Document</FileType>
       <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\src\qt\overviewpage.cpp;%(AdditionalInputs)</AdditionalInputs>
index d2a612d..e5b1238 100644 (file)
     <ClCompile Include="..\..\src\qt\walletmodel.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\qt\mintingfilterproxy.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\qt\mintingtablemodel.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\qt\mintingview.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="build\moc_mintingview.cpp">
+      <Filter>Generated Files</Filter>
+    </ClCompile>
+    <ClCompile Include="build\moc_mintingtablemodel.cpp">
+      <Filter>Generated Files</Filter>
+    </ClCompile>
+    <ClCompile Include="build\moc_mintingfilterproxy.cpp">
+      <Filter>Generated Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\..\src\qt\aboutdialog.h">
     <ClInclude Include="..\..\src\qt\dialogwindowflags.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <CustomBuild Include="..\..\src\qt\mintingfilterproxy.h">
+      <Filter>Header Files</Filter>
+    </CustomBuild>
+    <CustomBuild Include="..\..\src\qt\mintingtablemodel.h">
+      <Filter>Header Files</Filter>
+    </CustomBuild>
+    <CustomBuild Include="..\..\src\qt\mintingview.h">
+      <Filter>Header Files</Filter>
+    </CustomBuild>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="build\moc_aboutdialog.cpp">
       <Filter>Resource Files</Filter>
     </Image>
   </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\kernelrecord.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
 </Project>
\ No newline at end of file
index 51ba8b1..2552e53 100644 (file)
@@ -185,6 +185,10 @@ HEADERS += src/qt/bitcoingui.h \
     src/qt/aboutdialog.h \
     src/qt/editaddressdialog.h \
     src/qt/bitcoinaddressvalidator.h \
+    src/qt/mintingfilterproxy.h \
+    src/qt/mintingtablemodel.h \
+    src/qt/mintingview.h \
+    src/kernelrecord.h \
     src/alert.h \
     src/addrman.h \
     src/base58.h \
@@ -269,6 +273,10 @@ SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
     src/qt/editaddressdialog.cpp \
     src/qt/bitcoinaddressvalidator.cpp \
     src/qt/trafficgraphwidget.cpp \
+    src/qt/mintingfilterproxy.cpp \
+    src/qt/mintingtablemodel.cpp \
+    src/qt/mintingview.cpp \
+    src/kernelrecord.cpp \
     src/alert.cpp \
     src/version.cpp \
     src/sync.cpp \
diff --git a/src/kernelrecord.cpp b/src/kernelrecord.cpp
new file mode 100644 (file)
index 0000000..eb68dd4
--- /dev/null
@@ -0,0 +1,116 @@
+#include "kernelrecord.h"
+
+#include "wallet.h"
+#include "base58.h"
+#include "main.h"
+
+using namespace std;
+
+bool KernelRecord::showTransaction(const CWalletTx &wtx)
+{
+    if (wtx.IsCoinBase())
+    {
+        if (wtx.GetDepthInMainChain() < 2)
+        {
+            return false;
+        }
+    }
+
+    if(!wtx.IsTrusted())
+    {
+        return false;
+    }
+
+    return true;
+}
+
+/*
+ * Decompose CWallet transaction to model kernel records.
+ */
+vector<KernelRecord> KernelRecord::decomposeOutput(const CWallet *wallet, const CWalletTx &wtx)
+{
+    vector<KernelRecord> parts;
+    int64 nTime = wtx.GetTxTime();
+    uint256 hash = wtx.GetHash();
+    std::map<std::string, std::string> mapValue = wtx.mapValue;
+    int64 nDayWeight = (min((GetAdjustedTime() - nTime), (int64)(nStakeMaxAge+nStakeMinAge)) - nStakeMinAge); // DayWeight * 86400, ÷òîáû áûë
+                                                                                                              // ïðàâèëüíûé ðàñ÷¸ò CoinAge                                                         
+    if (showTransaction(wtx))
+    {
+        for (int nOut = 0; nOut < wtx.vout.size(); nOut++)
+        {
+            CTxOut txOut = wtx.vout[nOut];
+            if( wallet->IsMine(txOut) ) {
+                CTxDestination address;
+                std::string addrStr;
+
+                uint64 coinAge = max( (txOut.nValue * nDayWeight) / (COIN * 86400), (int64)0);
+
+                if (ExtractDestination(txOut.scriptPubKey, address))
+                {
+                    // Sent to Bitcoin Address
+                    addrStr = CBitcoinAddress(address).ToString();
+                }
+                else
+                {
+                    // Sent to IP, or other non-address transaction like OP_EVAL
+                    addrStr = mapValue["to"];
+                }
+
+                parts.push_back(KernelRecord(hash, nTime, addrStr, txOut.nValue, wtx.IsSpent(nOut), coinAge));
+            }
+        }
+    }
+
+    return parts;
+}
+
+std::string KernelRecord::getTxID()
+{
+    return hash.ToString() + strprintf("-%03d", idx);
+}
+
+int64 KernelRecord::getAge() const
+{
+    return (GetAdjustedTime() - nTime) / 86400;
+}
+
+double KernelRecord::getProbToMintStake(double difficulty, int timeOffset) const
+{
+    double maxTarget = pow(static_cast<double>(2), 224);
+    double target = maxTarget / difficulty;
+    int dayWeight = (min((GetAdjustedTime() - nTime) + timeOffset, (int64)(nStakeMinAge+nStakeMaxAge)) - nStakeMinAge) / 86400;
+    uint64 coinAge = max(nValue * dayWeight / COIN, (int64)0);
+    return target * coinAge / pow(static_cast<double>(2), 256);
+}
+
+double KernelRecord::getProbToMintWithinNMinutes(double difficulty, int minutes)
+{
+    if(difficulty != prevDifficulty || minutes != prevMinutes)
+    {
+        double prob = 1;
+        double p;
+        int d = minutes / (60 * 24); // Number of full days
+        int m = minutes % (60 * 24); // Number of minutes in the last day
+        int i, timeOffset;
+
+        // Probabilities for the first d days
+        for(i = 0; i < d; i++)
+        {
+            timeOffset = i * 86400;
+            p = pow(1 - getProbToMintStake(difficulty, timeOffset), 86400);
+            prob *= p;
+        }
+
+        // Probability for the m minutes of the last day
+        timeOffset = d * 86400;
+        p = pow(1 - getProbToMintStake(difficulty, timeOffset), 60 * m);
+        prob *= p;
+
+        prob = 1 - prob;
+        prevProbability = prob;
+        prevDifficulty = difficulty;
+        prevMinutes = minutes;
+    }
+    return prevProbability;
+}
diff --git a/src/kernelrecord.h b/src/kernelrecord.h
new file mode 100644 (file)
index 0000000..d54e551
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef KERNELRECORD_H
+#define KERNELRECORD_H
+
+#include "uint256.h"
+
+class CWallet;
+class CWalletTx;
+
+class KernelRecord
+{
+public:
+    KernelRecord():
+        hash(), nTime(0), address(""), nValue(0), idx(0), spent(false), coinAge(0), prevMinutes(0), prevDifficulty(0), prevProbability(0)
+    {
+    }
+
+    KernelRecord(uint256 hash, int64 nTime):
+            hash(hash), nTime(nTime), address(""), nValue(0), idx(0), spent(false), coinAge(0), prevMinutes(0), prevDifficulty(0), prevProbability(0)
+    {
+    }
+
+    KernelRecord(uint256 hash, int64 nTime,
+                 const std::string &address,
+                 int64 nValue, bool spent, int64 coinAge):
+        hash(hash), nTime(nTime), address(address), nValue(nValue),
+        idx(0), spent(spent), coinAge(coinAge), prevMinutes(0), prevDifficulty(0), prevProbability(0)
+    {
+    }
+
+    static bool showTransaction(const CWalletTx &wtx);
+    static std::vector<KernelRecord> decomposeOutput(const CWallet *wallet, const CWalletTx &wtx);
+
+
+    uint256 hash;
+    int64 nTime;
+    std::string address;
+    int64 nValue;
+    int idx;
+    bool spent;
+    int64 coinAge;
+
+    std::string getTxID();
+    int64 getAge() const;
+    double getProbToMintStake(double difficulty, int timeOffset = 0) const;
+    double getProbToMintWithinNMinutes(double difficulty, int minutes);
+protected:
+    int prevMinutes;
+    double prevDifficulty;
+    double prevProbability;
+};
+
+#endif // KERNELRECORD_H
index d7bc458..5db27fe 100644 (file)
@@ -26,6 +26,7 @@
 #include "guiutil.h"
 #include "ui_interface.h"
 #include "rpcconsole.h"
+#include "mintingview.h"
 
 #ifdef Q_OS_MAC
 #include "macdockiconhandler.h"
@@ -116,6 +117,12 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
     vbox->addWidget(transactionView);
     transactionsPage->setLayout(vbox);
 
+    mintingPage = new QWidget(this);
+    QVBoxLayout *vboxMinting = new QVBoxLayout();
+    mintingView = new MintingView(this);
+    vboxMinting->addWidget(mintingView);
+    mintingPage->setLayout(vboxMinting);
+
     addressBookPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab);
 
     receiveCoinsPage = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab);
@@ -127,6 +134,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
     centralWidget = new QStackedWidget(this);
     centralWidget->addWidget(overviewPage);
     centralWidget->addWidget(transactionsPage);
+    centralWidget->addWidget(mintingPage);
     centralWidget->addWidget(addressBookPage);
     centralWidget->addWidget(receiveCoinsPage);
     centralWidget->addWidget(sendCoinsPage);
@@ -234,10 +242,16 @@ void BitcoinGUI::createActions()
     historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));
     tabGroup->addAction(historyAction);
 
+    mintingAction = new QAction(QIcon(":/icons/history"), tr("&Minting"), this);
+    mintingAction->setToolTip(tr("Show your minting capacity"));
+    mintingAction->setCheckable(true);
+    mintingAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
+    tabGroup->addAction(mintingAction);
+
     addressBookAction = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this);
     addressBookAction->setToolTip(tr("Edit the list of stored addresses and labels"));
     addressBookAction->setCheckable(true);
-    addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
+    addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
     tabGroup->addAction(addressBookAction);
 
     connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
@@ -248,6 +262,8 @@ void BitcoinGUI::createActions()
     connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
     connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
     connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
+    connect(mintingAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
+    connect(mintingAction, SIGNAL(triggered()), this, SLOT(gotoMintingPage()));
     connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
     connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
 
@@ -363,6 +379,7 @@ void BitcoinGUI::createToolBars()
     toolbar->addAction(sendCoinsAction);
     toolbar->addAction(receiveCoinsAction);
     toolbar->addAction(historyAction);
+    toolbar->addAction(mintingAction);
     toolbar->addAction(addressBookAction);
 
     QToolBar *toolbar2 = addToolBar(tr("Actions toolbar"));
@@ -422,6 +439,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel)
 
         // Put transaction list in tabs
         transactionView->setModel(walletModel);
+        mintingView->setModel(walletModel);
 
         overviewPage->setModel(walletModel);
         addressBookPage->setModel(walletModel->getAddressTableModel());
@@ -845,6 +863,17 @@ void BitcoinGUI::gotoHistoryPage()
     connect(exportAction, SIGNAL(triggered()), transactionView, SLOT(exportClicked()));
 }
 
+void BitcoinGUI::gotoMintingPage()
+{
+    mintingAction->setChecked(true);
+    centralWidget->setCurrentWidget(mintingPage);
+
+    exportAction->setEnabled(true);
+    disconnect(exportAction, SIGNAL(triggered()), 0, 0);
+    connect(exportAction, SIGNAL(triggered()), mintingView, SLOT(exportClicked()));
+}
+
+
 void BitcoinGUI::gotoAddressBookPage()
 {
     addressBookAction->setChecked(true);
index 0f85654..df5d93e 100644 (file)
@@ -8,6 +8,7 @@ class TransactionTableModel;
 class ClientModel;
 class WalletModel;
 class TransactionView;
+class MintingView;
 class OverviewPage;
 class AddressBookPage;
 class SendCoinsDialog;
@@ -61,6 +62,7 @@ private:
 
     OverviewPage *overviewPage;
     QWidget *transactionsPage;
+    QWidget *mintingPage;
     AddressBookPage *addressBookPage;
     AddressBookPage *receiveCoinsPage;
     SendCoinsDialog *sendCoinsPage;
@@ -76,6 +78,7 @@ private:
     QMenuBar *appMenuBar;
     QAction *overviewAction;
     QAction *historyAction;
+    QAction *mintingAction;
     QAction *quitAction;
     QAction *sendCoinsAction;
     QAction *addressBookAction;
@@ -100,6 +103,7 @@ private:
     QSystemTrayIcon *trayIcon;
     Notificator *notificator;
     TransactionView *transactionView;
+    MintingView *mintingView;
     RPCConsole *rpcConsole;
 
     QMovie *syncIconMovie;
@@ -146,6 +150,8 @@ private slots:
     void gotoOverviewPage();
     /** Switch to history (transactions) page */
     void gotoHistoryPage();
+    /** Switch to minting page */
+    void gotoMintingPage();
     /** Switch to address book page */
     void gotoAddressBookPage();
     /** Switch to receive coins page */
index 405ba39..da18c83 100644 (file)
@@ -31,4 +31,9 @@ static const int MAX_URI_LENGTH = 255;
 /* QRCodeDialog -- size of exported QR Code image */
 #define EXPORT_IMAGE_SIZE 256
 
+/* Colors for minting tab for each coin age group */
+#define COLOR_MINT_YOUNG QColor(127, 127, 240)
+#define COLOR_MINT_MATURE QColor(127, 240, 127)
+#define COLOR_MINT_OLD QColor(240, 127, 127)
+
 #endif // GUICONSTANTS_H
index 3543764..2cd4930 100644 (file)
@@ -2,6 +2,136 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="ru">
 <defaultcodec>UTF-8</defaultcodec>
+  <context>
+    <name>MintingView</name>
+    <message>
+      <location filename="../mintingview.cpp" line="33"/>
+      <source>transaction is too young</source>
+      <translation>транзакция молода для PoS</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="40"/>
+      <source>transaction is mature</source>
+      <translation>зрелая транзакция</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="47"/>
+      <source>transaction has reached maximum probability</source>
+      <translation>транзакция достигла максимальной вероятности</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="60"/>
+      <source>Display minting probability within : </source>
+      <translation>Показывать вероятность найти блок в течение : </translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="62"/>
+      <source>10 min</source>
+      <translation>10 минут</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="63"/>
+      <source>24 hours</source>
+      <translation>24 часов</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="64"/>
+      <source>30 days</source>
+      <translation>30 дней</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="65"/>
+      <source>90 days</source>
+      <translation>90 дней</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="167"/>
+      <source>Export Minting Data</source>
+      <translation>Экспортировать данные таблицы</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="168"/>
+      <source>Comma separated file (*.csv)</source>
+      <translation>Текст, разделённый запятыми (*.csv)</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="185"/>
+      <source>Error exporting</source>
+      <translation>Ошибка экспорта</translation>
+    </message>
+    <message>
+      <location filename="../mintingview.cpp" line="185"/>
+      <source>Could not write to file %1.</source>
+      <translation>Невозможно записать в файл %1.</translation>
+    </message>
+  </context>
+  <context>
+    <name>MintingTableModel</name>
+    <message>
+      <source>Address</source>
+      <translation>Адрес</translation>
+    </message>
+    <message>
+      <source>Transaction</source>
+      <translation>Транзакция</translation>
+    </message>
+    <message>
+      <source>Age</source>
+      <translation>Возраст</translation>
+    </message>
+    <message>
+      <source>CoinDay</source>
+      <translation>Вес</translation>
+    </message>
+    <message>
+      <source>Balance</source>
+      <translation>Баланс</translation>
+    </message>
+    <message>
+      <source>MintProbability</source>
+      <translation>Вероятность PoS</translation>
+    </message>
+    <message>
+      <source>minutes</source>
+      <translation>минут</translation>
+    </message>
+    <message>
+      <source>hours</source>
+      <translation>часа</translation>
+    </message>
+    <message>
+      <source>days</source>
+      <translation>дней</translation>
+    </message>
+    <message>
+      <source>You have %1 chance to find a POS block if you mint %2 %3 at current difficulty.</source>
+      <translation>У вас есть %1 шанс найти PoS блок, если вы будете майнить %2 %3 при текущей сложности.</translation>
+    </message>
+    <message>
+      <source>Destination address of the output.</source>
+      <translation>Адрес который получил эту транзакцию.</translation>
+    </message>
+    <message>
+      <source>Original transaction id.</source>
+      <translation>Исходный ID транзакции.</translation>
+    </message>
+    <message>
+      <source>Age of the transaction in days.</source>
+      <translation>Возраст транзакции в днях.</translation>
+    </message>
+    <message>
+      <source>Balance of the output.</source>
+      <translation>Баланс выхода.</translation>
+    </message>
+    <message>
+      <source>Coin age in the output.</source>
+      <translation>CoinDayWeight выхода.</translation>
+    </message>
+    <message>
+      <source>Chance to mint a block within given time interval.</source>
+      <translation>Шанс найти блок в течение выбранного временного интервала.</translation>
+    </message>
+  </context>
 <context>
   <name>QObject</name>
   <message>
@@ -341,6 +471,16 @@ Copyright © 2012-2014 The NovaCoin developers</source>
         <translation>Показать историю транзакций</translation>
     </message>
     <message>
+        <location line="+17"/>
+        <source>&amp;Minting</source>
+        <translation>&amp;PoS</translation>
+    </message>
+    <message>
+        <location line="+1"/>
+        <source>Show your minting capacity</source>
+        <translation>Показать ваш PoS потенциал</translation>
+    </message>
+    <message>
         <location line="+5"/>
         <source>&amp;Address Book</source>
         <translation>&amp;Адресная книга</translation>
diff --git a/src/qt/mintingfilterproxy.cpp b/src/qt/mintingfilterproxy.cpp
new file mode 100644 (file)
index 0000000..664cbe7
--- /dev/null
@@ -0,0 +1,7 @@
+#include "mintingfilterproxy.h"
+
+MintingFilterProxy::MintingFilterProxy(QObject * parent) :
+    QSortFilterProxyModel(parent)
+{
+
+}
diff --git a/src/qt/mintingfilterproxy.h b/src/qt/mintingfilterproxy.h
new file mode 100644 (file)
index 0000000..26c4abf
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef MINTINGFILTERPROXY_H
+#define MINTINGFILTERPROXY_H
+
+#include <QSortFilterProxyModel>
+
+class MintingFilterProxy : public QSortFilterProxyModel
+{
+    Q_OBJECT
+public:
+    explicit MintingFilterProxy(QObject *parent = 0);
+};
+
+#endif // MINTINGFILTERPROXY_H
diff --git a/src/qt/mintingtablemodel.cpp b/src/qt/mintingtablemodel.cpp
new file mode 100644 (file)
index 0000000..4973480
--- /dev/null
@@ -0,0 +1,450 @@
+#include "mintingtablemodel.h"
+#include "transactiontablemodel.h"
+#include "guiutil.h"
+#include "kernelrecord.h"
+#include "guiconstants.h"
+#include "transactiondesc.h"
+#include "walletmodel.h"
+#include "optionsmodel.h"
+#include "addresstablemodel.h"
+#include "bitcoinunits.h"
+#include "util.h"
+#include "kernel.h"
+
+#include "wallet.h"
+
+#include <QLocale>
+#include <QList>
+#include <QColor>
+#include <QTimer>
+#include <QIcon>
+#include <QDateTime>
+#include <QtAlgorithms>
+
+extern double GetDifficulty(const CBlockIndex* blockindex);
+
+static int column_alignments[] = {
+    Qt::AlignLeft|Qt::AlignVCenter,
+    Qt::AlignLeft|Qt::AlignVCenter,
+    Qt::AlignRight|Qt::AlignVCenter,
+    Qt::AlignRight|Qt::AlignVCenter,
+    Qt::AlignRight|Qt::AlignVCenter,
+    Qt::AlignRight|Qt::AlignVCenter
+};
+
+struct TxLessThan
+{
+    bool operator()(const KernelRecord &a, const KernelRecord &b) const
+    {
+        return a.hash < b.hash;
+    }
+    bool operator()(const KernelRecord &a, const uint256 &b) const
+    {
+        return a.hash < b;
+    }
+    bool operator()(const uint256 &a, const KernelRecord &b) const
+    {
+        return a < b.hash;
+    }
+};
+
+class MintingTablePriv
+{
+public:
+    MintingTablePriv(CWallet *wallet, MintingTableModel *parent):
+        wallet(wallet),
+        parent(parent)
+    {
+    }
+    CWallet *wallet;
+    MintingTableModel *parent;
+
+    QList<KernelRecord> cachedWallet;
+
+    void refreshWallet()
+    {
+#ifdef WALLET_UPDATE_DEBUG
+        qDebug() << "refreshWallet";
+#endif
+        cachedWallet.clear();
+        {
+            LOCK(wallet->cs_wallet);
+            for(std::map<uint256, CWalletTx>::iterator it = wallet->mapWallet.begin(); it != wallet->mapWallet.end(); ++it)
+            {
+                std::vector<KernelRecord> txList = KernelRecord::decomposeOutput(wallet, it->second);
+                BOOST_FOREACH(KernelRecord& kr, txList) {
+                    if(!kr.spent) {
+                        cachedWallet.append(kr);
+                    }
+                }
+
+            }
+        }
+    }
+
+    /* Update our model of the wallet incrementally, to synchronize our model of the wallet
+       with that of the core.
+
+       Call with list of hashes of transactions that were added, removed or changed.
+     */
+    void updateWallet(const QList<uint256> &updated)
+    {
+        // Walk through updated transactions, update model as needed.
+#ifdef WALLET_UPDATE_DEBUG
+        qDebug() << "updateWallet";
+#endif
+        // Sort update list, and iterate through it in reverse, so that model updates
+        //  can be emitted from end to beginning (so that earlier updates will not influence
+        // the indices of latter ones).
+        QList<uint256> updated_sorted = updated;
+        qSort(updated_sorted);
+
+        {
+            LOCK(wallet->cs_wallet);
+            for(int update_idx = updated_sorted.size()-1; update_idx >= 0; --update_idx)
+            {
+                const uint256 &hash = updated_sorted.at(update_idx);
+                // Find transaction in wallet
+                std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(hash);
+                bool inWallet = mi != wallet->mapWallet.end();
+                // Find bounds of this transaction in model
+                QList<KernelRecord>::iterator lower = qLowerBound(
+                    cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan());
+                QList<KernelRecord>::iterator upper = qUpperBound(
+                    cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan());
+                int lowerIndex = (lower - cachedWallet.begin());
+                int upperIndex = (upper - cachedWallet.begin());
+
+                // Determine if transaction is in model already
+                bool inModel = false;
+                if(lower != upper)
+                {
+                    inModel = true;
+                }
+
+#ifdef WALLET_UPDATE_DEBUG
+                qDebug() << "  " << QString::fromStdString(hash.ToString()) << inWallet << " " << inModel
+                        << lowerIndex << "-" << upperIndex;
+#endif
+
+                if(inWallet && !inModel)
+                {
+                    // Added -- insert at the right position
+                    std::vector<KernelRecord> toInsert =
+                            KernelRecord::decomposeOutput(wallet, mi->second);
+                    if(!toInsert.empty()) /* only if something to insert */
+                    {
+                        parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex+toInsert.size()-1);
+                        int insert_idx = lowerIndex;
+                        BOOST_FOREACH(const KernelRecord &rec, toInsert)
+                        {
+                            if(!rec.spent) {
+                                cachedWallet.insert(insert_idx, rec);
+                                insert_idx += 1;
+                            }
+                        }
+                        parent->endInsertRows();
+                    }
+                }
+                else if(!inWallet && inModel)
+                {
+                    // Removed -- remove entire transaction from table
+                    parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);
+                    cachedWallet.erase(lower, upper);
+                    parent->endRemoveRows();
+                }
+                else if(inWallet && inModel)
+                {               
+                    // Updated -- nothing to do, status update will take care of this
+                }
+            }
+        }
+    }
+
+    int size()
+    {
+        return cachedWallet.size();
+    }
+
+    KernelRecord *index(int idx)
+    {
+        if(idx >= 0 && idx < cachedWallet.size())
+        {
+            KernelRecord *rec = &cachedWallet[idx];
+            return rec;
+        }
+        else
+        {
+            return 0;
+        }
+    }
+
+    QString describe(KernelRecord *rec)
+    {
+        {
+            LOCK(wallet->cs_wallet);
+            std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(rec->hash);
+            if(mi != wallet->mapWallet.end())
+            {
+                return TransactionDesc::toHTML(wallet, mi->second);
+            }
+        }
+        return QString("");
+    }
+
+};
+
+
+MintingTableModel::MintingTableModel(CWallet *wallet, WalletModel *parent):
+        QAbstractTableModel(parent),
+        wallet(wallet),
+        walletModel(parent),
+        mintingInterval(10),
+        priv(new MintingTablePriv(wallet, this))
+{
+    columns << tr("Transaction") <<  tr("Address") << tr("Age") << tr("Balance") << tr("CoinDay") << tr("MintProbability");
+    priv->refreshWallet();
+
+    QTimer *timer = new QTimer(this);
+    connect(timer, SIGNAL(timeout()), this, SLOT(update()));
+    timer->start(MODEL_UPDATE_DELAY);
+}
+
+MintingTableModel::~MintingTableModel()
+{
+    delete priv;
+}
+
+void MintingTableModel::update()
+{
+    QList<uint256> updated;
+
+    // Check if there are changes to wallet map
+    {
+        TRY_LOCK(wallet->cs_wallet, lockWallet);
+        if (lockWallet && !wallet->vMintingWalletUpdated.empty())
+        {
+            BOOST_FOREACH(uint256 hash, wallet->vMintingWalletUpdated)
+            {
+                updated.append(hash);
+            }
+            wallet->vMintingWalletUpdated.clear();
+        }
+    }
+
+    if(!updated.empty())
+    {
+        priv->updateWallet(updated);
+    }
+}
+
+int MintingTableModel::rowCount(const QModelIndex &parent) const
+{
+    Q_UNUSED(parent);
+    return priv->size();
+}
+
+int MintingTableModel::columnCount(const QModelIndex &parent) const
+{
+    Q_UNUSED(parent);
+    return columns.length();
+}
+
+QVariant MintingTableModel::data(const QModelIndex &index, int role) const
+{
+    if(!index.isValid())
+        return QVariant();
+    KernelRecord *rec = static_cast<KernelRecord*>(index.internalPointer());
+
+    switch(role)
+    {
+      case Qt::DisplayRole:
+        switch(index.column())
+        {
+        case Address:
+            return formatTxAddress(rec, false);
+        case TxHash:
+            return formatTxHash(rec);
+        case Age:
+            return formatTxAge(rec);
+        case Balance:
+            return formatTxBalance(rec);
+        case CoinDay:
+            return formatTxCoinDay(rec);
+        case MintProbability:
+            return formatDayToMint(rec);
+        }
+        break;
+      case Qt::TextAlignmentRole:
+        return column_alignments[index.column()];
+        break;
+      case Qt::ToolTipRole:
+        switch(index.column())
+        {
+        case MintProbability:
+            int interval = this->mintingInterval;
+            QString unit = tr("minutes");
+
+            int hours = interval / 60;
+            int days = hours  / 24;
+
+            if(hours > 1) {
+                interval = hours;
+                unit = tr("hours");
+            }
+            if(days > 1) {
+                interval = days;
+                unit = tr("days");
+            }
+
+            QString str = QString(tr("You have %1 chance to find a POS block if you mint %2 %3 at current difficulty."));
+            return str.arg(index.data().toString().toUtf8().constData()).arg(interval).arg(unit);
+        }
+        break;
+      case Qt::EditRole:
+        switch(index.column())
+        {
+        case Address:
+            return formatTxAddress(rec, false);
+        case TxHash:
+            return formatTxHash(rec);
+        case Age:
+            return rec->getAge();
+        case CoinDay:
+            return rec->coinAge;
+        case Balance:
+            return rec->nValue;
+        case MintProbability:
+            return getDayToMint(rec);
+        }
+        break;
+      case Qt::BackgroundColorRole:
+        int minAge = nStakeMinAge / 60 / 60 / 24;
+        int maxAge = nStakeMaxAge / 60 / 60 / 24;
+        if(rec->getAge() < minAge)
+        {
+            return COLOR_MINT_YOUNG;
+        }
+        else if (rec->getAge() >= minAge && rec->getAge() < (maxAge + minAge))
+        {
+            return COLOR_MINT_MATURE;
+        }
+        else
+        {
+            return COLOR_MINT_OLD;
+        }
+        break;
+
+    }
+    return QVariant();
+}
+
+void MintingTableModel::setMintingInterval(int interval)
+{
+    mintingInterval = interval;
+}
+
+QString MintingTableModel::lookupAddress(const std::string &address, bool tooltip) const
+{
+    QString label = walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(address));
+    QString description;
+    if(!label.isEmpty())
+    {
+        description += label + QString(" ");
+    }
+    if(label.isEmpty() || walletModel->getOptionsModel()->getDisplayAddresses() || tooltip)
+    {
+        description += QString("(") + QString::fromStdString(address) + QString(")");
+    }
+    return description;
+}
+
+double MintingTableModel::getDayToMint(KernelRecord *wtx) const
+{
+    const CBlockIndex *p = GetLastBlockIndex(pindexBest, true);
+    double difficulty = GetDifficulty(p);
+
+    double prob = wtx->getProbToMintWithinNMinutes(difficulty, mintingInterval);
+    prob = prob * 100;
+    return prob;
+}
+
+QString MintingTableModel::formatDayToMint(KernelRecord *wtx) const
+{
+    double prob = getDayToMint(wtx);
+    return QString::number(prob, 'f', 3) + "%";
+}
+
+QString MintingTableModel::formatTxAddress(const KernelRecord *wtx, bool tooltip) const
+{
+    return QString::fromStdString(wtx->address);
+}
+
+QString MintingTableModel::formatTxHash(const KernelRecord *wtx) const
+{
+    return QString::fromStdString(wtx->hash.ToString());
+}
+
+QString MintingTableModel::formatTxCoinDay(const KernelRecord *wtx) const
+{
+    return QString::number(wtx->coinAge);
+}
+
+QString MintingTableModel::formatTxAge(const KernelRecord *wtx) const
+{
+    int64 nAge = wtx->getAge();
+    return QString::number(nAge);
+}
+
+QString MintingTableModel::formatTxBalance(const KernelRecord *wtx) const
+{
+    return BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), wtx->nValue);
+}
+
+QVariant MintingTableModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+    if(orientation == Qt::Horizontal)
+    {
+        if(role == Qt::DisplayRole)
+        {
+            return columns[section];
+        }
+        else if (role == Qt::TextAlignmentRole)
+        {
+            return column_alignments[section];
+        } else if (role == Qt::ToolTipRole)
+        {
+            switch(section)
+            {
+            case Address:
+                return tr("Destination address of the output.");
+            case TxHash:
+                return tr("Original transaction id.");
+            case Age:
+                return tr("Age of the transaction in days.");
+            case Balance:
+                return tr("Balance of the output.");
+            case CoinDay:
+                return tr("Coin age in the output.");
+            case MintProbability:
+                return tr("Chance to mint a block within given time interval.");
+            }
+        }
+    }
+    return QVariant();
+}
+
+QModelIndex MintingTableModel::index(int row, int column, const QModelIndex &parent) const
+{
+    Q_UNUSED(parent);
+    KernelRecord *data = priv->index(row);
+    if(data)
+    {
+        return createIndex(row, column, priv->index(row));
+    }
+    else
+    {
+        return QModelIndex();
+    }
+}
+
diff --git a/src/qt/mintingtablemodel.h b/src/qt/mintingtablemodel.h
new file mode 100644 (file)
index 0000000..c265ce5
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef MINTINGTABLEMODEL_H
+#define MINTINGTABLEMODEL_H
+
+
+#include <QAbstractTableModel>
+#include <QStringList>
+
+class CWallet;
+class MintingTablePriv;
+class KernelRecord;
+class WalletModel;
+
+class MintingTableModel : public QAbstractTableModel
+{
+    Q_OBJECT
+public:
+    explicit MintingTableModel(CWallet * wallet, WalletModel *parent = 0);
+    ~MintingTableModel();
+
+    enum ColumnIndex {
+        TxHash = 0,
+        Address = 1,
+        Age = 2,
+        Balance = 3,
+        CoinDay = 4,
+        MintProbability = 5
+    };
+
+
+    int rowCount(const QModelIndex &parent) const;
+    int columnCount(const QModelIndex &parent) const;
+    QVariant data(const QModelIndex &index, int role) const;
+    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+    QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;
+
+    void setMintingInterval(int interval);
+
+private:
+    CWallet* wallet;
+    WalletModel *walletModel;
+    QStringList columns;
+    int mintingInterval;
+    MintingTablePriv *priv;
+
+    QString lookupAddress(const std::string &address, bool tooltip) const;
+
+    double getDayToMint(KernelRecord *wtx) const;
+    QString formatDayToMint(KernelRecord *wtx) const;
+    QString formatTxAddress(const KernelRecord *wtx, bool tooltip) const;
+    QString formatTxHash(const KernelRecord *wtx) const;
+    QString formatTxAge(const KernelRecord *wtx) const;
+    QString formatTxBalance(const KernelRecord *wtx) const;
+    QString formatTxCoinDay(const KernelRecord *wtx) const;
+private slots:
+    void update();
+
+    friend class MintingTablePriv;
+};
+
+#endif // MINTINGTABLEMODEL_H
diff --git a/src/qt/mintingview.cpp b/src/qt/mintingview.cpp
new file mode 100644 (file)
index 0000000..07ecadf
--- /dev/null
@@ -0,0 +1,188 @@
+#include "mintingview.h"
+#include "mintingfilterproxy.h"
+#include "transactionrecord.h"
+#include "mintingtablemodel.h"
+#include "walletmodel.h"
+#include "guiconstants.h"
+#include "guiutil.h"
+#include "csvmodelwriter.h"
+
+
+#include <QHBoxLayout>
+#include <QHeaderView>
+#include <QVBoxLayout>
+#include <QTableView>
+#include <QScrollBar>
+#include <QLabel>
+#include <QLineEdit>
+#include <QComboBox>
+#include <QMessageBox>
+
+MintingView::MintingView(QWidget *parent) :
+    QWidget(parent), model(0), mintingView(0)
+{
+    QHBoxLayout *hlayout = new QHBoxLayout();
+    hlayout->setContentsMargins(0,0,0,0);
+
+    QString legendBoxStyle = "background-color: rgb(%1,%2,%3); border: 1px solid black;";
+
+    QLabel *youngColor = new QLabel(" ");
+    youngColor->setMaximumHeight(15);
+    youngColor->setMaximumWidth(10);
+    youngColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_YOUNG.red()).arg(COLOR_MINT_YOUNG.green()).arg(COLOR_MINT_YOUNG.blue()));
+    QLabel *youngLegend = new QLabel(tr("transaction is too young"));
+    youngLegend->setContentsMargins(5,0,15,0);
+
+    QLabel *matureColor = new QLabel(" ");
+    matureColor->setMaximumHeight(15);
+    matureColor->setMaximumWidth(10);
+    matureColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_MATURE.red()).arg(COLOR_MINT_MATURE.green()).arg(COLOR_MINT_MATURE.blue()));
+    QLabel *matureLegend = new QLabel(tr("transaction is mature"));
+    matureLegend->setContentsMargins(5,0,15,0);
+
+    QLabel *oldColor = new QLabel(" ");
+    oldColor->setMaximumHeight(15);
+    oldColor->setMaximumWidth(10);
+    oldColor->setStyleSheet(legendBoxStyle.arg(COLOR_MINT_OLD.red()).arg(COLOR_MINT_OLD.green()).arg(COLOR_MINT_OLD.blue()));
+    QLabel *oldLegend = new QLabel(tr("transaction has reached maximum probability"));
+    oldLegend->setContentsMargins(5,0,15,0);
+
+    QHBoxLayout *legendLayout = new QHBoxLayout();
+    legendLayout->setContentsMargins(10,10,0,0);
+    legendLayout->addWidget(youngColor);
+    legendLayout->addWidget(youngLegend);
+    legendLayout->addWidget(matureColor);
+    legendLayout->addWidget(matureLegend);
+    legendLayout->addWidget(oldColor);
+    legendLayout->addWidget(oldLegend);
+    legendLayout->insertStretch(-1);
+
+    QLabel *mintingLabel = new QLabel(tr("Display minting probability within : "));
+    mintingCombo = new QComboBox();
+    mintingCombo->addItem(tr("10 min"), Minting10min);
+    mintingCombo->addItem(tr("24 hours"), Minting1day);
+    mintingCombo->addItem(tr("30 days"), Minting30days);
+    mintingCombo->addItem(tr("90 days"), Minting90days);
+    mintingCombo->setFixedWidth(120);
+
+
+    hlayout->insertStretch(0);
+    hlayout->addWidget(mintingLabel);
+    hlayout->addWidget(mintingCombo);
+
+    QVBoxLayout *vlayout = new QVBoxLayout(this);
+    vlayout->setContentsMargins(0,0,0,0);
+    vlayout->setSpacing(0);
+
+    QTableView *view = new QTableView(this);
+    vlayout->addLayout(hlayout);
+    vlayout->addWidget(view);
+    vlayout->addLayout(legendLayout);
+
+    vlayout->setSpacing(0);
+    int width = view->verticalScrollBar()->sizeHint().width();
+    // Cover scroll bar width with spacing
+#ifdef Q_WS_MAC
+    hlayout->addSpacing(width+2);
+#else
+    hlayout->addSpacing(width);
+#endif
+    // Always show scroll bar
+    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
+    view->setTabKeyNavigation(false);
+    view->setContextMenuPolicy(Qt::CustomContextMenu);
+
+    mintingView = view;
+
+    connect(mintingCombo, SIGNAL(activated(int)), this, SLOT(chooseMintingInterval(int)));
+
+}
+
+
+void MintingView::setModel(WalletModel *model)
+{
+    this->model = model;
+    if(model)
+    {
+        mintingProxyModel = new MintingFilterProxy(this);
+        mintingProxyModel->setSourceModel(model->getMintingTableModel());
+        mintingProxyModel->setDynamicSortFilter(true);
+        mintingProxyModel->setSortRole(Qt::EditRole);
+
+        mintingView->setModel(mintingProxyModel);
+        mintingView->setAlternatingRowColors(true);
+        mintingView->setSelectionBehavior(QAbstractItemView::SelectRows);
+        mintingView->setSelectionMode(QAbstractItemView::ExtendedSelection);
+        mintingView->setSortingEnabled(true);
+        mintingView->sortByColumn(MintingTableModel::CoinDay, Qt::DescendingOrder);
+        mintingView->verticalHeader()->hide();
+
+        mintingView->horizontalHeader()->resizeSection(
+                MintingTableModel::Address, 420);
+#if QT_VERSION < 0x050000
+        mintingView->horizontalHeader()->setResizeMode(
+                MintingTableModel::TxHash, QHeaderView::Stretch);
+#else
+        mintingView->horizontalHeader()->setSectionResizeMode(
+                MintingTableModel::TxHash, QHeaderView::Stretch);
+#endif
+        mintingView->horizontalHeader()->resizeSection(
+                MintingTableModel::Age, 120);
+        mintingView->horizontalHeader()->resizeSection(
+                MintingTableModel::Balance, 120);
+        mintingView->horizontalHeader()->resizeSection(
+                MintingTableModel::CoinDay,120);
+        mintingView->horizontalHeader()->resizeSection(
+                MintingTableModel::MintProbability, 160);
+    }
+}
+
+void MintingView::chooseMintingInterval(int idx)
+{
+    int interval = 10;
+    switch(mintingCombo->itemData(idx).toInt())
+    {
+        case Minting10min:
+            interval = 10;
+            break;
+        case Minting1day:
+            interval = 60*24;
+            break;
+        case Minting30days:
+            interval = 60*24*30;
+            break;
+        case Minting90days:
+            interval = 60*24*90;
+            break;
+    }
+    model->getMintingTableModel()->setMintingInterval(interval);
+    mintingProxyModel->invalidate();
+}
+
+void MintingView::exportClicked()
+{
+    // CSV is currently the only supported format
+    QString filename = GUIUtil::getSaveFileName(
+            this,
+            tr("Export Minting Data"), QString(),
+            tr("Comma separated file (*.csv)"));
+
+    if (filename.isNull()) return;
+
+    CSVModelWriter writer(filename);
+
+    // name, column, role
+    writer.setModel(mintingProxyModel);
+    writer.addColumn(tr("Address"),0, MintingTableModel::Address);
+    writer.addColumn(tr("Transaction"), 0, MintingTableModel::TxHash);
+    writer.addColumn(tr("Age"), 0, MintingTableModel::Age);
+    writer.addColumn(tr("CoinDay"), 0, MintingTableModel::CoinDay);
+    writer.addColumn(tr("Balance"), 0, MintingTableModel::Balance);
+    writer.addColumn(tr("MintingProbability"), 0, MintingTableModel::MintProbability);
+
+    if(!writer.write())
+    {
+        QMessageBox::critical(this, tr("Error exporting"), tr("Could not write to file %1.").arg(filename),
+                              QMessageBox::Abort, QMessageBox::Abort);
+    }
+}
diff --git a/src/qt/mintingview.h b/src/qt/mintingview.h
new file mode 100644 (file)
index 0000000..452deaa
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef MINTINGVIEW_H
+#define MINTINGVIEW_H
+
+#include <QWidget>
+#include <QComboBox>
+#include "mintingfilterproxy.h"
+
+class WalletModel;
+
+
+QT_BEGIN_NAMESPACE
+class QTableView;
+QT_END_NAMESPACE
+
+class MintingView : public QWidget
+{
+    Q_OBJECT
+public:
+    explicit MintingView(QWidget *parent = 0);
+    void setModel(WalletModel *model);
+
+    enum MintingEnum
+    {
+        Minting10min,
+        Minting1day,
+        Minting30days,
+        Minting90days
+    };
+
+private:
+    WalletModel *model;
+    QTableView *mintingView;
+
+    QComboBox *mintingCombo;
+
+    MintingFilterProxy *mintingProxyModel;
+
+signals:
+
+public slots:
+    void exportClicked();
+    void chooseMintingInterval(int idx);
+};
+
+#endif // MINTINGVIEW_H
index ad954de..b8e5236 100644 (file)
@@ -2,6 +2,7 @@
 #include "guiconstants.h"
 #include "optionsmodel.h"
 #include "addresstablemodel.h"
+#include "mintingtablemodel.h"
 #include "transactiontablemodel.h"
 
 #include "ui_interface.h"
@@ -21,6 +22,7 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p
     cachedNumBlocks(0)
 {
     addressTableModel = new AddressTableModel(wallet, this);
+    mintingTableModel = new MintingTableModel(wallet, this);
     transactionTableModel = new TransactionTableModel(wallet, this);
 
     // This timer will be fired repeatedly to update the balance
@@ -252,6 +254,11 @@ AddressTableModel *WalletModel::getAddressTableModel()
     return addressTableModel;
 }
 
+MintingTableModel *WalletModel::getMintingTableModel()
+{
+    return mintingTableModel;
+}
+
 TransactionTableModel *WalletModel::getTransactionTableModel()
 {
     return transactionTableModel;
index f155006..caeeb97 100644 (file)
@@ -10,6 +10,7 @@
 class OptionsModel;
 class AddressTableModel;
 class TransactionTableModel;
+class MintingTableModel;
 class CWallet;
 class CKeyID;
 class CPubKey;
@@ -61,6 +62,7 @@ public:
 
     OptionsModel *getOptionsModel();
     AddressTableModel *getAddressTableModel();
+    MintingTableModel *getMintingTableModel();
     TransactionTableModel *getTransactionTableModel();
 
     qint64 getBalance() const;
@@ -141,6 +143,7 @@ private:
     OptionsModel *optionsModel;
 
     AddressTableModel *addressTableModel;
+    MintingTableModel *mintingTableModel;
     TransactionTableModel *transactionTableModel;
 
     // Cache some values to be able to detect changes
index dc1000c..3aed377 100644 (file)
@@ -2722,6 +2722,7 @@ void CWallet::UpdatedTransaction(const uint256 &hashTx)
         map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(hashTx);
         if (mi != mapWallet.end())
             NotifyTransactionChanged(this, hashTx, CT_UPDATED);
+        vMintingWalletUpdated.push_back(hashTx);
     }
 }
 
index 3522cc8..7f6159c 100644 (file)
@@ -118,6 +118,7 @@ public:
     }
 
     std::map<uint256, CWalletTx> mapWallet;
+    std::vector<uint256> vMintingWalletUpdated;
     int64 nOrderPosNext;
     std::map<uint256, int> mapRequestCount;