OpenToonz - An open-source full-featured 2D animation creation software
C
make filesystemwatcher optional (#1060)
shun-iwasawa57bc09cd02ba
diff --git "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm" "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm"index 62cf13f9a..5088eec2a 100644Binary files "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm" and "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm" differdiff --git a/toonz/sources/include/toonz/preferences.h b/toonz/sources/include/toonz/preferences.hindex d3917fffd..e5d0d9f8b 100644--- a/toonz/sources/include/toonz/preferences.h+++ b/toonz/sources/include/toonz/preferences.h@@ -127,6 +127,9 @@ public:void setCustomProjectRoot(std::wstring path);QString getCustomProjectRoot() { return m_customProjectRoot; }+ void enableWatchFileSystem(bool on);+ bool isWatchFileSystemEnabled() { return m_watchFileSystem; }+// Interface tabvoid setCurrentLanguage(int currentLanguage);@@ -543,6 +546,9 @@ private:// enable to input drawing numbers into cells without double-clickingbool m_inputCellsWithoutDoubleClickingEnabled;+ // enable to watch file system in order to update file browser automatically+ bool m_watchFileSystem;+private:Preferences();~Preferences();diff --git a/toonz/sources/toonz/Resources/refresh.png b/toonz/sources/toonz/Resources/refresh.pngnew file mode 100644index 000000000..b3f5463ccBinary files /dev/null and b/toonz/sources/toonz/Resources/refresh.png differdiff --git a/toonz/sources/toonz/Resources/refresh_over.png b/toonz/sources/toonz/Resources/refresh_over.pngnew file mode 100644index 000000000..58a93976dBinary files /dev/null and b/toonz/sources/toonz/Resources/refresh_over.png differdiff --git a/toonz/sources/toonz/dvdirtreeview.cpp b/toonz/sources/toonz/dvdirtreeview.cppindex 05cf21276..b76b75270 100644--- a/toonz/sources/toonz/dvdirtreeview.cpp+++ b/toonz/sources/toonz/dvdirtreeview.cpp@@ -17,6 +17,8 @@#include "toonzqt/icongenerator.h"#include "toonzqt/dvdialog.h"#include "toonzqt/gutil.h"+#include "tapp.h"+#include "toonz/tscenehandle.h"#include <QPainter>#include <QPixmap>@@ -47,6 +49,50 @@ QStringList getLevelFileNames(TFilePath path) {}} // namespace+//=============================================================================+// MyFileSystemWatcher+//-----------------------------------------------------------------------------++MyFileSystemWatcher::MyFileSystemWatcher() {+ m_watcher = new QFileSystemWatcher(this);++ bool ret = connect(m_watcher, SIGNAL(directoryChanged(const QString &)), this,+ SIGNAL(directoryChanged(const QString &)));+ assert(ret);+}++void MyFileSystemWatcher::addPaths(const QStringList &paths, bool onlyNewPath) {+ if (paths.isEmpty()) return;+ if (onlyNewPath) {+ for (int p = 0; p < paths.size(); p++) {+ QString path = paths.at(p);+ if (!m_watchedPath.contains(path)) {+ m_watchedPath.append(path);+ m_watcher->addPath(path);+ }+ }+ } else {+ m_watchedPath.append(paths);+ m_watcher->addPaths(paths);+ }+}++void MyFileSystemWatcher::removePaths(const QStringList &paths) {+ if (m_watchedPath.isEmpty() || paths.isEmpty()) return;+ for (int p = 0; p < paths.size(); p++) {+ QString path = paths.at(p);+ bool ret = m_watchedPath.removeOne(path);+ assert(ret);+ if (!m_watchedPath.contains(path)) m_watcher->removePath(path);+ }+}++void MyFileSystemWatcher::removeAllPaths() {+ if (m_watchedPath.isEmpty()) return;+ m_watcher->removePaths(m_watcher->directories());+ m_watchedPath.clear();+}+//=============================================================================// DvDirTreeViewDelegate//-----------------------------------------------------------------------------@@ -289,30 +335,37 @@ DvDirTreeView::DvDirTreeView(QWidget *parent)setIndentation(14);setAlternatingRowColors(true);- m_dirFileSystemWatcher = new QFileSystemWatcher(this);-// Connect all possible changes that can alter the// bottom horizontal scrollbar to resize contents...- connect(this, SIGNAL(expanded(const QModelIndex &)), this,- SLOT(resizeToConts()));+ bool ret = true;+ ret = ret && connect(this, SIGNAL(expanded(const QModelIndex &)), this,+ SLOT(resizeToConts()));++ ret = ret && connect(this, SIGNAL(collapsed(const QModelIndex &)), this,+ SLOT(resizeToConts()));- connect(this, SIGNAL(collapsed(const QModelIndex &)), this,- SLOT(resizeToConts()));+ ret = ret && connect(this->model(), SIGNAL(layoutChanged()), this,+ SLOT(resizeToConts()));- connect(this->model(), SIGNAL(layoutChanged()), this, SLOT(resizeToConts()));+ if (Preferences::instance()->isWatchFileSystemEnabled()) {+ ret = ret && connect(this, SIGNAL(expanded(const QModelIndex &)), this,+ SLOT(onExpanded(const QModelIndex &)));- connect(this, SIGNAL(expanded(const QModelIndex &)), this,- SLOT(onExpanded(const QModelIndex &)));+ ret = ret && connect(this, SIGNAL(collapsed(const QModelIndex &)), this,+ SLOT(onCollapsed(const QModelIndex &)));+ addPathsToWatcher();+ }+ ret = ret && connect(MyFileSystemWatcher::instance(),+ SIGNAL(directoryChanged(const QString &)), this,+ SLOT(onMonitoredDirectoryChanged(const QString &)));- connect(this, SIGNAL(collapsed(const QModelIndex &)), this,- SLOT(onCollapsed(const QModelIndex &)));+ ret = ret && connect(TApp::instance()->getCurrentScene(),+ SIGNAL(preferenceChanged(const QString &)), this,+ SLOT(onPreferenceChanged(const QString &)));- connect(m_dirFileSystemWatcher, SIGNAL(directoryChanged(const QString &)),- this, SLOT(onMonitoredDirectoryChanged(const QString &)));+ assert(ret);setAcceptDrops(true);-- updateWatcher();}//-----------------------------------------------------------------------------@@ -404,6 +457,13 @@ void DvDirTreeView::contextMenuEvent(QContextMenuEvent *e) {DvDirModelNode *node = DvDirModel::instance()->getNode(index);if (!node) return;+ QMenu menu(this);++ if (!Preferences::instance()->isWatchFileSystemEnabled()) {+ QAction *refresh = CommandManager::instance()->getAction("MI_RefreshTree");+ menu.addAction(refresh);+ }+DvDirVersionControlNode *vcNode =dynamic_cast<DvDirVersionControlNode *>(node);if (vcNode) {@@ -412,7 +472,6 @@ void DvDirTreeView::contextMenuEvent(QContextMenuEvent *e) {std::string pathType = path.getType();DvDirVersionControlProjectNode *vcProjectNode =dynamic_cast<DvDirVersionControlProjectNode *>(node);- QMenu menu(this);QAction *action;if (vcNode->isUnderVersionControl()) {if (vcProjectNode || (fileExists && pathType == "tnz")) {@@ -480,9 +539,9 @@ void DvDirTreeView::contextMenuEvent(QContextMenuEvent *e) {SLOT(purgeCurrentVersionControlNode()));}}-- menu.exec(e->globalPos());}++ if (!menu.isEmpty()) menu.exec(e->globalPos());}//-----------------------------------------------------------------------------@@ -1542,14 +1601,10 @@ DvItemListModel::Status DvDirTreeView::getItemVersionControlStatus(/*- Refresh monitoring paths according to expand/shrink state of the folder tree* -*/-void DvDirTreeView::updateWatcher() {- if (!m_dirFileSystemWatcher->directories().isEmpty())- m_dirFileSystemWatcher->removePaths(m_dirFileSystemWatcher->directories());-+void DvDirTreeView::addPathsToWatcher() {QStringList paths;getExpandedPathsRecursive(rootIndex(), paths);-- m_dirFileSystemWatcher->addPaths(paths);+ if (!paths.isEmpty()) MyFileSystemWatcher::instance()->addPaths(paths);}void DvDirTreeView::getExpandedPathsRecursive(const QModelIndex &index,@@ -1576,7 +1631,8 @@ void DvDirTreeView::getExpandedPathsRecursive(const QModelIndex &index,void DvDirTreeView::onExpanded(const QModelIndex &index) {QStringList paths;getExpandedPathsRecursive(index, paths);- m_dirFileSystemWatcher->addPaths(paths);+ paths.removeFirst();+ MyFileSystemWatcher::instance()->addPaths(paths);}void DvDirTreeView::onCollapsed(const QModelIndex &index) {@@ -1586,7 +1642,7 @@ void DvDirTreeView::onCollapsed(const QModelIndex &index) {QModelIndex child = DvDirModel::instance()->index(r, 0, index);getExpandedPathsRecursive(child, paths);}- m_dirFileSystemWatcher->removePaths(paths);+ MyFileSystemWatcher::instance()->removePaths(paths);}void DvDirTreeView::onMonitoredDirectoryChanged(const QString &dirPath) {@@ -1604,9 +1660,30 @@ void DvDirTreeView::onMonitoredDirectoryChanged(const QString &dirPath) {dynamic_cast<DvDirModelFileFolderNode *>(node->getChild(c));if (childNode) paths.append(toQString(childNode->getPath()));}- /*- if there are paths which are already being monitored, they will be- * ignored. -*/- m_dirFileSystemWatcher->addPaths(paths);+ MyFileSystemWatcher::instance()->addPaths(paths, true);+}++// on preference changed, update file browser's behavior+void DvDirTreeView::onPreferenceChanged(const QString &prefName) {+ // react only when the related preference is changed+ if (prefName != "WatchFileSystem") return;+ bool ret = true;+ if (Preferences::instance()->isWatchFileSystemEnabled()) {+ ret = ret && connect(this, SIGNAL(expanded(const QModelIndex &)), this,+ SLOT(onExpanded(const QModelIndex &)));++ ret = ret && connect(this, SIGNAL(collapsed(const QModelIndex &)), this,+ SLOT(onCollapsed(const QModelIndex &)));+ addPathsToWatcher();+ } else {+ ret = ret && disconnect(this, SIGNAL(expanded(const QModelIndex &)), this,+ SLOT(onExpanded(const QModelIndex &)));+ ret = ret && disconnect(this, SIGNAL(collapsed(const QModelIndex &)), this,+ SLOT(onCollapsed(const QModelIndex &)));++ MyFileSystemWatcher::instance()->removeAllPaths();+ }+ assert(ret);}//=============================================================================diff --git a/toonz/sources/toonz/dvdirtreeview.h b/toonz/sources/toonz/dvdirtreeview.hindex 966176e05..9cff87641 100644--- a/toonz/sources/toonz/dvdirtreeview.h+++ b/toonz/sources/toonz/dvdirtreeview.h@@ -32,6 +32,27 @@ class QFileSystemWatcher;//==============================================================+class MyFileSystemWatcher : public QObject { // singleton+ Q_OBJECT++ QStringList m_watchedPath;+ QFileSystemWatcher *m_watcher;+ MyFileSystemWatcher();++public:+ static MyFileSystemWatcher *instance() {+ static MyFileSystemWatcher _instance;+ return &_instance;+ }++ void addPaths(const QStringList &paths, bool onlyNewPath = false);+ void removePaths(const QStringList &paths);+ void removeAllPaths();++signals:+ void directoryChanged(const QString &path);+};+//**********************************************************************************// DvDirTreeView declaration//**********************************************************************************@@ -155,6 +176,7 @@ public slots:void onExpanded(const QModelIndex &);void onCollapsed(const QModelIndex &);void onMonitoredDirectoryChanged(const QString &);+ void onPreferenceChanged(const QString &);protected:QSize sizeHint() const override;@@ -189,10 +211,9 @@ private:// Using for version control node refreshingDvDirVersionControlNode *m_currentRefreshedNode;- QFileSystemWatcher *m_dirFileSystemWatcher;/*- Refresh monitoring paths according to expand/shrink state of the folder* tree -*/- void updateWatcher();+ void addPathsToWatcher();void getExpandedPathsRecursive(const QModelIndex &, QStringList &);};diff --git a/toonz/sources/toonz/dvitemview.cpp b/toonz/sources/toonz/dvitemview.cppindex ad6d9556f..a4d55a2c8 100644--- a/toonz/sources/toonz/dvitemview.cpp+++ b/toonz/sources/toonz/dvitemview.cpp@@ -17,6 +17,7 @@#include "toonz/toonzscene.h"#include "toonz/tproject.h"#include "toonz/tscenehandle.h"+#include "toonz/preferences.h"// TnzBase includes#include "tenv.h"@@ -1868,6 +1869,12 @@ DvItemViewerButtonBar::DvItemViewerButtonBar(DvItemViewer *itemViewer,addAction(exportFileListAction);addSeparator();+ if (itemViewer->m_windowType == DvItemViewer::Browser &&+ !Preferences::instance()->isWatchFileSystemEnabled()) {+ addAction(CommandManager::instance()->getAction("MI_RefreshTree"));+ addSeparator();+ }+connect(exportFileListAction, SIGNAL(triggered()), itemViewer->getPanel(),SLOT(exportFileList()));@@ -1884,6 +1891,12 @@ DvItemViewerButtonBar::DvItemViewerButtonBar(DvItemViewer *itemViewer,connect(m_folderBack, SIGNAL(triggered()), SIGNAL(folderBack()));connect(m_folderFwd, SIGNAL(triggered()), SIGNAL(folderFwd()));++ if (itemViewer->m_windowType == DvItemViewer::Browser) {+ connect(TApp::instance()->getCurrentScene(),+ SIGNAL(preferenceChanged(const QString &)), this,+ SLOT(onPreferenceChanged(const QString &)));+ }}//-----------------------------------------------------------------------------@@ -1899,3 +1912,19 @@ void DvItemViewerButtonBar::onHistoryChanged(bool backEnable, bool fwdEnable) {elsem_folderFwd->setEnabled(false);}++//-----------------------------------------------------------------------------++void DvItemViewerButtonBar::onPreferenceChanged(const QString &prefName) {+ // react only when the related preference is changed+ if (prefName != "WatchFileSystem") return;++ QAction *refreshAct = CommandManager::instance()->getAction("MI_RefreshTree");+ if (Preferences::instance()->isWatchFileSystemEnabled()) {+ removeAction(refreshAct);+ removeAction(actions().last()); // remove separator+ } else {+ addAction(refreshAct);+ addSeparator();+ }+}\ No newline at end of filediff --git a/toonz/sources/toonz/dvitemview.h b/toonz/sources/toonz/dvitemview.hindex 5f57f6345..0f192d93a 100644--- a/toonz/sources/toonz/dvitemview.h+++ b/toonz/sources/toonz/dvitemview.h@@ -463,6 +463,7 @@ public:public slots:void onHistoryChanged(bool, bool);+ void onPreferenceChanged(const QString &);signals:void folderUp();diff --git a/toonz/sources/toonz/filebrowser.cpp b/toonz/sources/toonz/filebrowser.cppindex 86ddcd7be..8e100ef2d 100644--- a/toonz/sources/toonz/filebrowser.cpp+++ b/toonz/sources/toonz/filebrowser.cpp@@ -180,8 +180,6 @@ FileBrowser::FileBrowser(QWidget *parent, Qt::WFlags flags, bool noContextMenu,new DvItemViewerButtonBar(m_itemViewer, box);DvItemViewerPanel *viewerPanel = m_itemViewer->getPanel();- m_fileSystemWatcher = new QFileSystemWatcher(this);-viewerPanel->addColumn(DvItemListModel::FileType, 50);viewerPanel->addColumn(DvItemListModel::FrameCount, 50);viewerPanel->addColumn(DvItemListModel::FileSize, 50);@@ -252,7 +250,7 @@ FileBrowser::FileBrowser(QWidget *parent, Qt::WFlags flags, bool noContextMenu,ret = ret && connect(&m_frameCountReader, SIGNAL(calculatedFrameCount()),m_itemViewer->getPanel(), SLOT(update()));- QAction *refresh = CommandManager::instance()->getAction("MI_RefreshTree");+ QAction *refresh = CommandManager::instance()->getAction(MI_RefreshTree);ret = ret && connect(refresh, SIGNAL(triggered()), this, SLOT(refresh()));addAction(refresh);@@ -278,10 +276,12 @@ FileBrowser::FileBrowser(QWidget *parent, Qt::WFlags flags, bool noContextMenu,ret = ret && connect(this, SIGNAL(historyChanged(bool, bool)), buttonBar,SLOT(onHistoryChanged(bool, bool)));- // check out the update of the current folder- ret = ret &&- connect(m_fileSystemWatcher, SIGNAL(directoryChanged(const QString &)),- this, SLOT(onFileSystemChanged(const QString &)));+ // check out the update of the current folder.+ // Use MyFileSystemWatcher which is shared by all browsers.+ // Adding and removing paths to the watcher is done in DvDirTreeView.+ ret = ret && connect(MyFileSystemWatcher::instance(),+ SIGNAL(directoryChanged(const QString &)), this,+ SLOT(onFileSystemChanged(const QString &)));// store the first item("Root") in the historym_indexHistoryList.append(m_folderTreeView->currentIndex());@@ -411,6 +411,7 @@ void FileBrowser::clearHistory() {/*! update the current folder when changes detected from QFileSystemWatcher*/void FileBrowser::onFileSystemChanged(const QString &folderPath) {+ if (folderPath != m_folder.getQString()) return;// changes may create/delete of folder, so update the DvDirModelQModelIndex parentFolderIndex = m_folderTreeView->currentIndex();DvDirModel::instance()->refresh(parentFolderIndex);@@ -686,10 +687,6 @@ void FileBrowser::setFolder(const TFilePath &fp, bool expandNode,elsem_folderName->setText(toQString(fp));- /*- reset the watching path -*/- m_fileSystemWatcher->removePaths(m_fileSystemWatcher->directories());- if (fp != TFilePath()) m_fileSystemWatcher->addPath(toQString(fp));-refreshCurrentFolderItems();m_folderTreeView->setCurrentNode(fp, expandNode);@@ -1103,6 +1100,9 @@ QMenu *FileBrowser::getContextMenu(QWidget *parent, int index) {if (files.empty()) {menu->addAction(cm->getAction(MI_ShowFolderContents));menu->addAction(cm->getAction(MI_SelectAll));+ if (!Preferences::instance()->isWatchFileSystemEnabled()) {+ menu->addAction(cm->getAction(MI_RefreshTree));+ }return menu;}@@ -1390,6 +1390,11 @@ QMenu *FileBrowser::getContextMenu(QWidget *parent, int index) {}}+ if (!Preferences::instance()->isWatchFileSystemEnabled()) {+ menu->addSeparator();+ menu->addAction(cm->getAction(MI_RefreshTree));+ }+assert(ret);return menu;diff --git a/toonz/sources/toonz/filebrowser.h b/toonz/sources/toonz/filebrowser.hindex cb506016a..82ab3bd9e 100644--- a/toonz/sources/toonz/filebrowser.h+++ b/toonz/sources/toonz/filebrowser.h@@ -254,8 +254,6 @@ private:QStringList m_filter;std::map<TFilePath, Item> m_multiFileItemMap;- QFileSystemWatcher *m_fileSystemWatcher;-private:void readFrameCount(Item &item);void readInfo(Item &item);diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cppindex a3415904f..bec5cca61 100644--- a/toonz/sources/toonz/mainwindow.cpp+++ b/toonz/sources/toonz/mainwindow.cpp@@ -2057,7 +2057,10 @@ void MainWindow::defineActions() {tr("Full Screen Mode"),tr("Exit Full Screen Mode"));- createMiscAction(MI_RefreshTree, tr("Refresh Folder Tree"), "");+ QAction *refreshAct =+ createMiscAction(MI_RefreshTree, tr("Refresh Folder Tree"), "");+ refreshAct->setIconText(tr("Refresh"));+ refreshAct->setIcon(createQIconOnOffPNG("refresh"));createToolOptionsAction("A_ToolOption_GlobalKey", tr("Global Key"), "");diff --git a/toonz/sources/toonz/preferencespopup.cpp b/toonz/sources/toonz/preferencespopup.cppindex ff4d42914..a86cb7a15 100644--- a/toonz/sources/toonz/preferencespopup.cpp+++ b/toonz/sources/toonz/preferencespopup.cpp@@ -987,6 +987,15 @@ void PreferencesPopup::onInputCellsWithoutDoubleClickingClicked(int on) {m_pref->enableInputCellsWithoutDoubleClicking(on);}+//-----------------------------------------------------------------------------++void PreferencesPopup::onWatchFileSystemClicked(int on) {+ m_pref->enableWatchFileSystem(on);+ // emit signal to update behavior of the File browser+ TApp::instance()->getCurrentScene()->notifyPreferenceChanged(+ "WatchFileSystem");+}+//**********************************************************************************// PrefencesPopup's constructor//**********************************************************************************@@ -1032,6 +1041,8 @@ PreferencesPopup::PreferencesPopup()m_chunkSizeFld =new DVGui::IntLineEdit(this, m_pref->getDefaultTaskChunkSize(), 1, 2000);CheckBox *sceneNumberingCB = new CheckBox(tr("Show Info in Rendered Frames"));+ CheckBox *watchFileSystemCB = new CheckBox(+ tr("Watch File System and Update File Browser Automatically"), this);m_projectRootDocuments = new CheckBox(tr("My Documents/OpenToonz*"), this);m_projectRootDesktop = new CheckBox(tr("Desktop/OpenToonz*"), this);@@ -1253,6 +1264,7 @@ PreferencesPopup::PreferencesPopup()m_cellsDragBehaviour->setCurrentIndex(m_pref->getDragCellsBehaviour());m_levelsBackup->setChecked(m_pref->isLevelsBackupEnabled());sceneNumberingCB->setChecked(m_pref->isSceneNumberingEnabled());+ watchFileSystemCB->setChecked(m_pref->isWatchFileSystemEnabled());m_customProjectRootFileField->setPath(m_pref->getCustomProjectRoot());@@ -1545,6 +1557,9 @@ PreferencesPopup::PreferencesPopup()Qt::AlignLeft | Qt::AlignVCenter);generalFrameLay->addWidget(sceneNumberingCB, 0,Qt::AlignLeft | Qt::AlignVCenter);+ generalFrameLay->addWidget(watchFileSystemCB, 0,+ Qt::AlignLeft | Qt::AlignVCenter);+QGroupBox *projectGroupBox =new QGroupBox(tr("Additional Project Locations"), this);QGridLayout *projectRootLay = new QGridLayout();@@ -2059,6 +2074,8 @@ PreferencesPopup::PreferencesPopup()SLOT(onLevelsBackupChanged(int)));ret = ret && connect(sceneNumberingCB, SIGNAL(stateChanged(int)),SLOT(onSceneNumberingChanged(int)));+ ret = ret && connect(watchFileSystemCB, SIGNAL(stateChanged(int)),+ SLOT(onWatchFileSystemClicked(int)));ret = ret && connect(m_chunkSizeFld, SIGNAL(editingFinished()), this,SLOT(onChunkSizeChanged()));ret = ret && connect(m_customProjectRootFileField, SIGNAL(pathChanged()),diff --git a/toonz/sources/toonz/preferencespopup.h b/toonz/sources/toonz/preferencespopup.hindex 0f11f337f..0f5c30751 100644--- a/toonz/sources/toonz/preferencespopup.h+++ b/toonz/sources/toonz/preferencespopup.h@@ -172,6 +172,7 @@ private slots:void onUseNumpadForSwitchingStylesClicked(bool);void onUseArrowKeyToShiftCellSelectionClicked(int);void onInputCellsWithoutDoubleClickingClicked(int);+ void onWatchFileSystemClicked(int);};//**********************************************************************************diff --git a/toonz/sources/toonz/toonz.qrc b/toonz/sources/toonz/toonz.qrcindex c74652c95..dcaa2beb1 100644--- a/toonz/sources/toonz/toonz.qrc+++ b/toonz/sources/toonz/toonz.qrc@@ -456,5 +456,7 @@<file>Resources/locator.png</file><file>Resources/locator_click.png</file><file>Resources/locator_over.png</file>+ <file>Resources/refresh.png</file>+ <file>Resources/refresh_over.png</file></qresource></RCC>diff --git a/toonz/sources/toonzlib/preferences.cpp b/toonz/sources/toonzlib/preferences.cppindex 1abc82de1..20184181b 100644--- a/toonz/sources/toonzlib/preferences.cpp+++ b/toonz/sources/toonzlib/preferences.cpp@@ -299,7 +299,8 @@ Preferences::Preferences(), m_shortcutPreset("defopentoonz"), m_useNumpadForSwitchingStyles(true), m_useArrowKeyToShiftCellSelection(false)- , m_inputCellsWithoutDoubleClickingEnabled(false) {+ , m_inputCellsWithoutDoubleClickingEnabled(false)+ , m_watchFileSystem(true) {TCamera camera;m_defLevelType = PLI_XSHLEVEL;m_defLevelWidth = camera.getSize().lx;@@ -577,6 +578,7 @@ Preferences::Preferences()m_useArrowKeyToShiftCellSelection);getValue(*m_settings, "inputCellsWithoutDoubleClickingEnabled",m_inputCellsWithoutDoubleClickingEnabled);+ getValue(*m_settings, "watchFileSystemEnabled", m_watchFileSystem);}//-----------------------------------------------------------------@@ -1363,4 +1365,11 @@ void Preferences::enableInputCellsWithoutDoubleClicking(bool on) {m_inputCellsWithoutDoubleClickingEnabled = on;m_settings->setValue("inputCellsWithoutDoubleClickingEnabled",on ? "1" : "0");+}++//-----------------------------------------------------------------++void Preferences::enableWatchFileSystem(bool on) {+ m_watchFileSystem = on;+ m_settings->setValue("watchFileSystemEnabled", on ? "1" : "0");}\ No newline at end of filediff --git a/toonz/sources/translations/japanese/toonz.ts b/toonz/sources/translations/japanese/toonz.tsindex f3cb3c81e..56b9f2731 100644--- a/toonz/sources/translations/japanese/toonz.ts+++ b/toonz/sources/translations/japanese/toonz.ts@@ -4513,6 +4513,10 @@ Do you want to create it?</source><source>Record Audio</source><translation>録音する</translation></message>+ <message>+ <source>Refresh</source>+ <translation>更新</translation>+ </message></context><context><name>MatchlinesDialog</name>@@ -6187,6 +6191,10 @@ Is it OK to release these shortcuts?</source><source>Fast Render Path: </source><translation>保存先のパス:</translation></message>+ <message>+ <source>Watch File System and Update File Browser Automatically</source>+ <translation>ファイルブラウザの内容を自動的に更新する</translation>+ </message></context><context><name>PreferencesPopup::FormatProperties</name>@@ -9222,7 +9230,7 @@ Please commit or revert changes first.</source></message><message><source>Apply</source>- <translation>適用</translation>+ <translation type="vanished">適用</translation></message><message><source>Use selected preset as shortcuts</source>@@ -9268,6 +9276,14 @@ Please commit or revert changes first.</source><source>Load from file...</source><translation>ファイルから読み込む...</translation></message>+ <message>+ <source>Load</source>+ <translation>読み込み</translation>+ </message>+ <message>+ <source>Shortcut Presets</source>+ <translation>ショートカットプリセット</translation>+ </message></context><context><name>ShortcutTree</name>@@ -10509,6 +10525,10 @@ Please refer to the user guide for details.</source><source>Pinned Center : Col%1%2</source><translation>固定ピン : Col%1%2</translation></message>+ <message>+ <source>Set Auto Markers</source>+ <translation>素材の範囲にマーカーを自動設定</translation>+ </message></context><context><name>XsheetViewer</name>