Commit 76f9d77b authored by Filipe Saraiva's avatar Filipe Saraiva
Browse files

Bring back m_previousFilter

parent 17a50189
......@@ -214,9 +214,11 @@ 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& 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)
{
......
......@@ -117,6 +117,9 @@ 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