This commit is contained in:
Ubuntu Admin
2015-12-04 17:27:27 +01:00
209 changed files with 9144 additions and 762 deletions

20
COPYING
View File

@@ -1,20 +1,8 @@
Copyright (c) 2009-2013 Bitcoin Developers Copyright (c) 2009-2013 Bitcoin Developers
Copyright (c) 2011-2013 CasinoCoin Developers Copyright (c) 2011-2015 CasinoCoin Developers
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

23
QmlImports.qml Normal file
View File

@@ -0,0 +1,23 @@
import QtQuick 2.0
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Dialogs 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import QtQuick.Controls.Styles 1.2
/*
QmlImports.qml
Declaration of QML Imports required by project.
This is necessary if we want to keep qml files in a folder
separate from .pro file because of the way qmlimportscanner works.
If these imports are not declared, qmake will not recognize them,
and QtQuick will not be packaged with statically built apps and imported
at runtime.
This must be kept in the same directory as your .pro file
*/
QtObject {}

View File

@@ -1,5 +1,5 @@
<h2>Please download the updated wallet asap, hard fork incoming at block 546250</h2> <h2>Wallet 2.0.0.0 Release available</h2>
[Click here to download the most recent wallet version -> 1.3.0 (Updated on July, 18 2014)](https://github.com/casinocoin/casinocoin/releases/tag/1.3.0.0 "Click to go to releases page") [Click here to download the most recent wallet version -> 2.0.0.0 (Updated on December, 3 2015)](https://github.com/casinocoin/casinocoin/releases/tag/2.0.0.0 "Click to go to releases page")
<p align="center"><img src="https://raw.github.com/transcoder/CasinoCoin/master/src/qt/res/images/logo.png" /></p> <p align="center"><img src="https://raw.github.com/transcoder/CasinoCoin/master/src/qt/res/images/logo.png" /></p>

439
casinocoin-qt-linux.pro Normal file
View File

@@ -0,0 +1,439 @@
TEMPLATE = app
TARGET = casinocoin-qt
macx:TARGET = "CasinoCoin-Qt"
VERSION = 2.0.0.0
INCLUDEPATH += src src/json src/qt
QT += core gui network widgets qml quick
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE USE_IPV6 __NO_SYSTEM_INCLUDES
CONFIG += no_include_pwd
CONFIG += thread
CONFIG += static
BOOST_INCLUDE_PATH=/home/ubuntu/CSC/deps/linux/boost_1_55_0
BOOST_LIB_PATH=/home/ubuntu/CSC/deps/linux/boost_1_55_0/stage/lib
BDB_INCLUDE_PATH=/home/ubuntu/CSC/deps/linux/db-4.8.30/build_unix
BDB_LIB_PATH=/home/ubuntu/CSC/deps/linux/db-4.8.30/build_unix
OPENSSL_INCLUDE_PATH=/home/ubuntu/CSC/deps/linux/openssl-1.0.2d/include
OPENSSL_LIB_PATH=/home/ubuntu/CSC/deps/linux/openssl-1.0.2d
MINIUPNPC_INCLUDE_PATH=/home/ubuntu/CSC/deps/linux/
MINIUPNPC_LIB_PATH=/home/ubuntu/CSC/deps/linux/miniupnpc
QRENCODE_INCLUDE_PATH=/home/ubuntu/CSC/deps/linux/qrencode-3.4.4
QRENCODE_LIB_PATH=/home/ubuntu/CSC/deps/linux/qrencode-3.4.4/.libs
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
# use: qmake "RELEASE=1"
contains(RELEASE, 1) {
# Linux: static link and extra security (see: https://wiki.debian.org/Hardening)
LIBS += -Wl,-Bstatic -Wl,-z,relro -Wl,-z,now
}
# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection
QMAKE_CXXFLAGS *= -fstack-protector-all
QMAKE_LFLAGS *= -fstack-protector-all
# for extra security (see: https://wiki.debian.org/Hardening): this flag is GCC compiler-specific
QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2
# use: qmake "USE_QRCODE=1"
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
contains(USE_QRCODE, 1) {
message(Building with QRCode support)
DEFINES += USE_QRCODE
#LIBS += -lqrencode
LIBS += -lqrencode $$join(QRENCODE_LIB_PATH,,-L,)
}
# use: qmake "USE_UPNP=1" ( enabled by default; default)
# or: qmake "USE_UPNP=0" (disabled by default)
# or: qmake "USE_UPNP=-" (not supported)
# miniupnpc (http://miniupnp.free.fr/files/) must be installed for support
contains(USE_UPNP, -) {
message(Building without UPNP support)
} else {
message(Building with UPNP support)
count(USE_UPNP, 0) {
USE_UPNP=1
}
DEFINES += USE_UPNP=$$USE_UPNP STATICLIB
INCLUDEPATH += $$MINIUPNPC_INCLUDE_PATH
LIBS += $$join(MINIUPNPC_LIB_PATH,,-L,) -lminiupnpc
}
# use: qmake "USE_DBUS=1"
contains(USE_DBUS, 1) {
message(Building with DBUS (Freedesktop notifications) support)
DEFINES += USE_DBUS
QT += dbus
}
# use: qmake "USE_IPV6=1" ( enabled by default; default)
# or: qmake "USE_IPV6=0" (disabled by default)
# or: qmake "USE_IPV6=-" (not supported)
contains(USE_IPV6, -) {
message(Building without IPv6 support)
} else {
count(USE_IPV6, 0) {
USE_IPV6=1
}
DEFINES += USE_IPV6=$$USE_IPV6
}
contains(BITCOIN_NEED_QT_PLUGINS, 1) {
DEFINES += BITCOIN_NEED_QT_PLUGINS
QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
}
INCLUDEPATH += src/leveldb/include src/leveldb/helpers
LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
# we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences
genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a
genleveldb.target = $$PWD/src/leveldb/libleveldb.a
genleveldb.depends = FORCE
PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
QMAKE_EXTRA_TARGETS += genleveldb
# Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean
# regenerate src/build.h
genbuild.depends = FORCE
genbuild.commands = cd $$PWD; /bin/sh share/genbuild.sh $$OUT_PWD/build/build.h
genbuild.target = $$OUT_PWD/build/build.h
PRE_TARGETDEPS += $$OUT_PWD/build/build.h
QMAKE_EXTRA_TARGETS += genbuild
DEFINES += HAVE_BUILD_INFO
QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wno-strict-aliasing -Wstack-protector
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedefs
##### Start Project Files #####
DEPENDPATH += src src/json src/qt
HEADERS += src/qt/bitcoingui.h \
src/qt/transactiontablemodel.h \
src/qt/addresstablemodel.h \
src/qt/optionsdialog.h \
src/qt/sendcoinsdialog.h \
src/qt/coincontroldialog.h \
src/qt/coincontroltreewidget.h \
src/qt/addressbookpage.h \
src/qt/signverifymessagedialog.h \
src/qt/aboutdialog.h \
src/qt/editaddressdialog.h \
src/qt/bitcoinaddressvalidator.h \
src/alert.h \
src/addrman.h \
src/base58.h \
src/bignum.h \
src/checkpoints.h \
src/coincontrol.h \
src/compat.h \
src/sync.h \
src/util.h \
src/hash.h \
src/uint256.h \
src/serialize.h \
src/main.h \
src/net.h \
src/key.h \
src/db.h \
src/walletdb.h \
src/script.h \
src/init.h \
src/bloom.h \
src/mruset.h \
src/checkqueue.h \
src/json/json_spirit_writer_template.h \
src/json/json_spirit_writer.h \
src/json/json_spirit_value.h \
src/json/json_spirit_utils.h \
src/json/json_spirit_stream_reader.h \
src/json/json_spirit_reader_template.h \
src/json/json_spirit_reader.h \
src/json/json_spirit_error_position.h \
src/json/json_spirit.h \
src/qt/clientmodel.h \
src/qt/guiutil.h \
src/qt/transactionrecord.h \
src/qt/guiconstants.h \
src/qt/optionsmodel.h \
src/qt/monitoreddatamapper.h \
src/qt/transactiondesc.h \
src/qt/transactiondescdialog.h \
src/qt/bitcoinamountfield.h \
src/wallet.h \
src/keystore.h \
src/qt/transactionfilterproxy.h \
src/qt/transactionview.h \
src/qt/walletmodel.h \
src/qt/walletview.h \
src/qt/walletstack.h \
src/qt/walletframe.h \
src/bitcoinrpc.h \
src/qt/overviewpage.h \
src/qt/csvmodelwriter.h \
src/crypter.h \
src/qt/sendcoinsentry.h \
src/qt/qvalidatedlineedit.h \
src/qt/bitcoinunits.h \
src/qt/qvaluecombobox.h \
src/qt/askpassphrasedialog.h \
src/protocol.h \
src/qt/notificator.h \
src/qt/paymentserver.h \
src/allocators.h \
src/ui_interface.h \
src/qt/rpcconsole.h \
src/scrypt.h \
src/version.h \
src/netbase.h \
src/clientversion.h \
src/txdb.h \
src/leveldb.h \
src/threadsafety.h \
src/limitedmap.h \
src/qt/macnotificationhandler.h \
src/qt/splashscreen.h \
src/qt/CSCPublicAPI/casinocoinwebapi.h \
src/qt/CSCPublicAPI/casinocoinwebapiparser.h \
src/qt/CSCPublicAPI/jsonactivepromotionsparser.h \
src/qt/CSCPublicAPI/jsonactiveexchangesparser.h \
src/qt/CSCPublicAPI/jsonsingleactivepromotion.h \
src/qt/CSCPublicAPI/jsonsingleactiveexchange.h \
src/qt/qtquick_controls/cpp/guibannercontrol.h \
src/qt/qtquick_controls/cpp/guibannerlistview.h \
src/qt/qtquick_controls/cpp/guibannerwidget.h \
src/qt/qtquick_controls/cpp/listiteminterface.h \
src/qt/qtquick_controls/cpp/qmlbannerlistitem.h \
src/qt/qtquick_controls/cpp/qmlbannerlistmodel.h \
src/qt/qtquick_controls/cpp/qmlimageprovider.h \
src/qt/qtquick_controls/cpp/qmllistitem.h \
src/qt/qtquick_controls/cpp/qmllistmodel.h \
src/qt/qtquick_controls/cpp/qmlmenutoolbarmodel.h \
src/qt/qtquick_controls/cpp/qmlmenutoolbaritem.h \
src/qt/qtquick_controls/cpp/guimenutoolbarwidget.h \
src/qt/qtquick_controls/cpp/guimenutoolbarlistview.h \
src/qt/qtquick_controls/cpp/guimenutoolbarcontrol.h \
src/qt/gui20_skin.h \
src/qt/cscfusionstyle.h \
src/qt/pryptopage.h \
src/qt/currencies.h \
src/qt/CSCPublicAPI/jsoncoininfoparser.h \
src/qt/infopage.h \
src/qt/qtquick_controls/cpp/guiexchangeswidget.h \
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.h \
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.h \
src/qt/qtquick_controls/cpp/guiexchangeslistview.h \
src/qt/qtquick_controls/cpp/guiexchangescontrol.h
SOURCES += src/qt/bitcoin.cpp \
src/qt/bitcoingui.cpp \
src/qt/transactiontablemodel.cpp \
src/qt/addresstablemodel.cpp \
src/qt/optionsdialog.cpp \
src/qt/sendcoinsdialog.cpp \
src/qt/coincontroldialog.cpp \
src/qt/coincontroltreewidget.cpp \
src/qt/addressbookpage.cpp \
src/qt/signverifymessagedialog.cpp \
src/qt/aboutdialog.cpp \
src/qt/editaddressdialog.cpp \
src/qt/bitcoinaddressvalidator.cpp \
src/alert.cpp \
src/version.cpp \
src/sync.cpp \
src/util.cpp \
src/hash.cpp \
src/netbase.cpp \
src/key.cpp \
src/script.cpp \
src/main.cpp \
src/init.cpp \
src/net.cpp \
src/bloom.cpp \
src/checkpoints.cpp \
src/addrman.cpp \
src/db.cpp \
src/walletdb.cpp \
src/qt/clientmodel.cpp \
src/qt/guiutil.cpp \
src/qt/transactionrecord.cpp \
src/qt/optionsmodel.cpp \
src/qt/monitoreddatamapper.cpp \
src/qt/transactiondesc.cpp \
src/qt/transactiondescdialog.cpp \
src/qt/bitcoinstrings.cpp \
src/qt/bitcoinamountfield.cpp \
src/wallet.cpp \
src/keystore.cpp \
src/qt/transactionfilterproxy.cpp \
src/qt/transactionview.cpp \
src/qt/walletmodel.cpp \
src/qt/walletview.cpp \
src/qt/walletstack.cpp \
src/qt/walletframe.cpp \
src/bitcoinrpc.cpp \
src/rpcdump.cpp \
src/rpcnet.cpp \
src/rpcmining.cpp \
src/rpcwallet.cpp \
src/rpcblockchain.cpp \
src/rpcrawtransaction.cpp \
src/qt/overviewpage.cpp \
src/qt/csvmodelwriter.cpp \
src/crypter.cpp \
src/qt/sendcoinsentry.cpp \
src/qt/qvalidatedlineedit.cpp \
src/qt/bitcoinunits.cpp \
src/qt/qvaluecombobox.cpp \
src/qt/askpassphrasedialog.cpp \
src/protocol.cpp \
src/qt/notificator.cpp \
src/qt/paymentserver.cpp \
src/qt/rpcconsole.cpp \
src/scrypt.cpp \
src/noui.cpp \
src/leveldb.cpp \
src/txdb.cpp \
src/qt/splashscreen.cpp \
src/qt/CSCPublicAPI/casinocoinwebapi.cpp \
src/qt/CSCPublicAPI/casinocoinwebapiparser.cpp \
src/qt/CSCPublicAPI/jsonactivepromotionsparser.cpp \
src/qt/CSCPublicAPI/jsonactiveexchangesparser.cpp \
src/qt/CSCPublicAPI/jsonsingleactivepromotion.cpp \
src/qt/CSCPublicAPI/jsonsingleactiveexchange.cpp \
src/qt/qtquick_controls/cpp/guibannercontrol.cpp \
src/qt/qtquick_controls/cpp/guibannerlistview.cpp \
src/qt/qtquick_controls/cpp/guibannerwidget.cpp \
src/qt/qtquick_controls/cpp/qmlbannerlistitem.cpp \
src/qt/qtquick_controls/cpp/qmlbannerlistmodel.cpp \
src/qt/qtquick_controls/cpp/qmlimageprovider.cpp \
src/qt/qtquick_controls/cpp/qmllistitem.cpp \
src/qt/qtquick_controls/cpp/qmllistmodel.cpp \
src/qt/qtquick_controls/cpp/qmlmenutoolbarmodel.cpp \
src/qt/qtquick_controls/cpp/qmlmenutoolbaritem.cpp \
src/qt/qtquick_controls/cpp/guimenutoolbarwidget.cpp \
src/qt/qtquick_controls/cpp/guimenutoolbarlistview.cpp \
src/qt/qtquick_controls/cpp/guimenutoolbarcontrol.cpp \
src/qt/gui20_skin.cpp \
src/qt/cscfusionstyle.cpp \
src/qt/pryptopage.cpp \
src/qt/currencies.cpp \
src/qt/CSCPublicAPI/jsoncoininfoparser.cpp \
src/qt/infopage.cpp \
src/qt/qtquick_controls/cpp/guiexchangeswidget.cpp \
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.cpp \
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.cpp \
src/qt/qtquick_controls/cpp/guiexchangeslistview.cpp \
src/qt/qtquick_controls/cpp/guiexchangescontrol.cpp
RESOURCES += src/qt/bitcoin.qrc
FORMS += src/qt/forms/sendcoinsdialog.ui \
src/qt/forms/coincontroldialog.ui \
src/qt/forms/addressbookpage.ui \
src/qt/forms/signverifymessagedialog.ui \
src/qt/forms/aboutdialog.ui \
src/qt/forms/editaddressdialog.ui \
src/qt/forms/transactiondescdialog.ui \
src/qt/forms/overviewpage.ui \
src/qt/forms/sendcoinsentry.ui \
src/qt/forms/askpassphrasedialog.ui \
src/qt/forms/rpcconsole.ui \
src/qt/forms/optionsdialog.ui \
src/qt/forms/pryptopage.ui \
src/qt/forms/infopage.ui
# "Other files" to show in Qt Creator
OTHER_FILES += README.md \
doc/*.rst \
doc/*.txt \
doc/*.md \
src/qt/res/bitcoin-qt.rc \
src/test/*.cpp \
src/test/*.h \
src/qt/test/*.cpp \
src/qt/test/*.h \
src/qt/qtquick_controls/qml/QmlGUIBannerControl.qml \
src/qt/qtquick_controls/qml/QmlGUIBannerListView.qml \
src/qt/qtquick_controls/qml/QmlGUIBannerWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIExchangesControl.qml \
src/qt/qtquick_controls/qml/QmlGUIExchangesListView.qml \
src/qt/qtquick_controls/qml/QmlGUIExchangesWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarListView.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarControl.qml
DISTFILES += \
QmlImports.qml
##### End Project Files #####
contains(USE_QRCODE, 1) {
HEADERS += src/qt/qrcodedialog.h
SOURCES += src/qt/qrcodedialog.cpp
FORMS += src/qt/forms/qrcodedialog.ui
}
contains(BITCOIN_QT_TEST, 1) {
SOURCES += src/qt/test/test_main.cpp \
src/qt/test/uritests.cpp
HEADERS += src/qt/test/uritests.h
DEPENDPATH += src/qt/test
QT += testlib
TARGET = casinocoin-qt_test
DEFINES += BITCOIN_QT_TEST
}
contains(USE_SSE2, 1) {
DEFINES += USE_SSE2
gccsse2.input = SOURCES_SSE2
gccsse2.output = $$PWD/build/${QMAKE_FILE_BASE}.o
gccsse2.commands = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} -msse2 -mstackrealign
QMAKE_EXTRA_COMPILERS += gccsse2
SOURCES_SSE2 += src/scrypt-sse2.cpp
}
# for lrelease/lupdate
# also add new translations to src/qt/bitcoin.qrc under translations/
TRANSLATIONS = $$files(src/qt/locale/bitcoin_*.ts)
isEmpty(QMAKE_LRELEASE) {
QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
}
isEmpty(QM_DIR):QM_DIR = $$PWD/src/qt/locale
# automatically build translations, so they can be included in resource file
TSQM.name = lrelease ${QMAKE_FILE_IN}
TSQM.input = TRANSLATIONS
TSQM.output = $$QM_DIR/${QMAKE_FILE_BASE}.qm
TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
TSQM.CONFIG = no_link
QMAKE_EXTRA_COMPILERS += TSQM
isEmpty(BOOST_THREAD_LIB_SUFFIX) {
BOOST_THREAD_LIB_SUFFIX = $$BOOST_LIB_SUFFIX
}
DEFINES += LINUX
LIBS += -lrt
# _FILE_OFFSET_BITS=64 lets 32-bit fopen transparently support large files.
DEFINES += _FILE_OFFSET_BITS=64
# Set libraries and includes at end, to use platform-defined defaults if not overridden
INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH
LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,)
LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lpthread
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX
contains(RELEASE, 1) {
# Linux: turn dynamic linking back on for c/c++ runtime libraries
LIBS += -Wl,-Bdynamic
}
system($$QMAKE_LRELEASE -silent $$TRANSLATIONS)

View File

@@ -0,0 +1,271 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.0, 2015-12-02T00:40:08. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{af9fddb2-7bcb-4144-bdf3-55c932c19fe1}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.5.1 Static (qt5)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.5.1 Static (qt5)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{86a38728-97f7-49ac-b7f5-0ca2720c2f29}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/ubuntu/CSC/casinocoin-2.0.0.0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/ubuntu/CSC/casinocoin-2.0.0.0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">casinocoin-qt-linux</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/ubuntu/CSC/casinocoin-2.0.0.0/casinocoin-qt-linux.pro</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">casinocoin-qt-linux.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">18</value>
</data>
<data>
<variable>Version</variable>
<value type="int">18</value>
</data>
</qtcreator>

460
casinocoin-qt-windows.pro Normal file
View File

@@ -0,0 +1,460 @@
TEMPLATE = app
TARGET = casinocoin-qt
macx:TARGET = "CasinoCoin-Qt"
VERSION = 2.0.0.0
INCLUDEPATH += src src/json src/qt
QT += core gui network widgets qml quick
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE USE_IPV6 __NO_SYSTEM_INCLUDES
CONFIG += no_include_pwd
CONFIG += thread
CONFIG += static
BOOST_LIB_SUFFIX=-mgw49-mt-s-1_55
BOOST_THREAD_LIB_SUFFIX=$$BOOST_LIB_SUFFIX
BOOST_INCLUDE_PATH=C:/deps/boost_1_55_0
BOOST_LIB_PATH=C:/deps/boost_1_55_0/stage/lib
BDB_INCLUDE_PATH=C:/deps/db-4.8.30.NC/build_unix
BDB_LIB_PATH=C:/deps/db-4.8.30.NC/build_unix
BDB_LIB_SUFFIX=-4.8
OPENSSL_INCLUDE_PATH=C:/deps/openssl-1.0.2d/include
OPENSSL_LIB_PATH=C:/deps/openssl-1.0.2d
MINIUPNPC_INCLUDE_PATH=C:/deps/
MINIUPNPC_LIB_PATH=C:/deps/miniupnpc
QRENCODE_INCLUDE_PATH=C:/deps/qrencode-3.4.3
QRENCODE_LIB_PATH=C:/deps/qrencode-3.4.3/.libs
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection
QMAKE_CXXFLAGS *= -fstack-protector-all
QMAKE_LFLAGS *= -fstack-protector-all
# Exclude on Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable!
# This can be enabled for Windows, when we switch to MinGW >= 4.4.x.
# for extra security (see: https://wiki.debian.org/Hardening): this flag is GCC compiler-specific
QMAKE_CXXFLAGS *= -D_FORTIFY_SOURCE=2
# for extra security on Windows: enable ASLR and DEP via GCC linker flags
QMAKE_LFLAGS *= -Wl,--dynamicbase -Wl,--nxcompat
# on Windows: enable GCC large address aware linker flag
QMAKE_LFLAGS *= -Wl,--large-address-aware
# i686-w64-mingw32
QMAKE_LFLAGS *= -static-libgcc -static-libstdc++
# use: qmake "USE_QRCODE=1"
# libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
contains(USE_QRCODE, 1) {
message(Building with QRCode support)
DEFINES += USE_QRCODE
#LIBS += -lqrencode
LIBS += -lqrencode $$join(QRENCODE_LIB_PATH,,-L,)
}
# use: qmake "USE_UPNP=1" ( enabled by default; default)
# or: qmake "USE_UPNP=0" (disabled by default)
# or: qmake "USE_UPNP=-" (not supported)
# miniupnpc (http://miniupnp.free.fr/files/) must be installed for support
contains(USE_UPNP, -) {
message(Building without UPNP support)
} else {
message(Building with UPNP support)
count(USE_UPNP, 0) {
USE_UPNP=1
}
DEFINES += USE_UPNP=$$USE_UPNP STATICLIB
INCLUDEPATH += $$MINIUPNPC_INCLUDE_PATH
LIBS += $$join(MINIUPNPC_LIB_PATH,,-L,) -lminiupnpc
LIBS += -liphlpapi
}
# use: qmake "USE_DBUS=1"
contains(USE_DBUS, 1) {
message(Building with DBUS (Freedesktop notifications) support)
DEFINES += USE_DBUS
QT += dbus
}
# use: qmake "USE_IPV6=1" ( enabled by default; default)
# or: qmake "USE_IPV6=0" (disabled by default)
# or: qmake "USE_IPV6=-" (not supported)
contains(USE_IPV6, -) {
message(Building without IPv6 support)
} else {
count(USE_IPV6, 0) {
USE_IPV6=1
}
DEFINES += USE_IPV6=$$USE_IPV6
}
contains(BITCOIN_NEED_QT_PLUGINS, 1) {
DEFINES += BITCOIN_NEED_QT_PLUGINS
QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
}
INCLUDEPATH += src/leveldb/include src/leveldb/helpers
LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
# make an educated guess about what the ranlib command is called
isEmpty(QMAKE_RANLIB) {
QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
}
LIBS += -lshlwapi
genleveldb.target = $$PWD/src/leveldb/libleveldb.a
genleveldb.depends = FORCE
PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a
QMAKE_EXTRA_TARGETS += genleveldb
# Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it.
# On windows manually execute: make TARGET_OS=OS_WINDOWS_CROSSCOMPILE libleveldb.a libmemenv.a
QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a;
# regenerate src/build.h
contains(USE_BUILD_INFO, 1) {
genbuild.depends = FORCE
genbuild.commands = cd $$PWD; /bin/sh share/genbuild.sh $$OUT_PWD/build/build.h
genbuild.target = $$OUT_PWD/build/build.h
PRE_TARGETDEPS += $$OUT_PWD/build/build.h
QMAKE_EXTRA_TARGETS += genbuild
DEFINES += HAVE_BUILD_INFO
}
QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wno-strict-aliasing -Wstack-protector
QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedefs
##### Start Project Files #####
DEPENDPATH += src src/json src/qt
HEADERS += src/qt/bitcoingui.h \
src/qt/transactiontablemodel.h \
src/qt/addresstablemodel.h \
src/qt/optionsdialog.h \
src/qt/sendcoinsdialog.h \
src/qt/coincontroldialog.h \
src/qt/coincontroltreewidget.h \
src/qt/addressbookpage.h \
src/qt/signverifymessagedialog.h \
src/qt/aboutdialog.h \
src/qt/editaddressdialog.h \
src/qt/bitcoinaddressvalidator.h \
src/alert.h \
src/addrman.h \
src/base58.h \
src/bignum.h \
src/checkpoints.h \
src/coincontrol.h \
src/compat.h \
src/sync.h \
src/util.h \
src/hash.h \
src/uint256.h \
src/serialize.h \
src/main.h \
src/net.h \
src/key.h \
src/db.h \
src/walletdb.h \
src/script.h \
src/init.h \
src/bloom.h \
src/mruset.h \
src/checkqueue.h \
src/json/json_spirit_writer_template.h \
src/json/json_spirit_writer.h \
src/json/json_spirit_value.h \
src/json/json_spirit_utils.h \
src/json/json_spirit_stream_reader.h \
src/json/json_spirit_reader_template.h \
src/json/json_spirit_reader.h \
src/json/json_spirit_error_position.h \
src/json/json_spirit.h \
src/qt/clientmodel.h \
src/qt/guiutil.h \
src/qt/transactionrecord.h \
src/qt/guiconstants.h \
src/qt/optionsmodel.h \
src/qt/monitoreddatamapper.h \
src/qt/transactiondesc.h \
src/qt/transactiondescdialog.h \
src/qt/bitcoinamountfield.h \
src/wallet.h \
src/keystore.h \
src/qt/transactionfilterproxy.h \
src/qt/transactionview.h \
src/qt/walletmodel.h \
src/qt/walletview.h \
src/qt/walletstack.h \
src/qt/walletframe.h \
src/bitcoinrpc.h \
src/qt/overviewpage.h \
src/qt/csvmodelwriter.h \
src/crypter.h \
src/qt/sendcoinsentry.h \
src/qt/qvalidatedlineedit.h \
src/qt/bitcoinunits.h \
src/qt/qvaluecombobox.h \
src/qt/askpassphrasedialog.h \
src/protocol.h \
src/qt/notificator.h \
src/qt/paymentserver.h \
src/allocators.h \
src/ui_interface.h \
src/qt/rpcconsole.h \
src/scrypt.h \
src/version.h \
src/netbase.h \
src/clientversion.h \
src/txdb.h \
src/leveldb.h \
src/threadsafety.h \
src/limitedmap.h \
src/qt/macnotificationhandler.h \
src/qt/splashscreen.h \
src/qt/CSCPublicAPI/casinocoinwebapi.h \
src/qt/CSCPublicAPI/casinocoinwebapiparser.h \
src/qt/CSCPublicAPI/jsonactivepromotionsparser.h \
src/qt/CSCPublicAPI/jsonactiveexchangesparser.h \
src/qt/CSCPublicAPI/jsonsingleactivepromotion.h \
src/qt/CSCPublicAPI/jsonsingleactiveexchange.h \
src/qt/qtquick_controls/cpp/guibannercontrol.h \
src/qt/qtquick_controls/cpp/guibannerlistview.h \
src/qt/qtquick_controls/cpp/guibannerwidget.h \
src/qt/qtquick_controls/cpp/listiteminterface.h \
src/qt/qtquick_controls/cpp/qmlbannerlistitem.h \
src/qt/qtquick_controls/cpp/qmlbannerlistmodel.h \
src/qt/qtquick_controls/cpp/qmlimageprovider.h \
src/qt/qtquick_controls/cpp/qmllistitem.h \
src/qt/qtquick_controls/cpp/qmllistmodel.h \
src/qt/qtquick_controls/cpp/qmlmenutoolbarmodel.h \
src/qt/qtquick_controls/cpp/qmlmenutoolbaritem.h \
src/qt/qtquick_controls/cpp/guimenutoolbarwidget.h \
src/qt/qtquick_controls/cpp/guimenutoolbarlistview.h \
src/qt/qtquick_controls/cpp/guimenutoolbarcontrol.h \
src/qt/gui20_skin.h \
src/qt/cscfusionstyle.h \
src/qt/pryptopage.h \
src/qt/currencies.h \
src/qt/CSCPublicAPI/jsoncoininfoparser.h \
src/qt/infopage.h \
src/qt/qtquick_controls/cpp/guiexchangeswidget.h \
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.h \
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.h \
src/qt/qtquick_controls/cpp/guiexchangeslistview.h \
src/qt/qtquick_controls/cpp/guiexchangescontrol.h
SOURCES += src/qt/bitcoin.cpp \
src/qt/bitcoingui.cpp \
src/qt/transactiontablemodel.cpp \
src/qt/addresstablemodel.cpp \
src/qt/optionsdialog.cpp \
src/qt/sendcoinsdialog.cpp \
src/qt/coincontroldialog.cpp \
src/qt/coincontroltreewidget.cpp \
src/qt/addressbookpage.cpp \
src/qt/signverifymessagedialog.cpp \
src/qt/aboutdialog.cpp \
src/qt/editaddressdialog.cpp \
src/qt/bitcoinaddressvalidator.cpp \
src/alert.cpp \
src/version.cpp \
src/sync.cpp \
src/util.cpp \
src/hash.cpp \
src/netbase.cpp \
src/key.cpp \
src/script.cpp \
src/main.cpp \
src/init.cpp \
src/net.cpp \
src/bloom.cpp \
src/checkpoints.cpp \
src/addrman.cpp \
src/db.cpp \
src/walletdb.cpp \
src/qt/clientmodel.cpp \
src/qt/guiutil.cpp \
src/qt/transactionrecord.cpp \
src/qt/optionsmodel.cpp \
src/qt/monitoreddatamapper.cpp \
src/qt/transactiondesc.cpp \
src/qt/transactiondescdialog.cpp \
src/qt/bitcoinstrings.cpp \
src/qt/bitcoinamountfield.cpp \
src/wallet.cpp \
src/keystore.cpp \
src/qt/transactionfilterproxy.cpp \
src/qt/transactionview.cpp \
src/qt/walletmodel.cpp \
src/qt/walletview.cpp \
src/qt/walletstack.cpp \
src/qt/walletframe.cpp \
src/bitcoinrpc.cpp \
src/rpcdump.cpp \
src/rpcnet.cpp \
src/rpcmining.cpp \
src/rpcwallet.cpp \
src/rpcblockchain.cpp \
src/rpcrawtransaction.cpp \
src/qt/overviewpage.cpp \
src/qt/csvmodelwriter.cpp \
src/crypter.cpp \
src/qt/sendcoinsentry.cpp \
src/qt/qvalidatedlineedit.cpp \
src/qt/bitcoinunits.cpp \
src/qt/qvaluecombobox.cpp \
src/qt/askpassphrasedialog.cpp \
src/protocol.cpp \
src/qt/notificator.cpp \
src/qt/paymentserver.cpp \
src/qt/rpcconsole.cpp \
src/scrypt.cpp \
src/noui.cpp \
src/leveldb.cpp \
src/txdb.cpp \
src/qt/splashscreen.cpp \
src/qt/CSCPublicAPI/casinocoinwebapi.cpp \
src/qt/CSCPublicAPI/casinocoinwebapiparser.cpp \
src/qt/CSCPublicAPI/jsonactivepromotionsparser.cpp \
src/qt/CSCPublicAPI/jsonactiveexchangesparser.cpp \
src/qt/CSCPublicAPI/jsonsingleactivepromotion.cpp \
src/qt/CSCPublicAPI/jsonsingleactiveexchange.cpp \
src/qt/qtquick_controls/cpp/guibannercontrol.cpp \
src/qt/qtquick_controls/cpp/guibannerlistview.cpp \
src/qt/qtquick_controls/cpp/guibannerwidget.cpp \
src/qt/qtquick_controls/cpp/qmlbannerlistitem.cpp \
src/qt/qtquick_controls/cpp/qmlbannerlistmodel.cpp \
src/qt/qtquick_controls/cpp/qmlimageprovider.cpp \
src/qt/qtquick_controls/cpp/qmllistitem.cpp \
src/qt/qtquick_controls/cpp/qmllistmodel.cpp \
src/qt/qtquick_controls/cpp/qmlmenutoolbarmodel.cpp \
src/qt/qtquick_controls/cpp/qmlmenutoolbaritem.cpp \
src/qt/qtquick_controls/cpp/guimenutoolbarwidget.cpp \
src/qt/qtquick_controls/cpp/guimenutoolbarlistview.cpp \
src/qt/qtquick_controls/cpp/guimenutoolbarcontrol.cpp \
src/qt/gui20_skin.cpp \
src/qt/cscfusionstyle.cpp \
src/qt/pryptopage.cpp \
src/qt/currencies.cpp \
src/qt/CSCPublicAPI/jsoncoininfoparser.cpp \
src/qt/infopage.cpp \
src/qt/qtquick_controls/cpp/guiexchangeswidget.cpp \
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.cpp \
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.cpp \
src/qt/qtquick_controls/cpp/guiexchangeslistview.cpp \
src/qt/qtquick_controls/cpp/guiexchangescontrol.cpp
RESOURCES += src/qt/bitcoin.qrc
FORMS += src/qt/forms/sendcoinsdialog.ui \
src/qt/forms/coincontroldialog.ui \
src/qt/forms/addressbookpage.ui \
src/qt/forms/signverifymessagedialog.ui \
src/qt/forms/aboutdialog.ui \
src/qt/forms/editaddressdialog.ui \
src/qt/forms/transactiondescdialog.ui \
src/qt/forms/overviewpage.ui \
src/qt/forms/sendcoinsentry.ui \
src/qt/forms/askpassphrasedialog.ui \
src/qt/forms/rpcconsole.ui \
src/qt/forms/optionsdialog.ui \
src/qt/forms/pryptopage.ui \
src/qt/forms/infopage.ui
OTHER_FILES += README.md \
doc/*.rst \
doc/*.txt \
doc/*.md \
src/qt/res/bitcoin-qt.rc \
src/test/*.cpp \
src/test/*.h \
src/qt/test/*.cpp \
src/qt/test/*.h \
src/qt/qtquick_controls/qml/QmlGUIBannerControl.qml \
src/qt/qtquick_controls/qml/QmlGUIBannerListView.qml \
src/qt/qtquick_controls/qml/QmlGUIBannerWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIExchangesControl.qml \
src/qt/qtquick_controls/qml/QmlGUIExchangesListView.qml \
src/qt/qtquick_controls/qml/QmlGUIExchangesWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarListView.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarControl.qml
DISTFILES += \
QmlImports.qml
##### End Project Files #####
contains(USE_QRCODE, 1) {
HEADERS += src/qt/qrcodedialog.h
SOURCES += src/qt/qrcodedialog.cpp
FORMS += src/qt/forms/qrcodedialog.ui
}
contains(BITCOIN_QT_TEST, 1) {
SOURCES += src/qt/test/test_main.cpp \
src/qt/test/uritests.cpp
HEADERS += src/qt/test/uritests.h
DEPENDPATH += src/qt/test
QT += testlib
TARGET = casinocoin-qt_test
DEFINES += BITCOIN_QT_TEST
}
contains(USE_SSE2, 1) {
DEFINES += USE_SSE2
gccsse2.input = SOURCES_SSE2
gccsse2.output = $$PWD/build/${QMAKE_FILE_BASE}.o
gccsse2.commands = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} -msse2 -mstackrealign
QMAKE_EXTRA_COMPILERS += gccsse2
SOURCES_SSE2 += src/scrypt-sse2.cpp
}
# for lrelease/lupdate
# also add new translations to src/qt/bitcoin.qrc under translations/
TRANSLATIONS = $$files(src/qt/locale/bitcoin_*.ts)
isEmpty(QMAKE_LRELEASE) {
QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
}
isEmpty(QM_DIR):QM_DIR = $$PWD/src/qt/locale
# automatically build translations, so they can be included in resource file
TSQM.name = lrelease ${QMAKE_FILE_IN}
TSQM.input = TRANSLATIONS
TSQM.output = $$QM_DIR/${QMAKE_FILE_BASE}.qm
TSQM.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT}
TSQM.CONFIG = no_link
QMAKE_EXTRA_COMPILERS += TSQM
# platform specific defaults, if not overridden on command line
isEmpty(BOOST_LIB_SUFFIX) {
BOOST_LIB_SUFFIX = -mgw46-mt-s-1_53
}
isEmpty(BOOST_THREAD_LIB_SUFFIX) {
BOOST_THREAD_LIB_SUFFIX = $$BOOST_LIB_SUFFIX
}
DEFINES += WIN32
RC_FILE = src/qt/res/bitcoin-qt.rc
!contains(MINGW_THREAD_BUGFIX, 0) {
# At least qmake's win32-g++-cross profile is missing the -lmingwthrd
# thread-safety flag. GCC has -mthreads to enable this, but it doesn't
# work with static linking. -lmingwthrd must come BEFORE -lmingw, so
# it is prepended to QMAKE_LIBS_QT_ENTRY.
# It can be turned off with MINGW_THREAD_BUGFIX=0, just in case it causes
# any problems on some untested qmake profile now or in the future.
DEFINES += _MT
QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY
}
# Set libraries and includes at end, to use platform-defined defaults if not overridden
INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH
LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,)
LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lpthread
# -lgdi32 has to happen after -lcrypto (see #681)
LIBS += -lws2_32 -lole32 -lmswsock -loleaut32 -luuid -lgdi32 -lshlwapi
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX
LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
system($$QMAKE_LRELEASE -silent $$TRANSLATIONS)

View File

@@ -0,0 +1,259 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.0, 2015-12-01T22:30:06. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{5cb6bc84-6e3a-4b8c-88a9-7054f966d617}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.5.1 MinGW Static 32bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.5.1 MinGW Static 32bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{7d14dbc8-0402-4b0e-98cc-9747e8c52c07}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/casinocoin-GUI-2.0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/casinocoin-GUI-2.0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">casinocoin-qt-windows</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/a.jochems/Documents/GitHub/casinocoin-GUI-2.0/casinocoin-qt-windows.pro</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">casinocoin-qt-windows.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">18</value>
</data>
<data>
<variable>Version</variable>
<value type="int">18</value>
</data>
</qtcreator>

View File

@@ -1,13 +1,13 @@
TEMPLATE = app TEMPLATE = app
TARGET = casinocoin-qt TARGET = casinocoin-qt
macx:TARGET = "CasinoCoin-Qt" macx:TARGET = "CasinoCoin-Qt"
VERSION = 1.3.0.0 VERSION = 2.0.0.0
INCLUDEPATH += src src/json src/qt INCLUDEPATH += src src/json src/qt
QT += core gui network QT += core gui network widgets qml quick
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE USE_IPV6 __NO_SYSTEM_INCLUDES DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE USE_IPV6 __NO_SYSTEM_INCLUDES
CONFIG += no_include_pwd CONFIG += no_include_pwd
CONFIG += thread CONFIG += thread
CONFIG += static
# for boost 1.37, add -mt to the boost libraries # for boost 1.37, add -mt to the boost libraries
# use: qmake BOOST_LIB_SUFFIX=-mt # use: qmake BOOST_LIB_SUFFIX=-mt
@@ -259,7 +259,38 @@ HEADERS += src/qt/bitcoingui.h \
src/threadsafety.h \ src/threadsafety.h \
src/limitedmap.h \ src/limitedmap.h \
src/qt/macnotificationhandler.h \ src/qt/macnotificationhandler.h \
src/qt/splashscreen.h src/qt/splashscreen.h \
src/qt/CSCPublicAPI/casinocoinwebapi.h \
src/qt/CSCPublicAPI/casinocoinwebapiparser.h \
src/qt/CSCPublicAPI/jsonactivepromotionsparser.h \
src/qt/CSCPublicAPI/jsonactiveexchangesparser.h \
src/qt/CSCPublicAPI/jsonsingleactivepromotion.h \
src/qt/CSCPublicAPI/jsonsingleactiveexchange.h \
src/qt/qtquick_controls/cpp/guibannercontrol.h \
src/qt/qtquick_controls/cpp/guibannerlistview.h \
src/qt/qtquick_controls/cpp/guibannerwidget.h \
src/qt/qtquick_controls/cpp/listiteminterface.h \
src/qt/qtquick_controls/cpp/qmlbannerlistitem.h \
src/qt/qtquick_controls/cpp/qmlbannerlistmodel.h \
src/qt/qtquick_controls/cpp/qmlimageprovider.h \
src/qt/qtquick_controls/cpp/qmllistitem.h \
src/qt/qtquick_controls/cpp/qmllistmodel.h \
src/qt/qtquick_controls/cpp/qmlmenutoolbarmodel.h \
src/qt/qtquick_controls/cpp/qmlmenutoolbaritem.h \
src/qt/qtquick_controls/cpp/guimenutoolbarwidget.h \
src/qt/qtquick_controls/cpp/guimenutoolbarlistview.h \
src/qt/qtquick_controls/cpp/guimenutoolbarcontrol.h \
src/qt/gui20_skin.h \
src/qt/cscfusionstyle.h \
src/qt/pryptopage.h \
src/qt/currencies.h \
src/qt/CSCPublicAPI/jsoncoininfoparser.h \
src/qt/infopage.h \
src/qt/qtquick_controls/cpp/guiexchangeswidget.h \
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.h \
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.h \
src/qt/qtquick_controls/cpp/guiexchangeslistview.h \
src/qt/qtquick_controls/cpp/guiexchangescontrol.h
SOURCES += src/qt/bitcoin.cpp \ SOURCES += src/qt/bitcoin.cpp \
src/qt/bitcoingui.cpp \ src/qt/bitcoingui.cpp \
@@ -330,7 +361,38 @@ SOURCES += src/qt/bitcoin.cpp \
src/noui.cpp \ src/noui.cpp \
src/leveldb.cpp \ src/leveldb.cpp \
src/txdb.cpp \ src/txdb.cpp \
src/qt/splashscreen.cpp src/qt/splashscreen.cpp \
src/qt/CSCPublicAPI/casinocoinwebapi.cpp \
src/qt/CSCPublicAPI/casinocoinwebapiparser.cpp \
src/qt/CSCPublicAPI/jsonactivepromotionsparser.cpp \
src/qt/CSCPublicAPI/jsonactiveexchangesparser.cpp \
src/qt/CSCPublicAPI/jsonsingleactivepromotion.cpp \
src/qt/CSCPublicAPI/jsonsingleactiveexchange.cpp \
src/qt/qtquick_controls/cpp/guibannercontrol.cpp \
src/qt/qtquick_controls/cpp/guibannerlistview.cpp \
src/qt/qtquick_controls/cpp/guibannerwidget.cpp \
src/qt/qtquick_controls/cpp/qmlbannerlistitem.cpp \
src/qt/qtquick_controls/cpp/qmlbannerlistmodel.cpp \
src/qt/qtquick_controls/cpp/qmlimageprovider.cpp \
src/qt/qtquick_controls/cpp/qmllistitem.cpp \
src/qt/qtquick_controls/cpp/qmllistmodel.cpp \
src/qt/qtquick_controls/cpp/qmlmenutoolbarmodel.cpp \
src/qt/qtquick_controls/cpp/qmlmenutoolbaritem.cpp \
src/qt/qtquick_controls/cpp/guimenutoolbarwidget.cpp \
src/qt/qtquick_controls/cpp/guimenutoolbarlistview.cpp \
src/qt/qtquick_controls/cpp/guimenutoolbarcontrol.cpp \
src/qt/gui20_skin.cpp \
src/qt/cscfusionstyle.cpp \
src/qt/pryptopage.cpp \
src/qt/currencies.cpp \
src/qt/CSCPublicAPI/jsoncoininfoparser.cpp \
src/qt/infopage.cpp \
src/qt/qtquick_controls/cpp/guiexchangeswidget.cpp \
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.cpp \
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.cpp \
src/qt/qtquick_controls/cpp/guiexchangeslistview.cpp \
src/qt/qtquick_controls/cpp/guiexchangescontrol.cpp
RESOURCES += src/qt/bitcoin.qrc RESOURCES += src/qt/bitcoin.qrc
@@ -345,7 +407,9 @@ FORMS += src/qt/forms/sendcoinsdialog.ui \
src/qt/forms/sendcoinsentry.ui \ src/qt/forms/sendcoinsentry.ui \
src/qt/forms/askpassphrasedialog.ui \ src/qt/forms/askpassphrasedialog.ui \
src/qt/forms/rpcconsole.ui \ src/qt/forms/rpcconsole.ui \
src/qt/forms/optionsdialog.ui src/qt/forms/optionsdialog.ui \
src/qt/forms/pryptopage.ui \
src/qt/forms/infopage.ui
contains(USE_QRCODE, 1) { contains(USE_QRCODE, 1) {
HEADERS += src/qt/qrcodedialog.h HEADERS += src/qt/qrcodedialog.h
@@ -403,7 +467,16 @@ OTHER_FILES += README.md \
src/test/*.cpp \ src/test/*.cpp \
src/test/*.h \ src/test/*.h \
src/qt/test/*.cpp \ src/qt/test/*.cpp \
src/qt/test/*.h src/qt/test/*.h \
src/qt/qtquick_controls/qml/QmlGUIBannerControl.qml \
src/qt/qtquick_controls/qml/QmlGUIBannerListView.qml \
src/qt/qtquick_controls/qml/QmlGUIBannerWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIExchangesControl.qml \
src/qt/qtquick_controls/qml/QmlGUIExchangesListView.qml \
src/qt/qtquick_controls/qml/QmlGUIExchangesWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarListView.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarControl.qml
# platform specific defaults, if not overridden on command line # platform specific defaults, if not overridden on command line
isEmpty(BOOST_LIB_SUFFIX) { isEmpty(BOOST_LIB_SUFFIX) {
@@ -484,3 +557,6 @@ contains(RELEASE, 1) {
} }
system($$QMAKE_LRELEASE -silent $$TRANSLATIONS) system($$QMAKE_LRELEASE -silent $$TRANSLATIONS)
DISTFILES += \
QmlImports.qml

View File

@@ -0,0 +1,14 @@
// This file is autogenerated by qmake. It imports static plugin classes for
// static plugins used by QML imports.
#include <QtPlugin>
Q_IMPORT_PLUGIN(QtQuick2Plugin)
Q_IMPORT_PLUGIN(QtQuickControlsPlugin)
Q_IMPORT_PLUGIN(QtQuick2DialogsPlugin)
Q_IMPORT_PLUGIN(QtQuickLayoutsPlugin)
Q_IMPORT_PLUGIN(QtQuick2WindowPlugin)
Q_IMPORT_PLUGIN(QmlFolderListModelPlugin)
Q_IMPORT_PLUGIN(QmlSettingsPlugin)
Q_IMPORT_PLUGIN(QtQuick2DialogsPrivatePlugin)
Q_IMPORT_PLUGIN(QtQuickExtrasPlugin)
Q_IMPORT_PLUGIN(QtQmlModelsPlugin)
Q_IMPORT_PLUGIN(QtQuick2PrivateWidgetsPlugin)

View File

@@ -265,6 +265,7 @@ static const CRPCCommand vRPCCommands[] =
{ "lockunspent", &lockunspent, false, false, true }, { "lockunspent", &lockunspent, false, false, true },
{ "listlockunspent", &listlockunspent, false, false, true }, { "listlockunspent", &listlockunspent, false, false, true },
{ "verifychain", &verifychain, true, false, false }, { "verifychain", &verifychain, true, false, false },
{ "getcoinsupply", &getcoinsupply, true, false, false },
}; };
CRPCTable::CRPCTable() CRPCTable::CRPCTable()
@@ -1194,6 +1195,8 @@ Array RPCConvertValues(const std::string &strMethod, const std::vector<std::stri
if (strMethod == "importprivkey" && n > 2) ConvertTo<bool>(params[2]); if (strMethod == "importprivkey" && n > 2) ConvertTo<bool>(params[2]);
if (strMethod == "verifychain" && n > 0) ConvertTo<boost::int64_t>(params[0]); if (strMethod == "verifychain" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "verifychain" && n > 1) ConvertTo<boost::int64_t>(params[1]); if (strMethod == "verifychain" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "getcoinsupply" && n > 0) ConvertTo<boost::int64_t>(params[0], true);
if (strMethod == "getcoinsupply" && n > 1) ConvertTo<bool>(params[1], true);
return params; return params;
} }

View File

@@ -206,4 +206,6 @@ extern json_spirit::Value gettxoutsetinfo(const json_spirit::Array& params, bool
extern json_spirit::Value gettxout(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value gettxout(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value verifychain(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value verifychain(const json_spirit::Array& params, bool fHelp);
extern json_spirit::Value getcoinsupply(const json_spirit::Array& params, bool fHelp);
#endif #endif

View File

@@ -6,8 +6,8 @@
// //
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MAJOR 2
#define CLIENT_VERSION_MINOR 3 #define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0 #define CLIENT_VERSION_BUILD 0
@@ -16,7 +16,7 @@
// Copyright year (2009-this) // Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source // Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2014 #define COPYRIGHT_YEAR 2015
// Converts the parameter X to a string after macro replacement on X has been performed. // Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro! // Don't merge these into one macro!

View File

@@ -78,6 +78,7 @@ volatile bool fRequestShutdown = false;
void StartShutdown() void StartShutdown()
{ {
boost::this_thread::sleep_for( boost::chrono::seconds( 1 ) );
fRequestShutdown = true; fRequestShutdown = true;
} }
bool ShutdownRequested() bool ShutdownRequested()

View File

@@ -1124,6 +1124,47 @@ int64 static GetBlockValue(int nHeight, int64 nFees)
return nSubsidy + nFees; return nSubsidy + nFees;
} }
int64 GetTotalCoinSupply(int nHeight, bool noCheckpoints)
{
int64 totalSupply = 0;
int startBlock = 1;
if ( !noCheckpoints ) {
// Reduce the amount of calculations by specifying total checkpoints
int heights[] = {
100000, 200000, 300000, 400000, 500000,
600000, 700000, 800000, 900000, 1000000,
1100000
};
int64 supplies[] = {
482721500000000, 982721500000000, 1482721500000000, 1982721500000000, 2482721500000000,
2882721500000000, 2982721500000000, 3082721500000000, 3182721500000000, 3282721500000000,
3382721500000000
};
if (nHeight>=1 ) {
int numHeights = (int)(sizeof(heights)/sizeof(heights[0]));
// int numSupplies = (int)(sizeof(supplies)/sizeof(supplies[0]));
// if (nHeight>heights[numHeights-1]) {
// nHeight = heights[numHeights-1];
// }
for (int i=(numHeights-1); i>=0; i--) {
if ( heights[i] <= nHeight ) {
if (i>=0) {
totalSupply = supplies[i];
startBlock = heights[i] + 1;
break;
}
}
}
}
}
if ( nHeight>=1 ) {
for (int i = startBlock; i <= nHeight; i++) {
totalSupply += GetBlockValue( i, 0 );
}
}
return totalSupply;
}
static const int64 nTargetTimespan = 0.25 * 24 * 60 * 60; // CasinoCoin: 0.25 day / 6 hours static const int64 nTargetTimespan = 0.25 * 24 * 60 * 60; // CasinoCoin: 0.25 day / 6 hours
static const int64 nTargetSpacing = 1 * 30; // CasinoCoin: 30 seconds static const int64 nTargetSpacing = 1 * 30; // CasinoCoin: 30 seconds
static const int64 nInterval = nTargetTimespan / nTargetSpacing; static const int64 nInterval = nTargetTimespan / nTargetSpacing;

View File

@@ -191,12 +191,8 @@ CBlockIndex * InsertBlockIndex(uint256 hash);
bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType); bool VerifySignature(const CCoins& txFrom, const CTransaction& txTo, unsigned int nIn, unsigned int flags, int nHashType);
/** Abort with a message */ /** Abort with a message */
bool AbortNode(const std::string &msg); bool AbortNode(const std::string &msg);
/** Get total coin supply for block height */
int64 GetTotalCoinSupply(int nHeight, bool noCheckpoints);

View File

@@ -21,21 +21,21 @@ USE_UPNP:=-
USE_IPV6:=1 USE_IPV6:=1
DEPSDIR?=/usr/local DEPSDIR?=/usr/local
BOOST_SUFFIX?=-mgw46-mt-s-1_53 BOOST_SUFFIX?=-mgw49-mt-s-1_55
INCLUDEPATHS= \ INCLUDEPATHS= \
-I"$(CURDIR)" \ -I"$(CURDIR)" \
-I"E:\crypto\deps\boost_1_53_0" \ -I"C:\deps\boost_1_55_0" \
-I"E:\crypto\deps\db-4.8.30.NC\build_unix" \ -I"C:\deps\db-4.8.30.NC\build_unix" \
-I"E:\crypto\deps\openssl-1.0.1b\include" \ -I"C:\deps\openssl-1.0.2d\include" \
-I"E:\crypto\deps\qrencode-3.4.3" -I"C:\deps\qrencode-3.4.3"
LIBPATHS= \ LIBPATHS= \
-L"$(CURDIR)/leveldb" \ -L"$(CURDIR)/leveldb" \
-L"E:\crypto\deps\boost_1_53_0\stage\lib" \ -L"C:\deps\boost_1_55_0\stage\lib" \
-L"E:\crypto\deps\db-4.8.30.NC\build_unix" \ -L"C:\deps\db-4.8.30.NC\build_unix" \
-L"E:\crypto\deps\openssl-1.0.1b" \ -L"C:\deps\openssl-1.0.2d" \
-L"E:\crypto\deps\qrencode-3.4.3\.libs" -L"C:\deps\qrencode-3.4.3\.libs"
LIBS= \ LIBS= \
-l leveldb \ -l leveldb \

View File

@@ -1192,10 +1192,14 @@ void MapPort(bool)
// The first name is used as information source for addrman. // The first name is used as information source for addrman.
// The second name should resolve to a list of seed addresses. // The second name should resolve to a list of seed addresses.
static const char *strMainNetDNSSeed[][2] = { static const char *strMainNetDNSSeed[][2] = {
{"casinocoin.org seed", "seed.casinocoin.org"}, {"casinocoin.org seed", "seed.dig0.com"},
{"casinocoin.org seed #1", "seed1.casinocoin.org"}, {"casinocoin.org seed s", "seed.casinocoin.org"},
{"casinocoin.org seed #2", "seed2.casinocoin.org"}, {"casinocoin.org seed #1", "seed1.dig0.com"},
{"casinocoin.org seed #3", "seed3.casinocoin.org"}, {"casinocoin.org seed #1s", "seed1.casinocoin.org"},
{"casinocoin.org seed #2", "seed2.dig0.com"},
{"casinocoin.org seed #2s", "seed2.casinocoin.org"},
{"casinocoin.org seed #3", "seed3.dig0.com"},
{"casinocoin.org seed #3s", "seed3.casinocoin.org"},
{NULL, NULL} {NULL, NULL}
}; };

View File

@@ -0,0 +1,59 @@
#include "casinocoinwebapi.h"
#include <QSsl>
#include <QDebug>
const QString CasinoCoinWebAPI::s_strServerAddress = "http://api.csc.dig0.com/";
const QString CasinoCoinWebAPI::s_strServerEndpoint = "CSCPublicAPI";
CasinoCoinWebAPI::CasinoCoinWebAPI( QObject*a_pParent )
: QObject(a_pParent )
{
connect( &m_oNetworkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(slotParseNetworkResponse(QNetworkReply*)));
}
void CasinoCoinWebAPI::GetActivePromotions()
{
Get( s_strServerAddress + s_strServerEndpoint + "/ActivePromotions" );
}
void CasinoCoinWebAPI::GetActiveCasinos()
{
Get( s_strServerAddress + s_strServerEndpoint + "/ActiveCasinos" );
}
void CasinoCoinWebAPI::GetActiveNewsItems()
{
Get( s_strServerAddress + s_strServerEndpoint + "/ActiveNewsItems" );
}
void CasinoCoinWebAPI::GetActiveExchanges()
{
Get( s_strServerAddress + s_strServerEndpoint + "/ActiveExchanges" );
}
void CasinoCoinWebAPI::GetCoinInfo()
{
Get( s_strServerAddress + s_strServerEndpoint + "/CoinInfo" );
}
void CasinoCoinWebAPI::Get( const QString& a_rUrl )
{
QUrl oUrl ( a_rUrl );
QNetworkRequest oNetworkRequest ( oUrl );
m_oNetworkAccessManager.get( oNetworkRequest );
}
void CasinoCoinWebAPI::slotParseNetworkResponse( QNetworkReply *finished )
{
if ( finished->error() != QNetworkReply::NoError )
{
// A communication error has occurred
qDebug() << "API Network Error: " << finished->errorString();
emit signalNetworkError( finished->error(), finished->request().url() );
return;
}
QByteArray data = finished->readAll();
emit signalResponseReady( data );
}

View File

@@ -0,0 +1,41 @@
#ifndef CASINOCOINWEBAPI_H
#define CASINOCOINWEBAPI_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
class CasinoCoinWebAPI : public QObject
{
Q_OBJECT
public:
explicit CasinoCoinWebAPI( QObject* a_pParent = 0 );
virtual ~CasinoCoinWebAPI(){}
void GetActivePromotions();
void GetActiveCasinos();
void GetActiveNewsItems();
void GetActiveExchanges();
void GetCoinInfo();
static const QString s_strServerAddress;
static const QString s_strServerEndpoint;
signals:
void signalResponseReady( const QByteArray& a_rJsonFile );
void signalNetworkError
( QNetworkReply::NetworkError a_eError
, const QUrl a_rFailedUrl
);
public slots:
void slotParseNetworkResponse( QNetworkReply *finished );
private:
void Get( const QString& a_rUrl );
QNetworkAccessManager m_oNetworkAccessManager;
};
#endif // CASINOCOINWEBAPI_H

View File

@@ -0,0 +1,140 @@
#include "casinocoinwebapiparser.h"
#include "util.h"
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <QDebug>
#include <QDir>
#include <QFile>
CasinoCoinWebAPIParser::CasinoCoinWebAPIParser( QObject* a_pParent )
: QObject(a_pParent)
{
}
void CasinoCoinWebAPIParser::slotParseAnswer( const QByteArray& a_rJsonFile )
{
QJsonParseError oError;
QJsonDocument jsonDoc = QJsonDocument::fromJson( a_rJsonFile, &oError );
if ( oError.error == QJsonParseError::NoError )
{
QJsonObject docAsObject = jsonDoc.object();
if ( docAsObject.find( "Result" ).value().isObject() )
{
QJsonObject jsonObjectResult = docAsObject.find( "Result" ).value().toObject();
if ( jsonObjectResult.find( "ActivePromotions" ).value().isArray() )
{
StoreFile( "ActivePromotions", a_rJsonFile );
ParsePromotions( docAsObject );
}
else if ( jsonObjectResult.find( "ActiveNewsItems" ).value().isArray() )
{
StoreFile( "ActiveNewsItems", a_rJsonFile );
ParseNewsItems( docAsObject );
}
else if ( jsonObjectResult.find( "ActiveCasinos" ).value().isArray() )
{
StoreFile( "ActiveCasinos", a_rJsonFile );
ParseCasinos( docAsObject );
}
else if ( jsonObjectResult.find( "ActiveExchanges" ).value().isArray() )
{
StoreFile( "ActiveExchanges", a_rJsonFile );
ParseExchanges( docAsObject );
}
else if ( jsonObjectResult.find( "CoinInfo" ).value().isObject() )
{
StoreFile( "CoinInfo", a_rJsonFile );
ParseCoinInfo( docAsObject );
}
}
else
{
qDebug() << "CasinoCoinWebAPIParser -> No Result object found: " << docAsObject.begin().key();
}
}
else
{
qDebug() << "CasinoCoinWebAPIParser -> Parse Error: " << oError.errorString();
}
}
void CasinoCoinWebAPIParser::slotNetworkError( QNetworkReply::NetworkError a_eError
, const QUrl a_rFailedUrl
)
{
qDebug() << "network error: " << a_eError;
QString strAccessedUrl = a_rFailedUrl.toString().split("/").last();
slotParseAnswer( ReadFile( strAccessedUrl ) );
}
void CasinoCoinWebAPIParser::ParsePromotions( const QJsonObject& a_rJsonPromotions )
{
qDebug() << "ParsePromotions";
emit signalActivePromotionsParsed( new JsonActivePromotionsParser( a_rJsonPromotions ) );
}
void CasinoCoinWebAPIParser::ParseCasinos( const QJsonObject& a_rJsonCasinos )
{
qDebug() << "Coming soon - ParseCasinos";
qDebug() << a_rJsonCasinos;
}
void CasinoCoinWebAPIParser::ParseExchanges( const QJsonObject& a_rJsonExchanges )
{
qDebug() << "ParseExchanges";
emit signalActiveExchangesParsed( new JsonActiveExchangesParser( a_rJsonExchanges ) );
}
void CasinoCoinWebAPIParser::ParseNewsItems( const QJsonObject& a_rJsonNewsItems )
{
qDebug() << "Coming soon - ParseNewsItems";
qDebug() << a_rJsonNewsItems;
}
void CasinoCoinWebAPIParser::ParseCoinInfo( const QJsonObject& a_rJsonCoinInfo )
{
qDebug() << "ParseCoinInfo";
emit signalCoinInfoParsed( new JsonCoinInfoParser( a_rJsonCoinInfo ) );
}
QByteArray CasinoCoinWebAPIParser::ReadFile( QString a_strSourcePath )
{
QByteArray strAnswer;
boost::filesystem::path pathCasinoCoinAPIResources = GetDataDir() / "cscapires";
QFile fileOutput( QDir( QString::fromStdString( pathCasinoCoinAPIResources.string() ) ).absoluteFilePath( a_strSourcePath ) );
if ( !fileOutput.open( QIODevice::ReadOnly ) )
{
qWarning() << "cannot open file to read: " << QDir::current().relativeFilePath( a_strSourcePath );
}
else
{
strAnswer = fileOutput.readAll();
fileOutput.close();
}
return strAnswer;
}
void CasinoCoinWebAPIParser::StoreFile( QString a_strDestinationPath, const QByteArray& a_rJsonFile )
{
boost::filesystem::path pathCasinoCoinAPIResources = GetDataDir() / "cscapires";
boost::filesystem::create_directories(pathCasinoCoinAPIResources);
QFile fileOutput( QDir( QString::fromStdString( pathCasinoCoinAPIResources.string() ) ).absoluteFilePath( a_strDestinationPath ) );
if ( !fileOutput.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
{
qWarning() << "cannot open file to write: " << QDir::current().relativeFilePath( a_strDestinationPath );
}
else
{
fileOutput.write( a_rJsonFile );
fileOutput.close();
}
}

View File

@@ -0,0 +1,45 @@
#ifndef CASINOCOINWEBAPIPARSER_H
#define CASINOCOINWEBAPIPARSER_H
#include <QObject>
#include "jsonactivepromotionsparser.h"
#include "jsonsingleactivepromotion.h"
#include "jsoncoininfoparser.h"
#include "jsonactiveexchangesparser.h"
#include "jsonsingleactiveexchange.h"
#include <QNetworkReply>
class CasinoCoinWebAPIParser : public QObject
{
Q_OBJECT
public:
explicit CasinoCoinWebAPIParser( QObject* a_pParent = 0 );
signals:
void signalActivePromotionsParsed( JsonActivePromotionsParser* a_pActivePromotions );
void signalCoinInfoParsed( JsonCoinInfoParser* a_pCoinInfo );
// void signalActiveCasinosParsed( JsonActiveCasinosParser* a_pActivePromotions );
void signalActiveExchangesParsed( JsonActiveExchangesParser* a_pActiveExchanges );
// void signalActiveNewsItemsParsed( JsonActiveNewsItemsParser* a_pActivePromotions );
public slots:
void slotParseAnswer( const QByteArray& a_rJsonFile );
void slotNetworkError
( QNetworkReply::NetworkError a_eError
, const QUrl a_rFailedUrl
);
private:
void ParsePromotions( const QJsonObject& a_rJsonPromotions );
void ParseCasinos ( const QJsonObject& a_rJsonCasinos );
void ParseExchanges ( const QJsonObject& a_rJsonExchanges );
void ParseNewsItems ( const QJsonObject& a_rJsonNewsItems );
void ParseCoinInfo ( const QJsonObject& a_rJsonCoinInfo );
QByteArray ReadFile( QString a_strSourcePath );
void StoreFile( QString a_strDestinationPath, const QByteArray& a_rJsonFile );
};
#endif // CASINOCOINWEBAPIPARSER_H

View File

@@ -0,0 +1,54 @@
#include "jsonactiveexchangesparser.h"
#include "../qtquick_controls/cpp/qmlimageprovider.h"
#include <QDebug>
JsonActiveExchangesParser::JsonActiveExchangesParser()
{
}
JsonActiveExchangesParser::JsonActiveExchangesParser( const QJsonObject& a_rOther )
: QJsonObject( a_rOther )
{
ResolveExchangesArray();
}
void JsonActiveExchangesParser::ResolveExchangesArray()
{
if ( find( "Result" ).value().isObject() )
{
if ( find( "Result" ).value().toObject().find( "ActiveExchanges" ).value().isArray() )
{
QJsonArray arrayOfExchangeDescriptors( find( "Result" ).value().toObject().find( "ActiveExchanges" ).value().toArray() );
foreach( QJsonValue singleExchangeDescriptor, arrayOfExchangeDescriptors )
{
if ( singleExchangeDescriptor.isObject() )
{
m_aActiveExchanges.append( JsonSingleActiveExchange( singleExchangeDescriptor.toObject() ) );
}
}
}
}
}
const QList<JsonSingleActiveExchange>& JsonActiveExchangesParser::GetExchanges() const
{
return m_aActiveExchanges;
}
QList<JsonSingleActiveExchange>& JsonActiveExchangesParser::GetExchanges()
{
return m_aActiveExchanges;
}
void JsonActiveExchangesParser::AddImagesToPool( QmlImageProvider* a_pImageProvider )
{
if ( a_pImageProvider )
{
foreach( JsonSingleActiveExchange oExchange, m_aActiveExchanges )
{
a_pImageProvider->AddToImagePool( oExchange.getImageName(), oExchange.getExchangeImage() );
}
}
}

View File

@@ -0,0 +1,31 @@
#ifndef JSONACTIVEEXCHANGESPARSER_H
#define JSONACTIVEEXCHANGESPARSER_H
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QList>
#include "jsonsingleactiveexchange.h"
class QmlImageProvider;
class JsonActiveExchangesParser : public QJsonObject
{
public:
JsonActiveExchangesParser();
JsonActiveExchangesParser( const QJsonObject& a_rOther );
virtual ~JsonActiveExchangesParser(){}
const QList<JsonSingleActiveExchange>& GetExchanges() const;
QList<JsonSingleActiveExchange>& GetExchanges();
void AddImagesToPool( QmlImageProvider* a_pImageProvider );
private:
void ResolveExchangesArray();
QList<JsonSingleActiveExchange> m_aActiveExchanges;
};
#endif // JSONACTIVEEXCHANGESPARSER_H

View File

@@ -0,0 +1,54 @@
#include "jsonactivepromotionsparser.h"
#include "../qtquick_controls/cpp/qmlimageprovider.h"
#include <QDebug>
JsonActivePromotionsParser::JsonActivePromotionsParser()
{
}
JsonActivePromotionsParser::JsonActivePromotionsParser( const QJsonObject& a_rOther )
: QJsonObject( a_rOther )
{
ResolvePromotionsArray();
}
void JsonActivePromotionsParser::ResolvePromotionsArray()
{
if ( find( "Result" ).value().isObject() )
{
if ( find( "Result" ).value().toObject().find( "ActivePromotions" ).value().isArray() )
{
QJsonArray arrayOfCasinoDescriptors( find( "Result" ).value().toObject().find( "ActivePromotions" ).value().toArray() );
foreach( QJsonValue singleCasinoDescriptor, arrayOfCasinoDescriptors )
{
if ( singleCasinoDescriptor.isObject() )
{
m_aActivePromotions.append( JsonSingleActivePromotion( singleCasinoDescriptor.toObject() ) );
}
}
}
}
}
const QList<JsonSingleActivePromotion>& JsonActivePromotionsParser::GetPromotions() const
{
return m_aActivePromotions;
}
QList<JsonSingleActivePromotion>& JsonActivePromotionsParser::GetPromotions()
{
return m_aActivePromotions;
}
void JsonActivePromotionsParser::AddImagesToPool( QmlImageProvider* a_pImageProvider )
{
if ( a_pImageProvider )
{
foreach( JsonSingleActivePromotion oPromotion, m_aActivePromotions )
{
a_pImageProvider->AddToImagePool( oPromotion.GetImageName(), oPromotion.GetAdvertImage() );
}
}
}

View File

@@ -0,0 +1,31 @@
#ifndef JSONACTIVEPROMOTIONSPARSER_H
#define JSONACTIVEPROMOTIONSPARSER_H
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QList>
#include "jsonsingleactivepromotion.h"
class QmlImageProvider;
class JsonActivePromotionsParser : public QJsonObject
{
public:
JsonActivePromotionsParser();
JsonActivePromotionsParser( const QJsonObject& a_rOther );
virtual ~JsonActivePromotionsParser(){}
const QList<JsonSingleActivePromotion>& GetPromotions() const;
QList<JsonSingleActivePromotion>& GetPromotions();
void AddImagesToPool( QmlImageProvider* a_pImageProvider );
private:
void ResolvePromotionsArray();
QList<JsonSingleActivePromotion> m_aActivePromotions;
};
#endif // JSONACTIVEPROMOTIONSPARSER_H

View File

@@ -0,0 +1,29 @@
#include "jsoncoininfoparser.h"
#include <QDebug>
JsonCoinInfoParser::JsonCoinInfoParser()
{
}
JsonCoinInfoParser::JsonCoinInfoParser( const QJsonObject& apiResult )
: QJsonObject( apiResult )
{
qDebug() << "JsonCoinInfoParser: " << apiResult.begin().key();
if ( apiResult.find( "Result" ).value().isObject() )
{
if ( apiResult.find( "Result" ).value().toObject().find( "CoinInfo" ).value().isObject() )
{
coinInfoObject = apiResult.find( "Result" ).value().toObject().find( "CoinInfo" ).value().toObject();
}
else
{
qDebug()<<"JsonCoinInfoParser first key: " << apiResult.find( "Result" ).value().toObject().begin().key();
}
}
}
const QJsonObject& JsonCoinInfoParser::getCoinInfo() const
{
return coinInfoObject;
}

View File

@@ -0,0 +1,20 @@
#ifndef JSONCOININFOPARSER_H
#define JSONCOININFOPARSER_H
#include <QJsonObject>
#include <QJsonValue>
class JsonCoinInfoParser : public QJsonObject
{
public:
JsonCoinInfoParser();
JsonCoinInfoParser( const QJsonObject& a_rOther );
virtual ~JsonCoinInfoParser(){}
const QJsonObject& getCoinInfo() const;
private:
QJsonObject coinInfoObject;
};
#endif // JSONCOININFOPARSER_H

View File

@@ -0,0 +1,42 @@
#include "jsonsingleactiveexchange.h"
#include <QFile>
#include <QImage>
#include <QDir>
#include <QDebug>
JsonSingleActiveExchange::JsonSingleActiveExchange()
{
}
JsonSingleActiveExchange::JsonSingleActiveExchange( const QJsonObject& a_rOther )
: QJsonObject( a_rOther )
{
m_strImageName = find( "exchange_name" ).value().toString().remove( getRestrictedCharacters() );
storeImage();
m_strExchangeName = find( "exchange_name" ).value().toString().remove( getRestrictedCharacters() );
m_strAccessUrl = find( "access_url" ).value().toString();
m_strDescription = find( "description" ).value().toString();
m_dblLastBidPriceBTC = find( "last_bid_price_btc" ).value().toDouble();
m_dblLastAskPriceBTC = find( "last_ask_price_btc" ).value().toDouble();
m_dblLastPriceBTC = find( "last_price_btc" ).value().toDouble();
m_dblVolume24H = find( "volume24h" ).value().toDouble();
m_strLastUpdateTime = find( "last_update_time" ).value().toString();
}
QRegExp JsonSingleActiveExchange::getRestrictedCharacters()
{
return QRegExp( "[<,>|\\:()&;#?*% ]" );
}
void JsonSingleActiveExchange::storeImage()
{
if ( find( "image_mime_type" ).value().toString().split( "/" ).first().contains( "image" ) )
{
QByteArray binaryData = QByteArray::fromBase64( find( "exchange_image" ).value().toString().toLocal8Bit() );
m_oExchangeImage = QImage::fromData( binaryData );
}
}

View File

@@ -0,0 +1,46 @@
#ifndef JSONSINGLEACTIVEEXCHANGE_H
#define JSONSINGLEACTIVEEXCHANGE_H
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QImage>
class JsonSingleActiveExchange : public QJsonObject
{
public:
JsonSingleActiveExchange();
JsonSingleActiveExchange( const QJsonObject& a_rOther );
virtual ~JsonSingleActiveExchange(){}
QString getImageName() const{ return m_strImageName; }
QImage getExchangeImage() const { return m_oExchangeImage; }
QString getExchangeName() const{ return m_strExchangeName; }
QString getAccessUrl() const{ return m_strAccessUrl; }
QString getDescription() const{ return m_strDescription; }
double getLastBidPriceBTC() const{ return m_dblLastBidPriceBTC; }
double getLastAskPriceBTC() const{ return m_dblLastAskPriceBTC; }
double getLastPriceBTC() const{ return m_dblLastBidPriceBTC; }
double getVolume24H() const{ return m_dblVolume24H; }
QString getLastUpdateTime() const{ return m_strLastUpdateTime; }
private:
void storeImage();
static QRegExp getRestrictedCharacters();
QString m_strImageName;
QImage m_oExchangeImage;
QString m_strExchangeName;
QString m_strAccessUrl;
QString m_strDescription;
double m_dblLastBidPriceBTC;
double m_dblLastAskPriceBTC;
double m_dblLastPriceBTC;
double m_dblVolume24H;
QString m_strLastUpdateTime;
};
#endif // JSONSINGLEACTIVEEXCHANGE_H

View File

@@ -0,0 +1,34 @@
#include "jsonsingleactivepromotion.h"
#include <QFile>
#include <QImage>
#include <QDir>
#include <QDebug>
JsonSingleActivePromotion::JsonSingleActivePromotion()
{
}
JsonSingleActivePromotion::JsonSingleActivePromotion( const QJsonObject& a_rOther )
: QJsonObject( a_rOther )
{
m_strImageName = find( "promotion_title" ).value().toString().remove( GetRestrictedCharacters() );
StoreImage();
}
QRegExp JsonSingleActivePromotion::GetRestrictedCharacters()
{
return QRegExp( "[<,>|\\:()&;#?*% ]" );
}
void JsonSingleActivePromotion::StoreImage()
{
if ( find( "image_mime_type" ).value().toString().split( "/" ).first().contains( "image" ) )
{
QByteArray binaryData = QByteArray::fromBase64( find( "promotion_image" ).value().toString().toLocal8Bit() );
m_oAdvertImage = QImage::fromData( binaryData );
}
}

View File

@@ -0,0 +1,29 @@
#ifndef JSONSINGLEACTIVEPROMOTION_H
#define JSONSINGLEACTIVEPROMOTION_H
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
#include <QImage>
class JsonSingleActivePromotion : public QJsonObject
{
public:
JsonSingleActivePromotion();
JsonSingleActivePromotion( const QJsonObject& a_rOther );
virtual ~JsonSingleActivePromotion(){}
QString GetImageName() const{ return m_strImageName; }
QImage GetAdvertImage() const { return m_oAdvertImage; }
private:
void StoreImage();
static QRegExp GetRestrictedCharacters();
QString m_strImageName;
QImage m_oAdvertImage;
};
#endif // JSONSINGLEACTIVEPROMOTION_H

View File

@@ -6,7 +6,7 @@
// Copyright year (2009-this) // Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source // Todo: update this when changing our copyright comments in the source
const int ABOUTDIALOG_COPYRIGHT_YEAR = 2013; const int ABOUTDIALOG_COPYRIGHT_YEAR = 2015;
AboutDialog::AboutDialog(QWidget *parent) : AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
@@ -15,7 +15,9 @@ AboutDialog::AboutDialog(QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
// Set current copyright year // Set current copyright year
ui->copyrightLabel->setText(tr("Copyright") + QString(" &copy; 2009-%1 ").arg(COPYRIGHT_YEAR) + tr("The Bitcoin developers") + QString("<br>") + tr("Copyright") + QString(" &copy; ") + tr("2013-%1 The CasinoCoin developers").arg(ABOUTDIALOG_COPYRIGHT_YEAR)); ui->copyrightLabel->setText(tr("Copyright") + QString(" &copy; 2009-%1 ").arg(COPYRIGHT_YEAR) + tr("The Bitcoin developers") + QString("<br>") +
tr("Copyright") + QString(" &copy; ") + tr("2013-%1 The CasinoCoin developers").arg(ABOUTDIALOG_COPYRIGHT_YEAR) + QString("<br>") +
tr("Copyright") + QString(" &copy; ") + tr("2015 - GUI 2.0 Design by Felix Rojauro (felix.rojauro@gmail.com)"));
} }
void AboutDialog::setModel(ClientModel *model) void AboutDialog::setModel(ClientModel *model)

View File

@@ -8,6 +8,8 @@
#include "csvmodelwriter.h" #include "csvmodelwriter.h"
#include "guiutil.h" #include "guiutil.h"
#include "gui20_skin.h"
#ifdef USE_QRCODE #ifdef USE_QRCODE
#include "qrcodedialog.h" #include "qrcodedialog.h"
#endif #endif
@@ -26,7 +28,6 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
tab(tab) tab(tab)
{ {
ui->setupUi(this); ui->setupUi(this);
#ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac #ifdef Q_OS_MAC // Icons on push buttons are very uncommon on Mac
ui->newAddress->setIcon(QIcon()); ui->newAddress->setIcon(QIcon());
ui->copyAddress->setIcon(QIcon()); ui->copyAddress->setIcon(QIcon());

View File

@@ -6,6 +6,7 @@
#include "wallet.h" #include "wallet.h"
#include "base58.h" #include "base58.h"
#include <QDebug>
#include <QFont> #include <QFont>
const QString AddressTableModel::Send = "S"; const QString AddressTableModel::Send = "S";
@@ -424,3 +425,24 @@ void AddressTableModel::emitDataChanged(int idx)
{ {
emit dataChanged(index(idx, 0, QModelIndex()), index(idx, columns.length()-1, QModelIndex())); emit dataChanged(index(idx, 0, QModelIndex()), index(idx, columns.length()-1, QModelIndex()));
} }
/* Look up address for label in address book, if not found return empty string.
*/
QString AddressTableModel::addressForLabel(const QString &label) const
{
LOCK(wallet->cs_wallet);
QString walletAddress = "";
// loop over addressbook values to find the key
std::map<CTxDestination, std::string>::iterator it;
for( it = wallet->mapAddressBook.begin(); it != wallet->mapAddressBook.end(); it++)
{
qDebug() << "Label Value: " << QString::fromStdString(it->second);
if (it->second.compare(label.toStdString()) == 0)
{
CTxDestination dest = it->first;
walletAddress = QString::fromStdString(CBitcoinAddress(dest).ToString());
break;
}
}
return walletAddress;
}

View File

@@ -69,6 +69,10 @@ public:
EditStatus getEditStatus() const { return editStatus; } EditStatus getEditStatus() const { return editStatus; }
/* Look up address for label in address book, if not found return empty string.
*/
QString addressForLabel(const QString &label) const;
private: private:
WalletModel *walletModel; WalletModel *walletModel;
CWallet *wallet; CWallet *wallet;

View File

@@ -91,7 +91,7 @@ static void InitMessage(const std::string &message)
{ {
if(splashref) if(splashref)
{ {
splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(55,55,55)); splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom|Qt::AlignHCenter, QColor(Qt::black));
qApp->processEvents(); qApp->processEvents();
} }
printf("init message: %s\n", message.c_str()); printf("init message: %s\n", message.c_str());
@@ -292,12 +292,14 @@ int main(int argc, char *argv[])
threadGroup.interrupt_all(); threadGroup.interrupt_all();
threadGroup.join_all(); threadGroup.join_all();
Shutdown(); Shutdown();
pollShutdownTimer->stop();
} }
else else
{ {
threadGroup.interrupt_all(); threadGroup.interrupt_all();
threadGroup.join_all(); threadGroup.join_all();
Shutdown(); Shutdown();
pollShutdownTimer->stop();
return 1; return 1;
} }
} catch (std::exception& e) { } catch (std::exception& e) {

View File

@@ -1,4 +1,4 @@
<!DOCTYPE RCC><RCC version="1.0"> <RCC>
<qresource prefix="/icons"> <qresource prefix="/icons">
<file alias="bitcoin">res/icons/bitcoin.png</file> <file alias="bitcoin">res/icons/bitcoin.png</file>
<file alias="address-book">res/icons/address-book.png</file> <file alias="address-book">res/icons/address-book.png</file>
@@ -40,12 +40,38 @@
<file alias="filesave">res/icons/filesave.png</file> <file alias="filesave">res/icons/filesave.png</file>
<file alias="qrcode">res/icons/qrcode.png</file> <file alias="qrcode">res/icons/qrcode.png</file>
<file alias="debugwindow">res/icons/debugwindow.png</file> <file alias="debugwindow">res/icons/debugwindow.png</file>
<file alias="advertsArrowLeft">res/icons/adverts_arrow_left.png</file>
<file alias="advertsArrowLeftHover">res/icons/adverts_arrow_left_hover.png</file>
<file alias="advertsArrowRight">res/icons/adverts_arrow_right.png</file>
<file alias="advertsArrowRightHover">res/icons/adverts_arrow_right_hover.png</file>
<file>res/icons/GUI20_mainToolBar_transactions.png</file>
<file>res/icons/GUI20_mainToolBar_transactions_hover.png</file>
<file>res/icons/GUI20_mainToolBar_send.png</file>
<file>res/icons/GUI20_mainToolBar_send_hover.png</file>
<file>res/icons/GUI20_mainToolBar_redeemprypto.png</file>
<file>res/icons/GUI20_mainToolBar_redeemprypto_hover.png</file>
<file>res/icons/GUI20_mainToolBar_receive.png</file>
<file>res/icons/GUI20_mainToolBar_receive_hover.png</file>
<file>res/icons/GUI20_mainToolBar_overview.png</file>
<file>res/icons/GUI20_mainToolBar_overview_hover.png</file>
<file>res/icons/GUI20_mainToolBar_info.png</file>
<file>res/icons/GUI20_mainToolBar_info_hover.png</file>
<file>res/icons/GUI20_mainToolBar_contacts.png</file>
<file>res/icons/GUI20_mainToolBar_contacts_hover.png</file>
<file>res/icons/prypto.png</file>
<file alias="checkboxTick">res/icons/checkbox_tick.png</file>
<file alias="advertsArrowDownHover">res/icons/adverts_arrow_bottom_hover.png</file>
<file alias="advertsArrowDown">res/icons/adverts_arrow_bottom.png</file>
<file alias="advertsArrowUp">res/icons/adverts_arrow_top.png</file>
<file alias="advertsArrowUpHover">res/icons/adverts_arrow_top_hover.png</file>
<file alias="radiobuttonTick">res/icons/radiobutton_tick.png</file>
</qresource> </qresource>
<qresource prefix="/images"> <qresource prefix="/images">
<file alias="about">res/images/about.png</file> <file alias="about">res/images/about.png</file>
<file alias="splash">res/images/splash.png</file> <file alias="splash">res/images/splash.png</file>
<file alias="splash_testnet">res/images/splash_testnet.png</file> <file alias="splash_testnet">res/images/splash_testnet.png</file>
<file alias="backg">res/images/wallet.png</file> <file alias="backg">res/images/wallet.png</file>
<file>res/images/GUI20_mainToolBar_cards.png</file>
</qresource> </qresource>
<qresource prefix="/movies"> <qresource prefix="/movies">
<file alias="update_spinner">res/movies/update_spinner.mng</file> <file alias="update_spinner">res/movies/update_spinner.mng</file>
@@ -99,4 +125,15 @@
<file alias="zh_CN">locale/bitcoin_zh_CN.qm</file> <file alias="zh_CN">locale/bitcoin_zh_CN.qm</file>
<file alias="zh_TW">locale/bitcoin_zh_TW.qm</file> <file alias="zh_TW">locale/bitcoin_zh_TW.qm</file>
</qresource> </qresource>
<qresource prefix="/qml">
<file>qtquick_controls/qml/QmlGUIBannerControl.qml</file>
<file>qtquick_controls/qml/QmlGUIBannerListView.qml</file>
<file>qtquick_controls/qml/QmlGUIBannerWindow.qml</file>
<file>qtquick_controls/qml/QmlGUIMenuToolbarWindow.qml</file>
<file>qtquick_controls/qml/QmlGUIMenuToolbarListView.qml</file>
<file>qtquick_controls/qml/QmlGUIMenuToolbarControl.qml</file>
<file>qtquick_controls/qml/QmlGUIExchangesWindow.qml</file>
<file>qtquick_controls/qml/QmlGUIExchangesListView.qml</file>
<file>qtquick_controls/qml/QmlGUIExchangesControl.qml</file>
</qresource>
</RCC> </RCC>

View File

@@ -13,19 +13,22 @@
BitcoinAmountField::BitcoinAmountField(QWidget *parent): BitcoinAmountField::BitcoinAmountField(QWidget *parent):
QWidget(parent), amount(0), currentUnit(-1) QWidget(parent), amount(0), currentUnit(-1)
{ {
unit = new QValueComboBox(this);
unit->setModel(new BitcoinUnits(this));
unit->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
amount = new QDoubleSpinBox(this); amount = new QDoubleSpinBox(this);
amount->setLocale(QLocale::c()); amount->setLocale(QLocale::c());
amount->setDecimals(8); amount->setDecimals(8);
amount->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
amount->installEventFilter(this); amount->installEventFilter(this);
amount->setMaximumWidth(170);
amount->setSingleStep(0.001); amount->setSingleStep(0.001);
QHBoxLayout *layout = new QHBoxLayout(this); QHBoxLayout *layout = new QHBoxLayout(this);
layout->addWidget(amount); layout->addWidget(amount);
unit = new QValueComboBox(this);
unit->setModel(new BitcoinUnits(this));
layout->addWidget(unit); layout->addWidget(unit);
layout->addStretch(1); // layout->addStretch(1);
layout->setContentsMargins(0,0,0,0); layout->setContentsMargins(0,0,0,0);
setLayout(layout); setLayout(layout);

View File

@@ -25,6 +25,10 @@
#include "ui_interface.h" #include "ui_interface.h"
#include "wallet.h" #include "wallet.h"
#include "init.h" #include "init.h"
#include "cscfusionstyle.h"
#include "gui20_skin.h"
#include "qtquick_controls/cpp/guimenutoolbarwidget.h"
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
#include "macdockiconhandler.h" #include "macdockiconhandler.h"
@@ -52,6 +56,7 @@
#include <QSettings> #include <QSettings>
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QListWidget> #include <QListWidget>
#include <QToolTip>
#include <iostream> #include <iostream>
@@ -60,6 +65,7 @@ const QString BitcoinGUI::DEFAULT_WALLET = "~Default";
BitcoinGUI::BitcoinGUI(QWidget *parent) : BitcoinGUI::BitcoinGUI(QWidget *parent) :
QMainWindow(parent), QMainWindow(parent),
clientModel(0), clientModel(0),
toolbarGUI20(0),
encryptWalletAction(0), encryptWalletAction(0),
changePassphraseAction(0), changePassphraseAction(0),
aboutQtAction(0), aboutQtAction(0),
@@ -68,6 +74,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent) :
rpcConsole(0), rpcConsole(0),
prevBlocks(0) prevBlocks(0)
{ {
QApplication::setStyle(new CSCFusionStyle);
restoreWindowGeometry(); restoreWindowGeometry();
setWindowTitle(tr("CasinoCoin") + " - " + tr("Wallet")); setWindowTitle(tr("CasinoCoin") + " - " + tr("Wallet"));
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
@@ -77,9 +85,20 @@ BitcoinGUI::BitcoinGUI(QWidget *parent) :
setUnifiedTitleAndToolBarOnMac(true); setUnifiedTitleAndToolBarOnMac(true);
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus); QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
#endif #endif
// Create wallet frame and make it the central widget // Create wallet frame with main menu
walletFrame = new WalletFrame(this); walletFrame = new WalletFrame(this);
setCentralWidget(walletFrame); toolbarGUI20 = new GUIMenuToolbarWidget( this );
connect( toolbarGUI20, SIGNAL( signalItemClicked( GUIMenuToolbarControl::EMenuToolbarItemTypes ) ), this, SLOT( slotMenuToolbarItemClicked( GUIMenuToolbarControl::EMenuToolbarItemTypes ) ), Qt::UniqueConnection );
// envelope them in another widget
QWidget* pCentralWidget = new QWidget( this );
QVBoxLayout* pBoxLayout = new QVBoxLayout();
pBoxLayout->addWidget( toolbarGUI20->dockQmlToWidget() );
pBoxLayout->addWidget( walletFrame );
pCentralWidget->setLayout( pBoxLayout );
// and make it the central widget
setCentralWidget(pCentralWidget);
// Accept D&D of URIs // Accept D&D of URIs
setAcceptDrops(true); setAcceptDrops(true);
@@ -92,7 +111,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent) :
createMenuBar(); createMenuBar();
// Create the toolbars // Create the toolbars
createToolBars(); // createToolBars();
// Create system tray icon and notification // Create system tray icon and notification
createTrayIcon(); createTrayIcon();
@@ -149,6 +168,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent) :
// Initially wallet actions should be disabled // Initially wallet actions should be disabled
setWalletActionsEnabled(false); setWalletActionsEnabled(false);
} }
BitcoinGUI::~BitcoinGUI() BitcoinGUI::~BitcoinGUI()
@@ -201,6 +221,20 @@ void BitcoinGUI::createActions()
addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); addressBookAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5));
tabGroup->addAction(addressBookAction); tabGroup->addAction(addressBookAction);
pryptoRedeemAction = new QAction(QIcon(":/icons/receive"), tr("&Prypto Redeem"), this);
pryptoRedeemAction->setStatusTip(tr("Redeem the value of a Prypto card to your wallet"));
pryptoRedeemAction->setToolTip(pryptoRedeemAction->statusTip());
pryptoRedeemAction->setCheckable(true);
pryptoRedeemAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_6));
tabGroup->addAction(pryptoRedeemAction);
infoPageAction = new QAction(QIcon(":/icons/bitcoin"), tr("&Information"), this);
infoPageAction->setStatusTip(tr("Show all Casinocoin related information"));
infoPageAction->setToolTip(infoPageAction->statusTip());
infoPageAction->setCheckable(true);
infoPageAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_7));
tabGroup->addAction(infoPageAction);
connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
@@ -211,6 +245,10 @@ void BitcoinGUI::createActions()
connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
connect(pryptoRedeemAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(pryptoRedeemAction, SIGNAL(triggered()), this, SLOT(gotoPryptoPage()));
connect(infoPageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
connect(infoPageAction, SIGNAL(triggered()), this, SLOT(gotoInfoPage()));
quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
quitAction->setStatusTip(tr("Quit application")); quitAction->setStatusTip(tr("Quit application"));
@@ -286,17 +324,6 @@ void BitcoinGUI::createMenuBar()
help->addAction(aboutQtAction); help->addAction(aboutQtAction);
} }
void BitcoinGUI::createToolBars()
{
QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolbar->addAction(overviewAction);
toolbar->addAction(sendCoinsAction);
toolbar->addAction(receiveCoinsAction);
toolbar->addAction(historyAction);
toolbar->addAction(addressBookAction);
}
void BitcoinGUI::setClientModel(ClientModel *clientModel) void BitcoinGUI::setClientModel(ClientModel *clientModel)
{ {
this->clientModel = clientModel; this->clientModel = clientModel;
@@ -318,7 +345,6 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
trayIcon->setToolTip(trayIcon->toolTip() + QString(" ") + tr("[testnet]")); trayIcon->setToolTip(trayIcon->toolTip() + QString(" ") + tr("[testnet]"));
trayIcon->setIcon(QIcon(":/icons/toolbar_testnet")); trayIcon->setIcon(QIcon(":/icons/toolbar_testnet"));
} }
toggleHideAction->setIcon(QIcon(":/icons/toolbar_testnet")); toggleHideAction->setIcon(QIcon(":/icons/toolbar_testnet"));
aboutAction->setIcon(QIcon(":/icons/toolbar_testnet")); aboutAction->setIcon(QIcon(":/icons/toolbar_testnet"));
} }
@@ -371,6 +397,8 @@ void BitcoinGUI::setWalletActionsEnabled(bool enabled)
signMessageAction->setEnabled(enabled); signMessageAction->setEnabled(enabled);
verifyMessageAction->setEnabled(enabled); verifyMessageAction->setEnabled(enabled);
addressBookAction->setEnabled(enabled); addressBookAction->setEnabled(enabled);
pryptoRedeemAction->setEnabled(enabled);
infoPageAction->setEnabled(enabled);
} }
void BitcoinGUI::createTrayIcon() void BitcoinGUI::createTrayIcon()
@@ -467,34 +495,61 @@ void BitcoinGUI::optionsClicked()
void BitcoinGUI::aboutClicked() void BitcoinGUI::aboutClicked()
{ {
if ( toolbarGUI20 ) toolbarGUI20->SetCurrentItemType( GUIMenuToolbarControl::INFO );
AboutDialog dlg; AboutDialog dlg;
dlg.setModel(clientModel); dlg.setModel(clientModel);
dlg.exec(); dlg.exec();
} }
// TODO
//void BitcoinGUI::redeemPryptoClicked()
//{
// if ( menuBar_new ) menuBar_new->SetCurrentItemType( GUIMenuToolbarControl::INFO );
// RedeemPryptoDialog dlg;
// dlg.setModel(clientModel);
// dlg.exec();
//}
void BitcoinGUI::gotoOverviewPage() void BitcoinGUI::gotoOverviewPage()
{ {
if (walletFrame) walletFrame->gotoOverviewPage(); if (walletFrame) walletFrame->gotoOverviewPage();
if ( toolbarGUI20 ) toolbarGUI20->SetCurrentItemType( GUIMenuToolbarControl::OVERVIEW );
} }
void BitcoinGUI::gotoHistoryPage() void BitcoinGUI::gotoHistoryPage()
{ {
if (walletFrame) walletFrame->gotoHistoryPage(); if (walletFrame) walletFrame->gotoHistoryPage();
if ( toolbarGUI20 ) toolbarGUI20->SetCurrentItemType( GUIMenuToolbarControl::TRANSACTIONS );
} }
void BitcoinGUI::gotoAddressBookPage() void BitcoinGUI::gotoAddressBookPage()
{ {
if (walletFrame) walletFrame->gotoAddressBookPage(); if (walletFrame) walletFrame->gotoAddressBookPage();
if ( toolbarGUI20 ) toolbarGUI20->SetCurrentItemType( GUIMenuToolbarControl::CONTACTS );
}
void BitcoinGUI::gotoPryptoPage()
{
if (walletFrame) walletFrame->gotoPryptoPage();
if ( toolbarGUI20 ) toolbarGUI20->SetCurrentItemType( GUIMenuToolbarControl::REDEEM_PRYPTO );
}
void BitcoinGUI::gotoInfoPage()
{
if (walletFrame) walletFrame->gotoInfoPage();
if ( toolbarGUI20 ) toolbarGUI20->SetCurrentItemType( GUIMenuToolbarControl::INFO );
} }
void BitcoinGUI::gotoReceiveCoinsPage() void BitcoinGUI::gotoReceiveCoinsPage()
{ {
if (walletFrame) walletFrame->gotoReceiveCoinsPage(); if (walletFrame) walletFrame->gotoReceiveCoinsPage();
if ( toolbarGUI20 ) toolbarGUI20->SetCurrentItemType( GUIMenuToolbarControl::RECEIVE );
} }
void BitcoinGUI::gotoSendCoinsPage(QString addr) void BitcoinGUI::gotoSendCoinsPage(QString addr)
{ {
if (walletFrame) walletFrame->gotoSendCoinsPage(addr); if (walletFrame) walletFrame->gotoSendCoinsPage(addr);
if ( toolbarGUI20 ) toolbarGUI20->SetCurrentItemType( GUIMenuToolbarControl::SEND );
} }
void BitcoinGUI::gotoSignMessageTab(QString addr) void BitcoinGUI::gotoSignMessageTab(QString addr)
@@ -837,3 +892,45 @@ void BitcoinGUI::detectShutdown()
if (ShutdownRequested()) if (ShutdownRequested())
QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection); QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection);
} }
void BitcoinGUI::slotMenuToolbarItemClicked( GUIMenuToolbarControl::EMenuToolbarItemTypes a_eType )
{
switch( a_eType )
{
case GUIMenuToolbarControl::OVERVIEW:
{
emit overviewAction->triggered();
break;
}
case GUIMenuToolbarControl::SEND:
{
emit sendCoinsAction->triggered();
break;
}
case GUIMenuToolbarControl::RECEIVE:
{
emit receiveCoinsAction->triggered();
break;
}
case GUIMenuToolbarControl::TRANSACTIONS:
{
emit historyAction->triggered();
break;
}
case GUIMenuToolbarControl::CONTACTS:
{
emit addressBookAction->triggered();
break;
}
case GUIMenuToolbarControl::REDEEM_PRYPTO:
{
emit pryptoRedeemAction->triggered();
break;
}
case GUIMenuToolbarControl::INFO:
{
emit infoPageAction->triggered();
break;
}
}
}

