diff --git a/.gitignore b/.gitignore index ded606788041fc9cd4d017e2dfe5a6e9bdeefbae..79a51db7feef2b88d412401f60ed812f1a4e617d 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,7 @@ nosetests.xml .mr.developer.cfg .project .pydevproject +.settings + +# Generated files +src/cutecoin/gen_ressources/* diff --git a/ui/cutecoint_concept.ui b/doc/cutecoint_concept.ui similarity index 99% rename from ui/cutecoint_concept.ui rename to doc/cutecoint_concept.ui index 25283d39faf9fa7bc3932542de8f9770e9425b82..825a9fa8d565bee64a4c6b5ef09772ff470a91b8 100644 --- a/ui/cutecoint_concept.ui +++ b/doc/cutecoint_concept.ui @@ -27,7 +27,7 @@ <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> - <number>1</number> + <number>0</number> </property> <widget class="QWidget" name="walletsTab"> <attribute name="title"> @@ -225,7 +225,7 @@ <x>0</x> <y>0</y> <width>452</width> - <height>21</height> + <height>20</height> </rect> </property> <widget class="QMenu" name="menuTr_File"> diff --git a/res/ui/accountConfiguration.ui b/res/ui/accountConfiguration.ui new file mode 100644 index 0000000000000000000000000000000000000000..d1b43c6a2f5392f290b38b1eb36067b3a22c03d6 --- /dev/null +++ b/res/ui/accountConfiguration.ui @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Dialog</class> + <widget class="QDialog" name="Dialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Account parameters</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Account name</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="lineEdit"/> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>PGPKey </string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>Dialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>Dialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/res/ui/addAccountDialog.ui b/res/ui/addAccountDialog.ui new file mode 100644 index 0000000000000000000000000000000000000000..a65a745a7a2233c15a527d7845532208bf533916 --- /dev/null +++ b/res/ui/addAccountDialog.ui @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Dialog</class> + <widget class="QDialog" name="Dialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Account parameters</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Account name</string> + </property> + </widget> + </item> + <item> + <widget class="QLineEdit" name="accountName"/> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>PGPKey </string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="pgpkeyList"/> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_2"> + <property name="title"> + <string>Communities membership</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QTableView" name="communitiesTable"/> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>Dialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>Dialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/res/ui/mainwindow.ui b/res/ui/mainwindow.ui new file mode 100644 index 0000000000000000000000000000000000000000..b2cda408026e35f696fa337e1a1fb3993d59255f --- /dev/null +++ b/res/ui/mainwindow.ui @@ -0,0 +1,222 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>452</width> + <height>400</height> + </rect> + </property> + <property name="windowTitle"> + <string notr="true">CuteCoin</string> + </property> + <widget class="QWidget" name="centralwidget"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QFrame" name="actionsFrame"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QTabWidget" name="tabWidget"> + <property name="currentIndex"> + <number>0</number> + </property> + <widget class="QWidget" name="walletsTab"> + <attribute name="title"> + <string>Wallets</string> + </attribute> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QListView" name="walletsList"/> + </item> + <item> + <widget class="QListView" name="walletContent"/> + </item> + </layout> + </widget> + <widget class="QWidget" name="transactionsTab"> + <attribute name="title"> + <string>Transactions</string> + </attribute> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Sent</string> + </property> + </widget> + </item> + <item> + <widget class="QListView" name="transactionsSent"/> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Received</string> + </property> + </widget> + </item> + <item> + <widget class="QListView" name="transactionsReceived"/> + </item> + </layout> + </item> + </layout> + </widget> + <widget class="QWidget" name="communitiesTab"> + <attribute name="title"> + <string>Communities</string> + </attribute> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QTabWidget" name="tabWidget_2"> + <property name="currentIndex"> + <number>1</number> + </property> + <widget class="QWidget" name="ucoinTab"> + <attribute name="title"> + <string>Ucoin</string> + </attribute> + </widget> + <widget class="QWidget" name="freecoinTab"> + <attribute name="title"> + <string>FreeCoin</string> + </attribute> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <item> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Members</string> + </property> + </widget> + </item> + <item> + <widget class="QListView" name="communityMembers"/> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Last issuance</string> + </property> + </widget> + </item> + <item> + <widget class="QListView" name="communityIssuance"/> + </item> + </layout> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + <widget class="QMenuBar" name="menubar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>452</width> + <height>20</height> + </rect> + </property> + <widget class="QMenu" name="menuTr_File"> + <property name="title"> + <string>Account</string> + </property> + <addaction name="actionChange_account"/> + <addaction name="actionManage_accounts"/> + <addaction name="actionConfigure_trustable_nodes"/> + </widget> + <widget class="QMenu" name="menuEdit"> + <property name="title"> + <string>Contacts</string> + </property> + <addaction name="separator"/> + <addaction name="actionAdd_a_contact"/> + </widget> + <addaction name="menuTr_File"/> + <addaction name="menuEdit"/> + </widget> + <widget class="QStatusBar" name="statusbar"/> + <action name="actionChange_account"> + <property name="text"> + <string>Change account</string> + </property> + </action> + <action name="actionManage_accounts"> + <property name="text"> + <string>Manage accounts</string> + </property> + </action> + <action name="actionConfigure_trustable_nodes"> + <property name="text"> + <string>Configure trustable nodes</string> + </property> + </action> + <action name="actionAdd_a_contact"> + <property name="text"> + <string>Add a contact</string> + </property> + </action> + <action name="actionSend_a_message"> + <property name="text"> + <string>Send a message</string> + </property> + </action> + <action name="actionSend_money"> + <property name="text"> + <string>Send money</string> + </property> + </action> + <action name="actionRemove_contact"> + <property name="text"> + <string>Remove contact</string> + </property> + </action> + <action name="actionSend_a_message_2"> + <property name="text"> + <string>Send a message</string> + </property> + </action> + <action name="actionSend_money_2"> + <property name="text"> + <string>Send money</string> + </property> + </action> + <action name="actionRemove_contact_2"> + <property name="text"> + <string>Remove contact</string> + </property> + </action> + </widget> + <resources/> + <connections/> +</ui> diff --git a/src/cutecoin/__init__.py b/src/cutecoin/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e9a7bd2401ebf4db17c0a66bc79995fcac2f43a0 --- /dev/null +++ b/src/cutecoin/__init__.py @@ -0,0 +1,17 @@ +''' +Created on 1 févr. 2014 + +@author: inso +''' +import sys +from PyQt5.QtWidgets import QApplication, QDialog +from cutecoin.gui.mainWindow import MainWindow +from cutecoin.models.account import Account + +if __name__ == '__main__': + app = QApplication(sys.argv) + acc = Account() + window = MainWindow() + window.show() + sys.exit(app.exec_()) + pass \ No newline at end of file diff --git a/src/cutecoin/gui/mainWindow.py b/src/cutecoin/gui/mainWindow.py new file mode 100644 index 0000000000000000000000000000000000000000..973ec967e8dc660ca47a44a936d49b5b229e4631 --- /dev/null +++ b/src/cutecoin/gui/mainWindow.py @@ -0,0 +1,22 @@ +''' +Created on 1 févr. 2014 + +@author: inso +''' +from cutecoin.gen_resources.mainwindow_uic import Ui_MainWindow +from PyQt5.QtWidgets import QMainWindow + + +class MainWindow(QMainWindow, Ui_MainWindow): + ''' + classdocs + ''' + + + def __init__(self): + ''' + Constructor + ''' + # Set up the user interface from Designer. + super(MainWindow, self).__init__() + self.setupUi(self) diff --git a/src/cutecoin/models/account.py b/src/cutecoin/models/account.py new file mode 100644 index 0000000000000000000000000000000000000000..936652d38965c739dd5ea267d22ab5808acb06ac --- /dev/null +++ b/src/cutecoin/models/account.py @@ -0,0 +1,27 @@ +''' +Created on 1 févr. 2014 + +@author: inso +''' + +import ucoinpy as ucoin + +class Account(object): + ''' + classdocs + ''' + + def __init__(self): + ''' + Constructor + ''' + self.transactionNodes = [] + self.trustableNodes = [] + + def addTransactionNode(self, node): + self.transactionNodes.append(node) + + def addTrustableNode(self, node): + self.trustableNodes.append(node) + + diff --git a/src/cutecoin/models/community.py b/src/cutecoin/models/community.py new file mode 100644 index 0000000000000000000000000000000000000000..73dd4d5937befac765711ebcd05ab31378c196c1 --- /dev/null +++ b/src/cutecoin/models/community.py @@ -0,0 +1,16 @@ +''' +Created on 1 févr. 2014 + +@author: inso +''' + +class communityModel(object): + ''' + classdocs + ''' + + + def __init__(self, params): + ''' + Constructor + ''' diff --git a/src/cutecoin/models/node.py b/src/cutecoin/models/node.py new file mode 100644 index 0000000000000000000000000000000000000000..4199091cf90827c801b8ea45815f22c631277058 --- /dev/null +++ b/src/cutecoin/models/node.py @@ -0,0 +1,19 @@ +''' +Created on 1 févr. 2014 + +@author: inso +''' + +class Node(object): + ''' + classdocs + ''' + + + def __init__(self, server, port, auth): + ''' + Constructor + ''' + self.server = server + self.port = port + self.auth = auth diff --git a/src/cutecoin/models/transaction.py b/src/cutecoin/models/transaction.py new file mode 100644 index 0000000000000000000000000000000000000000..766a906a9c258044586264334c8e682f31a9c6f9 --- /dev/null +++ b/src/cutecoin/models/transaction.py @@ -0,0 +1,16 @@ +''' +Created on 1 févr. 2014 + +@author: inso +''' + +class TransactionModel(object): + ''' + classdocs + ''' + + + def __init__(self, params): + ''' + Constructor + ''' diff --git a/src/cutecoin/models/wallet.py b/src/cutecoin/models/wallet.py new file mode 100644 index 0000000000000000000000000000000000000000..9d6e49295d72a6a016331c39ae5b8d6e4eb2bd53 --- /dev/null +++ b/src/cutecoin/models/wallet.py @@ -0,0 +1,16 @@ +''' +Created on 1 févr. 2014 + +@author: inso +''' + +class WalletModel(object): + ''' + classdocs + ''' + + + def __init__(self, params): + ''' + Constructor + '''