Skip to content

Commit

Permalink
Add a directory wrap option for autosync pyramids
Browse files Browse the repository at this point in the history
Remove the "unpin previous content" option for now
  • Loading branch information
cipres authored and cipres committed Jun 29, 2020
1 parent c1ef5c9 commit 8bf0388
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion galacteek/ui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ def __init__(self, marks, pyramidType, parent=None):
self.checkBoxFileStore.setCheckState(Qt.Unchecked)
self.checkBoxUnpinPrev = QCheckBox('Unpin old content')
self.checkBoxUnpinPrev.setCheckState(Qt.Unchecked)
self.checkBoxDirWrap = QCheckBox('Wrap with directory')
self.checkBoxDirWrap.setCheckState(Qt.Unchecked)
self.checkBoxStartupSync = QCheckBox('Sync on startup')
self.checkBoxStartupSync.setCheckState(Qt.Unchecked)

Expand Down Expand Up @@ -511,8 +513,8 @@ def __init__(self, marks, pyramidType, parent=None):
extraLayout.addWidget(labelOr)
extraLayout.addWidget(self.syncFileButton)
extraLayout.addWidget(self.checkBoxHiddenFiles)
extraLayout.addWidget(self.checkBoxDirWrap)
extraLayout.addWidget(self.checkBoxFileStore)
extraLayout.addWidget(self.checkBoxUnpinPrev)
extraLayout.addWidget(self.checkBoxStartupSync)
extraLayout.addLayout(layout1)
extraLayout.addLayout(layout2)
Expand Down Expand Up @@ -601,6 +603,7 @@ def accept(self):
extra['importhidden'] = self.checkBoxHiddenFiles.isChecked()
extra['ignorerulespath'] = self.ignRulesPath.text().strip()
extra['usefilestore'] = self.checkBoxFileStore.isChecked()
extra['dirwrapper'] = self.checkBoxDirWrap.isChecked()
extra['unpinprevious'] = self.checkBoxUnpinPrev.isChecked()
extra['startupsync'] = self.checkBoxStartupSync.isChecked()

Expand Down
7 changes: 6 additions & 1 deletion galacteek/ui/pyramids.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,8 @@ async def reinject(self, ipfsop, path):
recursive=True,
useFileStore=self.useFileStore,
hidden=self.importHiddenFiles,
ignRulesPath=self.ignoreRulesPath
ignRulesPath=self.ignoreRulesPath,
wrap=self.useDirWrapper
)

self.resetStyleSheet()
Expand All @@ -1169,6 +1170,10 @@ async def reinject(self, ipfsop, path):
def delay(self):
return int(self.pyramid.extra.get('syncdelay', 5000))

@property
def useDirWrapper(self):
return self.pyramid.extra.get('dirwrapper', False)

@property
def importHiddenFiles(self):
return self.pyramid.extra.get('importhidden')
Expand Down

0 comments on commit 8bf0388

Please sign in to comment.