View File

@@ -5,6 +5,8 @@
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include <QMap> #include <QMap>
#include "qtquick_controls/cpp/guimenutoolbarcontrol.h"
class TransactionTableModel; class TransactionTableModel;
class WalletFrame; class WalletFrame;
class WalletView; class WalletView;
@@ -19,6 +21,8 @@ class SignVerifyMessageDialog;
class Notificator; class Notificator;
class RPCConsole; class RPCConsole;
class GUIMenuToolbarWidget;
class CWallet; class CWallet;
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@@ -65,6 +69,8 @@ public:
QAction * getOverviewAction() { return overviewAction; } QAction * getOverviewAction() { return overviewAction; }
QAction * getHistoryAction() { return historyAction; } QAction * getHistoryAction() { return historyAction; }
QAction * getAddressBookAction() { return addressBookAction; } QAction * getAddressBookAction() { return addressBookAction; }
QAction * getPryptoRedeemAction() { return pryptoRedeemAction; }
QAction * getInfoPageAction() { return infoPageAction; }
QAction * getReceiveCoinsAction() { return receiveCoinsAction; } QAction * getReceiveCoinsAction() { return receiveCoinsAction; }
QAction * getSendCoinsAction() { return sendCoinsAction; } QAction * getSendCoinsAction() { return sendCoinsAction; }
@@ -78,6 +84,7 @@ protected:
private: private:
ClientModel *clientModel; ClientModel *clientModel;
WalletFrame *walletFrame; WalletFrame *walletFrame;
GUIMenuToolbarWidget *toolbarGUI20;
QLabel *labelEncryptionIcon; QLabel *labelEncryptionIcon;
QLabel *labelConnectionsIcon; QLabel *labelConnectionsIcon;
@@ -102,6 +109,8 @@ private:
QAction *changePassphraseAction; QAction *changePassphraseAction;
QAction *aboutQtAction; QAction *aboutQtAction;
QAction *openRPCConsoleAction; QAction *openRPCConsoleAction;
QAction *pryptoRedeemAction;
QAction *infoPageAction;
QSystemTrayIcon *trayIcon; QSystemTrayIcon *trayIcon;
Notificator *notificator; Notificator *notificator;
@@ -116,8 +125,6 @@ private:
void createActions(); void createActions();
/** Create the menu bar and sub-menus. */ /** Create the menu bar and sub-menus. */
void createMenuBar(); void createMenuBar();
/** Create the toolbars */
void createToolBars();
/** Create system tray icon and notification */ /** Create system tray icon and notification */
void createTrayIcon(); void createTrayIcon();
/** Create system tray menu (or setup the dock menu) */ /** Create system tray menu (or setup the dock menu) */
@@ -169,10 +176,14 @@ private slots:
void gotoHistoryPage(); void gotoHistoryPage();
/** Switch to address book page */ /** Switch to address book page */
void gotoAddressBookPage(); void gotoAddressBookPage();
/** Switch to redeem prypto page */
void gotoPryptoPage();
/** Switch to receive coins page */ /** Switch to receive coins page */
void gotoReceiveCoinsPage(); void gotoReceiveCoinsPage();
/** Switch to send coins page */ /** Switch to send coins page */
void gotoSendCoinsPage(QString addr = ""); void gotoSendCoinsPage(QString addr = "");
/** Switch to info page */
void gotoInfoPage();
/** Show Sign/Verify Message dialog and switch to sign message tab */ /** Show Sign/Verify Message dialog and switch to sign message tab */
void gotoSignMessageTab(QString addr = ""); void gotoSignMessageTab(QString addr = "");
@@ -195,6 +206,9 @@ private slots:
/** called by a timer to check if fRequestShutdown has been set **/ /** called by a timer to check if fRequestShutdown has been set **/
void detectShutdown(); void detectShutdown();
/** called from new Qml menu toolbar on user click **/
void slotMenuToolbarItemClicked( GUIMenuToolbarControl::EMenuToolbarItemTypes a_eType );
}; };
#endif // BITCOINGUI_H #endif // BITCOINGUI_H

429
src/qt/cscfusionstyle.cpp Normal file
View File

@@ -0,0 +1,429 @@
#include <QtWidgets>
#include "cscfusionstyle.h"
#include "gui20_skin.h"
CSCFusionStyle::CSCFusionStyle() :
QProxyStyle(QStyleFactory::create("fusion"))
{
}
void CSCFusionStyle::polish(QPalette &palette)
{
GUI20Skin& skin = GUI20Skin::Instance();
QLinearGradient buttonGradient;
buttonGradient.setColorAt( 0, skin.GetColorButtonTopGradient() );
buttonGradient.setColorAt( 1, skin.GetColorButtonBottomGradient() );
QLinearGradient toolTipGradient;
toolTipGradient.setColorAt( 0, skin.GetColorToolbarMainGradientBegin() );
toolTipGradient.setColorAt( 1, skin.GetColorToolbarMainGradientEnd() );
palette = QPalette();
palette.setBrush( QPalette::Active, QPalette::Text, skin.GetColorTextActive() );
palette.setBrush( QPalette::Active, QPalette::BrightText, skin.GetColorTextActiveAutocomplete() );
palette.setBrush( QPalette::Active, QPalette::Base, skin.GetColorFrameBackground() );
palette.setBrush( QPalette::Active, QPalette::AlternateBase, skin.GetColorListValueAlternative() );
palette.setBrush( QPalette::Active, QPalette::Highlight, skin.GetColorListCurrent() );
palette.setBrush( QPalette::Active, QPalette::HighlightedText, skin.GetColorTextActive() );
palette.setBrush( QPalette::Active, QPalette::Button, skin.GetColorButtonBottomGradient() );
palette.setBrush( QPalette::Active, QPalette::ButtonText, skin.GetColorTextActive() );
palette.setBrush( QPalette::Active, QPalette::Mid, skin.GetColorButtonMid() );
palette.setBrush( QPalette::Active, QPalette::Dark, skin.GetColorButtonDark() );
palette.setBrush( QPalette::Active, QPalette::Light, skin.GetColorButtonLight() );
palette.setBrush( QPalette::Active, QPalette::Window, skin.GetColorWindowBackground() );
palette.setBrush( QPalette::Inactive, QPalette::Text, skin.GetColorTextDisabled() );
palette.setBrush( QPalette::Inactive, QPalette::BrightText, skin.GetColorTextDisabledAutocomplete() );
palette.setBrush( QPalette::Inactive, QPalette::Base, skin.GetColorFrameBackground() );
palette.setBrush( QPalette::Inactive, QPalette::AlternateBase, skin.GetColorListValueAlternative() );
palette.setBrush( QPalette::Inactive, QPalette::Highlight, skin.GetColorListCurrent() );
palette.setBrush( QPalette::Inactive, QPalette::HighlightedText, skin.GetColorTextDisabled() );
palette.setBrush( QPalette::Inactive, QPalette::Button, skin.GetColorButtonBottomGradient() );
palette.setBrush( QPalette::Inactive, QPalette::ButtonText, skin.GetColorTextDisabled() );
palette.setBrush( QPalette::Inactive, QPalette::Mid, skin.GetColorButtonMid() );
palette.setBrush( QPalette::Inactive, QPalette::Dark, skin.GetColorButtonDark() );
palette.setBrush( QPalette::Inactive, QPalette::Light, skin.GetColorButtonLight() );
palette.setBrush( QPalette::Inactive, QPalette::Window, skin.GetColorWindowBackground() );
palette.setBrush( QPalette::Inactive, QPalette::ToolTipBase, toolTipGradient );
palette.setBrush( QPalette::Inactive, QPalette::ToolTipText, skin.GetColorToolbarMainTextCurrent() );
palette.setBrush( QPalette::Disabled, QPalette::Text, skin.GetColorTextDisabled() );
palette.setBrush( QPalette::Disabled, QPalette::BrightText, skin.GetColorTextDisabledAutocomplete() );
palette.setBrush( QPalette::Disabled, QPalette::Base, skin.GetColorFrameBackground() );
palette.setBrush( QPalette::Disabled, QPalette::AlternateBase, skin.GetColorListValueAlternative() );
palette.setBrush( QPalette::Disabled, QPalette::Highlight, skin.GetColorListCurrent() );
palette.setBrush( QPalette::Disabled, QPalette::HighlightedText, skin.GetColorTextDisabled() );
palette.setBrush( QPalette::Disabled, QPalette::Button, skin.GetColorButtonBottomGradient() );
palette.setBrush( QPalette::Disabled, QPalette::ButtonText, skin.GetColorTextDisabled() );
palette.setBrush( QPalette::Disabled, QPalette::Mid, skin.GetColorButtonMid() );
palette.setBrush( QPalette::Disabled, QPalette::Dark, skin.GetColorButtonDark() );
palette.setBrush( QPalette::Disabled, QPalette::Light, skin.GetColorButtonLight() );
palette.setBrush( QPalette::Disabled, QPalette::Window, skin.GetColorWindowBackground() );
}
void CSCFusionStyle::polish(QWidget *widget)
{
if ( qobject_cast<QPushButton *>(widget)
|| qobject_cast<QComboBox *>(widget)
)
{
widget->setAttribute(Qt::WA_Hover, true);
}
}
void CSCFusionStyle::unpolish(QWidget *widget)
{
if ( qobject_cast<QPushButton *>(widget)
|| qobject_cast<QComboBox *>(widget)
)
{
widget->setAttribute(Qt::WA_Hover, false);
}
}
int CSCFusionStyle::pixelMetric(PixelMetric metric,
const QStyleOption *option,
const QWidget *widget) const
{
switch (metric)
{
case PM_DefaultFrameWidth:
case PM_ComboBoxFrameWidth:
case PM_SpinBoxFrameWidth:
case PM_CheckBoxLabelSpacing:
case PM_HeaderMargin:
{
return 8;
}
case PM_IndicatorHeight:
case PM_IndicatorWidth:
case PM_ExclusiveIndicatorWidth:
case PM_ExclusiveIndicatorHeight:
{
return 18;
}
case PM_ScrollBarExtent:
{
return QProxyStyle::pixelMetric(metric, option, widget) + 4;
}
case PM_ToolTipLabelFrameWidth:
{
return 6;
}
default:
{
return QProxyStyle::pixelMetric(metric, option, widget);
}
}
}
int CSCFusionStyle::styleHint(StyleHint hint, const QStyleOption *option,
const QWidget *widget,
QStyleHintReturn *returnData) const
{
switch (hint)
{
case SH_DitherDisabledText:
{
return int(false);
}
case SH_EtchDisabledText:
{
return int(true);
}
default:
{
return QProxyStyle::styleHint(hint, option, widget, returnData);
}
}
}
void CSCFusionStyle::drawPrimitive(PrimitiveElement element,
const QStyleOption *option,
QPainter *painter,
const QWidget *widget) const
{
GUI20Skin& skin = GUI20Skin::Instance();
switch (element)
{
case PE_FrameDefaultButton:
{
return;
}
case PE_FrameFocusRect:
{
return;
}
case PE_PanelItemViewRow:
{
QPainterPath roundRect = roundRectPath(option->rect, 0);
QBrush brush = option->palette.base();
painter->save();
painter->setRenderHint(QPainter::Antialiasing, true);
painter->fillPath(roundRect, brush);
painter->restore();
break;
}
// case PE_IndicatorArrowDown:
// case PE_IndicatorArrowUp:
// case PE_IndicatorArrowLeft:
// case PE_IndicatorArrowRight:
// {
// int x, y, width, height;
// option->rect.getRect(&x, &y, &width, &height);
// painter->save();
// painter->setRenderHint(QPainter::Antialiasing, true);
// QImage imgArrow;
// QString strPath = ":/icons/advertsArrow";
// if ( element == PE_IndicatorArrowDown || PE_IndicatorSpinDown || PE_IndicatorSpinMinus )
// {
// strPath.append( "Down" );
// }
// else if ( element == PE_IndicatorArrowLeft )
// {
// strPath.append( "Left" );
// }
// else if ( element == PE_IndicatorArrowUp || PE_IndicatorSpinUp || PE_IndicatorSpinPlus )
// {
// strPath.append( "Up" );
// }
// else if ( element == PE_IndicatorArrowRight )
// {
// strPath.append( "Right" );
// }
// if ( option->state & QStyle::State_MouseOver )
// {
// strPath.append( "Hover" );
// }
// qDebug() << "gonna draw: " << strPath;
// imgArrow.load( strPath );
// int iTopLeftX = x + ( ( ( width - imgArrow.width() ) / 2 ) );
// int iTopLeftY = y + ( ( ( height - imgArrow.height() ) / 2 ) );
// painter->drawImage( QPoint( iTopLeftX, iTopLeftY), imgArrow );
// painter->restore();
// break;
// }
case PE_FrameGroupBox:
case PE_FrameWindow:
case PE_Frame:
{
int x, y, width, height;
option->rect.getRect(&x, &y, &width, &height);
QPainterPath roundRect = roundRectPath(option->rect, 5);
QBrush brush = option->palette.base();
painter->save();
painter->setRenderHint(QPainter::Antialiasing, true);
painter->fillPath(roundRect, brush);
painter->restore();
break;
}
case PE_IndicatorRadioButton:
{
int x, y, width, height;
option->rect.getRect(&x, &y, &width, &height);
QPainterPath roundRect = roundRectPath( QRect( x + 1, y + 1, width - 1, height - 1 ), ( width -1 ) / 2);
QPen pen( skin.GetColorToolbarMainGradientBegin(), 2 );
painter->save();
painter->setPen( pen );
painter->setRenderHint(QPainter::Antialiasing, true);
painter->drawPath( roundRect );
if ( option->state & QStyle::State_Off )
{
}
else if ( option->state & QStyle::State_On )
{
QImage checkboxTick( ":/icons/radiobuttonTick" );
checkboxTick = checkboxTick.scaled( 10, 10 );
int iTopLeftX = x + ( ( ( width - checkboxTick.width() ) / 2 ) );
int iTopLeftY = y + ( ( ( height - checkboxTick.height() ) / 2 ) );
painter->drawImage( QPoint( iTopLeftX, iTopLeftY ), checkboxTick );
}
painter->restore();
break;
}
case PE_IndicatorCheckBox:
{
int x, y, width, height;
option->rect.getRect(&x, &y, &width, &height);
QPainterPath roundRect = roundRectPath( QRect( x + 1, y + 1, width - 1, height - 1 ), 2 );
QPen pen( skin.GetColorToolbarMainGradientBegin(), 2 );
painter->save();
painter->setPen( pen );
painter->setRenderHint(QPainter::Antialiasing, true);
painter->drawPath( roundRect );
if ( option->state & QStyle::State_Off )
{
}
else if ( option->state & QStyle::State_On )
{
QImage checkboxTick( ":/icons/checkboxTick" );
int iTopLeftX = x + ( ( ( width - checkboxTick.width() ) / 2 ) );
int iTopLeftY = y + ( ( ( height - checkboxTick.height() ) / 2 ) );
painter->drawImage( QPoint( iTopLeftX, iTopLeftY ), checkboxTick );
}
painter->restore();
break;
}
case PE_PanelButtonCommand:
{
GUI20Skin& skin = GUI20Skin::Instance();
int delta = (option->state & State_MouseOver) ? 64 : 0;
QColor semiTransparentWhite = skin.GetColorButtonLight();
semiTransparentWhite.setAlpha(127 + delta);
QColor semiTransparentBlack = skin.GetColorButtonDark();
semiTransparentBlack.setAlpha(127 - delta);
int x, y, width, height;
option->rect.getRect(&x, &y, &width, &height);
int radius = 5;
QPainterPath roundRect = roundRectPath( QRect( x + 1, y + 1, width - 1, height - 1 ), radius );
QBrush brush;
if (option->state & (State_Sunken | State_On))
{
brush = option->palette.mid();
}
else
{
brush = option->palette.button();
}
painter->save();
painter->setRenderHint(QPainter::Antialiasing, true);
painter->fillPath(roundRect, brush);
int penWidth;
if (radius < 10)
{
penWidth = 3;
}
else if (radius < 20)
{
penWidth = 5;
}
else
{
penWidth = 7;
}
QPen topPen(semiTransparentWhite, penWidth);
QPen bottomPen(semiTransparentBlack, penWidth);
if (option->state & (State_Sunken | State_On))
{
qSwap(topPen, bottomPen);
}
int x1 = x;
int x2 = x + radius;
int x3 = x + width - radius;
int x4 = x + width;
if (option->direction == Qt::RightToLeft)
{
qSwap(x1, x4);
qSwap(x2, x3);
}
QPolygon topHalf;
topHalf << QPoint(x1, y)
<< QPoint(x4, y)
<< QPoint(x3, y + radius)
<< QPoint(x2, y + height - radius)
<< QPoint(x1, y + height);
painter->setClipPath(roundRect);
painter->setClipRegion(topHalf, Qt::IntersectClip);
painter->setPen(topPen);
painter->drawPath(roundRect);
QPolygon bottomHalf = topHalf;
bottomHalf[0] = QPoint(x4, y + height);
painter->setClipPath(roundRect);
painter->setClipRegion(bottomHalf, Qt::IntersectClip);
painter->setPen(bottomPen);
painter->drawPath(roundRect);
painter->setPen(option->palette.foreground().color());
painter->setClipping(false);
painter->drawPath(roundRect);
painter->restore();
break;
}
default:
{
QProxyStyle::drawPrimitive(element, option, painter, widget);
}
}
}
void CSCFusionStyle::drawControl(ControlElement element,
const QStyleOption *option,
QPainter *painter,
const QWidget *widget) const
{
switch (element)
{
case CE_PushButtonLabel:
{
QStyleOptionButton myButtonOption;
const QStyleOptionButton *buttonOption =
qstyleoption_cast<const QStyleOptionButton *>(option);
if (buttonOption)
{
myButtonOption = *buttonOption;
if (myButtonOption.palette.currentColorGroup() != QPalette::Disabled)
{
if (myButtonOption.state & (State_Sunken | State_On))
{
myButtonOption.palette.setBrush(QPalette::ButtonText,
myButtonOption.palette.brightText());
}
}
}
QProxyStyle::drawControl(element, &myButtonOption, painter, widget);
break;
}
default:
{
QProxyStyle::drawControl(element, option, painter, widget);
break;
}
}
}
QPainterPath CSCFusionStyle::roundRectPath(const QRect &rect, int radius)
{
int diam = 2 * radius;
int x1, y1, x2, y2;
rect.getCoords(&x1, &y1, &x2, &y2);
QPainterPath path;
path.moveTo(x2, y1 + radius);
path.arcTo(QRect(x2 - diam, y1, diam, diam), 0.0, +90.0);
path.lineTo(x1 + radius, y1);
path.arcTo(QRect(x1, y1, diam, diam), 90.0, +90.0);
path.lineTo(x1, y2 - radius);
path.arcTo(QRect(x1, y2 - diam, diam, diam), 180.0, +90.0);
path.lineTo(x1 + radius, y2);
path.arcTo(QRect(x2 - diam, y2 - diam, diam, diam), 270.0, +90.0);
path.closeSubpath();
return path;
}

