Add --autoimport command argument
This commit is contained in:
parent
f94ad0126a
commit
e2b86eb239
|
@ -204,7 +204,7 @@ class GuiAutoImport (threading.Thread):
|
||||||
# That is not correct. It should open another dir for importing while piping the
|
# That is not correct. It should open another dir for importing while piping the
|
||||||
# results to the same pipe. This means that self.path should be a a list of dirs
|
# results to the same pipe. This means that self.path should be a a list of dirs
|
||||||
# to watch.
|
# to watch.
|
||||||
if widget.get_active(): # toggled on
|
if widget.get_active() or data == "autostart": # toggled on
|
||||||
# - Does the lock acquisition need to be more sophisticated for multiple dirs?
|
# - Does the lock acquisition need to be more sophisticated for multiple dirs?
|
||||||
# (see comment above about what to do if pipe already open)
|
# (see comment above about what to do if pipe already open)
|
||||||
# - Ideally we want to release the lock if the auto-import is killed by some
|
# - Ideally we want to release the lock if the auto-import is killed by some
|
||||||
|
|
|
@ -63,6 +63,8 @@ def fpdb_options():
|
||||||
help=_("X location to open window"))
|
help=_("X location to open window"))
|
||||||
parser.add_option("--yloc", dest="yloc", default=None, type="int",
|
parser.add_option("--yloc", dest="yloc", default=None, type="int",
|
||||||
help=_("Y location to open Window"))
|
help=_("Y location to open Window"))
|
||||||
|
parser.add_option("--autoimport", action="store_true", dest="autoimport",
|
||||||
|
help=_("Auto-start Auto-import"))
|
||||||
|
|
||||||
|
|
||||||
(options, argv) = parser.parse_args()
|
(options, argv) = parser.parse_args()
|
||||||
|
|
|
@ -993,6 +993,9 @@ class fpdb:
|
||||||
self.threads.append(new_aimp_thread)
|
self.threads.append(new_aimp_thread)
|
||||||
aimp_tab=new_aimp_thread.get_vbox()
|
aimp_tab=new_aimp_thread.get_vbox()
|
||||||
self.add_and_display_tab(aimp_tab, _("Auto Import"))
|
self.add_and_display_tab(aimp_tab, _("Auto Import"))
|
||||||
|
if options.autoimport:
|
||||||
|
new_aimp_thread.startClicked(new_aimp_thread.startButton, "autostart")
|
||||||
|
options.autoimport = False
|
||||||
|
|
||||||
def tab_bulk_import(self, widget, data=None):
|
def tab_bulk_import(self, widget, data=None):
|
||||||
"""opens a tab for bulk importing"""
|
"""opens a tab for bulk importing"""
|
||||||
|
@ -1177,6 +1180,9 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt an
|
||||||
|
|
||||||
self.window.connect('window-state-event', self.window_state_event_cb)
|
self.window.connect('window-state-event', self.window_state_event_cb)
|
||||||
sys.stderr.write(_("fpdb starting ..."))
|
sys.stderr.write(_("fpdb starting ..."))
|
||||||
|
|
||||||
|
if options.autoimport:
|
||||||
|
self.tab_auto_import(None)
|
||||||
|
|
||||||
|
|
||||||
def __iconify(self):
|
def __iconify(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user