mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 09:30:48 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
981b276cef
@ -55,7 +55,7 @@ const showErrorWindow = (title, content) => {
|
|||||||
width: screen.getPrimaryDisplay().size.width / 2,
|
width: screen.getPrimaryDisplay().size.width / 2,
|
||||||
height: screen.getPrimaryDisplay().workAreaSize.height / 2,
|
height: screen.getPrimaryDisplay().workAreaSize.height / 2,
|
||||||
frame: false,
|
frame: false,
|
||||||
icon: path.join(appDir, 'stage', 'icon.png'),
|
icon: path.join(appDir, 'stage', 'icon-large.png'),
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nativeWindowOpen: true,
|
nativeWindowOpen: true,
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
@ -71,7 +71,7 @@ const showErrorWindow = (title, content) => {
|
|||||||
v: appVer,
|
v: appVer,
|
||||||
title: title,
|
title: title,
|
||||||
content: content,
|
content: content,
|
||||||
icon: path.join(appDir, 'stage', 'icon.png'),
|
icon: path.join(appDir, 'stage', 'icon-large.png'),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
errWindow.show()
|
errWindow.show()
|
||||||
@ -176,7 +176,7 @@ const boot = () => {
|
|||||||
},
|
},
|
||||||
frame: 'darwin' === process.platform,
|
frame: 'darwin' === process.platform,
|
||||||
titleBarStyle: 'hidden',
|
titleBarStyle: 'hidden',
|
||||||
icon: path.join(appDir, 'stage', 'icon.png'),
|
icon: path.join(appDir, 'stage', 'icon-large.png'),
|
||||||
})
|
})
|
||||||
|
|
||||||
require('@electron/remote/main').enable(mainWindow.webContents)
|
require('@electron/remote/main').enable(mainWindow.webContents)
|
||||||
@ -361,7 +361,7 @@ const boot = () => {
|
|||||||
|
|
||||||
if ('win32' === process.platform || 'linux' === process.platform) {
|
if ('win32' === process.platform || 'linux' === process.platform) {
|
||||||
// 系统托盘
|
// 系统托盘
|
||||||
tray = new Tray(path.join(appDir, 'stage', 'icon.png'))
|
tray = new Tray(path.join(appDir, 'stage', 'icon-large.png'))
|
||||||
tray.setToolTip('SiYuan')
|
tray.setToolTip('SiYuan')
|
||||||
const trayMenuTemplate = [
|
const trayMenuTemplate = [
|
||||||
{
|
{
|
||||||
@ -432,7 +432,7 @@ const initKernel = (initData) => {
|
|||||||
width: screen.getPrimaryDisplay().size.width / 2,
|
width: screen.getPrimaryDisplay().size.width / 2,
|
||||||
height: screen.getPrimaryDisplay().workAreaSize.height / 2,
|
height: screen.getPrimaryDisplay().workAreaSize.height / 2,
|
||||||
frame: false,
|
frame: false,
|
||||||
icon: path.join(appDir, 'stage', 'icon.png'),
|
icon: path.join(appDir, 'stage', 'icon-large.png'),
|
||||||
transparent: 'linux' !== process.platform,
|
transparent: 'linux' !== process.platform,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nativeWindowOpen: true,
|
nativeWindowOpen: true,
|
||||||
@ -586,7 +586,7 @@ app.whenReady().then(() => {
|
|||||||
width: screen.getPrimaryDisplay().size.width / 2,
|
width: screen.getPrimaryDisplay().size.width / 2,
|
||||||
height: screen.getPrimaryDisplay().workAreaSize.height / 2,
|
height: screen.getPrimaryDisplay().workAreaSize.height / 2,
|
||||||
frame: false,
|
frame: false,
|
||||||
icon: path.join(appDir, 'stage', 'icon.png'),
|
icon: path.join(appDir, 'stage', 'icon-large.png'),
|
||||||
transparent: 'linux' !== process.platform,
|
transparent: 'linux' !== process.platform,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nativeWindowOpen: true,
|
nativeWindowOpen: true,
|
||||||
@ -606,7 +606,7 @@ app.whenReady().then(() => {
|
|||||||
query: {
|
query: {
|
||||||
home: app.getPath('home'),
|
home: app.getPath('home'),
|
||||||
v: appVer,
|
v: appVer,
|
||||||
icon: path.join(appDir, 'stage', 'icon.png'),
|
icon: path.join(appDir, 'stage', 'icon-large.png'),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
firstOpenWindow.show()
|
firstOpenWindow.show()
|
||||||
|
BIN
app/stage/icon-large.png
Normal file
BIN
app/stage/icon-large.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
@ -183,7 +183,7 @@ func (box *Box) Index(fullRebuildIndex bool) (treeCount int, treeSize int64) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bootProgressPart = 40.0 / float64(boxLen) / float64(treeCount)
|
bootProgressPart = 20.0 / float64(boxLen) / float64(treeCount)
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
// 块级行级入库,缓存块
|
// 块级行级入库,缓存块
|
||||||
|
@ -455,7 +455,7 @@ func syncRepo(boot, exit, byHand bool) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = indexRepoBeforeCloudSync(repo)
|
indexBeforeSync, err := indexRepoBeforeCloudSync(repo)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
syncDownloadErrCount++
|
syncDownloadErrCount++
|
||||||
planSyncAfter(fixSyncInterval)
|
planSyncAfter(fixSyncInterval)
|
||||||
@ -467,9 +467,9 @@ func syncRepo(boot, exit, byHand bool) {
|
|||||||
if nil != err {
|
if nil != err {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
syncContext := map[string]interface{}{dejavu.CtxPushMsg: dejavu.CtxPushMsgToStatusBar}
|
syncContext := map[string]interface{}{dejavu.CtxPushMsg: dejavu.CtxPushMsgToStatusBar}
|
||||||
_, mergeResult, trafficStat, err := repo.Sync(cloudInfo, syncContext)
|
_, mergeResult, trafficStat, err := repo.Sync(cloudInfo, syncContext)
|
||||||
|
|
||||||
elapsed := time.Since(start)
|
elapsed := time.Since(start)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
syncDownloadErrCount++
|
syncDownloadErrCount++
|
||||||
@ -526,9 +526,15 @@ func syncRepo(boot, exit, byHand bool) {
|
|||||||
treenode.InitBlockTree()
|
treenode.InitBlockTree()
|
||||||
}
|
}
|
||||||
|
|
||||||
incReindex(upserts, removes)
|
|
||||||
cache.ClearDocsIAL() // 同步后文档树文档图标没有更新 https://github.com/siyuan-note/siyuan/issues/4939
|
cache.ClearDocsIAL() // 同步后文档树文档图标没有更新 https://github.com/siyuan-note/siyuan/issues/4939
|
||||||
|
|
||||||
|
fullReindex := 0.2 < float64(len(upserts))/float64(len(indexBeforeSync.Files))
|
||||||
|
if fullReindex {
|
||||||
|
RefreshFileTree()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
incReindex(upserts, removes)
|
||||||
|
|
||||||
if !boot && !exit {
|
if !boot && !exit {
|
||||||
util.ReloadUI()
|
util.ReloadUI()
|
||||||
}
|
}
|
||||||
@ -543,10 +549,10 @@ func syncRepo(boot, exit, byHand bool) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func indexRepoBeforeCloudSync(repo *dejavu.Repo) (err error) {
|
func indexRepoBeforeCloudSync(repo *dejavu.Repo) (index *entity.Index, err error) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
latest, _ := repo.Latest()
|
latest, _ := repo.Latest()
|
||||||
index, err := repo.Index("[Sync] Cloud sync", map[string]interface{}{
|
index, err = repo.Index("[Sync] Cloud sync", map[string]interface{}{
|
||||||
dejavu.CtxPushMsg: dejavu.CtxPushMsgToStatusBar,
|
dejavu.CtxPushMsg: dejavu.CtxPushMsgToStatusBar,
|
||||||
})
|
})
|
||||||
if nil != err {
|
if nil != err {
|
||||||
@ -682,7 +688,7 @@ func subscribeEvents() {
|
|||||||
eventbus.Subscribe(dejavu.EvtCloudBeforeDownloadFiles, func(context map[string]interface{}, ids []string) {
|
eventbus.Subscribe(dejavu.EvtCloudBeforeDownloadFiles, func(context map[string]interface{}, ids []string) {
|
||||||
msg := fmt.Sprintf(Conf.Language(165), len(ids))
|
msg := fmt.Sprintf(Conf.Language(165), len(ids))
|
||||||
util.SetBootDetails(msg)
|
util.SetBootDetails(msg)
|
||||||
bootProgressPart = 20 / float64(len(ids))
|
bootProgressPart = 10 / float64(len(ids))
|
||||||
contextPushMsg(context, msg)
|
contextPushMsg(context, msg)
|
||||||
})
|
})
|
||||||
eventbus.Subscribe(dejavu.EvtCloudBeforeDownloadFile, func(context map[string]interface{}, id string) {
|
eventbus.Subscribe(dejavu.EvtCloudBeforeDownloadFile, func(context map[string]interface{}, id string) {
|
||||||
@ -696,7 +702,7 @@ func subscribeEvents() {
|
|||||||
eventbus.Subscribe(dejavu.EvtCloudBeforeDownloadChunks, func(context map[string]interface{}, ids []string) {
|
eventbus.Subscribe(dejavu.EvtCloudBeforeDownloadChunks, func(context map[string]interface{}, ids []string) {
|
||||||
msg := fmt.Sprintf(Conf.Language(166), len(ids))
|
msg := fmt.Sprintf(Conf.Language(166), len(ids))
|
||||||
util.SetBootDetails(msg)
|
util.SetBootDetails(msg)
|
||||||
bootProgressPart = 20 / float64(len(ids))
|
bootProgressPart = 10 / float64(len(ids))
|
||||||
contextPushMsg(context, msg)
|
contextPushMsg(context, msg)
|
||||||
})
|
})
|
||||||
eventbus.Subscribe(dejavu.EvtCloudBeforeDownloadChunk, func(context map[string]interface{}, id string) {
|
eventbus.Subscribe(dejavu.EvtCloudBeforeDownloadChunk, func(context map[string]interface{}, id string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user