77
src/qt/cscfusionstyle.h Normal file
View File

@@ -0,0 +1,77 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CSCFUSIONSTYLE_H
#define CSCFUSIONSTYLE_H
#include <QProxyStyle>
#include <QPalette>
QT_BEGIN_NAMESPACE
class QPainterPath;
QT_END_NAMESPACE
//! [0]
class CSCFusionStyle : public QProxyStyle
{
Q_OBJECT
public:
CSCFusionStyle();
void polish(QPalette &palette) Q_DECL_OVERRIDE;
void polish(QWidget *widget) Q_DECL_OVERRIDE;
void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
int pixelMetric(PixelMetric metric, const QStyleOption *option,
const QWidget *widget) const Q_DECL_OVERRIDE;
int styleHint(StyleHint hint, const QStyleOption *option,
const QWidget *widget, QStyleHintReturn *returnData) const Q_DECL_OVERRIDE;
void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
void drawControl(ControlElement control, const QStyleOption *option,
QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
private:
static QPainterPath roundRectPath(const QRect &rect, int radius);
};
//! [0]
#endif

116
src/qt/currencies.cpp Normal file
View File

@@ -0,0 +1,116 @@
#include "currencies.h"
#include <QStringList>
#include <QLocale>
Currencies::Currencies(QObject *parent):
QAbstractListModel(parent),
currencylist(availableCurrencies())
{
}
QList<Currencies::FiatCurrencyID> Currencies::availableCurrencies()
{
QList<Currencies::FiatCurrencyID> currencylist;
currencylist.append(USD);
currencylist.append(EUR);
currencylist.append(CNY);
currencylist.append(JPY);
currencylist.append(RUB);
return currencylist;
}
bool Currencies::valid(int currency)
{
switch(currency)
{
case USD:
case EUR:
case CNY:
case JPY:
case RUB:
return true;
default:
return false;
}
}
QString Currencies::name(int currency)
{
switch(currency)
{
case USD: return QString("USD");
case EUR: return QString("EUR");
case CNY: return QString("CNY");
case JPY: return QString("JPY");
case RUB: return QString("RUB");
default: return QString("???");
}
}
QString Currencies::description(int currency)
{
switch(currency)
{
case USD: return QString("US Dollars");
case EUR: return QString("European Euro");
case CNY: return QString("Chinese Yuan");
case JPY: return QString("Japanese Yen");
case RUB: return QString("Russian Ruble");
default: return QString("???");
}
}
QString Currencies::symbol(int currency)
{
switch(currency)
{
case USD: return QString("$");
case EUR: return QString("");
case CNY: return QString("¥");
case JPY: return QString("¥");
case RUB: return QString("");
default: return QString("$");
}
}
QString Currencies::format(int currency, double value, bool useSymbol)
{
// divide by satoshi
double fiatValue = value * 0.00000001;
QString formattedValue = "";
if(useSymbol)
{
formattedValue.append(symbol(currency)).append(" ");
}
// apply format
QLocale::setDefault( QLocale(QLocale::English, QLocale::UnitedStates) );
formattedValue.append(QString("%L1").arg(fiatValue, 0, 'f', 2)).append(" ").append(name(currency));
return formattedValue;
}
int Currencies::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return currencylist.size();
}
QVariant Currencies::data(const QModelIndex &index, int role) const
{
int row = index.row();
if(row >= 0 && row < currencylist.size())
{
FiatCurrencyID currency = currencylist.at(row);
switch(role)
{
case Qt::EditRole:
case Qt::DisplayRole:
return QVariant(name(currency));
case Qt::ToolTipRole:
return QVariant(description(currency));
case CurrencyRole:
return QVariant(static_cast<int>(currency));
}
}
return QVariant();
}

50
src/qt/currencies.h Normal file
View File

@@ -0,0 +1,50 @@
#ifndef CURRENCIES_H
#define CURRENCIES_H
#include <QAbstractListModel>
class Currencies : public QAbstractListModel
{
Q_OBJECT
public:
explicit Currencies(QObject *parent);
enum FiatCurrencyID {
USD,
EUR,
CNY,
JPY,
RUB,
};
//! Get list of currencies, for drop-down box
static QList<FiatCurrencyID> availableCurrencies();
//! Is currency ID valid?
static bool valid(int currency);
//! Short name
static QString name(int currency);
//! Longer description
static QString description(int unit);
//! symbol
static QString symbol(int currency);
//! Format value
static QString format(int currency, double value, bool symbol);
//! @name AbstractListModel implementation
//! List model for currency drop-down selection box.
///@{
enum RoleIndex {
/** Currency identifier */
CurrencyRole = Qt::UserRole
};
int rowCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
///@}
private:
QList<Currencies::FiatCurrencyID> currencylist;
};
typedef Currencies::FiatCurrencyID Currency;
#endif // CURRENCIES_H

View File

@@ -6,53 +6,15 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>760</width> <width>993</width>
<height>380</height> <height>380</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Address Book</string> <string>Address Book</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QGridLayout" name="gridLayout">
<item> <item row="1" column="0">
<widget class="QLabel" name="labelExplanation">
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QTableView" name="tableView">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="toolTip">
<string>Double-click to edit address or label</string>
</property>
<property name="tabKeyNavigation">
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QPushButton" name="newAddress"> <widget class="QPushButton" name="newAddress">
@@ -153,6 +115,17 @@
<property name="toolTip"> <property name="toolTip">
<string>Export the data in the current tab to a file</string> <string>Export the data in the current tab to a file</string>
</property> </property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(170, 28, 33);
color: rgb(255, 255, 255);
pressed
{
background-color: rgb(166, 27, 31);
}</string>
</property>
<property name="text"> <property name="text">
<string>&amp;Export</string> <string>&amp;Export</string>
</property> </property>
@@ -160,6 +133,12 @@
<iconset resource="../bitcoin.qrc"> <iconset resource="../bitcoin.qrc">
<normaloff>:/icons/export</normaloff>:/icons/export</iconset> <normaloff>:/icons/export</normaloff>:/icons/export</iconset>
</property> </property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@@ -177,6 +156,59 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="3" column="0">
<widget class="QTableView" name="tableView">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="toolTip">
<string>Double-click to edit address or label</string>
</property>
<property name="tabKeyNavigation">
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
<item row="2" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="labelExplanation">
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources>

550
src/qt/forms/infopage.ui Normal file
View File

