diff --git a/res/i18n/ts/fr_FR.ts b/res/i18n/ts/fr_FR.ts index 2d7d7a90e2d4e8af3b728c5a3090eb2a03120f03..64b1eed757120058953d6bbaee5aeda4fdcdade1 100644 --- a/res/i18n/ts/fr_FR.ts +++ b/res/i18n/ts/fr_FR.ts @@ -304,20 +304,20 @@ <message> <location filename="../../ui/community_tab.ui" line="118"/> <source>Quality : </source> - <translation>Qualification : </translation> + <translation type="obsolete">Qualification : </translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="351"/> <source>Renew membership</source> - <translation>Renouveller le statut de membre</translation> + <translation type="obsolete">Renouveller le statut de membre</translation> </message> <message> <location filename="../../ui/community_tab.ui" line="146"/> <source>Send leaving demand</source> - <translation>Quitter la communauté</translation> + <translation type="obsolete">Quitter la communauté</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="78"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="76"/> <source>Membership</source> <translation>Statut de membre</translation> </message> @@ -339,17 +339,17 @@ <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="226"/> <source>Network error</source> - <translation>Erreur réseau</translation> + <translation type="obsolete">Erreur réseau</translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="226"/> <source>Couldn't connect to network : {0}</source> - <translation>Impossible de se connecter au réseau : {0}</translation> + <translation type="obsolete">Impossible de se connecter au réseau : {0}</translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="235"/> <source>Warning</source> - <translation>Attention</translation> + <translation type="obsolete">Attention</translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="202"/> @@ -374,15 +374,15 @@ <message> <location filename="../../ui/community_tab.ui" line="125"/> <source>Publish UID</source> - <translation>Publier votre UID</translation> + <translation type="obsolete">Publier votre UID</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="60"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="59"/> <source>Members</source> <translation>Membres</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="63"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="62"/> <source>Direct connections</source> <translation>Connections directes</translation> </message> @@ -396,12 +396,12 @@ Publier votre UID ne peut être annulé.</translation> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="220"/> <source>UID Publishing</source> - <translation>Publication de l'UID</translation> + <translation type="obsolete">Publication de l'UID</translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="220"/> <source>Success publishing your UID</source> - <translation>Succès lors de la publication de votre UID</translation> + <translation type="obsolete">Succès lors de la publication de votre UID</translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="177"/> @@ -415,66 +415,66 @@ Vous ne pouvez pas envoyer de requête de membre.</translation> <source>Are you sure ? Sending a leaving demand cannot be canceled. The process to join back the community later will have to be done again.</source> - <translation>Êtes vous certain ? + <translation type="obsolete">Êtes vous certain ? Envoyer une demande pour quitter la communauté ne peut être annulée. Le processus pour rejoindre la communauté devrait être refait à zéro.</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="59"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="58"/> <source>Web of Trust</source> <translation>Toile de Confiance</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="104"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="102"/> <source>Informations</source> <translation>Informations</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="107"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="105"/> <source>Add as contact</source> <translation>Ajouter comme contact</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="111"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="109"/> <source>Send money</source> <translation>Envoyer de l'argent</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="115"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="113"/> <source>Certify identity</source> <translation>Certifier cette identité</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="119"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="117"/> <source>View in Web of Trust</source> <translation>Voir dans la Toile de Confiance</translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="358"/> <source>Send membership demand</source> - <translation>Envoyer une demande de membre</translation> + <translation type="obsolete">Envoyer une demande de membre</translation> </message> <message> <location filename="../../ui/community_tab.ui" line="132"/> <source>Revoke UID</source> - <translation>Révoquer votre UID</translation> + <translation type="obsolete">Révoquer votre UID</translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="209"/> <source>Are you sure ? Publishing your UID can be canceled by Revoke UID.</source> - <translation>Etes-vous sûr(e) ? Publier votre UID peut être annulé par le bouton Révoquer votre UID.</translation> + <translation type="obsolete">Etes-vous sûr(e) ? Publier votre UID peut être annulé par le bouton Révoquer votre UID.</translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="223"/> <source>Publish UID error</source> - <translation>Publier votre UID</translation> + <translation type="obsolete">Publier votre UID</translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="235"/> <source>Are you sure ? Revoking your UID can only success if it is not already validated by the network.</source> - <translation>Etes-vous sûr(e) ? Révoquer votre UID ne peut réussir que s'il n'a pas été déjà validé par le réseau.</translation> + <translation type="obsolete">Etes-vous sûr(e) ? Révoquer votre UID ne peut réussir que s'il n'a pas été déjà validé par le réseau.</translation> </message> <message> <location filename="../../../src/cutecoin/gui/community_tab.py" line="253"/> @@ -492,27 +492,27 @@ Revoking your UID can only success if it is not already validated by the network <translation type="obsolete">Erreur lors de la révocation de votre UID</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="78"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="76"/> <source>Success sending Membership demand</source> <translation>Envoi demande à être membre réussie</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="84"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="82"/> <source>Revoke</source> <translation>Révocation</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="84"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="82"/> <source>Success sending Revoke demand</source> <translation>Envoi demande de révocation réussie</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="90"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="88"/> <source>Self Certification</source> <translation>Auto-certification</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/community_tab.py" line="90"/> + <location filename="../../../src/cutecoin/gui/community_tab.py" line="88"/> <source>Success sending Self Certification document</source> <translation>Envoi auto-certification réussie</translation> </message> @@ -581,17 +581,17 @@ Revoking your UID can only success if it is not already validated by the network <translation>Transferts</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/currency_tab.py" line="85"/> + <location filename="../../../src/cutecoin/gui/currency_tab.py" line="81"/> <source>Community</source> <translation>Communauté</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/currency_tab.py" line="81"/> + <location filename="../../../src/cutecoin/gui/currency_tab.py" line="89"/> <source>Informations</source> <translation>Informations</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/currency_tab.py" line="89"/> + <location filename="../../../src/cutecoin/gui/currency_tab.py" line="85"/> <source>Network</source> <translation>Réseau</translation> </message> @@ -2031,20 +2031,45 @@ Veuillez rééssayer plus tard</translation> <translation></translation> </message> <message> - <location filename="../../ui/wallets_tab.ui" line="68"/> + <location filename="../../ui/wallets_tab.ui" line="119"/> <source>Balance</source> <translation>Solde</translation> </message> <message> - <location filename="../../ui/wallets_tab.ui" line="74"/> + <location filename="../../ui/wallets_tab.ui" line="132"/> <source>label_balance</source> <translation></translation> </message> + <message> + <location filename="../../ui/wallets_tab.ui" line="86"/> + <source>Publish UID</source> + <translation>Publier votre UID</translation> + </message> + <message> + <location filename="../../ui/wallets_tab.ui" line="93"/> + <source>Revoke UID</source> + <translation>Révoquer votre UID</translation> + </message> + <message> + <location filename="../../ui/wallets_tab.ui" line="100"/> + <source>Renew membership</source> + <translation>Renouveller le statut de membre</translation> + </message> + <message> + <location filename="../../ui/wallets_tab.ui" line="107"/> + <source>Send leaving demand</source> + <translation>Quitter la communauté</translation> + </message> + <message> + <location filename="../../ui/wallets_tab.ui" line="142"/> + <source>label_balance_range</source> + <translation></translation> + </message> </context> <context> <name>WalletsTabWidget</name> <message> - <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="82"/> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="86"/> <source> <table cellpadding="5"> <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> @@ -2055,17 +2080,17 @@ Veuillez rééssayer plus tard</translation> <translation></translation> </message> <message> - <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="82"/> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="86"/> <source>Membership</source> <translation>Statut de membre</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="82"/> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="86"/> <source>Last renewal on {:}, expiration on {:}</source> <translation>Dernier renouvellement le {:}, expire le {:}</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="100"/> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="104"/> <source> <table cellpadding="5"> <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> @@ -2076,20 +2101,10 @@ Veuillez rééssayer plus tard</translation> <translation></translation> </message> <message> - <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="100"/> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="104"/> <source>Not a member</source> <translation>Non-membre</translation> </message> - <message> - <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="134"/> - <source> - <table cellpadding="5"> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - </table> - </source> - <translation></translation> - </message> <message> <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="118"/> <source>{:} {:} in [{:.2f} - {:}] {:}</source> @@ -2111,24 +2126,19 @@ Veuillez rééssayer plus tard</translation> <translation>Transférer à...</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="100"/> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="104"/> <source>Your web of trust</source> <translation>Votre toile de confiance</translation> </message> <message> <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="134"/> <source>Your money share </source> - <translation>Votre part de monnaie</translation> - </message> - <message> - <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="134"/> - <source>{:.2f}%</source> - <translation></translation> + <translation type="obsolete">Votre part de monnaie</translation> </message> <message> <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="134"/> <source>Your part </source> - <translation>Votre part</translation> + <translation type="obsolete">Votre part</translation> </message> <message> <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="181"/> @@ -2136,7 +2146,7 @@ Veuillez rééssayer plus tard</translation> <translation>Nouveau portefeuille</translation> </message> <message> - <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="100"/> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="104"/> <source>Certified by {:} members; Certifier of {:} members</source> <translation>Certifié par {:} membres; Certifieur de {:} membres</translation> </message> @@ -2148,7 +2158,83 @@ Veuillez rééssayer plus tard</translation> <message> <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="134"/> <source>{:} {:} in [{:} ; {:}] {:}</source> - <translation>{:} {:} compris entre [{:} ; {:}] {:}</translation> + <translation type="obsolete">{:} {:} compris entre [{:} ; {:}] {:}</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="138"/> + <source><center><b>{:} {:} in [{:} ; {:}] {:}</b></center></source> + <translation type="obsolete"><center><b>{:} {:} compris entre [{:} ; {:}] {:}</b></center></translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="306"/> + <source>Warning</source> + <translation>Attention</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="267"/> + <source>Are you sure ? +Sending a leaving demand cannot be canceled. +The process to join back the community later will have to be done again.</source> + <translation>Êtes vous certain ? +Envoyer une demande pour quitter la communauté ne peut être annulée. +Le processus pour rejoindre la communauté devrait être refait à zéro.</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="280"/> + <source>Are you sure ? +Publishing your UID can be canceled by Revoke UID.</source> + <translation>Etes-vous sûr(e) ? Publier votre UID peut être annulé par le bouton Révoquer votre UID.</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="291"/> + <source>UID Publishing</source> + <translation>Publication de l'UID</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="291"/> + <source>Success publishing your UID</source> + <translation>Publication de votre UID réussie</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="294"/> + <source>Publish UID error</source> + <translation>Publier votre UID</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="297"/> + <source>Network error</source> + <translation>Erreur réseau</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="297"/> + <source>Couldn't connect to network : {0}</source> + <translation>Impossible de se connecter au réseau : {0}</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="306"/> + <source>Are you sure ? +Revoking your UID can only success if it is not already validated by the network.</source> + <translation>Etes-vous sûr(e) ? Révoquer votre UID ne peut réussir que s'il n'a pas été déjà validé par le réseau.</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="322"/> + <source>Renew membership</source> + <translation>Renouveller le statut de membre</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="329"/> + <source>Send membership demand</source> + <translation>Envoyer une demande de membre</translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="138"/> + <source>{:} {:}</source> + <translation></translation> + </message> + <message> + <location filename="../../../src/cutecoin/gui/wallets_tab.py" line="145"/> + <source>in [{:} ; {:}] {:}</source> + <translation>compris entre [{:} ; {:}] {:}</translation> </message> </context> <context> diff --git a/res/ui/community_tab.ui b/res/ui/community_tab.ui index aa2718ddddbe9bd7397085fa81a1360dbe1d3be1..43eb5750042ac2493427e536b2e9837890c72624 100644 --- a/res/ui/community_tab.ui +++ b/res/ui/community_tab.ui @@ -91,64 +91,6 @@ </attribute> </widget> </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>5</number> - </property> - <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> - <widget class="QLabel" name="label_quality"> - <property name="text"> - <string>Quality : </string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="button_publish_uid"> - <property name="text"> - <string>Publish UID</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="button_revoke_uid"> - <property name="text"> - <string>Revoke UID</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="button_membership"> - <property name="text"> - <string>Renew membership</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="button_leaving"> - <property name="text"> - <string>Send leaving demand</string> - </property> - </widget> - </item> - </layout> - </item> </layout> </item> </layout> @@ -161,38 +103,6 @@ <include location="../icons/icons.qrc"/> </resources> <connections> - <connection> - <sender>button_membership</sender> - <signal>clicked()</signal> - <receiver>CommunityTabWidget</receiver> - <slot>send_membership_demand()</slot> - <hints> - <hint type="sourcelabel"> - <x>198</x> - <y>335</y> - </hint> - <hint type="destinationlabel"> - <x>199</x> - <y>149</y> - </hint> - </hints> - </connection> - <connection> - <sender>button_leaving</sender> - <signal>clicked()</signal> - <receiver>CommunityTabWidget</receiver> - <slot>send_membership_leaving()</slot> - <hints> - <hint type="sourcelabel"> - <x>338</x> - <y>335</y> - </hint> - <hint type="destinationlabel"> - <x>199</x> - <y>149</y> - </hint> - </hints> - </connection> <connection> <sender>edit_textsearch</sender> <signal>returnPressed()</signal> @@ -225,38 +135,6 @@ </hint> </hints> </connection> - <connection> - <sender>button_publish_uid</sender> - <signal>clicked()</signal> - <receiver>CommunityTabWidget</receiver> - <slot>publish_uid()</slot> - <hints> - <hint type="sourcelabel"> - <x>123</x> - <y>334</y> - </hint> - <hint type="destinationlabel"> - <x>228</x> - <y>184</y> - </hint> - </hints> - </connection> - <connection> - <sender>button_revoke_uid</sender> - <signal>clicked()</signal> - <receiver>CommunityTabWidget</receiver> - <slot>revoke_uid()</slot> - <hints> - <hint type="sourcelabel"> - <x>750</x> - <y>368</y> - </hint> - <hint type="destinationlabel"> - <x>622</x> - <y>201</y> - </hint> - </hints> - </connection> </connections> <slots> <slot>identity_context_menu(QPoint)</slot> diff --git a/res/ui/wallets_tab.ui b/res/ui/wallets_tab.ui index f896dc71372d05c3799d8f9830d046d61c891ca6..cef471bfba54f06dc89fb6eaa1b6d7ee03a642d8 100644 --- a/res/ui/wallets_tab.ui +++ b/res/ui/wallets_tab.ui @@ -59,6 +59,57 @@ QGroupBox::title { </property> </widget> </item> + <item row="1" column="0"> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>5</number> + </property> + <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> + <widget class="QPushButton" name="button_publish_uid"> + <property name="text"> + <string>Publish UID</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="button_revoke_uid"> + <property name="text"> + <string>Revoke UID</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="button_membership"> + <property name="text"> + <string>Renew membership</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="button_leaving"> + <property name="text"> + <string>Send leaving demand</string> + </property> + </widget> + </item> + </layout> + </item> </layout> </widget> </item> @@ -70,11 +121,28 @@ QGroupBox::title { <layout class="QVBoxLayout" name="verticalLayout_3"> <item> <widget class="QLabel" name="label_balance"> + <property name="font"> + <font> + <pointsize>22</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> <property name="text"> <string>label_balance</string> </property> <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> + <set>Qt::AlignHCenter|Qt::AlignTop</set> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_balance_range"> + <property name="text"> + <string>label_balance_range</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> </property> </widget> </item> @@ -134,9 +202,77 @@ QGroupBox::title { </hint> </hints> </connection> + <connection> + <sender>button_publish_uid</sender> + <signal>clicked()</signal> + <receiver>WalletsTab</receiver> + <slot>publish_uid()</slot> + <hints> + <hint type="sourcelabel"> + <x>430</x> + <y>69</y> + </hint> + <hint type="destinationlabel"> + <x>461</x> + <y>459</y> + </hint> + </hints> + </connection> + <connection> + <sender>button_revoke_uid</sender> + <signal>clicked()</signal> + <receiver>WalletsTab</receiver> + <slot>revoke_uid()</slot> + <hints> + <hint type="sourcelabel"> + <x>533</x> + <y>69</y> + </hint> + <hint type="destinationlabel"> + <x>461</x> + <y>459</y> + </hint> + </hints> + </connection> + <connection> + <sender>button_membership</sender> + <signal>clicked()</signal> + <receiver>WalletsTab</receiver> + <slot>send_membership_demand()</slot> + <hints> + <hint type="sourcelabel"> + <x>662</x> + <y>69</y> + </hint> + <hint type="destinationlabel"> + <x>461</x> + <y>459</y> + </hint> + </hints> + </connection> + <connection> + <sender>button_leaving</sender> + <signal>clicked()</signal> + <receiver>WalletsTab</receiver> + <slot>send_membership_leaving()</slot> + <hints> + <hint type="sourcelabel"> + <x>823</x> + <y>69</y> + </hint> + <hint type="destinationlabel"> + <x>461</x> + <y>459</y> + </hint> + </hints> + </connection> </connections> <slots> <slot>wallet_context_menu(QPoint)</slot> <slot>wallet_changed()</slot> + <slot>send_membership_demand()</slot> + <slot>send_membership_leaving()</slot> + <slot>revoke_uid()</slot> + <slot>publish_uid()</slot> </slots> </ui> diff --git a/src/cutecoin/gui/community_tab.py b/src/cutecoin/gui/community_tab.py index ae672340d2c7fbe3f5b2bc9f808fc04f2cae3bec..35b47cf7fdf65398ba96d1d8ab5ec031b2edbe4f 100644 --- a/src/cutecoin/gui/community_tab.py +++ b/src/cutecoin/gui/community_tab.py @@ -18,7 +18,6 @@ from .transfer import TransferMoneyDialog from .certification import CertificationDialog from . import toast import asyncio -from ..tools.exceptions import LookupFailureError, NoPeerAvailable from ..core.net.api import bma as qtbma @@ -69,7 +68,6 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): self.account.membership_broadcasted.connect(self.handle_membership_broadcasted) self.account.revoke_broadcasted.connect(self.handle_revoke_broadcasted) self.account.selfcert_broadcasted.connect(self.handle_selfcert_broadcasted) - self.refresh_quality_buttons() def handle_membership_broadcasted(self): if self.app.preferences['notifications']: @@ -186,63 +184,6 @@ class CommunityTabWidget(QWidget, Ui_CommunityTabWidget): index_wot_tab = self.tabs_information.indexOf(self.wot_tab) self.tabs_information.setCurrentIndex(index_wot_tab) - def send_membership_demand(self): - password = self.password_asker.exec_() - if self.password_asker.result() == QDialog.Rejected: - return - asyncio.async(self.account.send_membership(password, self.community, 'IN')) - - def send_membership_leaving(self): - reply = QMessageBox.warning(self, self.tr("Warning"), - self.tr("""Are you sure ? -Sending a leaving demand cannot be canceled. -The process to join back the community later will have to be done again.""") -.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) - if reply == QMessageBox.Ok: - password = self.password_asker.exec_() - if self.password_asker.result() == QDialog.Rejected: - return - - asyncio.async(self.account.send_membership(password, self.community, 'OUT')) - - def publish_uid(self): - reply = QMessageBox.warning(self, self.tr("Warning"), - self.tr("""Are you sure ? -Publishing your UID can be canceled by Revoke UID.""") -.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) - if reply == QMessageBox.Ok: - password = self.password_asker.exec_() - if self.password_asker.result() == QDialog.Rejected: - return - - try: - self.account.send_selfcert(password, self.community) - toast.display(self.tr("UID Publishing"), - self.tr("Success publishing your UID")) - except ValueError as e: - QMessageBox.critical(self, self.tr("Publish UID error"), - str(e)) - except NoPeerAvailable as e: - QMessageBox.critical(self, self.tr("Network error"), - self.tr("Couldn't connect to network : {0}").format(e), - QMessageBox.Ok) - # except Exception as e: - # QMessageBox.critical(self, self.tr("Error"), - # "{0}".format(e), - # QMessageBox.Ok) - - def revoke_uid(self): - reply = QMessageBox.warning(self, self.tr("Warning"), - self.tr("""Are you sure ? -Revoking your UID can only success if it is not already validated by the network.""") -.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) - if reply == QMessageBox.Ok: - password = self.password_asker.exec_() - if self.password_asker.result() == QDialog.Rejected: - return - - asyncio.async(self.account.revoke(password, self.community)) - @asyncio.coroutine def _execute_search_text(self, text): response = yield from self.community.bma_access.future_request(qtbma.wot.Lookup, {'search': text}) @@ -343,30 +284,3 @@ Revoking your UID can only success if it is not already validated by the network self.table_identities.model().sourceModel().refresh_identities(identities) self.table_identities.resizeColumnsToContents() - def refresh_quality_buttons(self): - try: - if self.account.identity(self.community).published_uid(self.community): - logging.debug("UID Published") - if self.account.identity(self.community).is_member(self.community): - self.button_membership.setText(self.tr("Renew membership")) - self.button_membership.show() - self.button_publish_uid.hide() - self.button_leaving.show() - self.button_revoke_uid.hide() - else: - logging.debug("Not a member") - self.button_membership.setText(self.tr("Send membership demand")) - self.button_membership.show() - self.button_revoke_uid.show() - self.button_leaving.hide() - self.button_publish_uid.hide() - else: - logging.debug("UID not published") - self.button_membership.hide() - self.button_leaving.hide() - self.button_publish_uid.show() - self.button_revoke_uid.hide() - except LookupFailureError: - self.button_membership.hide() - self.button_leaving.hide() - self.button_publish_uid.show() diff --git a/src/cutecoin/gui/currency_tab.py b/src/cutecoin/gui/currency_tab.py index ad666123ed7b06767a7ac44626062520113646ac..4041e88f4e02bc898c36f9400007e17cc24539e5 100644 --- a/src/cutecoin/gui/currency_tab.py +++ b/src/cutecoin/gui/currency_tab.py @@ -78,10 +78,6 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): QIcon(':/icons/tx_icon'), self.tr("Transactions")) - self.tabs_account.addTab(self.tab_informations, - QIcon(':/icons/informations_icon'), - self.tr("Informations")) - self.tabs_account.addTab(self.tab_community, QIcon(':/icons/community_icon'), self.tr("Community")) @@ -90,6 +86,10 @@ class CurrencyTabWidget(QWidget, Ui_CurrencyTabWidget): QIcon(":/icons/network_icon"), self.tr("Network")) + self.tabs_account.addTab(self.tab_informations, + QIcon(':/icons/informations_icon'), + self.tr("Informations")) + self.community.network.new_block_mined.connect(self.refresh_block) self.community.network.nodes_changed.connect(self.refresh_status) self.community.inner_data_changed.connect(self.refresh_status) diff --git a/src/cutecoin/gui/wallets_tab.py b/src/cutecoin/gui/wallets_tab.py index b9136e9e9be7fed427d39cd2180196c3ecdab34c..ec52c17f5cf87de8638a24e4eaf3ad391117525e 100644 --- a/src/cutecoin/gui/wallets_tab.py +++ b/src/cutecoin/gui/wallets_tab.py @@ -3,17 +3,20 @@ Created on 15 févr. 2015 @author: inso """ - +import asyncio import logging -from PyQt5.QtWidgets import QWidget, QMenu, QAction, QApplication, QDialog + +from PyQt5.QtWidgets import QWidget, QMenu, QAction, QApplication, QDialog, QMessageBox from PyQt5.QtCore import QDateTime, QModelIndex, Qt, QLocale from PyQt5.QtGui import QCursor + from ..core.registry import Identity from ..core.wallet import Wallet +from cutecoin.gui import toast from ..gui.password_asker import PasswordAskerDialog from ..models.wallets import WalletsTableModel, WalletsFilterProxyModel from .transfer import TransferMoneyDialog -from ..tools.exceptions import MembershipNotFoundError +from ..tools.exceptions import MembershipNotFoundError, NoPeerAvailable, LookupFailureError from ..gen_resources.wallets_tab_uic import Ui_WalletsTab @@ -45,9 +48,10 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab): def refresh(self): self.refresh_informations_frame() self.refresh_wallets() + self.refresh_quality_buttons() def refresh_wallets(self): - #TODO: Using reset model instead of destroy/create + # TODO: Using reset model instead of destroy/create wallets_model = WalletsTableModel(self.app, self.community) proxy_model = WalletsFilterProxyModel() proxy_model.setSourceModel(wallets_model) @@ -92,7 +96,7 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab): self.tr("Last renewal on {:}, expiration on {:}").format(date_renewal, date_expiration), self.tr("Your web of trust"), self.tr("Certified by {:} members; Certifier of {:} members").format(len(certifiers), - len(certified)) + len(certified)) ) ) else: @@ -109,7 +113,7 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab): self.tr("Not a member"), self.tr("Your web of trust"), self.tr("Certified by {:} members; Certifier of {:} members").format(len(certifiers), - len(certified)) + len(certified)) ) ) @@ -126,32 +130,28 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab): localized_amount = QLocale().toString(float(self.get_referential_value(amount)), 'f', self.app.preferences['digits_after_comma']) localized_minimum = QLocale().toString(float(self.get_referential_value(0)), 'f', - self.app.preferences['digits_after_comma']) + self.app.preferences['digits_after_comma']) localized_maximum = QLocale().toString(float(self.get_referential_value(maximum)), 'f', - self.app.preferences['digits_after_comma']) + self.app.preferences['digits_after_comma']) # set infos in label self.label_balance.setText( - self.tr(""" - <table cellpadding="5"> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - <tr><td align="right"><b>{:}</b></td><td>{:}</td></tr> - </table> - """).format( - self.tr("Your money share "), - self.tr("{:.2f}%").format(amount / maximum * 100) if maximum != 0 else "0%", - self.tr("Your part "), - self.tr("{:} {:} in [{:} ; {:}] {:}") - .format( - localized_amount, - self.get_referential_name(), - localized_minimum, - localized_maximum, - self.get_referential_name() - ) + self.tr("{:} {:}") + .format( + localized_amount, + self.get_referential_name() + ) + ) + self.label_balance_range.setText( + self.tr("in [{:} ; {:}] {:}") + .format( + localized_minimum, + localized_maximum, + self.get_referential_name() ) ) + def get_referential_value(self, value): return self.account.units_to_ref(value, self.community) @@ -218,11 +218,11 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab): # create new wallet by increasing wallet pool size self.account.set_walletpool_size(len(self.account.wallets) + 1, password) # capture new wallet - wallet = self.account.wallets[len(self.account.wallets)-1] + wallet = self.account.wallets[len(self.account.wallets) - 1] # feed cache data of the wallet wallet.refresh_cache(self.community, list()) # save wallet cache on disk - self.app.save_wallet(self.account, self.account.wallets[len(self.account.wallets)-1]) + self.app.save_wallet(self.account, self.account.wallets[len(self.account.wallets) - 1]) # save account cache on disk (update number of wallets) self.app.save(self.account) # refresh wallet list in gui @@ -256,3 +256,88 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab): if dialog.exec_() == QDialog.Accepted: currency_tab = self.window().currencies_tabwidget.currentWidget() currency_tab.tab_history.table_history.model().sourceModel().refresh_transfers() + + def send_membership_demand(self): + password = self.password_asker.exec_() + if self.password_asker.result() == QDialog.Rejected: + return + asyncio.async(self.account.send_membership(password, self.community, 'IN')) + + def send_membership_leaving(self): + reply = QMessageBox.warning(self, self.tr("Warning"), + self.tr("""Are you sure ? +Sending a leaving demand cannot be canceled. +The process to join back the community later will have to be done again.""") +.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) + if reply == QMessageBox.Ok: + password = self.password_asker.exec_() + if self.password_asker.result() == QDialog.Rejected: + return + + asyncio.async(self.account.send_membership(password, self.community, 'OUT')) + + def publish_uid(self): + reply = QMessageBox.warning(self, self.tr("Warning"), + self.tr("""Are you sure ? +Publishing your UID can be canceled by Revoke UID.""") +.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) + if reply == QMessageBox.Ok: + password = self.password_asker.exec_() + if self.password_asker.result() == QDialog.Rejected: + return + + try: + self.account.send_selfcert(password, self.community) + toast.display(self.tr("UID Publishing"), + self.tr("Success publishing your UID")) + except ValueError as e: + QMessageBox.critical(self, self.tr("Publish UID error"), + str(e)) + except NoPeerAvailable as e: + QMessageBox.critical(self, self.tr("Network error"), + self.tr("Couldn't connect to network : {0}").format(e), + QMessageBox.Ok) + # except Exception as e: + # QMessageBox.critical(self, self.tr("Error"), + # "{0}".format(e), + # QMessageBox.Ok) + + def revoke_uid(self): + reply = QMessageBox.warning(self, self.tr("Warning"), + self.tr("""Are you sure ? +Revoking your UID can only success if it is not already validated by the network.""") +.format(self.account.pubkey), QMessageBox.Ok | QMessageBox.Cancel) + if reply == QMessageBox.Ok: + password = self.password_asker.exec_() + if self.password_asker.result() == QDialog.Rejected: + return + + asyncio.async(self.account.revoke(password, self.community)) + + def refresh_quality_buttons(self): + try: + if self.account.identity(self.community).published_uid(self.community): + logging.debug("UID Published") + if self.account.identity(self.community).is_member(self.community): + self.button_membership.setText(self.tr("Renew membership")) + self.button_membership.show() + self.button_publish_uid.hide() + self.button_leaving.show() + self.button_revoke_uid.hide() + else: + logging.debug("Not a member") + self.button_membership.setText(self.tr("Send membership demand")) + self.button_membership.show() + self.button_revoke_uid.show() + self.button_leaving.hide() + self.button_publish_uid.hide() + else: + logging.debug("UID not published") + self.button_membership.hide() + self.button_leaving.hide() + self.button_publish_uid.show() + self.button_revoke_uid.hide() + except LookupFailureError: + self.button_membership.hide() + self.button_leaving.hide() + self.button_publish_uid.show()