If there no default saved dir, show a dialog for autosaving
This commit is contained in:
parent
d8e961126a
commit
cbc1761e9f
26
labelImg.py
26
labelImg.py
@ -342,7 +342,7 @@ class MainWindow(QMainWindow, WindowMixin):
|
||||
recentFiles=QMenu('Open &Recent'),
|
||||
labelList=labelMenu)
|
||||
|
||||
# Auto saving : Enble auto saving if pressing next
|
||||
# Auto saving : Enable auto saving if pressing next
|
||||
self.autoSaving = QAction("Auto Saving", self)
|
||||
self.autoSaving.setCheckable(True)
|
||||
|
||||
@ -1029,7 +1029,7 @@ class MainWindow(QMainWindow, WindowMixin):
|
||||
path = '.'
|
||||
|
||||
dirpath = ustr(QFileDialog.getExistingDirectory(self,
|
||||
'%s - Save to the directory' % __appname__, path, QFileDialog.ShowDirsOnly
|
||||
'%s - Save annotations to the directory' % __appname__, path, QFileDialog.ShowDirsOnly
|
||||
| QFileDialog.DontResolveSymlinks))
|
||||
|
||||
if dirpath is not None and len(dirpath) > 1:
|
||||
@ -1098,9 +1098,13 @@ class MainWindow(QMainWindow, WindowMixin):
|
||||
|
||||
def openPrevImg(self, _value=False):
|
||||
# Proceding prev image without dialog if having any label
|
||||
if self.autoSaving.isChecked() and self.defaultSaveDir is not None:
|
||||
if self.dirty is True:
|
||||
self.saveFile()
|
||||
if self.autoSaving.isChecked():
|
||||
if self.defaultSaveDir is not None:
|
||||
if self.dirty is True:
|
||||
self.saveFile()
|
||||
else:
|
||||
self.changeSavedir()
|
||||
return
|
||||
|
||||
if not self.mayContinue():
|
||||
return
|
||||
@ -1118,10 +1122,14 @@ class MainWindow(QMainWindow, WindowMixin):
|
||||
self.loadFile(filename)
|
||||
|
||||
def openNextImg(self, _value=False):
|
||||
# Proceding next image without dialog if having any label
|
||||
if self.autoSaving.isChecked() and self.defaultSaveDir is not None:
|
||||
if self.dirty is True:
|
||||
self.saveFile()
|
||||
# Proceding prev image without dialog if having any label
|
||||
if self.autoSaving.isChecked():
|
||||
if self.defaultSaveDir is not None:
|
||||
if self.dirty is True:
|
||||
self.saveFile()
|
||||
else:
|
||||
self.changeSavedir()
|
||||
return
|
||||
|
||||
if not self.mayContinue():
|
||||
return
|
||||
|
||||
@ -7,7 +7,7 @@ class Settings(object):
|
||||
# Be default, the home will be in the same folder as labelImg
|
||||
home = os.path.expanduser("~")
|
||||
self.data = {}
|
||||
self.path = os.path.join(home, '.settings.pkl')
|
||||
self.path = os.path.join(home, '.labelImgSettings.pkl')
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
self.data[key] = value
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[bumpversion]
|
||||
current_version = 1.5.0
|
||||
current_version = 1.5.1
|
||||
commit = True
|
||||
tag = True
|
||||
|
||||
|
||||
4
setup.py
4
setup.py
@ -15,7 +15,7 @@ requirements = [
|
||||
|
||||
setup(
|
||||
name='labelImg',
|
||||
version='1.5.0',
|
||||
version='1.5.1',
|
||||
description="LabelImg is a graphical image annotation tool and label object bounding boxes in images",
|
||||
long_description=readme + '\n\n' + history,
|
||||
author="TzuTa Lin",
|
||||
@ -46,4 +46,4 @@ setup(
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user