Commit b8c6d94f authored by Filipe Saraiva's avatar Filipe Saraiva
Browse files

Add a filter to present worksheets and notebooks together

parent 5a1e6ce4
......@@ -214,14 +214,9 @@ void CantorShell::fileOpen()
// this slot is called whenever the File->Open menu is selected,
// the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
// button is clicked
static const QString& worksheetFilter = i18n("Cantor Worksheet (*.cws)");
static const QString& notebookFilter = i18n("Jupyter Notebook (*.ipynb)");
QString filter;
if (m_previousFilter == notebookFilter)
filter = notebookFilter + QLatin1String(";;") + worksheetFilter;
filter = worksheetFilter + QLatin1String(";;") + notebookFilter;
QUrl url = QFileDialog::getOpenFileUrl(this, i18n("Open file"), QUrl(), filter, &m_previousFilter);
static const QString& filter = i18n("All supported files (*.cws *ipynb);;Cantor Worksheet (*.cws);;Jupyter Notebook (*.ipynb)");
QUrl url = QFileDialog::getOpenFileUrl(this, i18n("Open file"), QUrl(), filter);
if (url.isEmpty() == false)
......@@ -117,8 +117,6 @@ private:
QList<QAction*> m_newBackendActions;
QDockWidget* m_helpDocker;
KRecentFilesAction* m_recentProjectsAction;
// For better UX: set previous used filter in "Open" action as default filter
QString m_previousFilter;
#endif // CANTOR_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment