diff --git a/buttonarea.py b/buttonarea.py index 6708714..33f27f6 100644 --- a/buttonarea.py +++ b/buttonarea.py @@ -99,8 +99,8 @@ class ButtonArea(QWidget): def get_current_state(self): label_button = self.get_checked_label_button() - result = {} if label_button != None: + result = {} label = str(label_button.text()) if self.label_properties.has_key(label): if self.label_properties[label].has_key("type"): @@ -112,7 +112,9 @@ class ButtonArea(QWidget): checked_button = button_list.get_checked_button() if checked_button != None: result[button_list.name] = str(checked_button.text()) - return result + return result + + return None def clickedButton(self): button = self.sender() @@ -140,7 +142,7 @@ class ButtonArea(QWidget): def load(self, config_filepath): execfile(config_filepath) self.init_button_lists() - + def main(): app = QApplication(sys.argv) diff --git a/labeltool.py b/labeltool.py index f5c574f..86944df 100755 --- a/labeltool.py +++ b/labeltool.py @@ -50,6 +50,7 @@ class MainWindow(QMainWindow): self.buttonarea = ButtonArea() self.buttonarea.load("example_config.py") self.ui.dockAnnotationButtons.setWidget(self.buttonarea) + self.connect(self.buttonarea, SIGNAL("stateChanged(state)"), self.scene.setMode) self.treeview = AnnotationTreeView() self.ui.dockInformation.setWidget(self.treeview)