@@ -0,0 +1,550 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>InfoPage</class>
<widget class="QDialog" name="InfoPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>480</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>800</width>
<height>480</height>
</size>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>15</number>
</property>
<property name="topMargin">
<number>15</number>
</property>
<property name="rightMargin">
<number>15</number>
</property>
<property name="bottomMargin">
<number>15</number>
</property>
<property name="horizontalSpacing">
<number>15</number>
</property>
<item row="1" column="0">
<widget class="QFrame" name="exchangeInfoBox">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayoutExchanges"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblExchangesHeader">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(166, 27, 31);</string>
</property>
<property name="text">
<string>Exchanges</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QFrame" name="coinInfoBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="lblInformationHeader">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(166, 27, 31);</string>
</property>
<property name="text">
<string>Information</string>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QFormLayout" name="formCoinDetails">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="horizontalSpacing">
<number>15</number>
</property>
<property name="verticalSpacing">
<number>10</number>
</property>
<property name="leftMargin">
<number>10</number>
</property>
<property name="topMargin">
<number>10</number>
</property>
<property name="rightMargin">
<number>10</number>
</property>
<property name="bottomMargin">
<number>10</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="lblBlockHeight">
<property name="font">
<font>
<kerning>true</kerning>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Current number of blocks</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="txtBlockHeight">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblLastBlockTime">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Last block time</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="txtLastBlockTime">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lblCoinSupply">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Coin Supply</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="txtCoinSupply">
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Button">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Text">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lblConnections">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Number of connections</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="txtConnections">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="lblDifficulty">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Difficulty</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="txtDifficulty">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lblHashRate">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Network Hashrate</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="txtHashRate">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="lblTransactionCount">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Transactions</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="txtTransactionCount">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string notr="true">-</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -16,20 +16,23 @@
<property name="modal"> <property name="modal">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QGridLayout" name="gridLayout_2">
<item> <item row="0" column="0">
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="tabPosition"> <property name="tabPosition">
<enum>QTabWidget::North</enum> <enum>QTabWidget::North</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>3</number>
</property> </property>
<widget class="QWidget" name="tabMain"> <widget class="QWidget" name="tabMain">
<attribute name="title"> <attribute name="title">
<string>&amp;Main</string> <string>&amp;Main</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_Main"> <layout class="QVBoxLayout" name="verticalLayout_Main">
<item>
<widget class="QFrame" name="verticalFrame1">
<layout class="QVBoxLayout" name="verticalLayout_6">
<item> <item>
<widget class="QLabel" name="transactionFeeInfoLabel"> <widget class="QLabel" name="transactionFeeInfoLabel">
<property name="text"> <property name="text">
@@ -43,7 +46,11 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QFrame" name="frameTransactionFee">
<layout class="QHBoxLayout" name="horizontalLayout_1_Main"> <layout class="QHBoxLayout" name="horizontalLayout_1_Main">
<item> <item>
<widget class="QLabel" name="transactionFeeLabel"> <widget class="QLabel" name="transactionFeeLabel">
@@ -61,31 +68,28 @@
<item> <item>
<widget class="BitcoinAmountField" name="transactionFee"/> <widget class="BitcoinAmountField" name="transactionFee"/>
</item> </item>
<item>
<spacer name="horizontalSpacer_1_Main">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget>
</item> </item>
<item>
<widget class="QFrame" name="verticalFrame2">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<widget class="QCheckBox" name="bitcoinAtStartup"> <widget class="QCheckBox" name="bitcoinAtStartup">
<property name="toolTip"> <property name="toolTip">
<string>Automatically start CasinoCoin after logging in to the system.</string> <string>Automatically start CasinoCoin after logging in to the system.</string>
</property> </property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text"> <property name="text">
<string>&amp;Start CasinoCoin on system login</string> <string>&amp;Start CasinoCoin on system login</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_Main"> <spacer name="verticalSpacer_Main">
<property name="orientation"> <property name="orientation">
@@ -100,6 +104,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QFrame" name="frameResetOptions">
<layout class="QHBoxLayout" name="horizontalLayout_2_Main"> <layout class="QHBoxLayout" name="horizontalLayout_2_Main">
<item> <item>
<spacer name="horizontalSpacer_2_Main"> <spacer name="horizontalSpacer_2_Main">
@@ -128,6 +133,7 @@
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -137,15 +143,8 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_Network"> <layout class="QVBoxLayout" name="verticalLayout_Network">
<item> <item>
<widget class="QCheckBox" name="mapPortUpnp"> <widget class="QFrame" name="verticalFrame3">
<property name="toolTip"> <layout class="QVBoxLayout" name="verticalLayout_4">
<string>Automatically open the CasinoCoin client port on the router. This only works when your router supports UPnP and it is enabled.</string>
</property>
<property name="text">
<string>Map port using &amp;UPnP</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="connectSocks"> <widget class="QCheckBox" name="connectSocks">
<property name="toolTip"> <property name="toolTip">
@@ -157,8 +156,22 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_Network"> <widget class="QCheckBox" name="mapPortUpnp">
<property name="toolTip">
<string>Automatically open the CasinoCoin client port on the router. This only works when your router supports UPnP and it is enabled.</string>
</property>
<property name="text">
<string>Map port using &amp;UPnP</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QFrame" name="frame">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="proxyIpLabel"> <widget class="QLabel" name="proxyIpLabel">
<property name="text"> <property name="text">
<string>Proxy &amp;IP:</string> <string>Proxy &amp;IP:</string>
@@ -171,20 +184,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QValidatedLineEdit" name="proxyIp">
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>IP address of the proxy (e.g. 127.0.0.1)</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="proxyPortLabel"> <widget class="QLabel" name="proxyPortLabel">
<property name="text"> <property name="text">
<string>&amp;Port:</string> <string>&amp;Port:</string>
@@ -197,20 +197,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="0">
<widget class="QLineEdit" name="proxyPort">
<property name="maximumSize">
<size>
<width>55</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Port of the proxy (e.g. 9050)</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="socksVersionLabel"> <widget class="QLabel" name="socksVersionLabel">
<property name="text"> <property name="text">
<string>SOCKS &amp;Version:</string> <string>SOCKS &amp;Version:</string>
@@ -223,14 +210,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="6">
<widget class="QValueComboBox" name="socksVersion">
<property name="toolTip">
<string>SOCKS version of the proxy (e.g. 5)</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_Network"> <spacer name="horizontalSpacer_Network">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@@ -243,7 +223,41 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="2" column="1">
<widget class="QValueComboBox" name="socksVersion">
<property name="toolTip">
<string>SOCKS version of the proxy (e.g. 5)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QValidatedLineEdit" name="proxyIp">
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>IP address of the proxy (e.g. 127.0.0.1)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="proxyPort">
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Port of the proxy (e.g. 9050)</string>
</property>
</widget>
</item>
</layout> </layout>
</widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_Network"> <spacer name="verticalSpacer_Network">
@@ -265,6 +279,9 @@
<string>&amp;Window</string> <string>&amp;Window</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_Window"> <layout class="QVBoxLayout" name="verticalLayout_Window">
<item>
<widget class="QFrame" name="verticalFrame4">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QCheckBox" name="minimizeToTray"> <widget class="QCheckBox" name="minimizeToTray">
<property name="toolTip"> <property name="toolTip">
@@ -285,6 +302,9 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_Window"> <spacer name="verticalSpacer_Window">
<property name="orientation"> <property name="orientation">
@@ -304,9 +324,15 @@
<attribute name="title"> <attribute name="title">
<string>&amp;Display</string> <string>&amp;Display</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_Display"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QFrame" name="verticalFrame5">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_1_Display"> <layout class="QHBoxLayout" name="horizontalLayout_display_Language">
<property name="sizeConstraint">
<enum>QLayout::SetMaximumSize</enum>
</property>
<item> <item>
<widget class="QLabel" name="langLabel"> <widget class="QLabel" name="langLabel">
<property name="text"> <property name="text">
@@ -330,7 +356,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2_Display"> <layout class="QHBoxLayout" name="horizontalLayout_display_Units">
<item> <item>
<widget class="QLabel" name="unitLabel"> <widget class="QLabel" name="unitLabel">
<property name="text"> <property name="text">
@@ -353,6 +379,33 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_display_Currency">
<item>
<widget class="QLabel" name="currencyLabel">
<property name="text">
<string>Currency to show amounts in:</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item>
<widget class="QValueComboBox" name="currency">
<property name="toolTip">
<string>Choose the default currency in which to show your total coin value.</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="verticalFrame6">
<layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QCheckBox" name="displayAddresses"> <widget class="QCheckBox" name="displayAddresses">
<property name="toolTip"> <property name="toolTip">
@@ -374,23 +427,24 @@
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_Display"> <widget class="QCheckBox" name="displayPromotions">
<property name="orientation"> <property name="toolTip">
<enum>Qt::Vertical</enum> <string>Whether to show casino promotions on the overview page or not.</string>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="text">
<size> <string>Display casino promotions</string>
<width>20</width>
<height>40</height>
</size>
</property> </property>
</spacer> </widget>
</item>
</layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QFrame" name="frameButtonBar">
<layout class="QHBoxLayout" name="horizontalLayout_Buttons"> <layout class="QHBoxLayout" name="horizontalLayout_Buttons">
<item> <item>
<spacer name="horizontalSpacer_1"> <spacer name="horizontalSpacer_1">
@@ -465,25 +519,27 @@
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>QValidatedLineEdit</class>
<extends>QLineEdit</extends>
<header>qvalidatedlineedit.h</header>
</customwidget>
<customwidget> <customwidget>
<class>BitcoinAmountField</class> <class>BitcoinAmountField</class>
<extends>QSpinBox</extends> <extends>QSpinBox</extends>
<header>bitcoinamountfield.h</header> <header>bitcoinamountfield.h</header>
<container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>QValueComboBox</class> <class>QValueComboBox</class>
<extends>QComboBox</extends> <extends>QComboBox</extends>
<header>qvaluecombobox.h</header> <header>qvaluecombobox.h</header>
</customwidget> </customwidget>
<customwidget>
<class>QValidatedLineEdit</class>
<extends>QLineEdit</extends>
<header>qvalidatedlineedit.h</header>
</customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
<connections/> <connections/>

View File

@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>573</width> <width>805</width>
<height>342</height> <height>550</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -31,49 +31,63 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1"> <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <property name="spacing">
<widget class="QFrame" name="frame"> <number>7</number>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property> </property>
<property name="frameShadow"> <item>
<enum>QFrame::Plain</enum> <widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
<width>470</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>470</width>
<height>16777215</height>
</size>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<property name="topMargin">
<number>7</number>
</property>
<property name="bottomMargin">
<number>7</number>
</property>
<item> <item>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<property name="horizontalSpacing">
<number>12</number>
</property>
<property name="verticalSpacing">
<number>12</number>
</property>
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<item> <item>
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="label_5">
<property name="font"> <property name="font">
<font> <font>
<pointsize>10</pointsize>
<weight>75</weight> <weight>75</weight>
<bold>true</bold> <bold>true</bold>
</font> </font>
</property> </property>
<property name="styleSheet">
<string notr="true">color: rgb(166, 27, 31);</string>
</property>
<property name="text"> <property name="text">
<string>Wallet</string> <string>Wallet</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QLabel" name="labelWalletStatus">
<property name="toolTip">
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
</property>
<property name="styleSheet">
<string notr="true">QLabel { color: red; }</string>
</property>
<property name="text">
<string notr="true">(out of sync)</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer_2"> <spacer name="horizontalSpacer_2">
<property name="orientation"> <property name="orientation">
@@ -87,30 +101,36 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QLabel" name="labelWalletStatus">
<property name="toolTip">
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(166, 27, 31);</string>
</property>
<property name="text">
<string notr="true">(out of sync)</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item row="1" column="0">
<layout class="QFormLayout" name="formLayout_2"> <widget class="QLabel" name="labelBalanceText">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<property name="horizontalSpacing">
<number>12</number>
</property>
<property name="verticalSpacing">
<number>12</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Balance:</string> <string>Balance:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="1" column="1">
<widget class="QLabel" name="labelBalance"> <widget class="QLabel" name="labelBalance">
<property name="font"> <property name="font">
<font> <font>
<pointsize>10</pointsize>
<weight>75</weight> <weight>75</weight>
<bold>true</bold> <bold>true</bold>
</font> </font>
@@ -124,19 +144,22 @@
<property name="text"> <property name="text">
<string notr="true">0 CSC</string> <string notr="true">0 CSC</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="labelUnconfirmedText">
<property name="text"> <property name="text">
<string>Unconfirmed:</string> <string>Unconfirmed:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="2" column="1">
<widget class="QLabel" name="labelUnconfirmed"> <widget class="QLabel" name="labelUnconfirmed">
<property name="font"> <property name="font">
<font> <font>
@@ -153,19 +176,22 @@
<property name="text"> <property name="text">
<string notr="true">0 CSC</string> <string notr="true">0 CSC</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="3" column="0">
<widget class="QLabel" name="labelImmatureText"> <widget class="QLabel" name="labelImmatureText">
<property name="text"> <property name="text">
<string>Immature:</string> <string>Immature:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="3" column="1">
<widget class="QLabel" name="labelImmature"> <widget class="QLabel" name="labelImmature">
<property name="font"> <property name="font">
<font> <font>
@@ -179,17 +205,44 @@
<property name="text"> <property name="text">
<string notr="true">0 CSC</string> <string notr="true">0 CSC</string>
</property> </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="4" column="0">
</item> <widget class="QLabel" name="labelBalanceFiatText">
</layout> <property name="text">
<string>Estimated Fiat Balance:</string>
</property>
</widget> </widget>
</item> </item>
<item> <item row="4" column="1">
<widget class="QLabel" name="labelBalanceFiat">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Estimated Fiat balance calculated against current market value</string>
</property>
<property name="text">
<string notr="true">0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@@ -197,28 +250,17 @@
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>100</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout>
</item>
<item> <item>
<widget class="QLabel" name="label_6"> <layout class="QVBoxLayout" name="verticalLayoutAdvertWidget"/>
<property name="text"> </item>
<string/> </layout>
</property>
<property name="pixmap">
<pixmap resource="../bitcoin.qrc">:/images/backg</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="margin">
<number>-2</number>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@@ -226,36 +268,34 @@
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QFrame" name="frame_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="frameShape"> <property name="minimumSize">
<enum>QFrame::NoFrame</enum> <size>
</property> <width>150</width>
<property name="frameShadow"> <height>0</height>
<enum>QFrame::Plain</enum> </size>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="topMargin">
<number>7</number>
</property>
<property name="bottomMargin">
<number>7</number>
</property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="font">
<string>&lt;b&gt;Recent transactions&lt;/b&gt;</string> <font>
</property> <pointsize>10</pointsize>
</widget> </font>
</item>
<item>
<widget class="QLabel" name="labelTransactionsStatus">
<property name="toolTip">
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QLabel { color: red; }</string> <string notr="true">color: rgb(166, 27, 31);</string>
</property> </property>
<property name="text"> <property name="text">
<string notr="true">(out of sync)</string> <string>&lt;b&gt;Recent transactions&lt;/b&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
@@ -272,6 +312,22 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QLabel" name="labelTransactionsStatus">
<property name="toolTip">
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(166, 27, 31);</string>
</property>
<property name="text">
<string notr="true">(out of sync)</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@@ -296,19 +352,6 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

116
src/qt/forms/pryptopage.ui Normal file
View File

@@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PryptoPage</class>
<widget class="QDialog" name="PryptoPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>507</width>
<height>282</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>481</width>
<height>261</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="leftMargin">
<number>50</number>
</property>
<property name="rightMargin">
<number>50</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="lblHelp">
<property name="minimumSize">
<size>
<width>0</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>Enter your Prypto Code and Security Code to redeem your Prypto card.</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lblPryptoCode">
<property name="text">
<string>Prypto Code</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="txtPryptoCode"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lblSecurityCode">
<property name="text">
<string>Security Code</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="txtSecurityCode">
<property name="inputMethodHints">
<set>Qt::ImhDigitsOnly</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="butRedeem">
<property name="styleSheet">
<string notr="true">background-color: rgb(166, 27, 31);
color: rgb(255, 255, 255);
pressed
{
background-color: rgb(166, 27, 31);
}</string>
</property>
<property name="text">
<string>Redeem</string>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
<normaloff>:/icons/res/icons/prypto.png</normaloff>:/icons/res/icons/prypto.png</iconset>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<resources>
<include location="../bitcoin.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>740</width> <width>740</width>
<height>450</height> <height>468</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@@ -17,7 +17,7 @@
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tab_info"> <widget class="QWidget" name="tab_info">
<attribute name="title"> <attribute name="title">

View File

@@ -13,7 +13,7 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Send Coins</string> <string>Send Coins</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0"> <layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,1">
<property name="bottomMargin"> <property name="bottomMargin">
<number>8</number> <number>8</number>
</property> </property>
@@ -39,7 +39,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayoutCoinControl2"> <layout class="QVBoxLayout" name="verticalLayoutCoinControl2">
<property name="spacing"> <property name="spacing">
<number>-1</number> <number>6</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
@@ -84,7 +84,7 @@
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">font-weight:bold;</string> <string notr="true">color:rgb(166,27,31);font-weight:bold;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Coin Control Features</string> <string>Coin Control Features</string>
@@ -130,7 +130,7 @@
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">color:red;font-weight:bold;</string> <string notr="true">color:rgb(166,27,31);font-weight:bold;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Insufficient funds!</string> <string>Insufficient funds!</string>
@@ -173,7 +173,16 @@
<string notr="true"/> <string notr="true"/>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayoutCoinControl5"> <layout class="QHBoxLayout" name="horizontalLayoutCoinControl5">
<property name="margin"> <property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@@ -615,48 +624,6 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>830</width>
<height>165</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="entries">
<property name="spacing">
<number>6</number>
</property>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
@@ -702,6 +669,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing"> <property name="spacing">
@@ -716,6 +696,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="labelBalance"> <widget class="QLabel" name="labelBalance">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="cursor"> <property name="cursor">
<cursorShape>IBeamCursor</cursorShape> <cursorShape>IBeamCursor</cursorShape>
</property> </property>
@@ -729,19 +715,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QPushButton" name="sendButton"> <widget class="QPushButton" name="sendButton">
<property name="minimumSize"> <property name="minimumSize">
@@ -753,6 +726,17 @@
<property name="toolTip"> <property name="toolTip">
<string>Confirm the send action</string> <string>Confirm the send action</string>
</property> </property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(166, 27, 31);
color: rgb(255, 255, 255);
pressed
{
background-color: rgb(166, 27, 31);
}</string>
</property>
<property name="text"> <property name="text">
<string>S&amp;end</string> <string>S&amp;end</string>
</property> </property>
@@ -767,6 +751,77 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>832</width>
<height>169</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="entries_2">
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="entries">
<property name="spacing">
<number>6</number>
</property>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources>

View File

@@ -49,9 +49,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1">
<widget class="BitcoinAmountField" name="payAmount"/>
</item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
@@ -80,42 +77,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> </layout>
<widget class="QToolButton" name="addressBookButton"> </item>
<item row="4" column="1">
<widget class="QValidatedLineEdit" name="addAsLabel">
<property name="toolTip"> <property name="toolTip">
<string>Choose address from address book</string> <string>Enter a label for this address to add it to your address book</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
<normaloff>:/icons/address-book</normaloff>:/icons/address-book</iconset>
</property>
<property name="shortcut">
<string>Alt+A</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QToolButton" name="pasteButton"> <widget class="QPushButton" name="deleteButton">
<property name="toolTip">
<string>Paste address from clipboard</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
<normaloff>:/icons/editpaste</normaloff>:/icons/editpaste</iconset>
</property>
<property name="shortcut">
<string>Alt+P</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="deleteButton">
<property name="toolTip"> <property name="toolTip">
<string>Remove this recipient</string> <string>Remove this recipient</string>
</property> </property>
@@ -126,31 +100,104 @@
<iconset resource="../bitcoin.qrc"> <iconset resource="../bitcoin.qrc">
<normaloff>:/icons/remove</normaloff>:/icons/remove</iconset> <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>
</property> </property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addressBookButton">
<property name="toolTip">
<string>Choose address from address book</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
<normaloff>:/icons/address-book</normaloff>:/icons/address-book</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="shortcut">
<string>Alt+A</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pasteButton">
<property name="toolTip">
<string>Paste address from clipboard</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../bitcoin.qrc">
<normaloff>:/icons/editpaste</normaloff>:/icons/editpaste</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="shortcut">
<string>Alt+P</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="4" column="1"> <item row="5" column="1" colspan="2">
<widget class="QValidatedLineEdit" name="addAsLabel"> <widget class="BitcoinAmountField" name="payAmount">
<property name="toolTip"> <property name="sizePolicy">
<string>Enter a label for this address to add it to your address book</string> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget>
<class>BitcoinAmountField</class>
<extends>QLineEdit</extends>
<header>bitcoinamountfield.h</header>
<container>1</container>
</customwidget>
<customwidget> <customwidget>
<class>QValidatedLineEdit</class> <class>QValidatedLineEdit</class>
<extends>QLineEdit</extends> <extends>QLineEdit</extends>
<header>qvalidatedlineedit.h</header> <header>qvalidatedlineedit.h</header>
</customwidget> </customwidget>
<customwidget>
<class>BitcoinAmountField</class>
<extends>QSpinBox</extends>
<header>bitcoinamountfield.h</header>
<container>1</container>
</customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../bitcoin.qrc"/> <include location="../bitcoin.qrc"/>

View File

@@ -20,7 +20,7 @@
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="tabSignMessage"> <widget class="QWidget" name="tabSignMessage">
<attribute name="title"> <attribute name="title">

44
src/qt/gui20_skin.cpp Normal file
View File

@@ -0,0 +1,44 @@
#include "gui20_skin.h"
GUI20Skin::GUI20Skin( QObject* a_pParent )
: QObject( a_pParent )
, colorToolbarMainGradientBegin( "#9c181c" )
// , colorToolbarMainGradientEnd( "#ae1e22" )
, colorToolbarMainGradientEnd( "#a61b22" )
, colorToolbarMainCurrent( "#761316" )
, colorToolbarMainBottomCurrent( "#e1252b" )
, colorToolbarMainTextCurrent( "#ffffff" )
, colorToolbarMainTextNormal( "#3f0a0c" )
, colorToolbarMainTextWebsiteURL( colorToolbarMainTextCurrent )
, colorToolbarMainTextVisitWebsite( "#ffffaf" )
, colorToolbarMainTextShadow( "#c72427" )
, colorWindowBackground( "#f0f0f0" )
, colorFrameBackground( "#ffffff" )
, colorButtonTopGradient( colorFrameBackground )
, colorButtonBottomGradient( "#F2F2F2" )
, colorButtonMid( "#F8F8F8" )
, colorButtonDark( colorButtonBottomGradient )
, colorButtonLight( colorFrameBackground )
, colorListCurrent( "#F5E5E5" )
, colorListValue( colorFrameBackground )
, colorListValueAlternative( "#F5F5F5" )
, colorTextActive( "#404040" )
, colorTextActiveAutocomplete( "#6B3D3D" )
, colorTextDisabled( "#707070" )
, colorTextDisabledAutocomplete( "#8B5D5D" )
, colorTextBlack("#000000")
{
}
GUI20Skin& GUI20Skin::Instance()
{
static GUI20Skin m_oInstance;
return m_oInstance;
}
GUI20Skin::~GUI20Skin()
{
}

126
src/qt/gui20_skin.h Normal file
View File

@@ -0,0 +1,126 @@
#ifndef GUI20_SKIN_H
#define GUI20_SKIN_H
#include <QColor>
#include <QString>
#include <QMutex>
#include <QObject>
class GUI20Skin : public QObject
{
Q_OBJECT
Q_PROPERTY( QColor colorToolbarMainGradientBegin READ GetColorToolbarMainGradientBegin CONSTANT )
Q_PROPERTY( QColor colorToolbarMainGradientEnd READ GetColorToolbarMainGradientEnd CONSTANT )
Q_PROPERTY( QColor colorToolbarMainCurrent READ GetColorToolbarMainCurrent CONSTANT )
Q_PROPERTY( QColor colorToolbarMainBottomCurrent READ GetColorToolbarBottomCurrent CONSTANT )
Q_PROPERTY( QColor colorToolbarMainTextCurrent READ GetColorToolbarMainTextCurrent CONSTANT )
Q_PROPERTY( QColor colorToolbarMainTextNormal READ GetColorToolbarMainTextNormal CONSTANT )
Q_PROPERTY( QColor colorToolbarMainTextShadow READ GetColorToolbarMainTextShadow CONSTANT )
Q_PROPERTY( QColor colorToolbarMainTextWebsiteURL READ GetColorToolbarMainTextWebsiteURL CONSTANT )
Q_PROPERTY( QColor colorToolbarMainTextVisitWebsite READ GetColorToolbarMainTextVisitWebsite CONSTANT )
Q_PROPERTY( QColor colorWindowBackground READ GetColorWindowBackground CONSTANT )
Q_PROPERTY( QColor colorFrameBackground READ GetColorFrameBackground CONSTANT )
Q_PROPERTY( QColor colorButtonTopGradient READ GetColorButtonTopGradient CONSTANT )
Q_PROPERTY( QColor colorButtonBottomGradient READ GetColorButtonBottomGradient CONSTANT )
Q_PROPERTY( QColor colorButtonMid READ GetColorButtonMid CONSTANT )
Q_PROPERTY( QColor colorButtonDark READ GetColorButtonDark CONSTANT )
Q_PROPERTY( QColor colorButtonLight READ GetColorButtonLight CONSTANT )
Q_PROPERTY( QColor colorListCurrent READ GetColorListCurrent CONSTANT )
Q_PROPERTY( QColor colorListValue READ GetColorListValue CONSTANT )
Q_PROPERTY( QColor colorListValueAlternative READ GetColorListValueAlternative CONSTANT )
Q_PROPERTY( QColor colorTextActive READ GetColorTextActive CONSTANT )
Q_PROPERTY( QColor colorTextActiveAutocomplete READ GetColorTextActiveAutocomplete CONSTANT )
Q_PROPERTY( QColor colorTextDisabled READ GetColorTextDisabled CONSTANT )
Q_PROPERTY( QColor colorTextDisabledAutocomplete READ GetColorTextDisabledAutocomplete CONSTANT )
Q_ENUMS( ESizeConstants )
public:
enum ESizeConstants
{
ToolbarMainHeight = 77,
ToolbarMainBottomPartHeight = 5
};
const QColor GetColorToolbarMainGradientBegin() const {return colorToolbarMainGradientBegin;}
const QColor GetColorToolbarMainGradientEnd() const {return colorToolbarMainGradientEnd;}
const QColor GetColorToolbarMainCurrent() const {return colorToolbarMainCurrent;}
const QColor GetColorToolbarBottomCurrent() const {return colorToolbarMainBottomCurrent;}
const QColor GetColorToolbarMainTextCurrent() const {return colorToolbarMainTextCurrent;}
const QColor GetColorToolbarMainTextNormal() const {return colorToolbarMainTextNormal;}
const QColor GetColorToolbarMainTextShadow() const {return colorToolbarMainTextShadow;}
const QColor GetColorToolbarMainTextWebsiteURL() const {return colorToolbarMainTextWebsiteURL;}
const QColor GetColorToolbarMainTextVisitWebsite() const {return colorToolbarMainTextVisitWebsite;}
const QColor GetColorWindowBackground() const {return colorWindowBackground;}
const QColor GetColorFrameBackground() const {return colorFrameBackground;}
const QColor GetColorButtonTopGradient() const {return colorButtonTopGradient;}
const QColor GetColorButtonBottomGradient() const {return colorButtonBottomGradient;}
const QColor GetColorButtonMid() const {return colorButtonMid;}
const QColor GetColorButtonDark() const {return colorButtonDark;}
const QColor GetColorButtonLight() const {return colorButtonLight;}
const QColor GetColorListCurrent() const {return colorListCurrent;}
const QColor GetColorListValue() const {return colorListValue;}
const QColor GetColorListValueAlternative() const {return colorListValueAlternative;}
const QColor GetColorTextActive() const {return colorTextActive;}
const QColor GetColorTextActiveAutocomplete() const {return colorTextActiveAutocomplete;}
const QColor GetColorTextDisabled() const {return colorTextDisabled;}
const QColor GetColorTextDisabledAutocomplete() const {return colorTextDisabledAutocomplete;}
private:
const QColor colorToolbarMainGradientBegin;
const QColor colorToolbarMainGradientEnd;
const QColor colorToolbarMainCurrent;
const QColor colorToolbarMainBottomCurrent;
const QColor colorToolbarMainTextCurrent;
const QColor colorToolbarMainTextNormal;
const QColor colorToolbarMainTextShadow;
const QColor colorToolbarMainTextWebsiteURL;
const QColor colorToolbarMainTextVisitWebsite;
const QColor colorWindowBackground;
const QColor colorFrameBackground;
const QColor colorButtonTopGradient;
const QColor colorButtonBottomGradient;
const QColor colorButtonMid;
const QColor colorButtonDark;
const QColor colorButtonLight;
const QColor colorListCurrent;
const QColor colorListValue;
const QColor colorListValueAlternative;
const QColor colorTextActive;
const QColor colorTextActiveAutocomplete;
const QColor colorTextDisabled;
const QColor colorTextDisabledAutocomplete;
const QColor colorTextBlack;
public:
static GUI20Skin& Instance();
private:
GUI20Skin( QObject* a_pParent = 0 );
virtual ~GUI20Skin();
};
#endif // GUI20_SKIN_H

View File

@@ -2,7 +2,7 @@
#define GUICONSTANTS_H #define GUICONSTANTS_H
/* Milliseconds between model updates */ /* Milliseconds between model updates */
static const int MODEL_UPDATE_DELAY = 250; static const int MODEL_UPDATE_DELAY = 1000;
/* AskPassphraseDialog -- Maximum passphrase length */ /* AskPassphraseDialog -- Maximum passphrase length */
static const int MAX_PASSPHRASE_SIZE = 1024; static const int MAX_PASSPHRASE_SIZE = 1024;
@@ -16,7 +16,9 @@ static const int STATUSBAR_ICONSIZE = 16;
/* Transaction list -- unconfirmed transaction */ /* Transaction list -- unconfirmed transaction */
#define COLOR_UNCONFIRMED QColor(128, 128, 128) #define COLOR_UNCONFIRMED QColor(128, 128, 128)
/* Transaction list -- negative amount */ /* Transaction list -- negative amount */
#define COLOR_NEGATIVE QColor(255, 0, 0) #define COLOR_NEGATIVE QColor(166, 27, 31)
/* Transaction list -- positive amount */
#define COLOR_POSITIVE QColor(27, 166, 31)
/* Transaction list -- bare address (without label) */ /* Transaction list -- bare address (without label) */
#define COLOR_BAREADDRESS QColor(140, 140, 140) #define COLOR_BAREADDRESS QColor(140, 140, 140)

121
src/qt/infopage.cpp Normal file
View File

@@ -0,0 +1,121 @@
#include "infopage.h"
#include "ui_infopage.h"
#include "walletmodel.h"
#include "clientmodel.h"
#include "bitcoinrpc.h"
#include <QDateTime>
#include "bitcoinunits.h"
#include "main.h"
#include "qtquick_controls/cpp/guiexchangeswidget.h"
using namespace std;
InfoPage::InfoPage(QWidget *parent) :
QDialog(parent),
ui(new Ui::InfoPage),
exchangesWidget( 0 )
{
ui->setupUi(this);
// ui->casinoInfoBox->setVisible(false);
// ui->newsItemsBox->setVisible(false);
createExchangesWidget();
}
void InfoPage::setWalletModel(WalletModel *model)
{
this->walletModel = model;
if(model)
{
// subscribe to transaction changes
connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int)));
setNumTransactions(model->getNumTransactions());
}
}
void InfoPage::setClientModel(ClientModel *model)
{
this->clientModel = model;
if(model)
{
// Subscribe to information, replies, messages, errors
connect(model, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
connect(model, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));
setNumConnections(model->getNumConnections());
setNumBlocks(model->getNumBlocks(), model->getNumBlocksOfPeers());
}
}
void InfoPage::setNumConnections(int count)
{
ui->txtConnections->setText(QString::number(count));
}
void InfoPage::setNumBlocks(int count, int countOfPeers)
{
ui->txtBlockHeight->setText(QString::number(count));
// block height changed so update all possible values as well
if(clientModel)
{
ui->txtLastBlockTime->setText(clientModel->getLastBlockDate().toString());
ui->txtDifficulty->setText(QString::number(GetDifficulty()));
ui->txtCoinSupply->setText(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, GetTotalCoinSupply(count, false)));
double megaHash = GetNetworkHashRate(-1, count) / 1000000;
ui->txtHashRate->setText(QString::number(megaHash,'f',0).append(" MHash/sec"));
}
}
void InfoPage::setNumTransactions(int count)
{
ui->txtTransactionCount->setText(QString::number(count));
}
double InfoPage::GetNetworkHashRate(int lookup, int height) {
CBlockIndex *pb = pindexBest;
if (height >= 0 && height < nBestHeight)
pb = FindBlockByHeight(height);
if (pb == NULL || !pb->nHeight)
return 0;
// If lookup is -1, then use blocks since last difficulty change.
if (lookup <= 0)
lookup = pb->nHeight % 2016 + 1;
// If lookup is larger than chain, then set it to chain length.
if (lookup > pb->nHeight)
lookup = pb->nHeight;
CBlockIndex *pb0 = pb;
int64 minTime = pb0->GetBlockTime();
int64 maxTime = minTime;
for (int i = 0; i < lookup; i++) {
pb0 = pb0->pprev;
int64 time = pb0->GetBlockTime();
minTime = std::min(time, minTime);
maxTime = std::max(time, maxTime);
}
// In case there's a situation where minTime == maxTime, we don't want a divide by zero exception.
if (minTime == maxTime)
return 0;
uint256 workDiff = pb->nChainWork - pb0->nChainWork;
int64 timeDiff = maxTime - minTime;
double workDiffDouble = workDiff.getdouble();
return workDiffDouble / timeDiff;
}
InfoPage::~InfoPage()
{
delete ui;
}
void InfoPage::createExchangesWidget()
{
exchangesWidget = new GUIExchangesWidget( this );
exchangesWidget->slotPopulateExchangesFromWeb();
ui->verticalLayoutExchanges->addWidget( exchangesWidget->dockQmlToWidget() );
}

