Added sidebar urls to Qt palette open file browser.
This commit is contained in:
parent
bf00cb62ca
commit
3556c1cbfc
|
@ -327,6 +327,17 @@ void PaletteConfDialog_t::openPaletteFile(void)
|
||||||
std::string last;
|
std::string last;
|
||||||
char dir[512];
|
char dir[512];
|
||||||
QFileDialog dialog(this, tr("Open NES Palette") );
|
QFileDialog dialog(this, tr("Open NES Palette") );
|
||||||
|
QList<QUrl> urls;
|
||||||
|
|
||||||
|
//urls = dialog.sidebarUrls();
|
||||||
|
urls << QUrl::fromLocalFile( QDir::rootPath() );
|
||||||
|
urls << QUrl::fromLocalFile(QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first());
|
||||||
|
urls << QUrl::fromLocalFile( QDir( FCEUI_GetBaseDirectory() ).absolutePath() );
|
||||||
|
#ifdef WIN32
|
||||||
|
|
||||||
|
#else
|
||||||
|
urls << QUrl::fromLocalFile( QDir("/usr/share/fceux/palettes").absolutePath() );
|
||||||
|
#endif
|
||||||
|
|
||||||
dialog.setFileMode(QFileDialog::ExistingFile);
|
dialog.setFileMode(QFileDialog::ExistingFile);
|
||||||
|
|
||||||
|
@ -338,10 +349,10 @@ void PaletteConfDialog_t::openPaletteFile(void)
|
||||||
|
|
||||||
g_config->getOption ("SDL.Palette", &last );
|
g_config->getOption ("SDL.Palette", &last );
|
||||||
|
|
||||||
if ( last.size() == 0 )
|
if ( last.size() == 0 )
|
||||||
{
|
{
|
||||||
last.assign( "/usr/share/fceux/palettes" );
|
last.assign( "/usr/share/fceux/palettes" );
|
||||||
}
|
}
|
||||||
|
|
||||||
getDirFromFile( last.c_str(), dir );
|
getDirFromFile( last.c_str(), dir );
|
||||||
|
|
||||||
|
@ -351,6 +362,7 @@ void PaletteConfDialog_t::openPaletteFile(void)
|
||||||
g_config->getOption ("SDL.UseNativeFileDialog", &useNativeFileDialogVal);
|
g_config->getOption ("SDL.UseNativeFileDialog", &useNativeFileDialogVal);
|
||||||
|
|
||||||
dialog.setOption(QFileDialog::DontUseNativeDialog, !useNativeFileDialogVal);
|
dialog.setOption(QFileDialog::DontUseNativeDialog, !useNativeFileDialogVal);
|
||||||
|
dialog.setSidebarUrls(urls);
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
ret = dialog.exec();
|
ret = dialog.exec();
|
||||||
|
|
Loading…
Reference in New Issue