Commit 774dba63 authored by Filipe Saraiva's avatar Filipe Saraiva
Browse files

Bring back m_previousFilter

parent 40cd9e64
...@@ -214,9 +214,11 @@ void CantorShell::fileOpen() ...@@ -214,9 +214,11 @@ void CantorShell::fileOpen()
// this slot is called whenever the File->Open menu is selected, // this slot is called whenever the File->Open menu is selected,
// the Open shortcut is pressed (usually CTRL+O) or the Open toolbar // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
// button is clicked // button is clicked
static const QString& filter = i18n("All supported files (*.cws *.ipynb);;Cantor Worksheet (*.cws);;Jupyter Notebook (*.ipynb)"); static const QString& worksheetFilter = i18n("Cantor Worksheet (*.cws)");
static const QString& notebookFilter = i18n("Jupyter Notebook (*.ipynb)");
QUrl url = QFileDialog::getOpenFileUrl(this, i18n("Open file"), QUrl(), filter); 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, &m_previousFilter);
if (url.isEmpty() == false) if (url.isEmpty() == false)
{ {
......
...@@ -117,6 +117,9 @@ private: ...@@ -117,6 +117,9 @@ private:
QList<QAction*> m_newBackendActions; QList<QAction*> m_newBackendActions;
QDockWidget* m_helpDocker; QDockWidget* m_helpDocker;
KRecentFilesAction* m_recentProjectsAction; KRecentFilesAction* m_recentProjectsAction;
// For better UX: set previous used filter in "Open" action as default filter
QString m_previousFilter;
}; };
#endif // CANTOR_H #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