Commit 180d25a2 authored by Wang Yinghao's avatar Wang Yinghao
Browse files

bugfix, toggle button

parent 201a54d0
...@@ -237,7 +237,7 @@ class MainWindow(QMainWindow, WindowMixin): ...@@ -237,7 +237,7 @@ class MainWindow(QMainWindow, WindowMixin):
'Ctrl+S', 'save', u'Save labels to file', enabled=False) 'Ctrl+S', 'save', u'Save labels to file', enabled=False)
save_format = action('&Format', self.change_format, save_format = action('&Format', self.change_format,
'Ctrl+', 'format', u'Change save format', enabled=True) 'Ctrl+', 'format_voc', u'Change save format', enabled=True)
saveAs = action('&Save As', self.saveFileAs, saveAs = action('&Save As', self.saveFileAs,
'Ctrl+Shift+S', 'save-as', u'Save labels to a different file', enabled=False) 'Ctrl+Shift+S', 'save-as', u'Save labels to a different file', enabled=False)
...@@ -475,17 +475,19 @@ class MainWindow(QMainWindow, WindowMixin): ...@@ -475,17 +475,19 @@ class MainWindow(QMainWindow, WindowMixin):
def set_format(self, save_format): def set_format(self, save_format):
if save_format == 'PascalVOC': if save_format == 'PascalVOC':
self.actions.save_format.setText("PascalVOC") self.actions.save_format.setText("PascalVOC")
self.actions.save_format.setIcon(newIcon("format_voc"))
self.usingPascalVocFormat = True self.usingPascalVocFormat = True
self.usingYoloFormat = False self.usingYoloFormat = False
elif save_format == 'YOLO': elif save_format == 'YOLO':
if self.usingYoloFormat: self.actions.save_format.setText("YOLO") self.actions.save_format.setText("YOLO")
self.actions.save_format.setIcon(newIcon("format_yolo"))
self.usingPascalVocFormat = False self.usingPascalVocFormat = False
self.usingYoloFormat = True self.usingYoloFormat = True
def change_format(self): def change_format(self):
if self.usingPascalVocFormat: self.set_format("YOLO") if self.usingPascalVocFormat: self.set_format("YOLO")
if self.usingYoloFormat: self.set_format("PascalVOC") elif self.usingYoloFormat: self.set_format("PascalVOC")
def noShapes(self): def noShapes(self):
return not self.itemsToShapes return not self.itemsToShapes
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
<file alias="edit">icons/edit.png</file> <file alias="edit">icons/edit.png</file>
<file alias="open">icons/open.png</file> <file alias="open">icons/open.png</file>
<file alias="save">icons/save.png</file> <file alias="save">icons/save.png</file>
<file alias="format_voc">icons/format_voc.png</file>
<file alias="format_yolo">icons/format_yolo.png</file>
<file alias="save-as">icons/save-as.png</file> <file alias="save-as">icons/save-as.png</file>
<file alias="color">icons/color.png</file> <file alias="color">icons/color.png</file>
<file alias="color_line">icons/color_line.png</file> <file alias="color_line">icons/color_line.png</file>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment