Browse Source

Fix changing the mapper to (none) if other mappers are defined

Yentl Van Tendeloo 7 years ago
parent
commit
644c5b5905
2 changed files with 9 additions and 5 deletions
  1. 3 1
      classes/window/main_window.xml
  2. 6 4
      frontend.py

+ 3 - 1
classes/window/main_window.xml

@@ -665,7 +665,9 @@
                                     result.add("(none)")
                                     result.add("(none)")
                                     self.allowed_mappers = list(result)
                                     self.allowed_mappers = list(result)
                                     global current_mapper
                                     global current_mapper
-                                    if current_mapper not in result:
+                                    if current_mapper is None:
+                                        current_mapper = None
+                                    elif current_mapper not in result:
                                         current_mapper = next(iter(result))
                                         current_mapper = next(iter(result))
                                         if current_mapper == "(none)":
                                         if current_mapper == "(none)":
                                             current_mapper = None
                                             current_mapper = None

+ 6 - 4
frontend.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Mon Jan 29 15:30:36 2018
+Date:   Mon Mar  5 08:55:17 2018
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   Modelverse Visual Editor - Tkinter Version 
 Model name:   Modelverse Visual Editor - Tkinter Version 
@@ -3439,13 +3439,13 @@ class Modelverse(RuntimeClassBase):
         return self.expect_response_partial('Success: ', pop=False)
         return self.expect_response_partial('Success: ', pop=False)
     
     
     def _initialized_behaviour_operations_read_association_source_0_exec(self, parameters):
     def _initialized_behaviour_operations_read_association_source_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("result", None, [self.split_response(self.responses.pop(0))[0]]))
+        self.raiseInternalEvent(Event("result", None, [self.split_response(self.responses.pop(0))]))
     
     
     def _initialized_behaviour_operations_read_association_source_0_guard(self, parameters):
     def _initialized_behaviour_operations_read_association_source_0_guard(self, parameters):
         return self.expect_response_partial('Success: ', pop=False)
         return self.expect_response_partial('Success: ', pop=False)
     
     
     def _initialized_behaviour_operations_read_association_destination_0_exec(self, parameters):
     def _initialized_behaviour_operations_read_association_destination_0_exec(self, parameters):
-        self.raiseInternalEvent(Event("result", None, [self.split_response(self.responses.pop(0))[0]]))
+        self.raiseInternalEvent(Event("result", None, [self.split_response(self.responses.pop(0))]))
     
     
     def _initialized_behaviour_operations_read_association_destination_0_guard(self, parameters):
     def _initialized_behaviour_operations_read_association_destination_0_guard(self, parameters):
         return self.expect_response_partial('Success: ', pop=False)
         return self.expect_response_partial('Success: ', pop=False)
@@ -6346,7 +6346,9 @@ class MainWindow(RuntimeClassBase, tk.Toplevel, SCCDWidget):
         result.add("(none)")
         result.add("(none)")
         self.allowed_mappers = list(result)
         self.allowed_mappers = list(result)
         global current_mapper
         global current_mapper
-        if current_mapper not in result:
+        if current_mapper is None:
+            current_mapper = None
+        elif current_mapper not in result:
             current_mapper = next(iter(result))
             current_mapper = next(iter(result))
             if current_mapper == "(none)":
             if current_mapper == "(none)":
                 current_mapper = None
                 current_mapper = None