Qt: improve VFS dialog a bit

- use normal selection instead of doubleclick
- move SaveSettings out of the tabs to reduce file access
- translate EmptyPath as well
- some other minor refactors to reduce lines of code
This commit is contained in:
Megamouse 2018-02-08 23:01:43 +01:00 committed by Ivan
parent 4c6ceeff11
commit bda466c3bd
4 changed files with 31 additions and 61 deletions

View file

@ -1,10 +1,5 @@
#include "vfs_dialog.h"
#include "Emu/System.h"
#include "vfs_dialog_tab.h"
#include <QVBoxLayout>
#include <QPushButton>
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
@ -69,8 +64,9 @@ vfs_dialog::vfs_dialog(std::shared_ptr<gui_settings> guiSettings, std::shared_pt
{
for (int i = 0; i < tabs->count(); ++i)
{
static_cast<vfs_dialog_tab*>(tabs->widget(i))->SaveSettings();
static_cast<vfs_dialog_tab*>(tabs->widget(i))->SetSettings();
}
m_emu_settings->SaveSettings();
accept();
});
@ -86,6 +82,6 @@ vfs_dialog::vfs_dialog(std::shared_ptr<gui_settings> guiSettings, std::shared_pt
vbox->addLayout(buttons);
setLayout(vbox);
setWindowTitle("Virtual File System");
setWindowTitle(tr("Virtual File System"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
}