Hello community,

here is the log from the commit of package yast2-apparmor for openSUSE:Factory 
checked in at 2017-08-08 12:05:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-apparmor (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-apparmor.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-apparmor"

Tue Aug  8 12:05:24 2017 rev:61 rq:512171 version:3.3.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-apparmor/yast2-apparmor.changes    
2017-07-02 13:32:59.738910023 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-apparmor.new/yast2-apparmor.changes       
2017-08-08 12:05:25.335775635 +0200
@@ -1,0 +2,5 @@
+Mon Jul 24 01:26:27 UTC 2017 - belphe...@belbel.or.jp
+
+- fix 'Toggle Mode' bug for non-English locale (bsc#1043546)
+
+-------------------------------------------------------------------

Old:
----
  yast2-apparmor-3.2.1.tar.bz2

New:
----
  yast2-apparmor-3.3.0.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-apparmor.spec ++++++
--- /var/tmp/diff_new_pack.zXPAFM/_old  2017-08-08 12:05:26.439620162 +0200
+++ /var/tmp/diff_new_pack.zXPAFM/_new  2017-08-08 12:05:26.443619598 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-apparmor
-Version:        3.2.1
+Version:        3.3.0
 Release:        0
 Summary:        YaST2 - Plugins for AppArmor Profile Management
 License:        GPL-2.0

++++++ yast2-apparmor-3.2.1.tar.bz2 -> yast2-apparmor-3.3.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-apparmor-3.2.1/package/yast2-apparmor.changes 
new/yast2-apparmor-3.3.0/package/yast2-apparmor.changes
--- old/yast2-apparmor-3.2.1/package/yast2-apparmor.changes     2017-06-30 
15:24:27.532314934 +0200
+++ new/yast2-apparmor-3.3.0/package/yast2-apparmor.changes     2017-07-24 
08:22:10.988794360 +0200
@@ -1,4 +1,9 @@
 -------------------------------------------------------------------
+Mon Jul 24 01:26:27 UTC 2017 - belphe...@belbel.or.jp
+
+- fix 'Toggle Mode' bug for non-English locale (bsc#1043546)
+
+-------------------------------------------------------------------
 Fri Jun 30 12:44:14 UTC 2017 - jreidin...@suse.com
 
 - fix name of apparmor systemd service (bsc#1046750)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-apparmor-3.2.1/package/yast2-apparmor.spec 
new/yast2-apparmor-3.3.0/package/yast2-apparmor.spec
--- old/yast2-apparmor-3.2.1/package/yast2-apparmor.spec        2017-06-30 
15:24:27.532314934 +0200
+++ new/yast2-apparmor-3.3.0/package/yast2-apparmor.spec        2017-07-24 
08:22:10.988794360 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-apparmor
-Version:        3.2.1
+Version:        3.3.0
 Release:        0
 Summary:        YaST2 - Plugins for AppArmor Profile Management
 Url:            https://github.com/yast/yast-apparmor
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-apparmor-3.2.1/src/include/apparmor/config_complain.rb 
new/yast2-apparmor-3.3.0/src/include/apparmor/config_complain.rb
--- old/yast2-apparmor-3.2.1/src/include/apparmor/config_complain.rb    
2017-06-30 15:24:27.540314934 +0200
+++ new/yast2-apparmor-3.3.0/src/include/apparmor/config_complain.rb    
2017-07-24 08:22:10.996794360 +0200
@@ -89,7 +89,7 @@
       nil
     end
 
-    def getRecordList(showAll)
+    def updateRecordList(showAll)
       _Settings = {}
       Ops.set(_Settings, "list", "1")
 
@@ -99,7 +99,7 @@
         Ops.set(_Settings, "showall", "0")
       end
 
-      recList = []
+      @recList = []
       key = 1
 
       # restarts ag_complain agent if necessary
@@ -112,25 +112,18 @@
         )
       end
 
-      translation_mapping = {
-        # translators: string is value in table for mode of apparmor
-        "enforce"  => _("enforce"),
-        "complain" => _("complain"),
-      }
-
       Builtins.foreach(db) do |record|
-        recList = Builtins.add(
-          recList,
-          Item(Id(key), Ops.get(record, "name"), 
translation_mapping[record["mode"]])
+        @recList = Builtins.add(
+          @recList,
+          Item(Id(key), Ops.get(record, "name"), record["mode"])
         )
         key = Ops.add(key, 1)
       end
 
-      deep_copy(recList)
+      nil
     end
 
-    def getProfModeForm(recList, showAll)
-      recList = deep_copy(recList)
+    def getProfModeForm(showAll)
       allBtn = PushButton(Id(:showAll), _("Show All Profiles"))
       allText = _("Configure Mode for Active Profiles")
 
@@ -139,6 +132,17 @@
         allText = _("Configure Mode for All Profiles")
       end
 
+      translation_mapping = {
+        # translators: string is value in table for mode of apparmor
+        "enforce"  => _("enforce"),
+        "complain" => _("complain"),
+      }
+
+      recListTranslated = (@recList || []).map do |record|
+        Item(record.params[0], record.params[1],
+          translation_mapping[record.params[2]] || record.params[2])
+      end
+
       modeForm = Frame(
         Id(:changeMode),
         allText,
@@ -151,7 +155,7 @@
               Id(:table),
               Opt(:notify),
               Header(_("Profile Name"), _("Mode")),
-              recList
+              recListTranslated
             )
           ),
           VSpacing(0.5),
@@ -168,16 +172,16 @@
     end
 
     def updateModeConfigForm(showAll)
-      recList = getRecordList(showAll)
-      newModeForm = getProfModeForm(recList, showAll)
+      updateRecordList(showAll)
+      newModeForm = getProfModeForm(showAll)
 
       deep_copy(newModeForm)
     end
 
     # Profile Mode Configuration -- Sets Complain and Enforce Behavior
     def profileModeConfigForm
-      recList = getRecordList(@showAll)
-      modeForm = getProfModeForm(recList, @showAll)
+      updateRecordList(@showAll)
+      modeForm = getProfModeForm(@showAll)
       Wizard.CreateDialog
       Wizard.SetContentsButtons(
         _("Profile Mode Configuration"),
@@ -256,13 +260,12 @@
             1,
             ""
           )
-          mode = Ops.get_string(
-            Convert.to_term(
-              UI.QueryWidget(Id(:table), term(:Item, itemselected))
-            ),
-            2,
-            ""
-          )
+          mode = ""
+          Builtins.foreach(@recList) do |record|
+            if record.params[1] == profile
+              mode = record.params[2]
+            end
+          end
 
           updateComplain(id, profile, mode, @showAll)
           modified = true


Reply via email to