42
src/qt/infopage.h Normal file
View File

@@ -0,0 +1,42 @@
#ifndef INFOPAGE_H
#define INFOPAGE_H
#include <QDialog>
class WalletModel;
class ClientModel;
class GUIExchangesWidget;
namespace Ui {
class InfoPage;
}
class InfoPage : public QDialog
{
Q_OBJECT
public slots:
/** Set number of connections shown in the UI */
void setNumConnections(int count);
/** Set number of blocks shown in the UI */
void setNumBlocks(int count, int countOfPeers);
/** Set number of transactions shown in the UI */
void setNumTransactions(int count);
public:
explicit InfoPage(QWidget *parent = 0);
void setWalletModel(WalletModel *model);
void setClientModel(ClientModel *model);
~InfoPage();
private:
Ui::InfoPage *ui;
WalletModel *walletModel;
ClientModel *clientModel;
GUIExchangesWidget* exchangesWidget;
void createExchangesWidget();
double GetNetworkHashRate(int lookup, int height);
};
#endif // INFOPAGE_H

View File

@@ -2,6 +2,7 @@
#include "ui_optionsdialog.h" #include "ui_optionsdialog.h"
#include "bitcoinunits.h" #include "bitcoinunits.h"
#include "currencies.h"
#include "monitoreddatamapper.h" #include "monitoreddatamapper.h"
#include "netbase.h" #include "netbase.h"
#include "optionsmodel.h" #include "optionsmodel.h"
@@ -80,6 +81,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) :
} }
ui->unit->setModel(new BitcoinUnits(this)); ui->unit->setModel(new BitcoinUnits(this));
ui->currency->setModel(new Currencies(this));
/* Widget-to-option mapper */ /* Widget-to-option mapper */
mapper = new MonitoredDataMapper(this); mapper = new MonitoredDataMapper(this);
@@ -106,7 +108,6 @@ void OptionsDialog::setModel(OptionsModel *model)
if(model) if(model)
{ {
connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
mapper->setModel(model); mapper->setModel(model);
setMapper(); setMapper();
mapper->toFirst(); mapper->toFirst();
@@ -145,8 +146,10 @@ void OptionsDialog::setMapper()
/* Display */ /* Display */
mapper->addMapping(ui->lang, OptionsModel::Language); mapper->addMapping(ui->lang, OptionsModel::Language);
mapper->addMapping(ui->unit, OptionsModel::DisplayUnit); mapper->addMapping(ui->unit, OptionsModel::DisplayUnit);
mapper->addMapping(ui->currency, OptionsModel::DisplayFiatCurrency);
mapper->addMapping(ui->displayAddresses, OptionsModel::DisplayAddresses); mapper->addMapping(ui->displayAddresses, OptionsModel::DisplayAddresses);
mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures); mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
mapper->addMapping(ui->displayPromotions, OptionsModel::DisplayPromotions);
} }
void OptionsDialog::enableApplyButton() void OptionsDialog::enableApplyButton()

View File

@@ -1,6 +1,7 @@
#include "optionsmodel.h" #include "optionsmodel.h"
#include "bitcoinunits.h" #include "bitcoinunits.h"
#include "currencies.h"
#include "init.h" #include "init.h"
#include "walletdb.h" #include "walletdb.h"
#include "guiutil.h" #include "guiutil.h"
@@ -49,6 +50,8 @@ void OptionsModel::Init()
nTransactionFee = settings.value("nTransactionFee").toLongLong(); nTransactionFee = settings.value("nTransactionFee").toLongLong();
language = settings.value("language", "").toString(); language = settings.value("language", "").toString();
fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool(); fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool();
nDisplayFiatCurrency = settings.value("nDisplayFiatCurrency", Currencies::USD).toInt();
fDisplayPromotions = settings.value("fDisplayPromotions", true).toBool();
// These are shared with core Bitcoin; we want // These are shared with core Bitcoin; we want
// command-line options to override the GUI settings: // command-line options to override the GUI settings:
@@ -199,6 +202,10 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
return settings.value("language", ""); return settings.value("language", "");
case CoinControlFeatures: case CoinControlFeatures:
return QVariant(fCoinControlFeatures); return QVariant(fCoinControlFeatures);
case DisplayFiatCurrency:
return QVariant(nDisplayFiatCurrency);
case DisplayPromotions:
return QVariant(fDisplayPromotions);
default: default:
return QVariant(); return QVariant();
} }
@@ -274,6 +281,11 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
settings.setValue("nDisplayUnit", nDisplayUnit); settings.setValue("nDisplayUnit", nDisplayUnit);
emit displayUnitChanged(nDisplayUnit); emit displayUnitChanged(nDisplayUnit);
break; break;
case DisplayFiatCurrency:
nDisplayFiatCurrency = value.toInt();
settings.setValue("nDisplayFiatCurrency", nDisplayFiatCurrency);
emit displayCurrencyChanged(nDisplayFiatCurrency);
break;
case DisplayAddresses: case DisplayAddresses:
bDisplayAddresses = value.toBool(); bDisplayAddresses = value.toBool();
settings.setValue("bDisplayAddresses", bDisplayAddresses); settings.setValue("bDisplayAddresses", bDisplayAddresses);
@@ -287,6 +299,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
emit coinControlFeaturesChanged(fCoinControlFeatures); emit coinControlFeaturesChanged(fCoinControlFeatures);
} }
break; break;
case DisplayPromotions: {
fDisplayPromotions = value.toBool();
settings.setValue("fDisplayPromotions", fDisplayPromotions);
emit displayPromotionsChanged(fDisplayPromotions);
}
break;
default: default:
break; break;
} }

View File

@@ -27,9 +27,11 @@ public:
ProxySocksVersion, // int ProxySocksVersion, // int
Fee, // qint64 Fee, // qint64
DisplayUnit, // BitcoinUnits::Unit DisplayUnit, // BitcoinUnits::Unit
DisplayFiatCurrency, // Currencies::FiatCurrencyID
DisplayAddresses, // bool DisplayAddresses, // bool
Language, // QString Language, // QString
CoinControlFeatures, // bool CoinControlFeatures, // bool
DisplayPromotions, // bool
OptionIDRowCount, OptionIDRowCount,
}; };
@@ -51,6 +53,8 @@ public:
bool getDisplayAddresses() { return bDisplayAddresses; } bool getDisplayAddresses() { return bDisplayAddresses; }
QString getLanguage() { return language; } QString getLanguage() { return language; }
bool getCoinControlFeatures(); bool getCoinControlFeatures();
int getDisplayFiatCurrency() { return nDisplayFiatCurrency; }
bool getDisplayPromotions() { return fDisplayPromotions; }
private: private:
int nDisplayUnit; int nDisplayUnit;
@@ -59,11 +63,15 @@ private:
bool fMinimizeOnClose; bool fMinimizeOnClose;
QString language; QString language;
bool fCoinControlFeatures; bool fCoinControlFeatures;
int nDisplayFiatCurrency;
bool fDisplayPromotions;
signals: signals:
void displayUnitChanged(int unit); void displayUnitChanged(int unit);
void transactionFeeChanged(qint64); void transactionFeeChanged(qint64);
void coinControlFeaturesChanged(bool); void coinControlFeaturesChanged(bool);
void displayCurrencyChanged(int currency);
void displayPromotionsChanged(bool);
}; };
#endif // OPTIONSMODEL_H #endif // OPTIONSMODEL_H

View File

@@ -4,17 +4,23 @@
#include "clientmodel.h" #include "clientmodel.h"
#include "walletmodel.h" #include "walletmodel.h"
#include "bitcoinunits.h" #include "bitcoinunits.h"
#include "currencies.h"
#include "optionsmodel.h" #include "optionsmodel.h"
#include "transactiontablemodel.h" #include "transactiontablemodel.h"
#include "transactionfilterproxy.h" #include "transactionfilterproxy.h"
#include "guiutil.h" #include "guiutil.h"
#include "guiconstants.h" #include "guiconstants.h"
#include "qtquick_controls/cpp/guibannerwidget.h"
#include "CSCPublicAPI/casinocoinwebapi.h"
#include "CSCPublicAPI/casinocoinwebapiparser.h"
#include <QAbstractItemDelegate> #include <QAbstractItemDelegate>
#include <QPainter> #include <QPainter>
#include <QDebug>
#define DECORATION_SIZE 64 #define DECORATION_SIZE 64
#define NUM_ITEMS 3 #define NUM_ITEMS 5
class TxViewDelegate : public QAbstractItemDelegate class TxViewDelegate : public QAbstractItemDelegate
{ {
@@ -65,16 +71,23 @@ public:
} }
else else
{ {
foreground = option.palette.color(QPalette::Text); foreground = COLOR_POSITIVE;
} }
painter->setPen(foreground); painter->setPen(foreground);
QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true); QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true);
QFont amountFont = painter->font();
if(!confirmed) if(!confirmed)
{ {
amountText = QString("[") + amountText + QString("]"); amountText = QString("[") + amountText + QString("]");
} }
else
{
amountFont.setWeight(QFont::Bold);
painter->setFont(amountFont);
}
painter->drawText(amountRect, Qt::AlignRight|Qt::AlignVCenter, amountText); painter->drawText(amountRect, Qt::AlignRight|Qt::AlignVCenter, amountText);
amountFont.setWeight(QFont::Bold);
painter->setFont(amountFont);
painter->setPen(option.palette.color(QPalette::Text)); painter->setPen(option.palette.color(QPalette::Text));
painter->drawText(amountRect, Qt::AlignLeft|Qt::AlignVCenter, GUIUtil::dateTimeStr(date)); painter->drawText(amountRect, Qt::AlignLeft|Qt::AlignVCenter, GUIUtil::dateTimeStr(date));
@@ -100,9 +113,13 @@ OverviewPage::OverviewPage(QWidget *parent) :
currentUnconfirmedBalance(-1), currentUnconfirmedBalance(-1),
currentImmatureBalance(-1), currentImmatureBalance(-1),
txdelegate(new TxViewDelegate()), txdelegate(new TxViewDelegate()),
filter(0) filter(0),
advertsWidget(0),
cscWebApiParser( new CasinoCoinWebAPIParser( this ) ),
cscWebApi( new CasinoCoinWebAPI( this ) )
{ {
ui->setupUi(this); ui->setupUi(this);
createAdvertsWidget();
// Recent transactions // Recent transactions
ui->listTransactions->setItemDelegate(txdelegate); ui->listTransactions->setItemDelegate(txdelegate);
@@ -111,6 +128,9 @@ OverviewPage::OverviewPage(QWidget *parent) :
ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false); ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false);
connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex))); connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex)));
connect( cscWebApi, SIGNAL( signalResponseReady(const QByteArray&)), cscWebApiParser, SLOT( slotParseAnswer(const QByteArray&)), Qt::UniqueConnection );
connect( cscWebApi, SIGNAL( signalNetworkError(QNetworkReply::NetworkError,const QUrl)), cscWebApiParser, SLOT( slotNetworkError(QNetworkReply::NetworkError,const QUrl)), Qt::UniqueConnection );
connect( cscWebApiParser, SIGNAL( signalCoinInfoParsed(JsonCoinInfoParser*)), this, SLOT( updateCoinInfoFromWeb(JsonCoinInfoParser*)), Qt::UniqueConnection );
// init "out of sync" warning labels // init "out of sync" warning labels
ui->labelWalletStatus->setText("(" + tr("out of sync") + ")"); ui->labelWalletStatus->setText("(" + tr("out of sync") + ")");
@@ -118,6 +138,9 @@ OverviewPage::OverviewPage(QWidget *parent) :
// start with displaying the "out of sync" warnings // start with displaying the "out of sync" warnings
showOutOfSyncWarning(true); showOutOfSyncWarning(true);
// get CoinInfo from the web
getCoinInfo();
} }
void OverviewPage::handleTransactionClicked(const QModelIndex &index) void OverviewPage::handleTransactionClicked(const QModelIndex &index)
@@ -126,11 +149,6 @@ void OverviewPage::handleTransactionClicked(const QModelIndex &index)
emit transactionClicked(filter->mapToSource(index)); emit transactionClicked(filter->mapToSource(index));
} }
OverviewPage::~OverviewPage()
{
delete ui;
}
void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance) void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance)
{ {
int unit = walletModel->getOptionsModel()->getDisplayUnit(); int unit = walletModel->getOptionsModel()->getDisplayUnit();
@@ -146,6 +164,17 @@ void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64
bool showImmature = immatureBalance != 0; bool showImmature = immatureBalance != 0;
ui->labelImmature->setVisible(showImmature); ui->labelImmature->setVisible(showImmature);
ui->labelImmatureText->setVisible(showImmature); ui->labelImmatureText->setVisible(showImmature);
// set fiat balance
updateFiatBalance(walletModel->getOptionsModel()->getDisplayFiatCurrency());
}
void OverviewPage::createAdvertsWidget()
{
advertsWidget = new GUIBannerWidget( this );
ui->verticalLayoutAdvertWidget->addWidget( advertsWidget->dockQmlToWidget(), Qt::AlignCenter );
// first load from local files as its faster, than look for new ads in CasinoCoinAPI
// advertsWidget->PopulateBannerLocally();
advertsWidget->PopulateBannerFromWeb();
} }
void OverviewPage::setClientModel(ClientModel *model) void OverviewPage::setClientModel(ClientModel *model)
@@ -178,8 +207,12 @@ void OverviewPage::setWalletModel(WalletModel *model)
// Keep up to date with wallet // Keep up to date with wallet
setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance()); setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance());
connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64))); connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64)));
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
connect(model->getOptionsModel(), SIGNAL(displayCurrencyChanged(int)), this, SLOT(updateFiatBalance(int)));
connect(model->getOptionsModel(), SIGNAL(displayPromotionsChanged(bool)), this, SLOT(updateDisplayPromotions(bool)));
// set visibility of adverts widget
updateDisplayPromotions(model->getOptionsModel()->getDisplayPromotions());
} }
// update the display unit, to not use the default ("BTC") // update the display unit, to not use the default ("BTC")
@@ -211,3 +244,53 @@ void OverviewPage::showOutOfSyncWarning(bool fShow)
ui->labelWalletStatus->setVisible(fShow); ui->labelWalletStatus->setVisible(fShow);
ui->labelTransactionsStatus->setVisible(fShow); ui->labelTransactionsStatus->setVisible(fShow);
} }
void OverviewPage::getCoinInfo()
{
if ( cscWebApi )
{
cscWebApi->GetCoinInfo();
}
}
void OverviewPage::updateCoinInfoFromWeb( JsonCoinInfoParser* coinInfoParser )
{
qDebug() << "CoinInfo ID: " << coinInfoParser->getCoinInfo().find("ID").value().toDouble();
qDebug() << "CoinInfo InfoTime: " <<coinInfoParser->getCoinInfo().find("InfoTime").value().toString();
// save the coin information
coinInformation = coinInfoParser->getCoinInfo();
// calculate and set the estimated fiat balance
if(walletModel)
{
updateFiatBalance(walletModel->getOptionsModel()->getDisplayFiatCurrency());
}
}
void OverviewPage::updateFiatBalance(int currency)
{
if(!coinInformation.isEmpty())
{
QString conversionCurrency = QString("Price").append(Currencies::name(currency));
double currencyValue = coinInformation.find(conversionCurrency).value().toDouble();
double fiatBalance = currentBalance * currencyValue;
ui->labelBalanceFiat->setText(Currencies::format(currency,fiatBalance,true));
}
}
void OverviewPage::updateDisplayPromotions(bool checked)
{
qDebug() << "updateDisplayPromotions: " << checked;
if ( ui->verticalLayoutAdvertWidget->itemAt( 0 ) )
{
QWidget* pAdvertWidget = ui->verticalLayoutAdvertWidget->itemAt( 0 )->widget();
if ( pAdvertWidget )
{
pAdvertWidget->setVisible( checked );
}
}
}
OverviewPage::~OverviewPage()
{
delete ui;
}

View File

@@ -2,6 +2,7 @@
#define OVERVIEWPAGE_H #define OVERVIEWPAGE_H
#include <QWidget> #include <QWidget>
#include <QJsonObject>
namespace Ui { namespace Ui {
class OverviewPage; class OverviewPage;
@@ -10,6 +11,10 @@ class ClientModel;
class WalletModel; class WalletModel;
class TxViewDelegate; class TxViewDelegate;
class TransactionFilterProxy; class TransactionFilterProxy;
class GUIBannerWidget;
class CasinoCoinWebAPIParser;
class CasinoCoinWebAPI;
class JsonCoinInfoParser;
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QModelIndex; class QModelIndex;
@@ -45,10 +50,22 @@ private:
TxViewDelegate *txdelegate; TxViewDelegate *txdelegate;
TransactionFilterProxy *filter; TransactionFilterProxy *filter;
GUIBannerWidget* advertsWidget;
/** Create widget to populate adverts */
void createAdvertsWidget();
/** Get the CoinInfo from REST service */
CasinoCoinWebAPIParser* cscWebApiParser;
CasinoCoinWebAPI* cscWebApi;
void getCoinInfo();
QJsonObject coinInformation;
private slots: private slots:
void updateDisplayUnit(); void updateDisplayUnit();
void handleTransactionClicked(const QModelIndex &index); void handleTransactionClicked(const QModelIndex &index);
void updateAlerts(const QString &warnings); void updateAlerts(const QString &warnings);
void updateCoinInfoFromWeb( JsonCoinInfoParser* coinInfoParser );
void updateFiatBalance(int currency);
void updateDisplayPromotions(bool checked);
}; };
#endif // OVERVIEWPAGE_H #endif // OVERVIEWPAGE_H

126
src/qt/pryptopage.cpp Normal file
View File

@@ -0,0 +1,126 @@
#include "pryptopage.h"
#include "ui_pryptopage.h"
#include "walletmodel.h"
#include "addresstablemodel.h"
#include <QSsl>
#include <QMessageBox>
#include <QDebug>
#include <QListIterator>
const QString PryptoPage::strAPIEndpoint = "https://prypto.com/merchants/api/";
const QString PryptoPage::strMerchantToken = "35616ab118fa557b77fdac78ef09d5632d302609";
const QString PryptoPage::strAddressLabel = "Prypto Cards";
PryptoPage::PryptoPage(QWidget *parent) :
QDialog(parent),
ui(new Ui::PryptoPage)
{
ui->setupUi(this);
connect( &networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(parseAPINetworkResponse(QNetworkReply*)) );
connect( this, SIGNAL(apiResponseReady(QByteArray)), this, SLOT(showAPIResult(QByteArray)) );
connect( this, SIGNAL(apiNetworkError(QNetworkReply::NetworkError)), this, SLOT(showAPINetworkError(QNetworkReply::NetworkError)) );
connect( &networkAccessManager, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> & )), this, SLOT(sslErrorHandler(QNetworkReply*, const QList<QSslError> & )));
}
void PryptoPage::setWalletModel(WalletModel *model)
{
this->walletModel = model;
}
void PryptoPage::on_butRedeem_clicked()
{
if((ui->txtPryptoCode->text().length() == 0) ||
(ui->txtSecurityCode->text().length() == 0))
{
QMessageBox msgBox;
msgBox.setText("Both Prypto code and Security code must be entered.");
msgBox.exec();
}
else
{
// Show Busy Indicator
busyDialog = new QProgressDialog(this);
busyDialog->setWindowModality(Qt::WindowModal);
busyDialog->setLabelText("Calling Prypto Services ...");
busyDialog->setCancelButton(0);
busyDialog->setRange(0,0);
busyDialog->setMinimumDuration(0);
busyDialog->show();
// get wallet address for redeem action
QString pryptoWalletAddress = walletModel->getAddressTableModel()->addressForLabel(strAddressLabel);
// create new if empty
if(pryptoWalletAddress == "")
{
pryptoWalletAddress = walletModel->getAddressTableModel()->addRow(AddressTableModel::Receive, strAddressLabel, "");
}
// call service
QUrl url ( strAPIEndpoint );
QUrlQuery query;
query.addQueryItem("T", "RX");
query.addQueryItem("TKN", strMerchantToken);
query.addQueryItem("COIN", "CSC");
query.addQueryItem("PC", ui->txtPryptoCode->text());
query.addQueryItem("SC", ui->txtSecurityCode->text());
query.addQueryItem("RX", pryptoWalletAddress);
url.setQuery(query.query());
QNetworkRequest networkRequest ( url );
networkAccessManager.get( networkRequest );
}
}
void PryptoPage::parseAPINetworkResponse( QNetworkReply *finished )
{
if ( finished->error() != QNetworkReply::NoError )
{
// A communication error has occurred
qDebug() << "API Network Error: " << finished->errorString() << " URL: " << finished->url();
busyDialog->cancel();
emit apiNetworkError( finished->error());
return;
}
QByteArray data = finished->readAll();
qDebug() << "API data: " << data;
busyDialog->cancel();
emit apiResponseReady( data );
}
void PryptoPage::sslErrorHandler(QNetworkReply* qnr, const QList<QSslError> & errlist)
{
qDebug() << "---PryptoPage::sslErrorHandler: ";
qnr->ignoreSslErrors();
}
void PryptoPage::showAPINetworkError(QNetworkReply::NetworkError error)
{
qDebug() << "PryptoPage::showAPINetworkError: " << error;
QMessageBox msgBox;
msgBox.setText("Error redeeming Prypto Card.");
msgBox.exec();
}
void PryptoPage::showAPIResult(QByteArray data)
{
// reset text fields
ui->txtPryptoCode->setText("");
ui->txtSecurityCode->setText("");
// handle result
if(data.length() > 0)
{
qDebug() << "API Result: " << data;
QMessageBox msgBox;
msgBox.setText("Prypto Card succesfully redeemed.");
msgBox.exec();
}
else
{
qDebug() << "API Empty Result";
QMessageBox msgBox;
msgBox.setText("Prypto Card already redeemed or invalid.");
msgBox.exec();
}
}
PryptoPage::~PryptoPage()
{
delete ui;
}

48
src/qt/pryptopage.h Normal file
View File

@@ -0,0 +1,48 @@
#ifndef PRYPTOPAGE_H
#define PRYPTOPAGE_H
#include <QDialog>
#include <QUrlQuery>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QProgressDialog>
#include <QList>
class WalletModel;
namespace Ui {
class PryptoPage;
}
class PryptoPage : public QDialog
{
Q_OBJECT
public:
explicit PryptoPage(QWidget *parent = 0);
void setWalletModel(WalletModel *model);
~PryptoPage();
signals:
void apiResponseReady( const QByteArray& content );
void apiNetworkError( const QNetworkReply::NetworkError& error );
private slots:
void on_butRedeem_clicked();
void parseAPINetworkResponse( QNetworkReply *finished );
void showAPIResult(QByteArray data);
void showAPINetworkError(QNetworkReply::NetworkError error);
void sslErrorHandler(QNetworkReply* qnr, const QList<QSslError> & errlist);
private:
static const QString strAPIEndpoint;
static const QString strMerchantToken;
static const QString strAddressLabel;
Ui::PryptoPage *ui;
QNetworkAccessManager networkAccessManager;
WalletModel *walletModel;
QProgressDialog *busyDialog;
};
#endif // PRYPTOPAGE_H

View File

@@ -0,0 +1,43 @@
#include "guibannercontrol.h"
#include "guibannerlistview.h"
#include "qmlbannerlistmodel.h"
#include "qmlbannerlistitem.h"
GUIBannerControl::GUIBannerControl( QQuickItem* a_pParent )
: QQuickItem( a_pParent )
, m_pAdvertsView( 0 )
{
}
GUIBannerControl::~GUIBannerControl()
{
if ( m_pAdvertsView )
{
delete m_pAdvertsView;
m_pAdvertsView = 0;
}
}
void GUIBannerControl::InitializeAdvertsView( GUIBannerListView* a_pView )
{
if ( a_pView )
{
if ( m_pAdvertsView )
{
delete m_pAdvertsView;
}
m_pAdvertsView = a_pView;
}
}
void GUIBannerControl::slotPopulateListView( JsonActivePromotionsParser* a_pActivePromotions )
{
if ( m_pAdvertsView && a_pActivePromotions )
{
QmlBannerListModel* pAdvertsModel = new QmlBannerListModel( *a_pActivePromotions );
m_pAdvertsView->setModel( pAdvertsModel );
delete a_pActivePromotions;
a_pActivePromotions = 0;
}
}

View File

@@ -0,0 +1,31 @@
#ifndef GUIBANNERCONTROL_H
#define GUIBANNERCONTROL_H
#include <QQuickItem>
#include "../../CSCPublicAPI/jsonactivepromotionsparser.h"
class GUIBannerListView;
class GUIBannerControl : public QQuickItem
{
Q_OBJECT
public:
GUIBannerControl( QQuickItem* a_pParent = 0 );
virtual ~GUIBannerControl();
Q_INVOKABLE void InitializeAdvertsView( GUIBannerListView* a_pView );
GUIBannerListView* GetAdvertsView() const { return m_pAdvertsView; }
public slots:
void slotPopulateListView( JsonActivePromotionsParser* a_pActivePromotions );
signals:
public slots:
private:
GUIBannerListView* m_pAdvertsView;
};
#endif // GUIBANNERCONTROL_H

View File

@@ -0,0 +1,50 @@
#include "guibannerlistview.h"
#include "qmlbannerlistitem.h"
#include "qmlbannerlistmodel.h"
#include "qmllistmodel.h"
#include <QDesktopServices>
#include <QUrl>
GUIBannerListView::GUIBannerListView( QQuickItem* a_pParent )
: QQuickItem( a_pParent )
, m_pModel( 0 )
{
}
void GUIBannerListView::clear()
{
if ( m_pModel )
{
m_pModel->clear();
}
}
void GUIBannerListView::onClicked( int a_iItemIndex )
{
if ( m_pModel )
{
QString strUrl = m_pModel->GetData( a_iItemIndex, QmlBannerListItem::ROLE_DESTINATION_URL ).toString();
QDesktopServices::openUrl( QUrl( strUrl ) );
}
}
GUIBannerListView::~GUIBannerListView()
{
if ( m_pModel )
{
delete m_pModel;
m_pModel = 0;
}
}
void GUIBannerListView::setModel( QmlBannerListModel* a_pModel )
{
if ( m_pModel )
{
delete m_pModel;
}
m_pModel = a_pModel;
emit signalModelChanged();
}

View File

@@ -0,0 +1,35 @@
#ifndef GUIBANNERLISTVIEW_H
#define GUIBANNERLISTVIEW_H
#include <QQuickItem>
class QmlListModel;
class QmlBannerListModel;
class QmlBannerListItem;
class GUIBannerListView : public QQuickItem
{
Q_OBJECT
Q_PROPERTY( QmlBannerListModel* p_pListModel MEMBER m_pModel NOTIFY signalModelChanged )
public:
explicit GUIBannerListView( QQuickItem *a_pParent = 0 );
virtual ~GUIBannerListView(); /** Destructor **/
void setModel( QmlBannerListModel* a_pModel );
QmlBannerListModel* setModel() const { return m_pModel; }
void clear();
Q_INVOKABLE void onClicked( int a_iItemIndex );
signals:
void signalModelChanged();
public slots:
private:
QmlBannerListModel* m_pModel;
};
#endif // GUIBANNERLISTVIEW_H

View File

@@ -0,0 +1,103 @@
#include "guibannerwidget.h"
#include <QHBoxLayout>
#include <QCheckBox>
#include <QQuickView>
#include <QQmlContext>
#include "gui20_skin.h"
// qml
#include "guibannercontrol.h"
#include "guibannerlistview.h"
#include "qmlbannerlistmodel.h"
#include "qmlbannerlistitem.h"
#include "qmlimageprovider.h"
// web
#include "../../CSCPublicAPI/casinocoinwebapi.h"
#include "../../CSCPublicAPI/casinocoinwebapiparser.h"
GUIBannerWidget::GUIBannerWidget(QWidget *parent)
: QWidget(parent)
, m_pBannerControl( 0 )
, m_pWebApiParserTemporary( new CasinoCoinWebAPIParser( this ) )
, m_pWebApiTemporary( new CasinoCoinWebAPI( this ) )
, m_pQmlImageProvider( 0 )
{
registerCustomQmlTypes();
connect( m_pWebApiTemporary, SIGNAL( signalResponseReady(const QByteArray&)), m_pWebApiParserTemporary, SLOT( slotParseAnswer(const QByteArray&)), Qt::UniqueConnection );
connect( m_pWebApiTemporary, SIGNAL( signalNetworkError(QNetworkReply::NetworkError,const QUrl)), m_pWebApiParserTemporary, SLOT( slotNetworkError(QNetworkReply::NetworkError,const QUrl)), Qt::UniqueConnection );
connect( m_pWebApiParserTemporary, SIGNAL( signalActivePromotionsParsed(JsonActivePromotionsParser*)), this, SLOT( slotPopulateFromWeb(JsonActivePromotionsParser*)), Qt::UniqueConnection );
}
GUIBannerWidget::~GUIBannerWidget()
{
// member objects are moved to qml engine and it manages their instances
}
void GUIBannerWidget::registerCustomQmlTypes()
{
qmlRegisterType<GUIBannerControl>("CasinoCoinControls", 1, 0, "GUIBannerControl" );
qmlRegisterType<GUIBannerListView>("CasinoCoinControls", 1, 0, "GUIBannerListView" );
qmlRegisterType<QmlBannerListModel>("CasinoCoinControls", 1, 0, "QmlBannerListModel" );
}
QWidget* GUIBannerWidget::dockQmlToWidget()
{
QQuickView* pBannerWindow = new QQuickView;
QWidget* pPlaceHolder = 0;
if ( pBannerWindow )
{
QQmlContext* pContext = pBannerWindow->rootContext();
if ( pContext )
{
pContext->setContextProperty( "GUI20Skin", &GUI20Skin::Instance() );
}
QQmlEngine* pEngine = pBannerWindow->engine();
if ( pEngine )
{
m_pQmlImageProvider = new QmlImageProvider();
pEngine->addImageProvider( "advertImages", m_pQmlImageProvider );
}
pBannerWindow->setSource( QUrl( QStringLiteral( "qrc:/qml/qtquick_controls/qml/QmlGUIBannerWindow.qml" ) ) );
QQuickItem* pRootObject = pBannerWindow->rootObject();
if ( pRootObject )
{
m_pBannerControl = pRootObject->findChild<GUIBannerControl*>();
if ( m_pBannerControl )
{
m_pBannerControl->setWidth( ( 115 * 3 ) + ( 4 * 10 ) + 60 );
m_pBannerControl->setHeight( 115 );
}
}
pPlaceHolder = QWidget::createWindowContainer( pBannerWindow, this );
if ( pPlaceHolder )
{
pPlaceHolder->setMinimumSize( 445, 115 );
pPlaceHolder->setMaximumSize( 445, 115 );
}
}
return pPlaceHolder;
}
void GUIBannerWidget::PopulateBannerFromWeb()
{
if ( m_pWebApiTemporary )
{
m_pWebApiTemporary->GetActivePromotions();
}
}
void GUIBannerWidget::slotPopulateFromWeb( JsonActivePromotionsParser* a_pPromotionsParser )
{
if ( a_pPromotionsParser )
{
a_pPromotionsParser->AddImagesToPool( m_pQmlImageProvider );
}
if ( m_pBannerControl )
{
m_pBannerControl->slotPopulateListView( a_pPromotionsParser );
}
}

