mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
VSync: add support for linux/mac
This commit is contained in:
parent
d3e1e560c4
commit
36e335bd72
@ -123,7 +123,11 @@ void VSync::onProcessFinish(int exitCode)
|
||||
|
||||
void VSync::start(const QString &cmd)
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
m_process->start("cmd", QStringList() << "/c" << cmd);
|
||||
#else
|
||||
m_process->start("/bin/sh", QStringList() << "-c" << cmd);
|
||||
#endif
|
||||
m_process->waitForStarted();
|
||||
}
|
||||
|
||||
|
@ -998,15 +998,15 @@ void VMainWindow::initMarkdownMenu()
|
||||
|
||||
void VMainWindow::initSyncMenu()
|
||||
{
|
||||
m_syncMenu = menuBar()->addMenu(tr("&Sync"));
|
||||
m_syncMenu = menuBar()->addMenu(tr("Git &Sync"));
|
||||
m_syncMenu->setToolTipsVisible(true);
|
||||
QAction* uploadAction = new QAction(tr("&Upload"), this);
|
||||
uploadAction->setToolTip(tr("upload note"));
|
||||
connect(uploadAction, &QAction::triggered, this, &VMainWindow::upload);
|
||||
QAction* uploadAction = new QAction(tr("&Upload"), this);
|
||||
uploadAction->setToolTip(tr("Upload notes to Git repo"));
|
||||
connect(uploadAction, &QAction::triggered, this, &VMainWindow::upload);
|
||||
m_syncMenu->addAction(uploadAction);
|
||||
|
||||
QAction* downloadAction = new QAction(tr("&Download"), this);
|
||||
downloadAction->setToolTip(tr("download note"));
|
||||
downloadAction->setToolTip(tr("Download notes from Git repo"));
|
||||
connect(downloadAction, &QAction::triggered, this, &VMainWindow::download);
|
||||
m_syncMenu->addAction(downloadAction);
|
||||
}
|
||||
@ -1018,9 +1018,9 @@ void VMainWindow::upload()
|
||||
{
|
||||
QString notebookDir = (*i)->getPath();
|
||||
QString notebookName = (*i)->getName();
|
||||
if ((*i)->isOpened())
|
||||
{
|
||||
qDebug() << "notebook name: " << notebookName << "notebook path: " << notebookDir;
|
||||
if ((*i)->isOpened())
|
||||
{
|
||||
qDebug() << "notebook name: " << notebookName << "notebook path: " << notebookDir;
|
||||
int ret = VUtils::showMessage(QMessageBox::Information, tr("Information"),
|
||||
tr("Are you sure to close opened notes"),
|
||||
tr("VNote will close all the opened notes before upload."),
|
||||
@ -1040,9 +1040,9 @@ void VMainWindow::upload()
|
||||
return;
|
||||
}
|
||||
m_git->setDir(notebookDir);
|
||||
m_git->upload();
|
||||
break;
|
||||
}
|
||||
m_git->upload();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user