Remove dokun-ui; Fix some bugs

pull/21/head
larteyoh 2 years ago
parent 2da6f4d3ca
commit 12fb2beecc

3
.gitmodules vendored

@ -13,6 +13,3 @@
[submodule "external/stduuid"]
path = external/stduuid
url = https://github.com/mariusbancila/stduuid.git
[submodule "external/dokun-ui"]
path = external/dokun-ui
url = https://github.com/sidtheprince/dokun-ui.git

@ -13,12 +13,11 @@ option(NEROSHOP_BUILD_TESTS "Build neroshop tests" OFF)
option(NEROSHOP_BUILD_CLI "Build neroshop CLI" OFF) # CLI is for testing only. This is a GUI-based ecommerce app so BUILD_CLI will be off by default
option(NEROSHOP_BUILD_GUI "Build neroshop GUI" ON)
include(CMakeDependentOption)
cmake_dependent_option(NEROSHOP_USE_QT "Build neroshop with Qt" ON "NEROSHOP_BUILD_GUI;NOT NEROSHOP_USE_DOKUN_UI" OFF)
cmake_dependent_option(NEROSHOP_USE_DOKUN_UI "Build neroshop with dokun-ui" ON "NEROSHOP_BUILD_GUI;NOT NEROSHOP_USE_QT" OFF) # defaults to ON if BUILD_GUI is defined and USE_QT is not defined
cmake_dependent_option(NEROSHOP_USE_QT "Build neroshop with Qt" ON "NEROSHOP_BUILD_GUI" OFF)
option(UUID_SYSTEM_GENERATOR "Enable operating system uuid generator" OFF)
option(UUID_TIME_GENERATOR "Enable experimental time-based uuid generator" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/external/monero-cpp/external/monero-project/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/external/monero-cpp/external/monero-project/cmake")
######################################
if(NEROSHOP_BUILD_GUI AND NEROSHOP_USE_QT)
set(CMAKE_AUTOMOC ON)
@ -29,7 +28,7 @@ if(NEROSHOP_BUILD_GUI AND NEROSHOP_USE_QT)
endif()
find_package(Qt5 COMPONENTS Qml Quick Gui #[[QuickControls2]])# REQUIRED) # v5.12.8
# add the qml.qrc file
qt5_add_resources(neroshop_src qml.qrc)#qt_add_resources# <= introduced in Qt 5.15 and higher
qt5_add_resources(neroshop_res qml.qrc)#qt_add_resources# <= introduced in Qt 5.15 and higher
endif()
######################################
@ -395,43 +394,13 @@ else()
set(png_src ${CMAKE_CURRENT_SOURCE_DIR}/build/libpng.a ${CMAKE_CURRENT_SOURCE_DIR}/build/libz.a)
endif()
######################################
# dokun-ui
if(NEROSHOP_USE_DOKUN_UI) # dokun-ui headers conflict with Qt headers
set(dokun_ui_external_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/lua/lua-5.4.1/src # lua
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/glew/include
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/png ${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/zlib
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/freetype/include # public headers - ft2build.h
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/freetype/include/freetype # public headers
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/freetype/include/freetype/config # public config headers
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/freetype/include/freetype/internal # private headers - added 2019-07-29
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/ogg/include
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/vorbis/include
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/vorbis/lib
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/theora/include
#${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/utf8/source
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/openal/include
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/openal-soft/include
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/jpeg
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/jpeg/jpeg-6b
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/tiff/libtiff
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/gif/lib
#[[${CMAKE_CURRENT_SOURCE_DIR}/external/flac]] # config.h
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/flac/include
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/flac/src/libFLAC/include # for "private/cpu.h"
${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/external/glm
)
set(dokun_ui_include_dir ${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/include/)
set(dokun_ui_src ${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui/build/libdokun-ui.a) # definitions added: DOKUN_OPENGL, DOKUN_BUILD_LIBRARY#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/dokun-ui)
endif()
######################################
# neroshop link directories
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/build) # target_link_directories only available in CMake version 3.13 :(
######################################
# neroshop core source files
set(neroshop_src ${neroshop_src} src/buyer.cpp #[[src/carrier.cpp]] src/cart.cpp src/catalog.cpp src/client.cpp src/config.cpp src/converter.cpp src/database.cpp src/encryptor.cpp #[[src/icon.cpp]] src/item.cpp #[[src/main.cpp]] src/order.cpp src/process.cpp src/qr.cpp src/script.cpp src/seller.cpp src/server.cpp src/user.cpp src/validator.cpp src/wallet.cpp)
set(neroshop_src src/buyer.cpp #[[src/carrier.cpp]] src/cart.cpp src/catalog.cpp src/client.cpp src/config.cpp src/converter.cpp src/database.cpp src/encryptor.cpp #[[src/icon.cpp]] src/item.cpp #[[src/main.cpp]] src/order.cpp src/process.cpp src/qr.cpp src/script.cpp src/seller.cpp src/server.cpp src/user.cpp src/validator.cpp src/wallet.cpp)
######################################
# neroshop tests
@ -453,12 +422,10 @@ target_link_libraries(${daemon_executable} ${libuv_src})#set(CMAKE_CXX_LINK_EXEC
if(NEROSHOP_BUILD_CLI)
set(neroshop_console "neroshop-console")
add_executable(${neroshop_console} src/console/main.cpp ${neroshop_src})
target_compile_definitions(${neroshop_console} PRIVATE NEROSHOP_DEBUG) # for more detailed debugging, use -DNEROSHOP_DEBUG0
target_compile_definitions(${neroshop_console} PRIVATE NEROSHOP_DEBUG)
target_include_directories(${neroshop_console} PRIVATE #[[${CMAKE_CURRENT_SOURCE_DIR}/src/]])
target_link_libraries(${neroshop_console} ${monero_cpp_src} ${sqlite_src} ${qr_code_generator_src} ${raft_src} ${libuv_src} ${curl_src} ${monero_src})
target_link_libraries(${neroshop_console} ${monero_cpp_src} ${sqlite_src} ${qr_code_generator_src} ${raft_src} ${libuv_src} ${curl_src} ${monero_src} ${lua_src} ${png_src} ${linenoise_src})
message(STATUS "${BoldMagenta}NEROSHOP_BUILD_CLI option set to ON${ColourReset}")
target_compile_definitions(${neroshop_console} PRIVATE NEROSHOP_BUILD_CLI)
target_link_libraries(${neroshop_console} ${linenoise_src} ${lua_src} ${png_src})
endif()
######################################
@ -466,20 +433,12 @@ endif()
if(NEROSHOP_BUILD_GUI)
set(neroshop_executable "neroshop")
add_executable(${neroshop_executable})
target_sources(${neroshop_executable} PRIVATE ${neroshop_src} src/gui/icon.cpp src/gui/main.cpp src/gui/main_window.cpp src/gui/message_box.cpp src/gui/wallet_proxy.cpp)
target_compile_definitions(${neroshop_executable} PRIVATE NEROSHOP_DEBUG) # for more detailed debugging, use -DNEROSHOP_DEBUG0 # set_target_properties(${neroshop_executable} PROPERTIES COMPILE_DEFINITIONS "NEROSHOP_DEBUG")
target_sources(${neroshop_executable} PRIVATE ${neroshop_res} ${neroshop_src} src/gui/icon.cpp src/gui/main.cpp src/gui/main_window.cpp src/gui/message_box.cpp src/gui/wallet_proxy.cpp)
target_compile_definitions(${neroshop_executable} PRIVATE NEROSHOP_DEBUG)#set_target_properties(${neroshop_executable} PROPERTIES COMPILE_DEFINITIONS "NEROSHOP_DEBUG")
target_include_directories(${neroshop_executable} PRIVATE #[[${CMAKE_CURRENT_SOURCE_DIR}/src/]])
target_link_libraries(${neroshop_executable} ${monero_cpp_src} ${sqlite_src} ${qr_code_generator_src} ${raft_src} ${libuv_src} ${curl_src} ${monero_src})
target_link_libraries(${neroshop_executable} ${monero_cpp_src} ${sqlite_src} ${qr_code_generator_src} ${raft_src} ${libuv_src} ${curl_src} ${monero_src} ${lua_src} ${png_src})
message(STATUS "${BoldMagenta}NEROSHOP_BUILD_GUI option set to ON${ColourReset}")
target_compile_definitions(${neroshop_executable} PRIVATE NEROSHOP_BUILD_GUI)
if(NEROSHOP_USE_DOKUN_UI)
message(STATUS "Using dokun-ui: ${dokun_ui_src}")
target_include_directories(${neroshop_executable} PRIVATE ${dokun_ui_external_include_dirs} ${dokun_ui_include_dir})
target_compile_definitions(${neroshop_executable} PRIVATE NEROSHOP_USE_DOKUN_UI)
target_link_libraries(${neroshop_executable} ${dokun_ui_src}) # If using dokun-ui for the user interface, you will not need to link to png nor lua which are already built into dokun-ui
else()
target_link_libraries(${neroshop_executable} ${lua_src} ${png_src})
endif()
endif()
######################################
@ -540,13 +499,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${neroshop_console} ${posix_src})
endif()
target_link_libraries(${daemon_executable} ${posix_src})
find_package(X11 REQUIRED)
if(X11_FOUND)
if(NEROSHOP_BUILD_GUI AND NEROSHOP_USE_DOKUN_UI)
target_link_libraries(${neroshop_executable} ${X11_LIBRARIES})
endif()
endif()
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@ -565,23 +517,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()
endif()
find_package(GLFW3)# REQUIRED)
if(GLFW3_FOUND)
if(NEROSHOP_BUILD_GUI AND NEROSHOP_USE_DOKUN_UI)
target_compile_definitions(${neroshop_executable} PRIVATE DOKUN_USE_GLFW)
target_link_libraries(${neroshop_executable} ${GLFW3_LIBRARY})
endif()
endif()
set(OpenGL_GL_PREFERENCE "LEGACY") # LEGACY (libGL.so) or GLVND (libOpenGL.so and libGLX.so)
find_package(OpenGL)# REQUIRED)
if(OPENGL_FOUND)
if(NEROSHOP_BUILD_GUI AND NEROSHOP_USE_DOKUN_UI)
target_compile_definitions(${neroshop_executable} PRIVATE DOKUN_USE_OPENGL)
target_link_libraries(${neroshop_executable} ${OPENGL_LIBRARIES})
endif()
endif()
if(Qt5_FOUND)
if(NEROSHOP_BUILD_GUI AND NEROSHOP_USE_QT)
# Linux requires Qt::Widgets due to the lack of a native platform file dialog implementation
@ -594,7 +529,7 @@ if(Qt5_FOUND)
message(STATUS "Using Qt5::Qml Qt5::Quick Qt5::Gui")
target_compile_definitions(${neroshop_executable} PRIVATE NEROSHOP_USE_QT)
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F00) # Disable any API deprecated in 5.15 or older Qt versions
#add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F00) # Disable any API deprecated in 5.15 or older Qt versions
#target_include_directories(${neroshop_executable} PRIVATE /usr/include/x86_64-linux-gnu/qt5/)
target_link_libraries(${neroshop_executable} Qt5::Qml Qt5::Quick Qt5::Gui #[[Qt5::QuickControls2]])
endif()

@ -57,7 +57,7 @@ Debian/Ubuntu
# prerequisites
sudo apt install build-essential cmake git
# neroshop
sudo apt install libx11-dev libgl1-mesa-dev libglu1-mesa-dev libglfw3-dev libcurl4-openssl-dev libssl-dev libuv1-dev qtdeclarative5-dev qml-module-qt-labs-platform qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-shapes
sudo apt install libcurl4-openssl-dev libssl-dev libuv1-dev qtdeclarative5-dev qml-module-qt-labs-platform qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qtquick-shapes
# monero-cpp (monero)
sudo apt update && sudo apt install pkg-config libssl-dev libzmq3-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache
```
@ -66,7 +66,7 @@ Arch (needs to be updated)
# prerequisites
sudo pacman -Sy --needed base-devel cmake git
# neroshop
sudo pacman -Sy --needed libx11 lib32-mesa lib32-glu curl openssl libuv
sudo pacman -Sy --needed curl openssl libuv
# monero-cpp (monero)
sudo pacman -Syu --needed boost openssl zeromq libpgm libsodium libunwind xz readline gtest python3 ccache qt5-tools hidapi libusb protobuf systemd
```
@ -75,7 +75,7 @@ Fedora (needs to be updated)
# prerequisites
sudo dnf install gcc gcc-c++ make cmake git
# neroshop
sudo dnf install libX11-devel mesa-libGL-devel mesa-libGLU-devel libcurl-devel openssl-devel libuv-devel libuv-static
sudo dnf install libcurl-devel openssl-devel libuv-devel libuv-static
# monero-cpp (monero)
sudo dnf install boost-static libstdc++-static pkgconf boost-devel openssl-devel zeromq-devel openpgm-devel libsodium-devel libunwind-devel xz-devel readline-devel gtest-devel ccache qt5-linguist hidapi-devel libusbx-devel protobuf-devel protobuf-compiler systemd-devel
```
@ -121,6 +121,8 @@ For Fedora users, you may need to add this line under the "find_package(Boost ..
**4. Build monero-project to create .a libraries**
```bash
make release-static
```
```bash
cd ../../../../
```

1
external/dokun-ui vendored

@ -1 +0,0 @@
Subproject commit a80dae6dda14cf36ce69f4a29a802dd8dcf85112

@ -25,10 +25,12 @@ Object {
// Icons used in neroshop GUI (Font Awesome version 6.2.0)
// To add new icons, check unicodes in Font Awesome Free's Cheatsheet:
// https://fontawesome.com/v5/cheatsheet/free/solid // filled with black
// https://fontawesome.com/v5/cheatsheet/free/regular // white
// https://fontawesome.com/v5/cheatsheet/free/brands
// https://fontawesome.com/v5/cheatsheet/free/solid
// https://fontawesome.com/v5/cheatsheet/free/regular
// https://fontawesome.com/v5/cheatsheet/free/brands
property string arrowAltCircleRight: "\uf35a"
property string arrowAltCircleLeft: "\uf359"
////property string upload: "\u"
////property string ?: "\u"
////property string user: "\uf007"

@ -1,4 +1,4 @@
import QtQuick 2.9
import QtQuick 2.12
QtObject {
id: object

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,646 +0,0 @@
area-chart:
name: chart-area
arrow-circle-o-down:
prefix: far
name: circle-down
arrow-circle-o-left:
prefix: far
name: circle-left
arrow-circle-o-right:
prefix: far
name: circle-right
arrow-circle-o-up:
prefix: far
name: circle-up
arrows:
name: up-down-left-right
arrows-alt:
name: maximize
arrows-h:
name: left-right
arrows-v:
name: up-down
asl-interpreting:
name: hands-asl-interpreting
automobile:
name: car
bank:
name: building-columns
bar-chart:
name: chart-column
bar-chart-o:
name: chart-column
bathtub:
name: bath
battery:
name: battery-full
battery-0:
name: battery-empty
battery-1:
name: battery-quarter
battery-2:
name: battery-half
battery-3:
name: battery-three-quarters
battery-4:
name: battery-full
behance-square:
prefix: fab
name: square-behance
bitbucket-square:
prefix: fab
name: bitbucket
bitcoin:
prefix: fab
name: btc
cab:
name: taxi
calendar:
name: calendar-days
calendar-times-o:
prefix: far
name: calendar-xmark
caret-square-o-down:
prefix: far
name: square-caret-down
caret-square-o-left:
prefix: far
name: square-caret-left
caret-square-o-right:
prefix: far
name: square-caret-right
caret-square-o-up:
prefix: far
name: square-caret-up
cc:
prefix: far
name: closed-captioning
chain:
name: link
chain-broken:
name: link-slash
check-circle-o:
prefix: far
name: circle-check
check-square-o:
prefix: far
name: square-check
circle-o-notch:
name: circle-notch
circle-thin:
prefix: far
name: circle
clipboard:
name: paste
clone:
prefix: far
close:
name: xmark
cloud-download:
name: cloud-arrow-down
cloud-upload:
name: cloud-arrow-up
cny:
name: yen-sign
code-fork:
name: code-branch
commenting:
name: comment-dots
commenting-o:
prefix: far
name: comment-dots
compass:
prefix: far
compress:
name: down-left-and-up-right-to-center
copyright:
prefix: far
credit-card:
prefix: far
credit-card-alt:
name: credit-card
cut:
name: scissors
cutlery:
name: utensils
dashboard:
name: gauge-high
deafness:
name: ear-deaf
dedent:
name: outdent
diamond:
prefix: far
name: gem
dollar:
name: dollar-sign
dot-circle-o:
prefix: far
name: circle-dot
drivers-license:
name: id-card
drivers-license-o:
prefix: far
name: id-card
edit:
prefix: far
name: pen-to-square
eercast:
prefix: fab
name: sellcast
eur:
name: euro-sign
euro:
name: euro-sign
exchange:
name: right-left
expand:
name: up-right-and-down-left-from-center
external-link:
name: up-right-from-square
external-link-square:
name: square-up-right
eye:
prefix: far
eye-slash:
prefix: far
eyedropper:
name: eye-dropper
fa:
prefix: fab
name: font-awesome
facebook:
prefix: fab
name: facebook-f
facebook-f:
prefix: fab
name: facebook-f
facebook-official:
prefix: fab
name: facebook
facebook-square:
prefix: fab
name: square-facebook
feed:
name: rss
file-archive-o:
prefix: far
name: file-zipper
file-movie-o:
prefix: far
name: file-video
file-photo-o:
prefix: far
name: file-image
file-picture-o:
prefix: far
name: file-image
file-sound-o:
prefix: far
name: file-audio
file-text:
name: file-lines
file-text-o:
prefix: far
name: file-lines
file-zip-o:
prefix: far
name: file-zipper
files-o:
prefix: far
name: copy
flash:
name: bolt
floppy-o:
prefix: far
name: floppy-disk
frown-o:
prefix: far
name: face-frown
gbp:
name: sterling-sign
ge:
prefix: fab
name: empire
gear:
name: gear
gears:
name: gears
git-square:
prefix: fab
name: square-git
github-square:
prefix: fab
name: square-github
gittip:
prefix: fab
name: gratipay
glass:
name: martini-glass-empty
globe:
name: earth-americas
google-plus:
prefix: fab
name: google-plus-g
google-plus-circle:
prefix: fab
name: google-plus
google-plus-official:
prefix: fab
name: google-plus
google-plus-square:
prefix: fab
name: square-google-plus
group:
name: users
hand-grab-o:
prefix: far
name: hand-back-fist
hand-o-down:
prefix: far
name: hand-point-down
hand-o-left:
prefix: far
name: hand-point-left
hand-o-right:
prefix: far
name: hand-point-right
hand-o-up:
prefix: far
name: hand-point-up
hand-paper-o:
prefix: far
name: hand
hand-rock-o:
prefix: far
name: hand-back-fist
hand-stop-o:
prefix: far
name: hand
hard-of-hearing:
name: ear-deaf
hdd-o:
prefix: far
name: hard-drive
header:
name: heading
home:
name: house
hotel:
name: bed
hourglass-1:
name: hourglass-start
hourglass-2:
name: hourglass-half
hourglass-3:
name: hourglass-end
hourglass-o:
name: hourglass
id-badge:
prefix: far
ils:
name: shekel-sign
image:
prefix: far
name: image
inr:
name: indian-rupee-sign
institution:
name: building-columns
intersex:
name: mars-and-venus
jpy:
name: yen-sign
krw:
name: won-sign
lastfm-square:
prefix: fab
name: square-lastfm
legal:
name: gavel
level-down:
name: turn-down
level-up:
name: turn-up
life-bouy:
name: life-ring
life-buoy:
name: life-ring
life-saver:
name: life-ring
line-chart:
name: chart-line
linkedin:
prefix: fab
name: linkedin-in
linkedin-square:
prefix: fab
name: linkedin
list-alt:
prefix: far
name: rectangle-list
long-arrow-down:
name: down-long
long-arrow-left:
name: left-long
long-arrow-right:
name: right-long
long-arrow-up:
name: up-long
magic:
name: wand-magic-sparkles
mail-forward:
name: share
mail-reply:
name: reply
mail-reply-all:
name: reply-all
map-marker:
name: location-dot
meh-o:
prefix: far
name: face-meh
minus-square-o:
prefix: far
name: square-minus
mobile:
name: mobile-screen-button
mobile-phone:
name: mobile-screen-button
money:
name: money-bill-1
mortar-board:
name: graduation-cap
navicon:
name: bars
object-group:
prefix: far
object-ungroup:
prefix: far
odnoklassniki-square:
prefix: fab
name: square-odnoklassniki
pause-circle-o:
prefix: far
name: circle-pause
pencil-square:
name: square-pen
pencil-square-o:
prefix: far
name: pen-to-square
photo:
prefix: far
name: image
picture-o:
prefix: far
name: image
pie-chart:
name: chart-pie
pinterest-square:
prefix: fab
name: square-pinterest
play-circle-o:
prefix: far
name: circle-play
plus-square-o:
prefix: far
name: square-plus
question-circle-o:
prefix: far
name: circle-question
ra:
prefix: fab
name: rebel
reddit-square:
prefix: fab
name: square-reddit
refresh:
name: arrows-rotate
registered:
prefix: far
remove:
name: xmark
reorder:
name: bars
repeat:
name: arrow-rotate-right
resistance:
prefix: fab
name: rebel
rmb:
name: yen-sign
rotate-left:
name: arrow-rotate-left
rotate-right:
name: arrow-rotate-right
rouble:
name: ruble-sign
rub:
name: ruble-sign
ruble:
name: ruble-sign
rupee:
name: indian-rupee-sign
s15:
name: bath
save:
prefix: far
name: floppy-disk
send:
name: paper-plane
send-o:
prefix: far
name: paper-plane
share-square-o:
name: share-from-square
shekel:
name: shekel-sign
sheqel:
name: shekel-sign
sign-in:
name: right-to-bracket
sign-out:
name: right-from-bracket
signing:
name: hands
smile-o:
prefix: far
name: face-smile
snapchat-ghost:
prefix: fab
name: snapchat
snapchat-square:
prefix: fab
name: square-snapchat
soccer-ball-o:
prefix: far
name: futbol
sort-alpha-asc:
name: arrow-down-a-z
sort-alpha-desc:
name: arrow-down-z-a
sort-amount-asc:
name: arrow-down-short-wide
sort-amount-desc:
name: arrow-down-wide-short
sort-asc:
name: sort-up
sort-desc:
name: sort-down
sort-numeric-asc:
name: arrow-down-1-9
sort-numeric-desc:
name: arrow-down-9-1
star-half-empty:
prefix: far
name: star-half-stroke
star-half-full:
prefix: far
name: star-half-stroke
star-half-o:
prefix: far
name: star-half-stroke
steam-square:
prefix: fab
name: square-steam
sticky-note-o:
prefix: far
name: note-sticky
stop-circle-o:
prefix: far
name: circle-stop
support:
name: life-ring
tablet:
name: tablet-screen-button
tachometer:
name: gauge-high
tasks:
name: bars-progress
television:
name: tv
thermometer:
name: temperature-full
thermometer-0:
name: temperature-empty
thermometer-1:
name: temperature-quarter
thermometer-2:
name: temperature-half
thermometer-3:
name: temperature-three-quarters
thermometer-4:
name: temperature-full
thumb-tack:
name: thumbtack
thumbs-o-down:
prefix: far
name: thumbs-down
thumbs-o-up:
prefix: far
name: thumbs-up
times-circle-o:
prefix: far
name: circle-xmark
times-rectangle:
name: rectangle-xmark
times-rectangle-o:
prefix: far
name: rectangle-xmark
toggle-down:
prefix: far
name: square-caret-down
toggle-left:
prefix: far
name: square-caret-left
toggle-right:
prefix: far
name: square-caret-right
toggle-up:
prefix: far
name: square-caret-up
transgender:
name: mars-and-venus
transgender-alt:
name: transgender
trash:
name: trash-can
trash-o:
prefix: far
name: trash-can
try:
name: turkish-lira-sign
tumblr-square:
prefix: fab
name: square-tumblr
turkish-lira:
name: turkish-lira-sign
twitter-square:
prefix: fab
name: square-twitter
unlink:
name: link-slash
unlock-alt:
name: unlock
unsorted:
name: sort
usd:
name: dollar-sign
user-circle-o:
prefix: far
name: circle-user
vcard:
name: address-card
vcard-o:
prefix: far
name: address-card
viadeo-square:
prefix: fab
name: square-viadeo
video-camera:
name: video
vimeo:
prefix: fab
name: vimeo-v
vimeo-square:
prefix: fab
name: square-vimeo
volume-control-phone:
name: phone-volume
warning:
name: triangle-exclamation
wechat:
prefix: fab
name: weixin
wheelchair-alt:
prefix: fab
name: accessible-icon
window-close-o:
prefix: far
name: rectangle-xmark
window-maximize:
prefix: far
window-restore:
prefix: far
won:
name: won-sign
xing-square:
prefix: fab
name: square-xing
y-combinator-square:
prefix: fab
name: hacker-news
yc:
prefix: fab
name: y-combinator
yc-square:
prefix: fab
name: hacker-news
yen:
name: yen-sign
youtube-play:
prefix: fab
name: youtube
youtube-square:
prefix: fab
name: square-youtube

File diff suppressed because it is too large Load Diff

@ -8,7 +8,10 @@ import QtQuick.Dialogs 1.3 // MessageDialog (since Qt 5.2)
import QtGraphicalEffects 1.12 // LinearGradient
import Qt.labs.platform 1.1 // FileDialog (since Qt 5.8) // change to "import QtQuick.Dialogs" if using Qt 6.2
//import "fonts" as FontAwesome//import FontAwesome 1.0
//import neroshop.Wallet 1.0
import "qml/components"
import "qml/components" as NeroshopComponents
import "qml/pages"

@ -6,9 +6,8 @@ import QtQuick.Shapes 1.3 // (since Qt 5.10) // Shape
import QtGraphicalEffects 1.12//Qt5Compat.GraphicalEffects 1.15//= Qt6// ColorOverlay
import "." as NeroshopComponents
// todo: place grid in stackview or swipeview for multiple grid pages (pagination mode)
// todo: place grid in scrollview (infinite scroll mode) but in a separate file called CatalogGridViewInfiniteScroll.qml or CatalogGridViewLimitlessScroll.qml
// todo: move this code to CatalogGridView.qml and create a CatalogListView
// todo: create a CatalogList.qml for the Catalog List View
// Grid should have two modes: Pagination mode and Infinite scroll mode
// catalog view (Grid)
Grid {
@ -17,10 +16,10 @@ import "." as NeroshopComponents
columns: 3
spacing: 5//rowSpacing: 5; columnSpacing: 5
//flow: Grid.TopToBottom
function get_box(index) { // or get_item(index)?
function getBox(index) { // or get_item(index)?
return catalog_grid_repeater.itemAt(index);
}
function get_box_count() {
function getBoxCount() {
return catalog_grid_repeater.count; // count is really just the number of items in the model :O
}

@ -3,7 +3,7 @@ import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import "." as NeroshopComponents
import "../../fonts" as FontAwesome//import FontAwesome 1.0
import "../../fonts/FontAwesome"//import FontAwesome 1.0
Row {//RowLayout {
id: paginationBar
@ -19,11 +19,13 @@ Row {//RowLayout {
Button {
id: backButton
text: qsTr("%1 Previous").arg("\uf359")//qsTr("<")
text: qsTr("%1 Previous").arg("\uf359")//qsTr("<")//solid: f104 (<),
width: 150
property bool disabled: (paginationBar.currentIndex == 0)//visible: (paginationBar.currentIndex != 0)
background: Rectangle {
color: paginationBar.buttonColor
radius: paginationBar.buttonRadius
opacity: (backButton.disabled) ? 0.5 : 1.0
}
contentItem: Text {
text: backButton.text
@ -36,7 +38,7 @@ Row {//RowLayout {
TextField {
id: currentPageTextField
width: 50
//readOnly: true // todo: make this editable
//readOnly: true
text: qsTr((parent.currentIndex + 1).toString())
inputMethodHints: Qt.ImhDigitsOnly // for Android and iOS - typically used for input of languages such as Chinese or Japanese
validator: RegExpValidator{ regExp: /[0-9]*/ }
@ -48,22 +50,27 @@ Row {//RowLayout {
//border.color: "#696969" // dim gray//"#ffffff"
//border.width: (NeroshopComponents.Style.darkTheme) ? 1 : 0
radius: paginationBar.radius
//opacity: 0.0
}
}
Button {
id: forwardButton
text: qsTr("Next %1").arg("\uf35a")//qsTr(">")
text: qsTr("Next %1").arg(FontAwesome.arrowAltCircleRight)//qsTr(">")// solid: "\uf105" (>)
width: 150
property bool disabled: (paginationBar.currentIndex == (count - 1))
background: Rectangle {
color: paginationBar.buttonColor
radius: paginationBar.buttonRadius
opacity: (forwardButton.disabled) ? 0.5 : 1.0
}
contentItem: Text {
text: forwardButton.text
color: "#ffffff"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
verticalAlignment: Text.AlignVCenter
//font.family: FontAwesome.fontFamily
//font.weight: Font.Bold
}
}
}

@ -42,12 +42,10 @@ Page {
function goToNextPage() {
catalog_stack.currentIndex = catalog_stack.currentIndex + 1
if(catalog_stack.currentIndex >= (catalog_stack.count - 1)) catalog_stack.currentIndex = (catalog_stack.count - 1)
console.log("CurrentIndex (next): " + catalog_stack.currentIndex)
}
function goToPrevPage() {
catalog_stack.currentIndex = catalog_stack.currentIndex - 1
if(catalog_stack.currentIndex <= 0) catalog_stack.currentIndex = 0
console.log("CurrentIndex (prev): " + catalog_stack.currentIndex)
}
function setCurrentPageIndex(numberInput) {
// if numberInput is greater than (count - 1) then equal it to (count - 1)
@ -59,13 +57,6 @@ Page {
numberInput = 0
}
catalog_stack.currentIndex = numberInput
console.log("\n")
console.log("Pages count: " + catalog_stack.count)
console.log("numberInput: " + numberInput)
console.log("catalog_stack.currentIndex: " + catalog_stack.currentIndex)
console.log("Pagination index: " + pagination.currentIndex)
console.log("Pagination displayText: " + pagination.numberField.displayText)
console.log("Pagination text: " + pagination.numberField.text)
}
function getPageCount() { // Returns total number of grid pages belonging to the catalog StackLayout
return catalog_stack.count;
@ -73,6 +64,9 @@ Page {
function getCurrentPageIndex() {
return catalog_stack.currentIndex;
}
function getItemsCount() {
// ... boxesPerGrid * pageCount
}
// Pagination mode (Infinite Scroll mode replaces the StackLayout with a ScrollView)
StackLayout {
id: catalog_stack
@ -85,7 +79,7 @@ Page {
model: 10 // Number of page results from search
delegate: NeroshopComponents.CatalogGrid {
// To access each grid: pages.itemAt(index)
// To access each box inside the grid: pages.itemAt(gridIndex).children[gridBoxIndex] //or: pages.itemAt(gridIndex).get_box(gridBoxIndex)
// To access each box inside the grid: pages.itemAt(gridIndex).children[gridBoxIndex] //or: pages.itemAt(gridIndex).getBox(gridBoxIndex)
//id: catalog
// Items in a StackLayout support these attached properties (anchors cannot be used when managed by StackLayout or any other Layout type):
//Layout.minimumWidth
@ -102,8 +96,8 @@ Page {
// Custom pagination bar
NeroshopComponents.PaginationBar {
id: pagination
firstButton.onClicked: { goToPrevPage() }
secondButton.onClicked: { goToNextPage() }
firstButton.onClicked: { if(!firstButton.disabled) goToPrevPage() }
secondButton.onClicked: { if(!secondButton.disabled) goToNextPage() }
numberField.onEditingFinished: { setCurrentPageIndex(numberField.text - 1) }
currentIndex: catalog_stack.currentIndex
count: catalog_stack.count

@ -26,7 +26,6 @@ bool neroshop::create_config() {
"localhost = \"127.0.0.1\";\n"
"neroshop = {};\n"
"neroshop[\"currency\"] = \"usd\";\n"//\n"
"\n"
"neroshop[\"window\"] = {};\n"
//"--neroshop[\"window\"][\"x\"] = 200;\n"
//"--neroshop[\"window\"][\"y\"] = 200;\n"
@ -34,18 +33,46 @@ bool neroshop::create_config() {
"neroshop[\"window\"][\"height\"] = 720;\n"
"neroshop[\"window\"][\"mode\"] = 0; --0 (window_mode) or 1 (fullscreen)\n"//\n"
"\n"
"neroshop[\"monerod\"] = {};\n" // maybe change name from daemon to node or nah?
"neroshop[\"monerod\"][\"network_type\"] = \"stagenet\"; --\"mainnet\", \"stagenet\", or \"testnet\"\n"
"neroshop[\"monerod\"][\"ip\"] = localhost; -- set to \"0.0.0.0\" to allow other wallets to connect to your node\n"
"neroshop[\"monerod\"][\"port\"] = \"38081\"; --\"18081\" (mainnet), \"38081\" (stagenet), or 28081 (testnet)\n"
"neroshop[\"monerod\"][\"confirm_external_bind\"] = false; -- if true then it confirms that you want to allow connections from other wallets outside of this system, but only when ip is set to \"0.0.0.0\"\n"
"neroshop[\"monerod\"][\"restricted_rpc\"] = true;\n"
"neroshop[\"monerod\"][\"data_dir\"] = \"/home/<user>/.bitmonero\";\n"
"neroshop[\"monerod\"][\"remote\"] = false; -- set to true if the node that you want to connect to is a remote node\n"//\n"
"neroshop[\"monero\"] = {};\n"
"\n"
"neroshop[\"monero\"][\"daemon\"] = {};\n" // maybe change name from daemon to node or nah?
"neroshop[\"monero\"][\"daemon\"][\"network_type\"] = \"stagenet\"; --\"mainnet\", \"stagenet\", or \"testnet\"\n"
"neroshop[\"monero\"][\"daemon\"][\"ip\"] = localhost; -- set to \"0.0.0.0\" to allow other wallets to connect to your node\n"
"neroshop[\"monero\"][\"daemon\"][\"port\"] = \"38081\"; --\"18081\" (mainnet), \"38081\" (stagenet), or 28081 (testnet)\n"
"neroshop[\"monero\"][\"daemon\"][\"confirm_external_bind\"] = false; -- if true then it confirms that you want to allow connections from other wallets outside of this system, but only when ip is set to \"0.0.0.0\"\n"
"neroshop[\"monero\"][\"daemon\"][\"restricted_rpc\"] = true;\n"
"neroshop[\"monero\"][\"daemon\"][\"data_dir\"] = \"/home/<user>/.bitmonero\";\n"
"neroshop[\"monero\"][\"daemon\"][\"remote\"] = false; -- set to true if the node that you want to connect to is a remote node\n"//\n"
"\n"
"neroshop[\"monero\"][\"wallet\"] = {};\n"
"neroshop[\"monero\"][\"wallet\"][\"file\"] = \"\"; -- include \".keys\" extension\n" // path or file
"neroshop[\"monero\"][\"wallet\"][\"restore_height\"] = \"2014-04-18\"; -- block height or date (YYYY-MM-DD)\n"
"\n"
"neroshop[\"wallet\"] = {};\n"
"neroshop[\"wallet\"][\"file\"] = \"\"; -- include \".keys\" extension\n" // path or file
"neroshop[\"wallet\"][\"restore_height\"] = \"2014-04-18\"; -- block height or date (YYYY-MM-DD)\n";
"neroshop[\"monero\"][\"nodes\"] = {}\n"
"neroshop[\"monero\"][\"nodes\"][\"mainnet\"] = {\n"
" \"node.community.rino.io:18081\",\n"
" \"node.sethforprivacy.com:18089\",\n"
" \"node2.sethforprivacy.com:18089\",\n"
" \"selsta1.featherwallet.net:18081\",\n"
" \"selsta2.featherwallet.net:18081\",\n"
" \"node.monerooutreach.org:18081\",\n"
" \"node.majesticbank.is:18089\",\n"
" \"node.majesticbank.su:18089\",\n"
" \"xmr-node-eu.cakewallet.com:18081\",\n"
" \"xmr-node-usa-east.cakewallet.com:18081\",\n"
" \"canada.node.xmr.pm:18089\",\n"
" \"singapore.node.xmr.pm:18089\",\n"
" \"nodes.hashvault.pro:18081\",\n"
" \"node.supportxmr.com:18081\",\n"
" \"node.xmr.ru:18081\"\n"
"};\n"
"neroshop[\"monero\"][\"nodes\"][\"stagenet\"] = {\n"
" \"super.fast.node.xmr.pm:38089\",\n"
" \"stagenet.community.rino.io:38081\"\n"
"};\n"
"neroshop[\"monero\"][\"nodes\"][\"testnet\"] = {\n"
" \"testnet.community.rino.io:28081\"\n"
"};\n";
// swap data_dir with user
#if defined(__gnu_linux__) // works!
text = neroshop::string::swap_first_of(text, "/home/<user>/.bitmonero", ("/home/" + user + "/.bitmonero"));

@ -6,8 +6,6 @@ using namespace neroshop;
// linenoise
#include <linenoise.h>
lua_State * neroshop::lua_state = luaL_newstate(); // lua_state should be initialized by default
int main() {
if(!neroshop::create_config()) {
@ -16,13 +14,13 @@ int main() {
std::vector<std::string> networks = {"mainnet", "stagenet", "testnet"};
std::string network_type = Script::get_string(lua_state, "neroshop.daemon.network_type");
std::string network_type = Script::get_string(lua_state, "neroshop.monero.daemon.network_type");
if (std::find(networks.begin(), networks.end(), network_type) == networks.end()) {
neroshop::print("\033[1;91mnetwork_type \"" + network_type + "\" is not valid");
return 1;
}
std::vector<std::string> nodes_list = Script::get_table_string(neroshop::get_lua_state(), "neroshop.nodes."+network_type);
std::vector<std::string> nodes_list = Script::get_table_string(lua_state, "neroshop.monero.nodes." + network_type);
if(nodes_list.empty()) {
std::cout << "failed to get nodes in the config file\nCheck your config file in ~/.config/neroshop" << std::endl;
@ -47,7 +45,7 @@ int main() {
}
}
else if(command == "version") {
std::cout << "\033[0;93m" << "neroshop v" << APP_VERSION << "\033[0m" << std::endl;
std::cout << "\033[0;93m" << "neroshop v" << NEROSHOP_VERSION << "\033[0m" << std::endl;
}
else if(command == "exit") {
break;//exit(0);

@ -21,7 +21,6 @@ using namespace dokun;
// neroshop (includes both the core headers and the gui headers)
#include "../neroshop.hpp"
using namespace neroshop;
//lua_State * neroshop::lua_state = luaL_newstate();
using WalletProxy = gui::Wallet;
@ -53,6 +52,8 @@ int main(int argc, char *argv[]) {
// open configuration script
neroshop::open_configuration_file();
// initialize (sync) database
std::string network_type = Script::get_string(lua_state, "neroshop.monero.daemon.network_type");
std::cout << "network_type: " << network_type << std::endl;
//std::string theme = Script::get_string(neroshop::get_lua_state(), "neroshop.theme");
//if(neroshop::string::lower(theme) == "dark") "NeroshopComponents.Style.darkTheme = true"
//else if(neroshop::string::lower(theme) == "light") "NeroshopComponents.Style.darkTheme = false"

Loading…
Cancel
Save