View File

@@ -0,0 +1,38 @@
#ifndef GUIBANNERWIDGET_H
#define GUIBANNERWIDGET_H
#include <QWidget>
#include <QNetworkReply>
class CasinoCoinWebAPIParser;
class CasinoCoinWebAPI;
class GUIBannerControl;
class QmlImageProvider;
class JsonActivePromotionsParser;
class GUIBannerWidget : public QWidget
{
Q_OBJECT
public:
GUIBannerWidget(QWidget *parent = 0);
~GUIBannerWidget();
QWidget* dockQmlToWidget();
void PopulateBannerFromWeb();
void PopulateBannerLocally();
private:
void registerCustomQmlTypes();
GUIBannerControl* m_pBannerControl;
CasinoCoinWebAPIParser* m_pWebApiParserTemporary;
CasinoCoinWebAPI* m_pWebApiTemporary;
QmlImageProvider* m_pQmlImageProvider;
private slots:
void slotPopulateFromWeb( JsonActivePromotionsParser* a_pPromotionsParser );
};
#endif // GUIBANNERWIDGET_H

View File

@@ -0,0 +1,43 @@
#include "guiexchangescontrol.h"
#include "guiexchangeslistview.h"
#include "qmlexchangeslistmodel.h"
#include "qmlexchangeslistitem.h"
GUIExchangesControl::GUIExchangesControl( QQuickItem* a_pParent )
: QQuickItem( a_pParent )
, m_pExchangesView( 0 )
{
}
GUIExchangesControl::~GUIExchangesControl()
{
if ( m_pExchangesView )
{
delete m_pExchangesView;
m_pExchangesView = 0;
}
}
void GUIExchangesControl::initializeExchangesView( GUIExchangesListView* a_pView )
{
if ( a_pView )
{
if ( m_pExchangesView )
{
delete m_pExchangesView;
}
m_pExchangesView = a_pView;
}
}
void GUIExchangesControl::slotPopulateListView( JsonActiveExchangesParser* a_pActiveExchanges )
{
if ( m_pExchangesView && a_pActiveExchanges )
{
QmlExchangesListModel* pExchangesModel = new QmlExchangesListModel( *a_pActiveExchanges );
m_pExchangesView->setModel( pExchangesModel );
delete a_pActiveExchanges;
a_pActiveExchanges = 0;
}
}

View File

@@ -0,0 +1,31 @@
#ifndef GUIEEXCHANGESCONTROL_H
#define GUIEEXCHANGESCONTROL_H
#include <QQuickItem>
#include "../../CSCPublicAPI/jsonactiveexchangesparser.h"
class GUIExchangesListView;
class GUIExchangesControl : public QQuickItem
{
Q_OBJECT
public:
GUIExchangesControl( QQuickItem* a_pParent = 0 );
virtual ~GUIExchangesControl();
Q_INVOKABLE void initializeExchangesView( GUIExchangesListView* a_pView );
GUIExchangesListView* getExchangesView() const { return m_pExchangesView; }
public slots:
void slotPopulateListView( JsonActiveExchangesParser* a_pActiveExchanges );
signals:
public slots:
private:
GUIExchangesListView* m_pExchangesView;
};
#endif // GUIEEXCHANGESCONTROL_H

View File

@@ -0,0 +1,50 @@
#include "guiexchangeslistview.h"
#include "qmlexchangeslistitem.h"
#include "qmlexchangeslistmodel.h"
#include "qmllistmodel.h"
#include <QDesktopServices>
#include <QUrl>
GUIExchangesListView::GUIExchangesListView( QQuickItem* a_pParent )
: QQuickItem( a_pParent )
, m_pModel( 0 )
{
}
void GUIExchangesListView::clear()
{
if ( m_pModel )
{
m_pModel->clear();
}
}
void GUIExchangesListView::onClicked( int a_iItemIndex )
{
if ( m_pModel )
{
QString strUrl = m_pModel->GetData( a_iItemIndex, QmlExchangesListItem::ROLE_DESTINATION_URL ).toString();
QDesktopServices::openUrl( QUrl( strUrl ) );
}
}
GUIExchangesListView::~GUIExchangesListView()
{
if ( m_pModel )
{
delete m_pModel;
m_pModel = 0;
}
}
void GUIExchangesListView::setModel( QmlExchangesListModel* a_pModel )
{
if ( m_pModel )
{
delete m_pModel;
}
m_pModel = a_pModel;
emit signalModelChanged();
}

View File

@@ -0,0 +1,36 @@
#ifndef GUIEXCHANGESLISTVIEW_H
#define GUIEXCHANGESLISTVIEW_H
#include <QQuickItem>
class QmlListModel;
class QmlExchangesListModel;
class QmlExchangesListItem;
class GUIExchangesListView : public QQuickItem
{
Q_OBJECT
Q_PROPERTY( QmlExchangesListModel* p_pListModel MEMBER m_pModel NOTIFY signalModelChanged )
public:
explicit GUIExchangesListView( QQuickItem *a_pParent = 0 );
virtual ~GUIExchangesListView(); /** Destructor **/
void setModel( QmlExchangesListModel* a_pModel );
QmlExchangesListModel* getModel() const { return m_pModel; }
void clear();
Q_INVOKABLE void onClicked( int a_iItemIndex );
signals:
void signalModelChanged();
public slots:
private:
QmlExchangesListModel* m_pModel;
};
#endif // GUIEXCHANGESLISTVIEW_H

View File

@@ -0,0 +1,113 @@
#include "guiexchangeswidget.h"
#include <QHBoxLayout>
#include <QCheckBox>
#include <QQuickView>
#include <QQmlContext>
#include "gui20_skin.h"
// qml
#include "guiexchangescontrol.h"
#include "guiexchangeslistview.h"
#include "qmlexchangeslistmodel.h"
#include "qmlexchangeslistitem.h"
#include "qmlimageprovider.h"
// web
#include "../../CSCPublicAPI/casinocoinwebapi.h"
#include "../../CSCPublicAPI/casinocoinwebapiparser.h"
GUIExchangesWidget::GUIExchangesWidget(QWidget *parent)
: QWidget(parent)
, m_pExchangesControl( 0 )
, m_pWebApiParserTemporary( new CasinoCoinWebAPIParser( this ) )
, m_pWebApiTemporary( new CasinoCoinWebAPI( this ) )
, m_pQmlImageProvider( 0 )
{
registerCustomQmlTypes();
connect( m_pWebApiTemporary, SIGNAL( signalResponseReady(const QByteArray&)), m_pWebApiParserTemporary, SLOT( slotParseAnswer(const QByteArray&)), Qt::UniqueConnection );
connect( m_pWebApiTemporary, SIGNAL( signalNetworkError(QNetworkReply::NetworkError,const QUrl)), m_pWebApiParserTemporary, SLOT( slotNetworkError(QNetworkReply::NetworkError,const QUrl)), Qt::UniqueConnection );
connect( m_pWebApiParserTemporary, SIGNAL( signalActiveExchangesParsed(JsonActiveExchangesParser*)), this, SLOT( slotPopulateFromWeb(JsonActiveExchangesParser*)), Qt::UniqueConnection );
SetupRefreshTimer();
m_timerRefresh.start();
}
GUIExchangesWidget::~GUIExchangesWidget()
{
// member objects are moved to qml engine and it manages their instances
}
void GUIExchangesWidget::registerCustomQmlTypes()
{
qmlRegisterType<GUIExchangesControl>("CasinoCoinControls", 1, 0, "GUIExchangesControl" );
qmlRegisterType<GUIExchangesListView>("CasinoCoinControls", 1, 0, "GUIExchangesListView" );
qmlRegisterType<QmlExchangesListModel>("CasinoCoinControls", 1, 0, "QmlExchangesListModel" );
}
void GUIExchangesWidget::SetupRefreshTimer()
{
m_timerRefresh.setSingleShot( false );
m_timerRefresh.setInterval( 1000 * 60 );
connect( &m_timerRefresh, SIGNAL( timeout() ), this, SLOT( slotPopulateExchangesFromWeb() ), Qt::UniqueConnection );
}
QWidget* GUIExchangesWidget::dockQmlToWidget()
{
QQuickView* pExchangesWindow = new QQuickView;
QWidget* pPlaceHolder = 0;
if ( pExchangesWindow )
{
QQmlContext* pContext = pExchangesWindow->rootContext();
if ( pContext )
{
pContext->setContextProperty( "GUI20Skin", &GUI20Skin::Instance() );
}
QQmlEngine* pEngine = pExchangesWindow->engine();
if ( pEngine )
{
m_pQmlImageProvider = new QmlImageProvider();
pEngine->addImageProvider( "exchangesImages", m_pQmlImageProvider );
}
pExchangesWindow->setSource( QUrl( QStringLiteral( "qrc:/qml/qtquick_controls/qml/QmlGUIExchangesWindow.qml" ) ) );
QQuickItem* pRootObject = pExchangesWindow->rootObject();
if ( pRootObject )
{
m_pExchangesControl = pRootObject->findChild<GUIExchangesControl*>();
if ( m_pExchangesControl )
{
}
}
pPlaceHolder = QWidget::createWindowContainer( pExchangesWindow, this );
if ( pPlaceHolder )
{
pPlaceHolder->setMinimumSize( 500, 200 );
pPlaceHolder->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
}
}
return pPlaceHolder;
}
void GUIExchangesWidget::slotPopulateExchangesFromWeb()
{
if ( m_pWebApiTemporary )
{
m_pWebApiTemporary->GetActiveExchanges();
}
}
void GUIExchangesWidget::slotPopulateFromWeb( JsonActiveExchangesParser* a_pExchangesParser )
{
if ( a_pExchangesParser )
{
a_pExchangesParser->AddImagesToPool( m_pQmlImageProvider );
}
if ( m_pExchangesControl )
{
m_pExchangesControl->slotPopulateListView( a_pExchangesParser );
}
}

View File

@@ -0,0 +1,44 @@
#ifndef GUIEXCHANGESWIDGET_H
#define GUIEXCHANGESWIDGET_H
#include <QWidget>
#include <QNetworkReply>
#include <QTimer>
class CasinoCoinWebAPIParser;
class CasinoCoinWebAPI;
class GUIExchangesControl;
class QmlImageProvider;
class JsonActiveExchangesParser;
class GUIExchangesWidget : public QWidget
{
Q_OBJECT
public:
GUIExchangesWidget( QWidget *parent = 0) ;
~GUIExchangesWidget();
QWidget* dockQmlToWidget();
void PopulateExchangesLocally();
public slots:
void slotPopulateExchangesFromWeb();
private:
void registerCustomQmlTypes();
void SetupRefreshTimer();
GUIExchangesControl* m_pExchangesControl;
CasinoCoinWebAPIParser* m_pWebApiParserTemporary;
CasinoCoinWebAPI* m_pWebApiTemporary;
QmlImageProvider* m_pQmlImageProvider;
QTimer m_timerRefresh;
private slots:
void slotPopulateFromWeb( JsonActiveExchangesParser* a_pExchangesParser );
};
#endif // GUIEXCHANGESWIDGET_H

View File

@@ -0,0 +1,90 @@
#include "guimenutoolbarcontrol.h"
#include "guimenutoolbarlistview.h"
#include "qmlmenutoolbarmodel.h"
#include "qmlmenutoolbaritem.h"
#include "gui20_skin.h"
GUIMenuToolbarControl::GUIMenuToolbarControl( QQuickItem* a_pParent )
: QQuickItem( a_pParent )
, m_pMenuToolbarView( 0 )
, m_strVisitWebsiteText( tr( "Visit our website" ) )
, m_strWebsiteURL( tr( "casinocoin.org" ) )
{
}
GUIMenuToolbarControl::~GUIMenuToolbarControl()
{
if ( m_pMenuToolbarView )
{
delete m_pMenuToolbarView;
m_pMenuToolbarView = 0;
}
}
void GUIMenuToolbarControl::initializeMenuToolbarView( GUIMenuToolbarListView* a_pView )
{
if ( a_pView )
{
if ( m_pMenuToolbarView )
{
delete m_pMenuToolbarView;
}
m_pMenuToolbarView = a_pView;
if ( m_pMenuToolbarView )
{
QmlMenuToolbarModel* pStandardMenuModel = new QmlMenuToolbarModel( m_pMenuToolbarView );
if ( pStandardMenuModel )
{
pStandardMenuModel->append( new QmlMenuToolbarItem( tr( "Overview" ), tr( "Overview description" ), "qrc:/icons/res/icons/GUI20_mainToolBar_overview_hover.png", "qrc:/icons/res/icons/GUI20_mainToolBar_overview.png" , OVERVIEW ) );
pStandardMenuModel->append( new QmlMenuToolbarItem( tr( "Send" ), tr( "Send description" ), "qrc:/icons/res/icons/GUI20_mainToolBar_send_hover.png", "qrc:/icons/res/icons/GUI20_mainToolBar_send.png" , SEND ) );
pStandardMenuModel->append( new QmlMenuToolbarItem( tr( "Receive" ), tr( "Receive description" ), "qrc:/icons/res/icons/GUI20_mainToolBar_receive_hover.png", "qrc:/icons/res/icons/GUI20_mainToolBar_receive.png" , RECEIVE ) );
pStandardMenuModel->append( new QmlMenuToolbarItem( tr( "Transactions" ), tr( "Transactions description" ), "qrc:/icons/res/icons/GUI20_mainToolBar_transactions_hover.png", "qrc:/icons/res/icons/GUI20_mainToolBar_transactions.png" , TRANSACTIONS ) );
pStandardMenuModel->append( new QmlMenuToolbarItem( tr( "Contacts" ), tr( "Contacts description" ), "qrc:/icons/res/icons/GUI20_mainToolBar_contacts_hover.png", "qrc:/icons/res/icons/GUI20_mainToolBar_contacts.png" , CONTACTS ) );
pStandardMenuModel->append( new QmlMenuToolbarItem( tr( "Redeem Prypto" ), tr( "Redeem Prypto description" ), "qrc:/icons/res/icons/GUI20_mainToolBar_redeemprypto_hover.png", "qrc:/icons/res/icons/GUI20_mainToolBar_redeemprypto.png" , REDEEM_PRYPTO ) );
pStandardMenuModel->append( new QmlMenuToolbarItem( tr( "Info" ), tr( "Info description" ), "qrc:/icons/res/icons/GUI20_mainToolBar_info_hover.png", "qrc:/icons/res/icons/GUI20_mainToolBar_info.png" , INFO ) );
pStandardMenuModel->SetCurrentItemIndex( 0 );
m_pMenuToolbarView->SetModel( pStandardMenuModel );
connectListViewSignals();
}
}
}
}
void GUIMenuToolbarControl::setVisitWebsiteText( QString a_strNewText )
{
if ( m_strVisitWebsiteText != a_strNewText )
{
m_strVisitWebsiteText = a_strNewText;
emit signalVisitWebsiteTextChanged();
}
}
void GUIMenuToolbarControl::setWebsiteURL( QString a_strNewText )
{
if ( m_strWebsiteURL != a_strNewText )
{
m_strWebsiteURL = a_strNewText;
emit signalWebsiteURLChanged();
}
}
void GUIMenuToolbarControl::connectListViewSignals()
{
if ( m_pMenuToolbarView )
{
disconnect( m_pMenuToolbarView );
QmlMenuToolbarModel* pModel = m_pMenuToolbarView->GetModel();
if ( pModel )
{
connect( pModel, SIGNAL( signalCurrentItemIndexChanged() ), this, SLOT( slotCurrentItemIndexChanged() ), Qt::UniqueConnection );
}
}
}
void GUIMenuToolbarControl::slotCurrentItemIndexChanged()
{
emit signalCurrentItemIndexChanged();
}

View File

@@ -0,0 +1,59 @@
#ifndef GUIMENUTOOLBARCONTROL_H
#define GUIMENUTOOLBARCONTROL_H
#include <QQuickItem>
class GUIMenuToolbarListView;
class GUIMenuToolbarControl : public QQuickItem
{
Q_OBJECT
Q_PROPERTY( QString p_strVisitWebsiteText MEMBER m_strVisitWebsiteText NOTIFY signalVisitWebsiteTextChanged )
Q_PROPERTY( QString p_strWebsiteURL MEMBER m_strWebsiteURL NOTIFY signalWebsiteURLChanged )
Q_ENUMS( EMenuToolbarItemTypes )
public:
enum EMenuToolbarItemTypes
{ OVERVIEW
, SEND
, RECEIVE
, TRANSACTIONS
, CONTACTS
, REDEEM_PRYPTO
, INFO
};
GUIMenuToolbarControl( QQuickItem* a_pParent = 0 );
virtual ~GUIMenuToolbarControl();
Q_INVOKABLE void initializeMenuToolbarView( GUIMenuToolbarListView* a_pView );
GUIMenuToolbarListView* GetMenuToolbarView() const { return m_pMenuToolbarView; }
void setVisitWebsiteText( QString a_strNewText );
void setWebsiteURL( QString a_strNewText );
QString GetVisitWebsiteText() const { return m_strVisitWebsiteText; }
QString GetWebsiteURL() const { return m_strWebsiteURL; }
public slots:
signals:
void signalCurrentItemIndexChanged();
void signalVisitWebsiteTextChanged();
void signalWebsiteURLChanged();
void signalOurWebsiteURLClicked();
private:
GUIMenuToolbarListView* m_pMenuToolbarView;
QString m_strVisitWebsiteText;
QString m_strWebsiteURL;
void connectListViewSignals();
private slots:
void slotCurrentItemIndexChanged();
};
#endif // GUIMENUTOOLBARCONTROL_H

View File

@@ -0,0 +1,47 @@
#include "guimenutoolbarlistview.h"
#include "qmlmenutoolbarmodel.h"
#include "qmlmenutoolbaritem.h"
GUIMenuToolbarListView::GUIMenuToolbarListView( QQuickItem* a_pParent )
: QQuickItem( a_pParent )
, m_pModel( 0 )
{
}
void GUIMenuToolbarListView::Clear()
{
if ( m_pModel )
{
m_pModel->clear();
}
}
void GUIMenuToolbarListView::OnClicked( int a_iItemIndex )
{
if ( m_pModel )
{
m_pModel->SetCurrentItemIndex( a_iItemIndex );
}
}
GUIMenuToolbarListView::~GUIMenuToolbarListView()
{
if ( m_pModel )
{
delete m_pModel;
m_pModel = 0;
}
}
void GUIMenuToolbarListView::SetModel( QmlMenuToolbarModel* a_pModel )
{
if ( m_pModel )
{
delete m_pModel;
}
m_pModel = a_pModel;
emit signalModelChanged();
}

View File

@@ -0,0 +1,36 @@
#ifndef GUIMENUTOOLBARLISTVIEW_H
#define GUIMENUTOOLBARLISTVIEW_H
#include <QQuickItem>
class QmlListModel;
class QmlMenuToolbarModel;
class QmlMenuToolbarItem;
class GUIMenuToolbarListView : public QQuickItem
{
Q_OBJECT
Q_PROPERTY( QmlMenuToolbarModel* p_pListModel MEMBER m_pModel NOTIFY signalModelChanged )
public:
explicit GUIMenuToolbarListView( QQuickItem *a_pParent = 0 );
virtual ~GUIMenuToolbarListView(); /** Destructor **/
void SetModel( QmlMenuToolbarModel* a_pModel );
QmlMenuToolbarModel* GetModel() const { return m_pModel; }
void Clear();
Q_INVOKABLE void OnClicked( int a_iItemIndex );
signals:
void signalModelChanged();
public slots:
private:
QmlMenuToolbarModel* m_pModel;
};
#endif // GUIMENUTOOLBARLISTVIEW_H

View File

@@ -0,0 +1,118 @@
#include "guimenutoolbarwidget.h"
#include "guimenutoolbarcontrol.h"
#include "guimenutoolbarlistview.h"
#include "qmlmenutoolbarmodel.h"
#include "qmlmenutoolbaritem.h"
#include "qmlimageprovider.h"
#include "gui20_skin.h"
#include <QQuickView>
#include <QQmlContext>
#include <QDesktopServices>
#include <QUrl>
GUIMenuToolbarWidget::GUIMenuToolbarWidget( QWidget *a_pParent )
: QWidget( a_pParent )
, m_pToolbarControl( 0 )
, m_pQmlImageProvider( 0 )
{
registerCustomQmlTypes();
}
GUIMenuToolbarWidget::~GUIMenuToolbarWidget()
{
// member objects are moved to qml engine and it manages their instances
}
void GUIMenuToolbarWidget::registerCustomQmlTypes()
{
qmlRegisterType<GUIMenuToolbarControl>("CasinoCoinControls", 1, 0, "GUIMenuToolbarControl" );
qmlRegisterType<GUIMenuToolbarListView>("CasinoCoinControls", 1, 0, "GUIMenuToolbarListView" );
qmlRegisterType<QmlMenuToolbarModel>("CasinoCoinControls", 1, 0, "QmlMenuToolbarModel" );
}
void GUIMenuToolbarWidget::slotCurrentItemChanged()
{
if ( m_pToolbarControl )
{
GUIMenuToolbarListView* pListView = m_pToolbarControl->GetMenuToolbarView();
if ( pListView )
{
QmlMenuToolbarModel* pModel = pListView->GetModel();
if ( pModel )
{
emit signalItemClicked( static_cast<GUIMenuToolbarControl::EMenuToolbarItemTypes>( pModel->GetData( pModel->GetCurrentItemIndex(), QmlMenuToolbarItem::ROLE_INTERNAL_TYPE ).toInt() ) );
}
}
}
}
void GUIMenuToolbarWidget::slotOurWebsiteURLClicked()
{
if ( m_pToolbarControl )
{
QString strUrl = m_pToolbarControl->GetWebsiteURL();
if ( !strUrl.contains( "http" ) )
{
strUrl.prepend( "http://" );
}
QDesktopServices::openUrl( QUrl( strUrl ) );
}
}
QWidget* GUIMenuToolbarWidget::dockQmlToWidget()
{
QQuickView* pMenuToolbarWindow = new QQuickView;
QWidget* pPlaceHolder = 0;
if ( pMenuToolbarWindow )
{
QQmlContext* pContext = pMenuToolbarWindow->rootContext();
if ( pContext )
{
pContext->setContextProperty( "GUI20Skin", &GUI20Skin::Instance() );
}
QQmlEngine* pEngine = pMenuToolbarWindow->engine();
if ( pEngine )
{
m_pQmlImageProvider = new QmlImageProvider();
pEngine->addImageProvider( "mainToolBarImages", m_pQmlImageProvider );
}
pMenuToolbarWindow->setSource( QUrl( QStringLiteral( "qrc:/qml/qtquick_controls/qml/QmlGUIMenuToolbarWindow.qml" ) ) );
QQuickItem* pRootObject = pMenuToolbarWindow->rootObject();
if ( pRootObject )
{
m_pToolbarControl = pRootObject->findChild<GUIMenuToolbarControl*>();
if ( m_pToolbarControl )
{
connect( m_pToolbarControl, SIGNAL( signalCurrentItemIndexChanged() ), this, SLOT( slotCurrentItemChanged() ), Qt::UniqueConnection );
connect( m_pToolbarControl, SIGNAL( signalOurWebsiteURLClicked() ), this, SLOT( slotOurWebsiteURLClicked() ), Qt::UniqueConnection );
}
}
pPlaceHolder = QWidget::createWindowContainer( pMenuToolbarWindow );
if ( pPlaceHolder )
{
pPlaceHolder->setMinimumHeight( 82 );
}
}
return pPlaceHolder;
}
void GUIMenuToolbarWidget::SetCurrentItemType( GUIMenuToolbarControl::EMenuToolbarItemTypes a_eType )
{
if ( m_pToolbarControl )
{
GUIMenuToolbarListView* pListView = m_pToolbarControl->GetMenuToolbarView();
if ( pListView )
{
QmlMenuToolbarModel* pModel = pListView->GetModel();
if ( pModel )
{
pModel->SetCurrentItemIndex( pModel->GetItemIndex( QmlMenuToolbarItem::ROLE_INTERNAL_TYPE, QVariant( a_eType ) ) );
}
}
}
}

View File

@@ -0,0 +1,35 @@
#ifndef GUIMENUTOOLBARWIDGET_H
#define GUIMENUTOOLBARWIDGET_H
#include <QWidget>
#include "guimenutoolbarcontrol.h"
class QmlImageProvider;
class GUIMenuToolbarWidget : public QWidget
{
Q_OBJECT
public:
explicit GUIMenuToolbarWidget( QWidget* a_pParent = 0 );
virtual ~GUIMenuToolbarWidget();
QWidget* dockQmlToWidget();
void SetCurrentItemType( GUIMenuToolbarControl::EMenuToolbarItemTypes a_eType );
signals:
void signalItemClicked( GUIMenuToolbarControl::EMenuToolbarItemTypes a_eType );
public slots:
private:
void registerCustomQmlTypes();
GUIMenuToolbarControl* m_pToolbarControl;
QmlImageProvider* m_pQmlImageProvider;
private slots:
void slotCurrentItemChanged();
void slotOurWebsiteURLClicked();
};
#endif // GUIMENUTOOLBARWIDGET_H

View File

@@ -0,0 +1,19 @@
#ifndef LISTITEMINTERFACE_H
#define LISTITEMINTERFACE_H
#include <QObject>
class ListItemInterface : public QObject
{
Q_OBJECT
public:
ListItemInterface( QObject* a_pParent = 0 ) : QObject( a_pParent ){} /** Constructor **/
virtual ~ListItemInterface() {} /** Destructor **/
virtual QVariant GetData( int a_iRole ) const = 0; /** Data Accesor **/
virtual bool SetData( int a_iRole, QVariant a_variantData ) = 0; /** Sets given value at specified role **/
virtual QHash<int, QByteArray> RoleNames() const = 0; /** User roles in model **/
};
#endif // LISTITEMINTERFACE_H

View File

@@ -0,0 +1,32 @@
#include "qmlbannerlistitem.h"
#include <QDebug>
QmlBannerListItem::QmlBannerListItem(QString a_strImageSource, QString a_strDestinationUrl, QString a_strDescription, QObject* a_pParent )
: QmlListItem( QVariant( a_strImageSource ), QVariant( a_strDestinationUrl ), QVariant( a_strDescription ), a_pParent )
{
}
QmlBannerListItem::QmlBannerListItem( const JsonSingleActivePromotion& a_rCasinoDescription, QObject* a_pParent )
: QmlListItem( QVariant( a_rCasinoDescription.GetImageName() ), a_rCasinoDescription.find( "access_url" ).value().toVariant(), a_rCasinoDescription.find( "description" ).value().toVariant(), a_pParent )
{
}
QmlBannerListItem::QmlBannerListItem( QObject* a_pParent )
: QmlListItem( QVariant( "" ), QVariant( "" ), QVariant( "" ), a_pParent )
{
}
QmlBannerListItem::~QmlBannerListItem()
{
}
QHash<int, QByteArray> QmlBannerListItem::RoleNames() const
{
QHash<int, QByteArray> aRoleNames;
aRoleNames[ROLE_IMAGE_SOURCE] = "m_imageSource";
aRoleNames[ROLE_DESTINATION_URL] = "m_destinationUrl";
aRoleNames[ROLE_DESCRIPTION] = "m_description";
return aRoleNames;
}

View File

@@ -0,0 +1,37 @@
#ifndef QMLBANNERLISTITEM_H
#define QMLBANNERLISTITEM_H
#include "qmllistitem.h"
#include "../../CSCPublicAPI/jsonsingleactivepromotion.h"
class QmlBannerListItem : public QmlListItem
{
Q_OBJECT
public:
enum EBannerRoles /** User-specific model roles **/
{ ROLE_IMAGE_SOURCE = ROLE_1
, ROLE_DESTINATION_URL = ROLE_2
, ROLE_DESCRIPTION = ROLE_3
};
explicit QmlBannerListItem
( QString a_strImageSource
, QString a_strDestinationUrl
, QString a_strDescription
, QObject *a_pParent = 0
);
explicit QmlBannerListItem ( const JsonSingleActivePromotion& a_rCasinoDescription
, QObject *a_pParent = 0
);
explicit QmlBannerListItem( QObject *a_pParent = 0 );
virtual ~QmlBannerListItem();
virtual QHash<int, QByteArray> RoleNames() const; /** Define class-specific roles **/
signals:
public slots:
};
#endif // QMLBANNERLISTITEM_H

View File

@@ -0,0 +1,30 @@
#include "qmlbannerlistmodel.h"
#include "qmlbannerlistitem.h"
#include "../../CSCPublicAPI/jsonactivepromotionsparser.h"
#include "../../CSCPublicAPI/jsonsingleactivepromotion.h"
#include <QDebug>
QmlBannerListModel::QmlBannerListModel( QObject* a_pParent )
: QmlListModel( new QmlBannerListItem( 0 ), a_pParent )
{
}
QmlBannerListModel::QmlBannerListModel
( const JsonActivePromotionsParser& a_rActivePromotions
, QObject* a_pParent
)
: QmlListModel( new QmlBannerListItem( 0 ), a_pParent )
{
foreach( const JsonSingleActivePromotion& rPromotion, a_rActivePromotions.GetPromotions() )
{
append( new QmlBannerListItem( rPromotion, this ) );
}
}
QmlBannerListModel::~QmlBannerListModel()
{
}

View File

@@ -0,0 +1,26 @@
#ifndef QMLBANNERLISTMODEL_H
#define QMLBANNERLISTMODEL_H
#include "qmllistmodel.h"
class QmlBannerListItem;
class JsonActivePromotionsParser;
class QmlBannerListModel : public QmlListModel
{
Q_OBJECT
public:
explicit QmlBannerListModel( QObject* a_pParent = 0 );
explicit QmlBannerListModel
( const JsonActivePromotionsParser& a_rActivePromotions
, QObject* a_pParent = 0
);
virtual ~QmlBannerListModel(); /** Destructor **/
signals:
public slots:
};
#endif // QMLBANNERLISTMODEL_H

View File

