mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
bug-fix: prompt for new notebook after mainwindow is shown
This commit is contained in:
parent
be5f7d2b6b
commit
1028c9a4ad
@ -168,5 +168,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
w.openFiles(filePaths);
|
||||
|
||||
w.promptNewNotebookIfEmpty();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
@ -2623,3 +2623,10 @@ void VMainWindow::flushLogFileByCaptain(void *p_target, void *p_data)
|
||||
g_logFile.flush();
|
||||
#endif
|
||||
}
|
||||
|
||||
void VMainWindow::promptNewNotebookIfEmpty()
|
||||
{
|
||||
if (vnote->getNotebooks().isEmpty()) {
|
||||
notebookSelector->newNotebook();
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +83,9 @@ public:
|
||||
|
||||
VCaptain *getCaptain() const;
|
||||
|
||||
// Prompt user for new notebook if there is no notebook.
|
||||
void promptNewNotebookIfEmpty();
|
||||
|
||||
private slots:
|
||||
void importNoteFromFile();
|
||||
void viewSettings();
|
||||
|
@ -243,7 +243,9 @@ void VNotebookSelector::handleCurIndexChanged(int p_index)
|
||||
setCurrentIndex(m_lastValidIndex);
|
||||
}
|
||||
|
||||
if (!m_notebooks.isEmpty()) {
|
||||
newNotebook();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@ -382,6 +384,12 @@ void VNotebookSelector::deleteNotebook(VNotebook *p_notebook, bool p_deleteFiles
|
||||
QDesktopServices::openUrl(url);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_notebooks.isEmpty()) {
|
||||
m_muted = true;
|
||||
setCurrentIndex(0);
|
||||
m_muted = false;
|
||||
}
|
||||
}
|
||||
|
||||
void VNotebookSelector::editNotebookInfo()
|
||||
|
Loading…
x
Reference in New Issue
Block a user