Add Sys_OpenFolderInFileManager
This commit is contained in:
parent
5c242be241
commit
411f5a6924
|
|
@ -1152,6 +1152,7 @@ typedef enum
|
|||
} dialogType_t;
|
||||
|
||||
dialogResult_t Sys_Dialog( dialogType_t type, const char *message, const char *title );
|
||||
qboolean Sys_OpenFolderInFileManager( const char *path, qboolean create );
|
||||
|
||||
void Sys_RemovePIDFile( const char *gamedir );
|
||||
void Sys_InitPIDFile( const char *gamedir );
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ void Sys_AnsiColorPrint( const char *msg );
|
|||
int Sys_PID( void );
|
||||
qboolean Sys_PIDIsRunning( int pid );
|
||||
|
||||
qboolean Sys_OpenFolderInPlatformFileManager( const char *path );
|
||||
|
||||
#ifdef PROTOCOL_HANDLER
|
||||
char *Sys_ParseProtocolUri( const char *uri );
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -277,6 +277,22 @@ void Sys_InitPIDFile( const char *gamedir ) {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Sys_OpenFolderInFileManager
|
||||
=================
|
||||
*/
|
||||
qboolean Sys_OpenFolderInFileManager( const char *path, qboolean create )
|
||||
{
|
||||
if( create )
|
||||
{
|
||||
if( FS_CreatePath( path ) )
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
return Sys_OpenFolderInPlatformFileManager( path );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Sys_Exit
|
||||
|
|
@ -880,4 +896,3 @@ int main( int argc, char **argv )
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1016,3 +1016,23 @@ qboolean Sys_DllExtension( const char *name ) {
|
|||
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
Sys_OpenFolderInPlatformFileManager
|
||||
==============
|
||||
*/
|
||||
qboolean Sys_OpenFolderInPlatformFileManager( const char *path )
|
||||
{
|
||||
Sys_ClearExecBuffer( );
|
||||
|
||||
#ifdef __APPLE__
|
||||
Sys_AppendToExecBuffer( "open" );
|
||||
#else
|
||||
Sys_AppendToExecBuffer( "xdg-open" );
|
||||
#endif
|
||||
|
||||
Sys_AppendToExecBuffer( path );
|
||||
|
||||
return Sys_Exec( ) == 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -915,3 +915,13 @@ Check if filename should be allowed to be loaded as a DLL.
|
|||
qboolean Sys_DllExtension( const char *name ) {
|
||||
return COM_CompareExtension( name, DLL_EXT );
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
Sys_OpenFolderInPlatformFileManager
|
||||
==============
|
||||
*/
|
||||
qboolean Sys_OpenFolderInPlatformFileManager( const char *path )
|
||||
{
|
||||
return ShellExecute( NULL, "explore", path, NULL, NULL, SW_SHOWDEFAULT ) > (HINSTANCE)32;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user