@@ -0,0 +1,79 @@
#include "qmlexchangeslistitem.h"
#include <QDebug>
#include <QDateTime>
QmlExchangesListItem::QmlExchangesListItem(QString a_strImageSource,
QString a_strDestinationUrl,
QString a_strExchangesName,
double a_dBidPrice,
double a_dAskPrice,
double a_dLastPrice,
QString a_strDescription,
double a_dVolume24H,
QString a_strLastUpdateTime,
QObject* a_pParent )
: QmlListItem ( QVariant( a_strImageSource )
, QVariant( a_strDestinationUrl )
, QVariant( a_strExchangesName )
, QVariant( getFormattedPrice( a_dBidPrice ) )
, QVariant( getFormattedPrice( a_dAskPrice ) )
, QVariant( getFormattedPrice( a_dLastPrice ) )
, QVariant( a_strDescription )
, QVariant( QString::number(a_dVolume24H) )
, QVariant( getFormattedDateTime(a_strLastUpdateTime) )
, a_pParent
)
{
}
QmlExchangesListItem::QmlExchangesListItem( const JsonSingleActiveExchange& a_rExchangeDescription, QObject* a_pParent )
: QmlListItem ( QVariant( a_rExchangeDescription.getImageName() )
, QVariant( a_rExchangeDescription.getAccessUrl() )
, QVariant( a_rExchangeDescription.getExchangeName() )
, QVariant( getFormattedPrice( a_rExchangeDescription.getLastBidPriceBTC() ) )
, QVariant( getFormattedPrice( a_rExchangeDescription.getLastAskPriceBTC() ) )
, QVariant( getFormattedPrice( a_rExchangeDescription.getLastPriceBTC() ) )
, QVariant( a_rExchangeDescription.getDescription() )
, QVariant( QString::number(a_rExchangeDescription.getVolume24H()) )
, QVariant( getFormattedDateTime( a_rExchangeDescription.getLastUpdateTime() ) )
, a_pParent
)
{
}
QmlExchangesListItem::QmlExchangesListItem( QObject* a_pParent )
: QmlListItem( QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), a_pParent )
{
}
QmlExchangesListItem::~QmlExchangesListItem()
{
}
QHash<int, QByteArray> QmlExchangesListItem::RoleNames() const
{
QHash<int, QByteArray> aRoleNames;
aRoleNames[ROLE_IMAGE_SOURCE] = "m_imageSource";
aRoleNames[ROLE_DESTINATION_URL] = "m_destinationUrl";
aRoleNames[ROLE_EXCHANGE_NAME] = "m_exchangeName";
aRoleNames[ROLE_BID_PRICE] = "m_bidPrice";
aRoleNames[ROLE_ASK_PRICE] = "m_askPrice";
aRoleNames[ROLE_LAST_PRICE] = "m_lastPrice";
aRoleNames[ROLE_DESCRIPTION] = "m_description";
aRoleNames[ROLE_VOLUME24H] = "m_volume24H";
aRoleNames[ROLE_LAST_UPDATE_TIME] = "m_lastUpdateTime";
return aRoleNames;
}
QString QmlExchangesListItem::getFormattedPrice(double a_dPrice)
{
return QString::number( a_dPrice, 'f', 8 );
}
QString QmlExchangesListItem::getFormattedDateTime( QString isoDateTime)
{
QDateTime datetime = QDateTime::fromString(isoDateTime, Qt::ISODate);
return datetime.toString("dd-MM-yyyy HH:mm:ss");
}

View File

@@ -0,0 +1,52 @@
#ifndef QMLEXCHANGESLISTITEM_H
#define QMLEXCHANGESLISTITEM_H
#include "qmllistitem.h"
#include "../../CSCPublicAPI/jsonsingleactiveexchange.h"
class QmlExchangesListItem : public QmlListItem
{
Q_OBJECT
public:
enum EExchangesRoles /** User-specific model roles **/
{ ROLE_IMAGE_SOURCE = ROLE_1
, ROLE_DESTINATION_URL = ROLE_2
, ROLE_EXCHANGE_NAME = ROLE_3
, ROLE_BID_PRICE = ROLE_4
, ROLE_ASK_PRICE = ROLE_5
, ROLE_LAST_PRICE = ROLE_6
, ROLE_DESCRIPTION = ROLE_7
, ROLE_VOLUME24H = ROLE_8
, ROLE_LAST_UPDATE_TIME = ROLE_9
};
explicit QmlExchangesListItem
( QString a_strImageSource
, QString a_strDestinationUrl
, QString a_strExchangesName
, double a_dBidPrice
, double a_dAskPrice
, double a_dLastPrice
, QString a_strDescription
, double a_dVolume24H
, QString a_strLastUpdateTime
, QObject *a_pParent = 0
);
explicit QmlExchangesListItem ( const JsonSingleActiveExchange& a_rExchangeDescription
, QObject *a_pParent = 0
);
explicit QmlExchangesListItem( QObject *a_pParent = 0 );
virtual ~QmlExchangesListItem();
virtual QHash<int, QByteArray> RoleNames() const; /** Define class-specific roles **/
signals:
public slots:
private:
QString getFormattedPrice( double a_dPrice );
QString getFormattedDateTime( QString isoDateTime);
};
#endif // QMLEXCHANGESLISTITEM_H

View File

@@ -0,0 +1,30 @@
#include "qmlexchangeslistmodel.h"
#include "qmlexchangeslistitem.h"
#include "../../CSCPublicAPI/jsonactiveexchangesparser.h"
#include "../../CSCPublicAPI/jsonsingleactiveexchange.h"
#include <QDebug>
QmlExchangesListModel::QmlExchangesListModel( QObject* a_pParent )
: QmlListModel( new QmlExchangesListItem( 0 ), a_pParent )
{
}
QmlExchangesListModel::QmlExchangesListModel
( const JsonActiveExchangesParser& a_rActiveExchanges
, QObject* a_pParent
)
: QmlListModel( new QmlExchangesListItem( 0 ), a_pParent )
{
foreach( const JsonSingleActiveExchange& rExchange, a_rActiveExchanges.GetExchanges() )
{
append( new QmlExchangesListItem( rExchange, this ) );
}
}
QmlExchangesListModel::~QmlExchangesListModel()
{
}

View File

@@ -0,0 +1,26 @@
#ifndef QMLEXCHANGESLISTMODEL_H
#define QMLEXCHANGESLISTMODEL_H
#include "qmllistmodel.h"
class QmlExchangesListItem;
class JsonActiveExchangesParser;
class QmlExchangesListModel : public QmlListModel
{
Q_OBJECT
public:
explicit QmlExchangesListModel( QObject* a_pParent = 0 );
explicit QmlExchangesListModel
( const JsonActiveExchangesParser& a_rActiveExchanges
, QObject* a_pParent = 0
);
virtual ~QmlExchangesListModel(); /** Destructor **/
signals:
public slots:
};
#endif // QMLEXCHANGESLISTMODEL_H

View File

@@ -0,0 +1,35 @@
#include "qmlimageprovider.h"
#include <QDebug>
QmlImageProvider::QmlImageProvider()
: QQuickImageProvider( QQuickImageProvider::Image )
{
}
void QmlImageProvider::AddToImagePool( QString a_strImageID, const QImage& a_rImage )
{
m_aImagePool.insert( a_strImageID, a_rImage );
}
void QmlImageProvider::AddToImagePool( const QMap<QString, QImage>& a_aImages )
{
QMapIterator<QString,QImage> iter( a_aImages );
while( iter.hasNext() )
{
iter.next();
AddToImagePool( iter.key(), iter.value() );
}
}
QImage QmlImageProvider::requestImage( const QString& a_rImageID, QSize* a_pSize, const QSize& a_rRequestedSize )
{
Q_UNUSED( a_rRequestedSize );
QImage oImage( m_aImagePool.value( a_rImageID ) );
if ( a_pSize )
{
a_pSize->setWidth( oImage.width() );
a_pSize->setHeight( oImage.height() );
}
return oImage;
}

View File

@@ -0,0 +1,28 @@
#ifndef QMLIMAGEPROVIDER_H
#define QMLIMAGEPROVIDER_H
#include <QQuickImageProvider>
#include <QImage>
class QmlImageProvider : public QQuickImageProvider
{
public:
explicit QmlImageProvider();
void AddToImagePool( QString a_strImageID, const QImage& a_rImage );
void AddToImagePool( const QMap<QString,QImage>& a_aImages );
virtual QImage requestImage
( const QString& a_rImageID
, QSize* a_pSize
, const QSize& a_rRequestedSize
);
signals:
public slots:
private:
QMap<QString,QImage> m_aImagePool;
};
#endif // QMLIMAGEPROVIDER_H

View File

@@ -0,0 +1,197 @@
#include "qmllistitem.h"
#include <QDebug>
QmlListItem::QmlListItem( QObject* a_pParent )
: ListItemInterface( a_pParent )
{
// Nothing
}
QmlListItem::QmlListItem( QVariant a_role1
, QObject* a_pParent
)
: ListItemInterface( a_pParent )
{
m_aDataHash[ROLE_1] = a_role1;
}
QmlListItem::QmlListItem( QVariant a_role1
, QVariant a_role2
, QObject* a_pParent
)
: ListItemInterface( a_pParent )
{
m_aDataHash[ROLE_1] = a_role1;
m_aDataHash[ROLE_2] = a_role2;
}
QmlListItem::QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QObject* a_pParent
)
: ListItemInterface( a_pParent )
{
m_aDataHash[ROLE_1] = a_role1;
m_aDataHash[ROLE_2] = a_role2;
m_aDataHash[ROLE_3] = a_role3;
}
QmlListItem::QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QObject* a_pParent
)
: ListItemInterface( a_pParent )
{
m_aDataHash[ROLE_1] = a_role1;
m_aDataHash[ROLE_2] = a_role2;
m_aDataHash[ROLE_3] = a_role3;
m_aDataHash[ROLE_4] = a_role4;
}
QmlListItem::QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QVariant a_role5
, QObject* a_pParent
)
: ListItemInterface( a_pParent )
{
m_aDataHash[ROLE_1] = a_role1;
m_aDataHash[ROLE_2] = a_role2;
m_aDataHash[ROLE_3] = a_role3;
m_aDataHash[ROLE_4] = a_role4;
m_aDataHash[ROLE_5] = a_role5;
}
QmlListItem::QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QVariant a_role5
, QVariant a_role6
, QObject* a_pParent
)
: ListItemInterface( a_pParent )
{
m_aDataHash[ROLE_1] = a_role1;
m_aDataHash[ROLE_2] = a_role2;
m_aDataHash[ROLE_3] = a_role3;
m_aDataHash[ROLE_4] = a_role4;
m_aDataHash[ROLE_5] = a_role5;
m_aDataHash[ROLE_6] = a_role6;
}
QmlListItem::QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QVariant a_role5
, QVariant a_role6
, QVariant a_role7
, QObject* a_pParent
)
: ListItemInterface( a_pParent )
{
m_aDataHash[ROLE_1] = a_role1;
m_aDataHash[ROLE_2] = a_role2;
m_aDataHash[ROLE_3] = a_role3;
m_aDataHash[ROLE_4] = a_role4;
m_aDataHash[ROLE_5] = a_role5;
m_aDataHash[ROLE_6] = a_role6;
m_aDataHash[ROLE_7] = a_role7;
}
QmlListItem::QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QVariant a_role5
, QVariant a_role6
, QVariant a_role7
, QVariant a_role8
, QObject* a_pParent
)
: ListItemInterface( a_pParent )
{
m_aDataHash[ROLE_1] = a_role1;
m_aDataHash[ROLE_2] = a_role2;
m_aDataHash[ROLE_3] = a_role3;
m_aDataHash[ROLE_4] = a_role4;
m_aDataHash[ROLE_5] = a_role5;
m_aDataHash[ROLE_6] = a_role6;
m_aDataHash[ROLE_7] = a_role7;
m_aDataHash[ROLE_8] = a_role8;
}
QmlListItem::QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QVariant a_role5
, QVariant a_role6
, QVariant a_role7
, QVariant a_role8
, QVariant a_role9
, QObject* a_pParent
)
: ListItemInterface( a_pParent )
{
m_aDataHash[ROLE_1] = a_role1;
m_aDataHash[ROLE_2] = a_role2;
m_aDataHash[ROLE_3] = a_role3;
m_aDataHash[ROLE_4] = a_role4;
m_aDataHash[ROLE_5] = a_role5;
m_aDataHash[ROLE_6] = a_role6;
m_aDataHash[ROLE_7] = a_role7;
m_aDataHash[ROLE_8] = a_role8;
m_aDataHash[ROLE_9] = a_role9;
}
QmlListItem::QmlListItem( const QmlListItem& a_rOther )
: ListItemInterface( a_rOther.parent() )
, m_aDataHash( a_rOther.m_aDataHash )
{
// Nothing
}
QmlListItem::~QmlListItem()
{
// Nothing
}
QVariant QmlListItem::GetData( int a_iRole ) const
{
return m_aDataHash[static_cast<ERoles>( a_iRole )];
}
bool QmlListItem::SetData( int a_iRole, QVariant a_variantData )
{
if ( m_aDataHash[static_cast<ERoles>( a_iRole )] != a_variantData )
{
m_aDataHash[static_cast<ERoles>( a_iRole )] = a_variantData;
return true;
}
return false;
}
QHash<int, QByteArray> QmlListItem::RoleNames() const
{
QHash<int, QByteArray> aRoleNames;
aRoleNames[ROLE_1] = "m_role1";
aRoleNames[ROLE_2] = "m_role2";
aRoleNames[ROLE_3] = "m_role3";
aRoleNames[ROLE_4] = "m_role4";
aRoleNames[ROLE_5] = "m_role5";
aRoleNames[ROLE_6] = "m_role6";
aRoleNames[ROLE_7] = "m_role7";
aRoleNames[ROLE_8] = "m_role8";
aRoleNames[ROLE_9] = "m_role9";
return aRoleNames;
}

View File

@@ -0,0 +1,109 @@
#ifndef QMLLISTITEM_H
#define QMLLISTITEM_H
// Qt
#include <QVariant>
#include <QColor>
#include <QHash>
// ptcommon
#include "listiteminterface.h"
class QmlListItem : public ListItemInterface
{
Q_OBJECT
public:
enum ERoles /** User-specific model roles **/
{ ROLE_1 = Qt::UserRole + 1
, ROLE_2 = Qt::UserRole + 2
, ROLE_3 = Qt::UserRole + 3
, ROLE_4 = Qt::UserRole + 4
, ROLE_5 = Qt::UserRole + 5
, ROLE_6 = Qt::UserRole + 6
, ROLE_7 = Qt::UserRole + 7
, ROLE_8 = Qt::UserRole + 8
, ROLE_9 = Qt::UserRole + 9
, ROLE_10 = Qt::UserRole + 10
, ROLE_LAST = Qt::UserRole + 11
};
explicit QmlListItem( QObject* a_pParent = 0 ); /** Default Constructor **/
explicit QmlListItem( QVariant a_role1
, QObject* a_pParent = 0
); /** Constructor with first role filled **/
explicit QmlListItem( QVariant a_role1
, QVariant a_role2
, QObject* a_pParent = 0
); /** Contstructor with first two roles filled **/
explicit QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QObject* a_pParent = 0
); /** Contstructor with first three roles filled **/
explicit QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QObject* a_pParent = 0
); /** Contstructor with first four roles filled **/
explicit QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QVariant a_role5
, QObject* a_pParent = 0
); /** Contstructor with first five roles filled **/
explicit QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QVariant a_role5
, QVariant a_role6
, QObject* a_pParent = 0
); /** Contstructor with first six roles filled **/
explicit QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QVariant a_role5
, QVariant a_role6
, QVariant a_role7
, QObject* a_pParent = 0
); /** Contstructor with first seven roles filled **/
explicit QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QVariant a_role5
, QVariant a_role6
, QVariant a_role7
, QVariant a_role8
, QObject* a_pParent = 0
); /** Contstructor with first eight roles filled **/
explicit QmlListItem( QVariant a_role1
, QVariant a_role2
, QVariant a_role3
, QVariant a_role4
, QVariant a_role5
, QVariant a_role6
, QVariant a_role7
, QVariant a_role8
, QVariant a_role9
, QObject* a_pParent = 0
); /** Contstructor with first nine roles filled **/
QmlListItem( const QmlListItem& a_rOther ); /** Copy constructor **/
virtual ~QmlListItem(); /** Destructor **/
virtual QVariant GetData( int a_iRole ) const; /** Retrieve role-specific data from class **/
virtual bool SetData( int a_iRole, QVariant a_variantData ); /** Sets given value at specified role **/
virtual QHash<int, QByteArray> RoleNames() const; /** Define class-specific roles **/
private:
QHash<ERoles, QVariant> m_aDataHash; /** Container keeping all item-specific roles **/
};
#endif // QMLLISTITEM_H

View File

@@ -0,0 +1,315 @@
#include "qmllistmodel.h"
#include <QDebug>
QmlListModel::QmlListModel( QObject* a_pParent )
: QAbstractListModel( a_pParent )
, m_pPrototype( 0 )
, m_iCurrentElementIndex( -1 )
{
m_aItems = QList<ListItemInterface*>();
}
QmlListModel::QmlListModel( ListItemInterface* a_pPrototype, QObject* a_pParent )
: QAbstractListModel( a_pParent )
, m_pPrototype( a_pPrototype )
, m_iCurrentElementIndex( -1 )
{
m_aItems = QList<ListItemInterface*>();
}
QmlListModel::~QmlListModel()
{
clear();
if ( m_pPrototype )
{
delete m_pPrototype;
m_pPrototype = 0;
}
}
int QmlListModel::rowCount( const QModelIndex& a_rParent ) const
{
Q_UNUSED( a_rParent );
return m_aItems.size();
}
QVariant QmlListModel::data( const QModelIndex& a_rIndex, int a_iRole ) const
{
if ( a_rIndex.row() < 0 )
{
return QVariant();
}
if ( a_rIndex.row() > m_aItems.size() )
{
return QVariant();
}
ListItemInterface* pValidate = m_aItems.at( a_rIndex.row() );
if ( pValidate )
{
return pValidate->GetData( a_iRole );
}
return QVariant();
}
bool QmlListModel::setData( const QModelIndex& a_rIndex, const QVariant& a_rValue, int a_iRole )
{
if ( a_rIndex.isValid() && a_iRole > Qt::UserRole )
{
ListItemInterface* pItem = m_aItems.at( a_rIndex.row() );
if ( pItem )
{
if ( pItem->SetData( a_iRole, a_rValue ) )
{
emit dataChanged( a_rIndex, a_rIndex );
return true;
}
}
}
return false;
}
QHash<int, QByteArray> QmlListModel::roleNames() const //NS
{
if ( m_pPrototype )
{
return m_pPrototype->RoleNames();
}
return ( QHash<int, QByteArray>() );
}
bool QmlListModel::removeRows( int a_iRow, int a_iCount, const QModelIndex& a_rParent ) //NS
{
if ( a_iRow < 0 )
{
return false;
}
if ( a_iCount <= 0 )
{
return false;
}
if ( ( a_iRow + a_iCount ) > m_aItems.size() )
{
return false;
}
beginRemoveRows( a_rParent, a_iRow, a_iRow + a_iCount - 1 );
for ( int i = 0; i < a_iCount; i++ )
{
ListItemInterface* pItem = m_aItems.takeAt( a_iRow );
delete pItem;
pItem = 0;
}
endRemoveRows();
emit signalCountChanged( rowCount() );
return true;
}
void QmlListModel::append( ListItemInterface* a_pItem ) //NS
{
if ( a_pItem != 0 )
{
beginInsertRows( QModelIndex(), rowCount(), rowCount() );
m_aItems.append( a_pItem );
a_pItem->setObjectName( objectName() + "_item_" + QString::number( rowCount() ) );
endInsertRows();
emit signalCountChanged( rowCount() );
}
}
void QmlListModel::insert( int a_iIndex, ListItemInterface* a_pItem ) //NS
{
if ( a_pItem != 0 && a_iIndex >= 0 && a_iIndex <= m_aItems.size() )
{
beginInsertRows( QModelIndex(), a_iIndex, a_iIndex );
m_aItems.insert( a_iIndex, a_pItem );
a_pItem->setObjectName( objectName() + "_item_" + QString::number( a_iIndex ) );
endInsertRows();
emit signalCountChanged( rowCount() );
}
}
QVariant QmlListModel::get( int a_iIndex )
{
if ( a_iIndex < 0 )
{
return QVariant();
}
if ( a_iIndex >= m_aItems.size() )
{
return QVariant();
}
QMap<QString, QVariant> aItemData;
ListItemInterface* pItem = m_aItems.at( a_iIndex );
if ( pItem )
{
QHashIterator<int, QByteArray> aRolesItr( pItem->RoleNames() );
while ( aRolesItr.hasNext() )
{
aRolesItr.next();
aItemData.insert( aRolesItr.value(), QVariant( pItem->GetData( aRolesItr.key() ) ) );
}
return QVariant( aItemData );
}
return QVariant();
}
void QmlListModel::clear()
{
if ( m_aItems.size() > 0 )
{
removeRows( 0, m_aItems.size() );
// signalCountChanged emitted inside removeRows
}
}
void QmlListModel::refresh()
{
if ( m_aItems.size() > 0 )
{
beginResetModel();
endResetModel();
}
}
int QmlListModel::GetItemIndex( int a_iItemRole, QVariant a_variantValue ) const
{
for ( int i = 0; i < m_aItems.size(); i++ )
{
if ( m_aItems[i]->GetData( a_iItemRole ) == a_variantValue )
{
return i;
}
}
return -1;
}
ListItemInterface* QmlListModel::GetCurrentItem() const
{
if ( m_iCurrentElementIndex >= 0 && m_aItems.size() > m_iCurrentElementIndex )
{
return m_aItems[m_iCurrentElementIndex];
}
return 0;
}
void QmlListModel::SetCurrentItemIndex( int a_iIndex )
{
if ( a_iIndex == -1
|| ( a_iIndex >= 0 && a_iIndex < rowCount() )
)
{
if ( m_iCurrentElementIndex != a_iIndex )
{
m_iCurrentElementIndex = a_iIndex;
emit signalCurrentItemIndexChanged();
}
else
{
if ( m_iCurrentElementIndex != -1 )
{
emit signalCurrentItemIndexClicked();
}
}
}
}
int QmlListModel::GetCurrentItemIndex() const
{
return m_iCurrentElementIndex;
}
bool QmlListModel::SetData( int a_iIndex, const QVariant& a_rValue, int a_iRole )
{
QModelIndex modelIndex = createIndex( a_iIndex, 0 );
return setData( modelIndex, a_rValue, a_iRole );
}
QVariant QmlListModel::GetData( int a_iIndex, int a_iRole )
{
QModelIndex modelIndex = createIndex( a_iIndex, 0 );
return data( modelIndex, a_iRole );
}
void QmlListModel::Sort( int a_iRole, Qt::SortOrder a_eOrder )
{
QList<ListItemInterface*> aSortedList;
if ( a_eOrder == Qt::AscendingOrder )
{
foreach ( ListItemInterface* pItem, m_aItems )
{
int iSortedIndex = 0;
const int iSortedListCount = aSortedList.count();
QVariant valueOriginal = pItem->GetData( a_iRole );
bool bIndexFound = false;
for ( iSortedIndex = iSortedListCount - 1 ; iSortedIndex >= 0 ; --iSortedIndex )
{
const ListItemInterface* pSortedItem = aSortedList.at( iSortedIndex );
if ( pSortedItem )
{
QVariant valueSorted = pSortedItem->GetData( a_iRole );
if ( Compare( a_iRole, valueOriginal, valueSorted ) > 0 )
{
aSortedList.insert( iSortedIndex + 1, pItem );
bIndexFound = true;
break;
}
}
}
if ( !bIndexFound )
{
aSortedList.prepend( pItem );
}
}
}
else if ( Qt::DescendingOrder )
{
foreach ( ListItemInterface* pItem, m_aItems )
{
int iSortedIndex = 0;
const int iSortedListCount = aSortedList.count();
QVariant valueOriginal = pItem->GetData( a_iRole );
bool bIndexFound = false;
for ( iSortedIndex = 0 ; iSortedIndex < iSortedListCount ; ++iSortedIndex )
{
const ListItemInterface* pSortedItem = aSortedList.at( iSortedIndex );
if ( pSortedItem )
{
QVariant valueSorted = pSortedItem->GetData( a_iRole );
if ( Compare( a_iRole, valueOriginal, valueSorted ) > 0 )
{
aSortedList.insert( iSortedIndex, pItem );
bIndexFound = true;
break;
}
}
}
if ( !bIndexFound )
{
aSortedList.append( pItem );
}
}
}
m_aItems = aSortedList;
emit dataChanged( createIndex( 0, 0 ), createIndex( rowCount() - 1, 0 ) );
}
int QmlListModel::Compare( int a_iRole, QVariant& a_rValue1, QVariant& a_rValue2 )
{
Q_UNUSED( a_iRole );
int iReturn = 0;
if ( a_rValue1 > a_rValue2 )
{
iReturn = 1;
}
else if ( a_rValue1 < a_rValue2 )
{
iReturn = -1;
}
return iReturn;
}

View File

@@ -0,0 +1,83 @@
#ifndef QMLLISTMODEL_H
#define QMLLISTMODEL_H
#include <QAbstractListModel>
#include <QColor>
#include "qmllistitem.h"
class QmlListModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY( int count READ rowCount NOTIFY signalCountChanged )
Q_PROPERTY( int p_iCurrentElementIndex MEMBER m_iCurrentElementIndex NOTIFY signalCurrentItemIndexChanged )
public:
//////////////////
// Methods
explicit QmlListModel( QObject* a_pParent = 0 ); /** Default Constructor **/
explicit QmlListModel( ListItemInterface* a_pPrototype, QObject* a_pParent = 0 ); /** Constructor with item prototype **/
virtual ~QmlListModel(); /** Destructor **/
int rowCount( const QModelIndex& a_rParent = QModelIndex() ) const; /** size of list getter **/
QVariant data( const QModelIndex& a_rIndex, int a_iRole = Qt::DisplayRole ) const; /** function returning model data at specific index **/
virtual bool setData /** Sets the role data for the item at index to value. **/
( const QModelIndex& a_rIndex
, const QVariant& a_rValue
, int a_iRole = Qt::EditRole
);
QHash<int, QByteArray> roleNames() const; /** returns user defined roles for model **/
bool removeRows( int a_iRow, int a_iCount, const QModelIndex& a_rParent = QModelIndex() ); /** deletes /count/ rows from model starting at /row/ **/
// Methods created to match QML Model style of data manipulation
Q_INVOKABLE void append( ListItemInterface* a_pItem ); /** appends /a_pItem/ element to the list **/
Q_INVOKABLE void insert( int a_iIndex, ListItemInterface* a_pItem ); /** insert /a_pItem/ to the list before the given /a_iIndex/ **/
Q_INVOKABLE QVariant get( int a_iIndex ); /** returns QMap containing value<->role pa at /a_iIndex/ **/
Q_INVOKABLE void clear(); /** clears the list **/
Q_INVOKABLE void refresh(); /** refreshes the list **/
inline const ListItemInterface* GetItem( int a_iIndex ) const; /** Get item at index **/
int GetItemIndex( int a_iItemRole, QVariant a_variantValue ) const; /** Get index of first item having given a_variantValue at given a_iItemRole **/
/** NOTE!!
This three methods have their implementation, however whole
currentItem system must be implemented manually for every derived class. **/
ListItemInterface* GetCurrentItem() const; /** Get current item pointer **/
virtual void SetCurrentItemIndex( int a_iIndex ); /** Set current item index **/
int GetCurrentItemIndex() const; /** Get current item index **/
bool SetData( int a_iIndex, const QVariant& a_rValue, int a_iRole ); /** Sets the role data for the item at index to value. **/
QVariant GetData( int a_iIndex, int a_iRole ); /** Get model data at specific index **/
void Sort( int a_iRole, Qt::SortOrder a_eOrder = Qt::AscendingOrder ); /** Sort items in list model by role in the given order **/
signals:
void signalCountChanged( int a_iNewCount ); /** notify that list contents changed **/
void signalCurrentItemIndexChanged(); /** notify that currently highlighted/focused item changed **/
void signalCurrentItemIndexClicked(); /** notify that currently highlighted/focused item was clicked again **/
void signalTextColorCol1Changed(); /** notify that text color in col1 changed **/
void signalTextSizeChanged(); /** notify that text size changed **/
void signalRowHeightChanged(); /** notify that row height changed **/
protected:
/////////////////
// Methods
virtual int Compare( int a_iRole, QVariant& a_rValue1, QVariant& a_rValue2 ); /** Compare two values with given role **/
//////////////////
// Properties
ListItemInterface* m_pPrototype; /** information on what type is held in a list **/
QList<ListItemInterface*> m_aItems; /** list with model data **/
int m_iCurrentElementIndex; /** current element index **/
};
const ListItemInterface* QmlListModel::GetItem( int a_iIndex ) const
{
if ( m_aItems.size() > a_iIndex && a_iIndex >= 0 )
{
return m_aItems[a_iIndex];
}
return 0;
}
#endif // QMLLISTMODEL_H

View File

@@ -0,0 +1,37 @@
#include "qmlmenutoolbaritem.h"
#include <QDebug>
QmlMenuToolbarItem::QmlMenuToolbarItem
( QString a_strText
, QString a_strDescription
, QString a_strImageHoverSource
, QString a_strImageNormalSource
, int a_iType
, QObject *a_pParent
)
: QmlListItem( QVariant( a_strText ), QVariant( a_strDescription ), QVariant( a_strImageHoverSource ), QVariant( a_strImageNormalSource ), QVariant( a_iType ), a_pParent )
{
}
QmlMenuToolbarItem::QmlMenuToolbarItem( QObject* a_pParent )
: QmlListItem( QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( -1 ), a_pParent )
{
}
QmlMenuToolbarItem::~QmlMenuToolbarItem()
{
}
QHash<int, QByteArray> QmlMenuToolbarItem::RoleNames() const
{
QHash<int, QByteArray> aRoleNames;
aRoleNames[ROLE_TEXT] = "m_text";
aRoleNames[ROLE_DESCRIPTION] = "m_description";
aRoleNames[ROLE_IMAGE_HOVER_SOURCE] = "m_imageHoverSource";
aRoleNames[ROLE_IMAGE_NORMAL_SOURCE] = "m_imageNormalSource";
aRoleNames[ROLE_INTERNAL_TYPE] = "m_internalType";
return aRoleNames;
}

View File

@@ -0,0 +1,36 @@
#ifndef QMLMENUTOOLBARITEM_H
#define QMLMENUTOOLBARITEM_H
#include "qmllistitem.h"
class QmlMenuToolbarItem : public QmlListItem
{
Q_OBJECT
Q_ENUMS( EMenuToolbarRoles )
public:
enum EMenuToolbarRoles /** User-specific model roles **/
{ ROLE_TEXT = ROLE_1
, ROLE_DESCRIPTION = ROLE_2
, ROLE_IMAGE_HOVER_SOURCE = ROLE_3
, ROLE_IMAGE_NORMAL_SOURCE = ROLE_4
, ROLE_INTERNAL_TYPE = ROLE_5
};
explicit QmlMenuToolbarItem
( QString a_strText
, QString a_strDescription
, QString a_strImageHoverSource
, QString a_strImageNormalSource
, int a_iType
, QObject *a_pParent = 0
);
explicit QmlMenuToolbarItem( QObject *a_pParent = 0 );
virtual ~QmlMenuToolbarItem();
virtual QHash<int, QByteArray> RoleNames() const; /** Define class-specific roles **/
};
#endif // QMLMENUTOOLBARITEM_H

Some files were not shown because too many files have changed in this diff Show More