changeset e27f5dd8f762 in /home/hg/repos/gajim-plugins

author: lovetox <[email protected]>
branches: 
details:gajim-plugins?cmd=changeset;node=e27f5dd8f762
description: Add Clear Devices function to the Config UI

        - Adds a page where all currently published Device IDs are shown
        - Small design changes to the whole Config UI

diffstat:

 omemo/__init__.py      |    4 +-
 omemo/config_dialog.ui |  291 +++++++++++++++++++++++++++++++++---------------
 omemo/ui.py            |   18 +++
 3 files changed, 218 insertions(+), 95 deletions(-)

diffs (truncated from 434 to 300 lines):

diff -r 22a2ea6f212e -r e27f5dd8f762 omemo/__init__.py
--- a/omemo/__init__.py Tue Jun 07 20:15:58 2016 +0200
+++ b/omemo/__init__.py Tue Jun 07 20:19:48 2016 +0200
@@ -521,10 +521,10 @@
             self.publish_own_devices_list(account, state)
 
     @log_calls('OmemoPlugin')
-    def clear_device_list(self, contact):
-        account = contact.account.name
+    def clear_device_list(self, account):
         state = self.get_omemo_state(account)
         devices_list = [state.own_device_id]
+        state.set_own_devices(devices_list)
 
         log.info(account + ' ⇒ Clearing devices_list ' + str(devices_list))
         iq = DeviceListAnnouncement(devices_list)
diff -r 22a2ea6f212e -r e27f5dd8f762 omemo/config_dialog.ui
--- a/omemo/config_dialog.ui    Tue Jun 07 20:15:58 2016 +0200
+++ b/omemo/config_dialog.ui    Tue Jun 07 20:19:48 2016 +0200
@@ -8,6 +8,12 @@
       <column type="gchararray"/>
     </columns>
   </object>
+  <object class="GtkListStore" id="deviceid_store">
+    <columns>
+      <!-- column-name Device -->
+      <column type="gchararray"/>
+    </columns>
+  </object>
   <object class="GtkListStore" id="fingerprint_store">
     <columns>
       <!-- column-name id -->
@@ -27,104 +33,44 @@
       <object class="GtkVBox" id="vbox1">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <property name="spacing">10</property>
         <child>
-          <object class="GtkFrame" id="frame1">
+          <object class="GtkHBox" id="hbox2">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="border_width">12</property>
-            <property name="label_xalign">0</property>
-            <property name="shadow_type">none</property>
+            <property name="spacing">5</property>
             <child>
-              <object class="GtkAlignment" id="alignment1">
+              <object class="GtkLabel" id="label4">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="top_padding">10</property>
-                <property name="left_padding">12</property>
+                <property name="label" translatable="yes" comments="label for 
account selector">&lt;b&gt;Account:&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="account_combobox">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="model">account_store</property>
+                <signal name="changed" handler="account_combobox_changed_cb" 
swapped="no"/>
                 <child>
-                  <object class="GtkVBox" id="vbox2">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkHBox" id="hbox1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">5</property>
-                        <child>
-                          <object class="GtkLabel" id="fingerprint_label_desc">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes" 
comments="Descriptive label">Own Fingerprint:</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkLabel" id="fingerprint_label">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label">&lt;tt&gt;-------- -------- 
-------- -------- --------      &lt;/tt&gt;</property>
-                            <property name="use_markup">True</property>
-                            <property name="selectable">True</property>
-                          </object>
-                          <packing>
-                            <property name="expand">True</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                  </object>
+                  <object class="GtkCellRendererText" id="cellrenderertext1"/>
+                  <attributes>
+                    <attribute name="text">0</attribute>
+                  </attributes>
                 </child>
               </object>
-            </child>
-            <child type="label">
-              <object class="GtkHBox" id="hbox2">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="spacing">5</property>
-                <child>
-                  <object class="GtkLabel" id="label4">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes" comments="label 
for account selector">&lt;b&gt;Account:&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="account_combobox">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="model">account_store</property>
-                    <signal name="changed" 
handler="account_combobox_changed_cb" swapped="no"/>
-                    <child>
-                      <object class="GtkCellRendererText" 
id="cellrenderertext1"/>
-                      <attributes>
-                        <attribute name="text">0</attribute>
-                      </attributes>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
             </child>
           </object>
           <packing>
@@ -133,6 +79,47 @@
             <property name="position">0</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkHBox" id="hbox1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">5</property>
+            <child>
+              <object class="GtkLabel" id="fingerprint_label_desc">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes" 
comments="Descriptive label">Own Fingerprint:</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="fingerprint_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label">&lt;tt&gt;-------- -------- -------- 
-------- --------  &lt;/tt&gt;</property>
+                <property name="use_markup">True</property>
+                <property name="selectable">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
       </object>
     </child>
     <child type="tab">
@@ -150,8 +137,10 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="border_width">12</property>
+        <property name="spacing">10</property>
         <child>
           <object class="GtkScrolledWindow" id="scrolledwindow1">
+            <property name="height_request">200</property>
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="hscrollbar_policy">automatic</property>
@@ -214,25 +203,25 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="spacing">5</property>
-            <property name="homogeneous">True</property>
             <child>
               <object class="GtkButton" id="trust_button">
                 <property name="label" translatable="yes" 
comments="button">Verify Fingerprint</property>
+                <property name="width_request">150</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <signal name="clicked" handler="trust_button_clicked_cb" 
swapped="no"/>
               </object>
               <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
                 <property name="position">0</property>
               </packing>
             </child>
           </object>
           <packing>
             <property name="expand">False</property>
-            <property name="fill">True</property>
+            <property name="fill">False</property>
             <property name="position">1</property>
           </packing>
         </child>
@@ -252,6 +241,122 @@
         <property name="tab_fill">False</property>
       </packing>
     </child>
+    <child>
+      <object class="GtkVBox" id="vbox3">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="border_width">12</property>
+        <property name="spacing">10</property>
+        <child>
+          <object class="GtkLabel" id="label5">
+            <property name="height_request">25</property>
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">Published 
Devices</property>
+            <attributes>
+              <attribute name="style" value="normal"/>
+              <attribute name="weight" value="bold"/>
+            </attributes>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="padding">7</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkScrolledWindow" id="scrolledwindow2">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="hscrollbar_policy">never</property>
+            <property name="vscrollbar_policy">automatic</property>
+            <child>
+              <object class="GtkTreeView" id="deviceid_view">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="model">deviceid_store</property>
+                <property name="search_column">0</property>
+                <child>
+                  <object class="GtkTreeViewColumn" id="deviceid_column">
+                    <property name="title" translatable="yes">Device 
ID</property>
+                    <child>
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to