(Qt) Cleanups
This commit is contained in:
parent
cc9ff9870f
commit
a9a9075f5f
|
@ -684,7 +684,8 @@ bool audio_driver_init_internal(void *settings_data, bool audio_cb_inited)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_rate != 0)
|
if (new_rate != 0)
|
||||||
configuration_set_int(settings, settings->uints.audio_output_sample_rate, new_rate);
|
configuration_set_int(settings,
|
||||||
|
settings->uints.audio_output_sample_rate, new_rate);
|
||||||
|
|
||||||
if (!audio_driver_st.context_audio_data)
|
if (!audio_driver_st.context_audio_data)
|
||||||
{
|
{
|
||||||
|
@ -715,7 +716,8 @@ bool audio_driver_init_internal(void *settings_data, bool audio_cb_inited)
|
||||||
/* Should never happen. */
|
/* Should never happen. */
|
||||||
RARCH_WARN("[Audio]: Input rate is invalid (%.3f Hz)."
|
RARCH_WARN("[Audio]: Input rate is invalid (%.3f Hz)."
|
||||||
" Using output rate (%u Hz).\n",
|
" Using output rate (%u Hz).\n",
|
||||||
audio_driver_st.input, settings->uints.audio_output_sample_rate);
|
audio_driver_st.input,
|
||||||
|
settings->uints.audio_output_sample_rate);
|
||||||
|
|
||||||
audio_driver_st.input = settings->uints.audio_output_sample_rate;
|
audio_driver_st.input = settings->uints.audio_output_sample_rate;
|
||||||
}
|
}
|
||||||
|
@ -1593,18 +1595,18 @@ bool audio_driver_disable_callback(void)
|
||||||
|
|
||||||
bool audio_driver_callback(void)
|
bool audio_driver_callback(void)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
bool menu_pause_libretro = config_get_ptr()->bools.menu_pause_libretro;
|
||||||
uint32_t runloop_flags = runloop_get_flags();
|
uint32_t runloop_flags = runloop_get_flags();
|
||||||
bool runloop_paused = (runloop_flags & RUNLOOP_FLAG_PAUSED) ? true : false;
|
bool runloop_paused = (runloop_flags & RUNLOOP_FLAG_PAUSED) ? true : false;
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
bool core_paused = runloop_paused
|
bool core_paused = runloop_paused
|
||||||
|| (settings->bools.menu_pause_libretro
|
|| (menu_pause_libretro
|
||||||
&& (menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE)
|
&& (menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE)
|
||||||
&& netplay_driver_ctl(RARCH_NETPLAY_CTL_ALLOW_PAUSE, NULL));
|
&& netplay_driver_ctl(RARCH_NETPLAY_CTL_ALLOW_PAUSE, NULL));
|
||||||
#else
|
#else
|
||||||
bool core_paused = runloop_paused
|
bool core_paused = runloop_paused
|
||||||
|| (settings->bools.menu_pause_libretro
|
|| (menu_pause_libretro
|
||||||
&& (menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE));
|
&& (menu_state_get_ptr()->flags & MENU_ST_FLAG_ALIVE));
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
|
@ -1715,17 +1717,14 @@ void audio_driver_frame_is_reverse(void)
|
||||||
|| !(audio_st->flags & AUDIO_FLAG_ACTIVE)
|
|| !(audio_st->flags & AUDIO_FLAG_ACTIVE)
|
||||||
|| !(audio_st->output_samples_buf)))
|
|| !(audio_st->output_samples_buf)))
|
||||||
if (!(audio_st->flags & AUDIO_FLAG_SUSPENDED))
|
if (!(audio_st->flags & AUDIO_FLAG_SUSPENDED))
|
||||||
{
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
audio_driver_flush(audio_st,
|
audio_driver_flush(audio_st,
|
||||||
settings->floats.slowmotion_ratio,
|
config_get_ptr()->floats.slowmotion_ratio,
|
||||||
audio_st->rewind_buf +
|
audio_st->rewind_buf +
|
||||||
audio_st->rewind_ptr,
|
audio_st->rewind_ptr,
|
||||||
audio_st->rewind_size -
|
audio_st->rewind_size -
|
||||||
audio_st->rewind_ptr,
|
audio_st->rewind_ptr,
|
||||||
(runloop_flags & RUNLOOP_FLAG_SLOWMOTION) ? true : false,
|
(runloop_flags & RUNLOOP_FLAG_SLOWMOTION) ? true : false,
|
||||||
(runloop_flags & RUNLOOP_FLAG_FASTMOTION) ? true : false);
|
(runloop_flags & RUNLOOP_FLAG_FASTMOTION) ? true : false);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1857,6 +1856,7 @@ void audio_driver_menu_sample(void)
|
||||||
{
|
{
|
||||||
static int16_t samples_buf[1024] = {0};
|
static int16_t samples_buf[1024] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
float slowmotion_ratio = settings->floats.slowmotion_ratio;
|
||||||
video_driver_state_t *video_st = video_state_get_ptr();
|
video_driver_state_t *video_st = video_state_get_ptr();
|
||||||
uint32_t runloop_flags = runloop_get_flags();
|
uint32_t runloop_flags = runloop_get_flags();
|
||||||
recording_state_t *recording_st = recording_state_get_ptr();
|
recording_state_t *recording_st = recording_state_get_ptr();
|
||||||
|
@ -1887,7 +1887,7 @@ void audio_driver_menu_sample(void)
|
||||||
}
|
}
|
||||||
if (check_flush)
|
if (check_flush)
|
||||||
audio_driver_flush(audio_st,
|
audio_driver_flush(audio_st,
|
||||||
settings->floats.slowmotion_ratio,
|
slowmotion_ratio,
|
||||||
samples_buf,
|
samples_buf,
|
||||||
1024,
|
1024,
|
||||||
(runloop_flags & RUNLOOP_FLAG_SLOWMOTION) ? true : false,
|
(runloop_flags & RUNLOOP_FLAG_SLOWMOTION) ? true : false,
|
||||||
|
@ -1908,9 +1908,7 @@ void audio_driver_menu_sample(void)
|
||||||
}
|
}
|
||||||
if (check_flush)
|
if (check_flush)
|
||||||
audio_driver_flush(audio_st,
|
audio_driver_flush(audio_st,
|
||||||
settings->floats.slowmotion_ratio,
|
slowmotion_ratio, samples_buf, sample_count,
|
||||||
samples_buf,
|
|
||||||
sample_count,
|
|
||||||
(runloop_flags & RUNLOOP_FLAG_SLOWMOTION) ? true : false,
|
(runloop_flags & RUNLOOP_FLAG_SLOWMOTION) ? true : false,
|
||||||
(runloop_flags & RUNLOOP_FLAG_FASTMOTION) ? true : false);
|
(runloop_flags & RUNLOOP_FLAG_FASTMOTION) ? true : false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ static void *wasapi_init(const char *dev_id, unsigned rate, unsigned latency,
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
bool float_format = settings->bools.audio_wasapi_float_format;
|
bool float_format = settings->bools.audio_wasapi_float_format;
|
||||||
bool exclusive_mode = settings->bools.audio_wasapi_exclusive_mode;
|
bool exclusive_mode = settings->bools.audio_wasapi_exclusive_mode;
|
||||||
|
bool audio_sync = settings->bools.audio_sync;
|
||||||
unsigned sh_buffer_length = settings->uints.audio_wasapi_sh_buffer_length;
|
unsigned sh_buffer_length = settings->uints.audio_wasapi_sh_buffer_length;
|
||||||
wasapi_t *w = (wasapi_t*)calloc(1, sizeof(wasapi_t));
|
wasapi_t *w = (wasapi_t*)calloc(1, sizeof(wasapi_t));
|
||||||
|
|
||||||
|
@ -140,7 +141,7 @@ static void *wasapi_init(const char *dev_id, unsigned rate, unsigned latency,
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
w->flags |= WASAPI_FLG_RUNNING;
|
w->flags |= WASAPI_FLG_RUNNING;
|
||||||
if (settings->bools.audio_sync)
|
if (audio_sync)
|
||||||
w->flags &= ~(WASAPI_FLG_NONBLOCK);
|
w->flags &= ~(WASAPI_FLG_NONBLOCK);
|
||||||
else
|
else
|
||||||
w->flags |= (WASAPI_FLG_NONBLOCK);
|
w->flags |= (WASAPI_FLG_NONBLOCK);
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include "audio/microphone_driver.h"
|
#include "audio/microphone_driver.h"
|
||||||
#include "verbosity.h"
|
#include "verbosity.h"
|
||||||
|
|
||||||
|
|
||||||
#define BYTES_TO_FRAMES(bytes, frame_bits) ((bytes) * 8 / frame_bits)
|
#define BYTES_TO_FRAMES(bytes, frame_bits) ((bytes) * 8 / frame_bits)
|
||||||
#define FRAMES_TO_BYTES(frames, frame_bits) ((frames) * frame_bits / 8)
|
#define FRAMES_TO_BYTES(frames, frame_bits) ((frames) * frame_bits / 8)
|
||||||
|
|
||||||
|
|
|
@ -90,18 +90,14 @@ static void wasapi_microphone_close_mic(void *driver_context, void *mic_context)
|
||||||
|
|
||||||
static void *wasapi_microphone_init(void)
|
static void *wasapi_microphone_init(void)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
wasapi_microphone_t *wasapi = (wasapi_microphone_t*)calloc(1, sizeof(wasapi_microphone_t));
|
wasapi_microphone_t *wasapi = (wasapi_microphone_t*)calloc(1, sizeof(wasapi_microphone_t));
|
||||||
|
|
||||||
if (!wasapi)
|
if (!wasapi)
|
||||||
{
|
{
|
||||||
RARCH_ERR("[WASAPI mic]: Failed to allocate microphone driver context\n");
|
RARCH_ERR("[WASAPI mic]: Failed to allocate microphone driver context\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
wasapi->nonblock = !config_get_ptr()->bools.audio_sync;
|
||||||
wasapi->nonblock = !settings->bools.audio_sync;
|
|
||||||
RARCH_DBG("[WASAPI mic]: Initialized microphone driver context.\n");
|
RARCH_DBG("[WASAPI mic]: Initialized microphone driver context.\n");
|
||||||
|
|
||||||
return wasapi;
|
return wasapi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,9 +143,7 @@ const char *config_get_microphone_driver_options(void)
|
||||||
return char_list_new_special(STRING_LIST_MICROPHONE_DRIVERS, NULL);
|
return char_list_new_special(STRING_LIST_MICROPHONE_DRIVERS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool microphone_driver_find_driver(
|
bool microphone_driver_find_driver(void *settings_data, const char *prefix,
|
||||||
void *settings_data,
|
|
||||||
const char *prefix,
|
|
||||||
bool verbosity_enabled)
|
bool verbosity_enabled)
|
||||||
{
|
{
|
||||||
settings_t *settings = (settings_t*)settings_data;
|
settings_t *settings = (settings_t*)settings_data;
|
||||||
|
@ -184,21 +182,23 @@ bool microphone_driver_find_driver(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mic_driver_microphone_handle_init(retro_microphone_t *microphone, const retro_microphone_params_t *params)
|
static void mic_driver_microphone_handle_init(retro_microphone_t *microphone,
|
||||||
|
const retro_microphone_params_t *params)
|
||||||
{
|
{
|
||||||
if (microphone)
|
if (microphone)
|
||||||
{
|
{
|
||||||
const settings_t *settings = config_get_ptr();
|
const settings_t *settings = config_get_ptr();
|
||||||
|
unsigned microphone_sample_rate = settings->uints.microphone_sample_rate;
|
||||||
microphone->microphone_context = NULL;
|
microphone->microphone_context = NULL;
|
||||||
microphone->flags = MICROPHONE_FLAG_ACTIVE;
|
microphone->flags = MICROPHONE_FLAG_ACTIVE;
|
||||||
microphone->sample_buffer = NULL;
|
microphone->sample_buffer = NULL;
|
||||||
microphone->sample_buffer_length = 0;
|
microphone->sample_buffer_length = 0;
|
||||||
|
|
||||||
microphone->requested_params.rate = params ? params->rate : settings->uints.microphone_sample_rate;
|
microphone->requested_params.rate = params ? params->rate : microphone_sample_rate;
|
||||||
microphone->actual_params.rate = 0;
|
microphone->actual_params.rate = 0;
|
||||||
/* We don't set the actual parameters until we actually open the mic.
|
/* We don't set the actual parameters until we actually open the mic.
|
||||||
* (Remember, the core can request one before the driver is ready.) */
|
* (Remember, the core can request one before the driver is ready.) */
|
||||||
microphone->effective_params.rate = params ? params->rate : settings->uints.microphone_sample_rate;
|
microphone->effective_params.rate = params ? params->rate : microphone_sample_rate;
|
||||||
/* We set the effective parameters because
|
/* We set the effective parameters because
|
||||||
* the frontend has to do what it can
|
* the frontend has to do what it can
|
||||||
* to give the core what it asks for. */
|
* to give the core what it asks for. */
|
||||||
|
@ -253,14 +253,6 @@ static void mic_driver_microphone_handle_free(retro_microphone_t *microphone, bo
|
||||||
/* Do NOT free the microphone handle itself! It's allocated statically! */
|
/* Do NOT free the microphone handle itself! It's allocated statically! */
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum resampler_quality microphone_driver_get_resampler_quality(
|
|
||||||
settings_t *settings)
|
|
||||||
{
|
|
||||||
if (settings)
|
|
||||||
return (enum resampler_quality)settings->uints.microphone_resampler_quality;
|
|
||||||
return RESAMPLER_QUALITY_DONTCARE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool microphone_driver_init_internal(void *settings_data)
|
bool microphone_driver_init_internal(void *settings_data)
|
||||||
{
|
{
|
||||||
settings_t *settings = (settings_t*)settings_data;
|
settings_t *settings = (settings_t*)settings_data;
|
||||||
|
@ -329,7 +321,7 @@ bool microphone_driver_init_internal(void *settings_data)
|
||||||
else
|
else
|
||||||
mic_st->resampler_ident[0] = '\0';
|
mic_st->resampler_ident[0] = '\0';
|
||||||
|
|
||||||
mic_st->resampler_quality = microphone_driver_get_resampler_quality(settings);
|
mic_st->resampler_quality = (enum resampler_quality)settings->uints.microphone_resampler_quality;
|
||||||
|
|
||||||
RARCH_LOG("[Microphone]: Initialized microphone driver.\n");
|
RARCH_LOG("[Microphone]: Initialized microphone driver.\n");
|
||||||
|
|
||||||
|
@ -710,15 +702,13 @@ retro_microphone_t *microphone_driver_open_mic(const retro_microphone_params_t *
|
||||||
void *driver_context = mic_st->driver_context;
|
void *driver_context = mic_st->driver_context;
|
||||||
|
|
||||||
if (!settings)
|
if (!settings)
|
||||||
{
|
|
||||||
RARCH_ERR("[Microphone]: Failed to open microphone due to uninitialized config.\n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
if (!settings->bools.microphone_enable)
|
/* Not checking mic_st->flags because they might not be set yet;
|
||||||
{ /* Not checking mic_st->flags because they might not be set yet;
|
|
||||||
* don't forget, the core can ask for a mic
|
* don't forget, the core can ask for a mic
|
||||||
* before the audio driver is ready to create one. */
|
* before the audio driver is ready to create one. */
|
||||||
|
if (!settings->bools.microphone_enable)
|
||||||
|
{
|
||||||
RARCH_DBG("[Microphone]: Refused to open microphone because it's disabled in the settings.\n");
|
RARCH_DBG("[Microphone]: Refused to open microphone because it's disabled in the settings.\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -729,8 +719,8 @@ retro_microphone_t *microphone_driver_open_mic(const retro_microphone_params_t *
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mic_driver &&
|
if ( !mic_driver
|
||||||
(string_is_equal(settings->arrays.microphone_driver, "null")
|
&& (string_is_equal(settings->arrays.microphone_driver, "null")
|
||||||
|| string_is_empty(settings->arrays.microphone_driver)))
|
|| string_is_empty(settings->arrays.microphone_driver)))
|
||||||
{ /* If the mic driver hasn't been initialized, but it's not going to be... */
|
{ /* If the mic driver hasn't been initialized, but it's not going to be... */
|
||||||
RARCH_ERR("[Microphone]: Cannot open microphone as the driver won't be initialized.\n");
|
RARCH_ERR("[Microphone]: Cannot open microphone as the driver won't be initialized.\n");
|
||||||
|
@ -756,8 +746,9 @@ retro_microphone_t *microphone_driver_open_mic(const retro_microphone_params_t *
|
||||||
* But the user still wants a handle, so we'll give them one.
|
* But the user still wants a handle, so we'll give them one.
|
||||||
*/
|
*/
|
||||||
mic_driver_microphone_handle_init(&mic_st->microphone, params);
|
mic_driver_microphone_handle_init(&mic_st->microphone, params);
|
||||||
/* If driver_context is NULL, the handle won't have a valid microphone context (but we'll create one later) */
|
|
||||||
|
|
||||||
|
/* If driver_context is NULL, the handle won't have
|
||||||
|
* a valid microphone context (but we'll create one later) */
|
||||||
if (driver_context)
|
if (driver_context)
|
||||||
{
|
{
|
||||||
/* If the microphone driver is ready to open a microphone... */
|
/* If the microphone driver is ready to open a microphone... */
|
||||||
|
|
|
@ -775,8 +775,8 @@ static bool netplay_handshake_init_send(netplay_t *netplay,
|
||||||
|
|
||||||
if (netplay->is_server)
|
if (netplay->is_server)
|
||||||
{
|
{
|
||||||
if (!string_is_empty(settings->paths.netplay_password) ||
|
if ( !string_is_empty(settings->paths.netplay_password)
|
||||||
!string_is_empty(settings->paths.netplay_spectate_password))
|
|| !string_is_empty(settings->paths.netplay_spectate_password))
|
||||||
{
|
{
|
||||||
/* Demand a password */
|
/* Demand a password */
|
||||||
if (netplay->simple_rand_next == 1)
|
if (netplay->simple_rand_next == 1)
|
||||||
|
@ -1435,17 +1435,17 @@ static bool netplay_handshake_sync(netplay_t *netplay,
|
||||||
static bool netplay_handshake_pre_nick(netplay_t *netplay,
|
static bool netplay_handshake_pre_nick(netplay_t *netplay,
|
||||||
struct netplay_connection *connection, bool *had_input)
|
struct netplay_connection *connection, bool *had_input)
|
||||||
{
|
{
|
||||||
struct nick_buf_s nick_buf;
|
|
||||||
ssize_t recvd;
|
ssize_t recvd;
|
||||||
|
struct nick_buf_s nick_buf;
|
||||||
int32_t ping = 0;
|
int32_t ping = 0;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
RECV(&nick_buf, sizeof(nick_buf)) {}
|
RECV(&nick_buf, sizeof(nick_buf)) {}
|
||||||
|
|
||||||
/* Expecting only a nick command */
|
/* Expecting only a nick command */
|
||||||
if (recvd < 0 ||
|
if ( recvd < 0
|
||||||
ntohl(nick_buf.cmd[0]) != NETPLAY_CMD_NICK ||
|
|| ntohl(nick_buf.cmd[0]) != NETPLAY_CMD_NICK
|
||||||
ntohl(nick_buf.cmd[1]) != sizeof(nick_buf.nick))
|
|| ntohl(nick_buf.cmd[1]) != sizeof(nick_buf.nick))
|
||||||
{
|
{
|
||||||
const char *_msg = NULL;
|
const char *_msg = NULL;
|
||||||
|
|
||||||
|
@ -1474,8 +1474,8 @@ static bool netplay_handshake_pre_nick(netplay_t *netplay,
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* There's a password, so just put them in PRE_PASSWORD mode */
|
/* There's a password, so just put them in PRE_PASSWORD mode */
|
||||||
if (!string_is_empty(settings->paths.netplay_password) ||
|
if ( !string_is_empty(settings->paths.netplay_password)
|
||||||
!string_is_empty(settings->paths.netplay_spectate_password))
|
|| !string_is_empty(settings->paths.netplay_spectate_password))
|
||||||
connection->mode = NETPLAY_CONNECTION_PRE_PASSWORD;
|
connection->mode = NETPLAY_CONNECTION_PRE_PASSWORD;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1505,19 +1505,19 @@ static bool netplay_handshake_pre_nick(netplay_t *netplay,
|
||||||
static bool netplay_handshake_pre_password(netplay_t *netplay,
|
static bool netplay_handshake_pre_password(netplay_t *netplay,
|
||||||
struct netplay_connection *connection, bool *had_input)
|
struct netplay_connection *connection, bool *had_input)
|
||||||
{
|
{
|
||||||
|
ssize_t recvd;
|
||||||
struct password_buf_s password_buf;
|
struct password_buf_s password_buf;
|
||||||
char password[8+NETPLAY_PASS_LEN]; /* 8 for salt */
|
char password[8+NETPLAY_PASS_LEN]; /* 8 for salt */
|
||||||
char hash[NETPLAY_PASS_HASH_LEN+1]; /* + NULL terminator */
|
char hash[NETPLAY_PASS_HASH_LEN+1]; /* + NULL terminator */
|
||||||
ssize_t recvd;
|
|
||||||
bool correct = false;
|
bool correct = false;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
RECV(&password_buf, sizeof(password_buf)) {}
|
RECV(&password_buf, sizeof(password_buf)) {}
|
||||||
|
|
||||||
/* Expecting only a password command */
|
/* Expecting only a password command */
|
||||||
if (recvd < 0 ||
|
if ( recvd < 0
|
||||||
ntohl(password_buf.cmd[0]) != NETPLAY_CMD_PASSWORD ||
|
|| ntohl(password_buf.cmd[0]) != NETPLAY_CMD_PASSWORD
|
||||||
ntohl(password_buf.cmd[1]) != sizeof(password_buf.password))
|
|| ntohl(password_buf.cmd[1]) != sizeof(password_buf.password))
|
||||||
{
|
{
|
||||||
RARCH_ERR("[Netplay] Failed to receive netplay password.\n");
|
RARCH_ERR("[Netplay] Failed to receive netplay password.\n");
|
||||||
return false;
|
return false;
|
||||||
|
@ -1538,7 +1538,8 @@ static bool netplay_handshake_pre_password(netplay_t *netplay,
|
||||||
connection->flags |= NETPLAY_CONN_FLAG_CAN_PLAY;
|
connection->flags |= NETPLAY_CONN_FLAG_CAN_PLAY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!correct && !string_is_empty(settings->paths.netplay_spectate_password))
|
if ( !correct
|
||||||
|
&& !string_is_empty(settings->paths.netplay_spectate_password))
|
||||||
{
|
{
|
||||||
strlcpy(password + 8, settings->paths.netplay_spectate_password,
|
strlcpy(password + 8, settings->paths.netplay_spectate_password,
|
||||||
sizeof(password) - 8);
|
sizeof(password) - 8);
|
||||||
|
|
|
@ -173,44 +173,32 @@ static bool netplay_json_object_member(void *ctx, const char *p_value,
|
||||||
p_ctx->cur_member_size = sizeof(net_st->rooms_data->cur->address);
|
p_ctx->cur_member_size = sizeof(net_st->rooms_data->cur->address);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(p_value, "port"))
|
else if (string_is_equal(p_value, "port"))
|
||||||
{
|
|
||||||
p_ctx->cur_member_int = &net_st->rooms_data->cur->port;
|
p_ctx->cur_member_int = &net_st->rooms_data->cur->port;
|
||||||
}
|
|
||||||
else if (string_is_equal(p_value, "game_crc"))
|
else if (string_is_equal(p_value, "game_crc"))
|
||||||
{
|
|
||||||
p_ctx->cur_member_inthex = &net_st->rooms_data->cur->gamecrc;
|
p_ctx->cur_member_inthex = &net_st->rooms_data->cur->gamecrc;
|
||||||
}
|
|
||||||
else if (string_is_equal(p_value, "core_version"))
|
else if (string_is_equal(p_value, "core_version"))
|
||||||
{
|
{
|
||||||
p_ctx->cur_member_string = net_st->rooms_data->cur->coreversion;
|
p_ctx->cur_member_string = net_st->rooms_data->cur->coreversion;
|
||||||
p_ctx->cur_member_size = sizeof(net_st->rooms_data->cur->coreversion);
|
p_ctx->cur_member_size = sizeof(net_st->rooms_data->cur->coreversion);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(p_value, "has_password"))
|
else if (string_is_equal(p_value, "has_password"))
|
||||||
{
|
|
||||||
p_ctx->cur_member_bool = &net_st->rooms_data->cur->has_password;
|
p_ctx->cur_member_bool = &net_st->rooms_data->cur->has_password;
|
||||||
}
|
|
||||||
else if (string_is_equal(p_value, "has_spectate_password"))
|
else if (string_is_equal(p_value, "has_spectate_password"))
|
||||||
{
|
|
||||||
p_ctx->cur_member_bool = &net_st->rooms_data->cur->has_spectate_password;
|
p_ctx->cur_member_bool = &net_st->rooms_data->cur->has_spectate_password;
|
||||||
}
|
|
||||||
else if (string_is_equal(p_value, "mitm_ip"))
|
else if (string_is_equal(p_value, "mitm_ip"))
|
||||||
{
|
{
|
||||||
p_ctx->cur_member_string = net_st->rooms_data->cur->mitm_address;
|
p_ctx->cur_member_string = net_st->rooms_data->cur->mitm_address;
|
||||||
p_ctx->cur_member_size = sizeof(net_st->rooms_data->cur->mitm_address);
|
p_ctx->cur_member_size = sizeof(net_st->rooms_data->cur->mitm_address);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(p_value, "mitm_port"))
|
else if (string_is_equal(p_value, "mitm_port"))
|
||||||
{
|
|
||||||
p_ctx->cur_member_int = &net_st->rooms_data->cur->mitm_port;
|
p_ctx->cur_member_int = &net_st->rooms_data->cur->mitm_port;
|
||||||
}
|
|
||||||
else if (string_is_equal(p_value, "mitm_session"))
|
else if (string_is_equal(p_value, "mitm_session"))
|
||||||
{
|
{
|
||||||
p_ctx->cur_member_string = net_st->rooms_data->cur->mitm_session;
|
p_ctx->cur_member_string = net_st->rooms_data->cur->mitm_session;
|
||||||
p_ctx->cur_member_size = sizeof(net_st->rooms_data->cur->mitm_session);
|
p_ctx->cur_member_size = sizeof(net_st->rooms_data->cur->mitm_session);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(p_value, "host_method"))
|
else if (string_is_equal(p_value, "host_method"))
|
||||||
{
|
|
||||||
p_ctx->cur_member_int = &net_st->rooms_data->cur->host_method;
|
p_ctx->cur_member_int = &net_st->rooms_data->cur->host_method;
|
||||||
}
|
|
||||||
else if (string_is_equal(p_value, "retroarch_version"))
|
else if (string_is_equal(p_value, "retroarch_version"))
|
||||||
{
|
{
|
||||||
p_ctx->cur_member_string = net_st->rooms_data->cur->retroarch_version;
|
p_ctx->cur_member_string = net_st->rooms_data->cur->retroarch_version;
|
||||||
|
@ -232,15 +220,11 @@ static bool netplay_json_object_member(void *ctx, const char *p_value,
|
||||||
p_ctx->cur_member_size = sizeof(net_st->rooms_data->cur->subsystem_name);
|
p_ctx->cur_member_size = sizeof(net_st->rooms_data->cur->subsystem_name);
|
||||||
}
|
}
|
||||||
else if (string_is_equal(p_value, "connectable"))
|
else if (string_is_equal(p_value, "connectable"))
|
||||||
{
|
|
||||||
p_ctx->cur_member_bool = &net_st->rooms_data->cur->connectable;
|
p_ctx->cur_member_bool = &net_st->rooms_data->cur->connectable;
|
||||||
}
|
|
||||||
else if (string_is_equal(p_value, "is_retroarch"))
|
else if (string_is_equal(p_value, "is_retroarch"))
|
||||||
{
|
|
||||||
p_ctx->cur_member_bool = &net_st->rooms_data->cur->is_retroarch;
|
p_ctx->cur_member_bool = &net_st->rooms_data->cur->is_retroarch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -351,7 +335,6 @@ int netplay_rooms_get_count(void)
|
||||||
while (room)
|
while (room)
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
room = room->next;
|
room = room->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3638,7 +3638,8 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
/* If we need to quit, skip unloading the core to avoid performing
|
/* If we need to quit, skip unloading the core to avoid performing
|
||||||
* cleanup actions (like writing autosave state) twice. */
|
* cleanup actions (like writing autosave state) twice. */
|
||||||
if (should_quit_on_close()) {
|
if (should_quit_on_close())
|
||||||
|
{
|
||||||
command_event(CMD_EVENT_QUIT, NULL);
|
command_event(CMD_EVENT_QUIT, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -435,7 +435,7 @@ static void reallocate_port_if_needed(unsigned detected_port, int vendor_id,
|
||||||
( detected_port == settings->uints.input_joypad_index[player]
|
( detected_port == settings->uints.input_joypad_index[player]
|
||||||
|| !input_config_get_device_name(settings->uints.input_joypad_index[player]))
|
|| !input_config_get_device_name(settings->uints.input_joypad_index[player]))
|
||||||
&& settings->uints.input_device_reservation_type[player]
|
&& settings->uints.input_device_reservation_type[player]
|
||||||
!= INPUT_DEVICE_RESERVATION_RESERVED )
|
!= INPUT_DEVICE_RESERVATION_RESERVED)
|
||||||
{
|
{
|
||||||
first_free_player_slot = player;
|
first_free_player_slot = player;
|
||||||
RARCH_DBG("[Autoconf]: First unconfigured / unreserved player is %d\n",
|
RARCH_DBG("[Autoconf]: First unconfigured / unreserved player is %d\n",
|
||||||
|
|
|
@ -1068,9 +1068,11 @@ bool ListWidget::isEditorOpen()
|
||||||
|
|
||||||
void ListWidget::keyPressEvent(QKeyEvent *event)
|
void ListWidget::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)
|
int key = event->key();
|
||||||
|
if ( key == Qt::Key_Return
|
||||||
|
|| key == Qt::Key_Enter)
|
||||||
emit enterPressed();
|
emit enterPressed();
|
||||||
else if (event->key() == Qt::Key_Delete)
|
else if (key == Qt::Key_Delete)
|
||||||
emit deletePressed();
|
emit deletePressed();
|
||||||
|
|
||||||
QListWidget::keyPressEvent(event);
|
QListWidget::keyPressEvent(event);
|
||||||
|
@ -1113,20 +1115,20 @@ void LogTextEdit::appendMessage(const QString& text)
|
||||||
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
|
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only accept indexes from current path. https://www.qtcentre.org/threads/50700-QFileSystemModel-and-QSortFilterProxyModel-don-t-work-well-together */
|
/* Only accept indexes from current path.
|
||||||
|
* https://www.qtcentre.org/threads/50700-QFileSystemModel-and-QSortFilterProxyModel-don-t-work-well-together */
|
||||||
bool FileSystemProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
bool FileSystemProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||||||
{
|
{
|
||||||
QFileSystemModel *sm = qobject_cast<QFileSystemModel*>(sourceModel());
|
QFileSystemModel *sm = qobject_cast<QFileSystemModel*>(sourceModel());
|
||||||
QModelIndex rootIndex = sm->index(sm->rootPath());
|
QModelIndex rootIndex = sm->index(sm->rootPath());
|
||||||
|
|
||||||
if (sourceParent == rootIndex)
|
if (sourceParent == rootIndex)
|
||||||
return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent);
|
return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* sort the source (QFileSystemModel to keep directories before files) */
|
||||||
void FileSystemProxyModel::sort(int column, Qt::SortOrder order)
|
void FileSystemProxyModel::sort(int column, Qt::SortOrder order)
|
||||||
{
|
{
|
||||||
/* sort the source (QFileSystemModel to keep directories before files) */
|
|
||||||
sourceModel()->sort(column, order);
|
sourceModel()->sort(column, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1415,14 +1417,16 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
|
|
||||||
connect(searchResetButton, SIGNAL(clicked()), this, SLOT(onSearchResetClicked()));
|
connect(searchResetButton, SIGNAL(clicked()), this, SLOT(onSearchResetClicked()));
|
||||||
|
|
||||||
m_dirModel->setFilter(QDir::NoDotAndDotDot |
|
m_dirModel->setFilter( QDir::NoDotAndDotDot
|
||||||
QDir::AllDirs |
|
| QDir::AllDirs
|
||||||
QDir::Drives |
|
| QDir::Drives
|
||||||
(m_settings->value("show_hidden_files", true).toBool() ? (QDir::Hidden | QDir::System) : static_cast<QDir::Filter>(0)));
|
| (m_settings->value("show_hidden_files", true).toBool()
|
||||||
|
? (QDir::Hidden | QDir::System) : static_cast<QDir::Filter>(0)));
|
||||||
|
|
||||||
m_fileModel->setFilter(QDir::NoDot |
|
m_fileModel->setFilter( QDir::NoDot
|
||||||
QDir::AllEntries |
|
| QDir::AllEntries
|
||||||
(m_settings->value("show_hidden_files", true).toBool() ? (QDir::Hidden | QDir::System) : static_cast<QDir::Filter>(0)));
|
| (m_settings->value("show_hidden_files", true).toBool()
|
||||||
|
? (QDir::Hidden | QDir::System) : static_cast<QDir::Filter>(0)));
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
m_dirModel->setRootPath("");
|
m_dirModel->setRootPath("");
|
||||||
|
@ -1440,12 +1444,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
|
|
||||||
if (m_dirModel->columnCount() > 3)
|
if (m_dirModel->columnCount() > 3)
|
||||||
{
|
{
|
||||||
/* size */
|
m_dirTree->hideColumn(1); /* size */
|
||||||
m_dirTree->hideColumn(1);
|
m_dirTree->hideColumn(2); /* type */
|
||||||
/* type */
|
m_dirTree->hideColumn(3); /* date modified */
|
||||||
m_dirTree->hideColumn(2);
|
|
||||||
/* date modified */
|
|
||||||
m_dirTree->hideColumn(3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadPlaylists();
|
reloadPlaylists();
|
||||||
|
@ -1460,7 +1461,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
m_searchDock->setWidget(m_searchWidget);
|
m_searchDock->setWidget(m_searchWidget);
|
||||||
m_searchDock->setFixedHeight(m_searchDock->minimumSizeHint().height());
|
m_searchDock->setFixedHeight(m_searchDock->minimumSizeHint().height());
|
||||||
|
|
||||||
addDockWidget(static_cast<Qt::DockWidgetArea>(m_searchDock->property("default_area").toInt()), m_searchDock);
|
addDockWidget(static_cast<Qt::DockWidgetArea>(
|
||||||
|
m_searchDock->property("default_area").toInt()), m_searchDock);
|
||||||
|
|
||||||
m_coreInfoLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
m_coreInfoLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
||||||
m_coreInfoLabel->setTextFormat(Qt::RichText);
|
m_coreInfoLabel->setTextFormat(Qt::RichText);
|
||||||
|
@ -1472,7 +1474,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
m_coreInfoDock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CORE_INFO));
|
m_coreInfoDock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CORE_INFO));
|
||||||
m_coreInfoDock->setWidget(m_coreInfoWidget);
|
m_coreInfoDock->setWidget(m_coreInfoWidget);
|
||||||
|
|
||||||
addDockWidget(static_cast<Qt::DockWidgetArea>(m_coreInfoDock->property("default_area").toInt()), m_coreInfoDock);
|
addDockWidget(static_cast<Qt::DockWidgetArea>(
|
||||||
|
m_coreInfoDock->property("default_area").toInt()), m_coreInfoDock);
|
||||||
|
|
||||||
m_logWidget->setLayout(new QVBoxLayout());
|
m_logWidget->setLayout(new QVBoxLayout());
|
||||||
m_logWidget->layout()->addWidget(m_logTextEdit);
|
m_logWidget->layout()->addWidget(m_logTextEdit);
|
||||||
|
@ -1619,12 +1622,12 @@ void MainWindow::startTimer()
|
||||||
|
|
||||||
void MainWindow::updateVisibleItems()
|
void MainWindow::updateVisibleItems()
|
||||||
{
|
{
|
||||||
if (m_currentBrowser == BROWSER_TYPE_PLAYLISTS && m_viewType == VIEW_TYPE_ICONS)
|
if ( m_currentBrowser == BROWSER_TYPE_PLAYLISTS
|
||||||
|
&& m_viewType == VIEW_TYPE_ICONS)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
QVector<QModelIndex> indexes = m_gridView->visibleIndexes();
|
QVector<QModelIndex> indexes = m_gridView->visibleIndexes();
|
||||||
size_t _len = indexes.size();
|
size_t _len = indexes.size();
|
||||||
|
|
||||||
for (i = 0; i < _len; i++)
|
for (i = 0; i < _len; i++)
|
||||||
m_playlistModel->loadThumbnail(m_proxyModel->mapToSource(indexes.at(i)));
|
m_playlistModel->loadThumbnail(m_proxyModel->mapToSource(indexes.at(i)));
|
||||||
}
|
}
|
||||||
|
@ -1754,6 +1757,10 @@ void MainWindow::showWelcomeScreen()
|
||||||
{
|
{
|
||||||
bool dont_ask = false;
|
bool dont_ask = false;
|
||||||
bool answer = false;
|
bool answer = false;
|
||||||
|
|
||||||
|
if (!m_settings->value("show_welcome_screen", true).toBool())
|
||||||
|
return;
|
||||||
|
|
||||||
const QString welcome_txt = QStringLiteral(""
|
const QString welcome_txt = QStringLiteral(""
|
||||||
"Welcome to the RetroArch Desktop Menu!<br>\n"
|
"Welcome to the RetroArch Desktop Menu!<br>\n"
|
||||||
"<br>\n"
|
"<br>\n"
|
||||||
|
@ -1774,9 +1781,6 @@ void MainWindow::showWelcomeScreen()
|
||||||
"Documentation for RetroArch, libretro and cores:<br>\n"
|
"Documentation for RetroArch, libretro and cores:<br>\n"
|
||||||
"<a href=\"https://docs.libretro.com/\">https://docs.libretro.com/</a>");
|
"<a href=\"https://docs.libretro.com/\">https://docs.libretro.com/</a>");
|
||||||
|
|
||||||
if (!m_settings->value("show_welcome_screen", true).toBool())
|
|
||||||
return;
|
|
||||||
|
|
||||||
answer = showMessageBox(welcome_txt,
|
answer = showMessageBox(welcome_txt,
|
||||||
MainWindow::MSGBOX_TYPE_QUESTION_OKCANCEL, Qt::ApplicationModal,
|
MainWindow::MSGBOX_TYPE_QUESTION_OKCANCEL, Qt::ApplicationModal,
|
||||||
true, &dont_ask);
|
true, &dont_ask);
|
||||||
|
@ -1794,7 +1798,9 @@ bool MainWindow::setCustomThemeFile(QString filePath)
|
||||||
{
|
{
|
||||||
if (filePath.isEmpty())
|
if (filePath.isEmpty())
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_PATH_IS_BLANK));
|
QMessageBox::critical(this,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME),
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_PATH_IS_BLANK));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1806,7 +1812,9 @@ bool MainWindow::setCustomThemeFile(QString filePath)
|
||||||
|
|
||||||
if (!opened)
|
if (!opened)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_READ_OPEN_FAILED));
|
QMessageBox::critical(this,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME),
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_READ_OPEN_FAILED));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1818,7 +1826,9 @@ bool MainWindow::setCustomThemeFile(QString filePath)
|
||||||
|
|
||||||
if (fileStr.isEmpty())
|
if (fileStr.isEmpty())
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_IS_EMPTY));
|
QMessageBox::critical(this,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME),
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_IS_EMPTY));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1827,20 +1837,19 @@ bool MainWindow::setCustomThemeFile(QString filePath)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST));
|
QMessageBox::critical(this,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME),
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setCustomThemeString(QString qss)
|
void MainWindow::setCustomThemeString(QString qss) { m_customThemeString = qss;}
|
||||||
{
|
|
||||||
m_customThemeString = qss;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MainWindow::showMessageBox(QString msg, MessageBoxType msgType,
|
bool MainWindow::showMessageBox(QString msg, MessageBoxType msgType,
|
||||||
Qt::WindowModality modality, bool showDontAsk, bool *dont_ask)
|
Qt::WindowModality modality, bool show_dont_ask, bool *dont_ask)
|
||||||
{
|
{
|
||||||
QCheckBox *checkbox = NULL;
|
QCheckBox *checkbox = NULL;
|
||||||
QPointer<QMessageBox> msg_box_ptr = new QMessageBox(this);
|
QPointer<QMessageBox> msg_box_ptr = new QMessageBox(this);
|
||||||
|
@ -1850,9 +1859,10 @@ bool MainWindow::showMessageBox(QString msg, MessageBoxType msgType,
|
||||||
msg_box->setTextFormat(Qt::RichText);
|
msg_box->setTextFormat(Qt::RichText);
|
||||||
msg_box->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
msg_box->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
|
|
||||||
if (showDontAsk)
|
if (show_dont_ask)
|
||||||
{
|
{
|
||||||
checkbox = new QCheckBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_DONT_SHOW_AGAIN), msg_box);
|
checkbox = new QCheckBox(
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_DONT_SHOW_AGAIN), msg_box);
|
||||||
/* QMessageBox::setCheckBox() is available since 5.2 */
|
/* QMessageBox::setCheckBox() is available since 5.2 */
|
||||||
msg_box->setCheckBox(checkbox);
|
msg_box->setCheckBox(checkbox);
|
||||||
}
|
}
|
||||||
|
@ -1891,9 +1901,10 @@ bool MainWindow::showMessageBox(QString msg, MessageBoxType msgType,
|
||||||
if (!msg_box_ptr)
|
if (!msg_box_ptr)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
int key = msg_box->result();
|
||||||
if (
|
if (
|
||||||
msg_box->result() != QMessageBox::Ok
|
key != QMessageBox::Ok
|
||||||
&& msg_box->result() != QMessageBox::Yes)
|
&& key != QMessageBox::Yes)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (checkbox && dont_ask)
|
if (checkbox && dont_ask)
|
||||||
|
@ -2119,10 +2130,7 @@ QString MainWindow::getThemeString(Theme theme)
|
||||||
return "default";
|
return "default";
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::Theme MainWindow::theme()
|
MainWindow::Theme MainWindow::theme() { return m_currentTheme; }
|
||||||
{
|
|
||||||
return m_currentTheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::setTheme(Theme theme)
|
void MainWindow::setTheme(Theme theme)
|
||||||
{
|
{
|
||||||
|
@ -2354,8 +2362,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
|
|
||||||
if (core_info->categories_list)
|
if (core_info->categories_list)
|
||||||
{
|
{
|
||||||
QHash<QString, QString> hash;
|
|
||||||
QString categories;
|
QString categories;
|
||||||
|
QHash<QString, QString> hash;
|
||||||
|
|
||||||
for (i = 0; i < core_info->categories_list->size; i++)
|
for (i = 0; i < core_info->categories_list->size; i++)
|
||||||
{
|
{
|
||||||
|
@ -2374,8 +2382,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
|
|
||||||
if (core_info->authors_list)
|
if (core_info->authors_list)
|
||||||
{
|
{
|
||||||
QHash<QString, QString> hash;
|
|
||||||
QString authors;
|
QString authors;
|
||||||
|
QHash<QString, QString> hash;
|
||||||
|
|
||||||
for (i = 0; i < core_info->authors_list->size; i++)
|
for (i = 0; i < core_info->authors_list->size; i++)
|
||||||
{
|
{
|
||||||
|
@ -2394,8 +2402,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
|
|
||||||
if (core_info->permissions_list)
|
if (core_info->permissions_list)
|
||||||
{
|
{
|
||||||
QHash<QString, QString> hash;
|
|
||||||
QString permissions;
|
QString permissions;
|
||||||
|
QHash<QString, QString> hash;
|
||||||
|
|
||||||
for (i = 0; i < core_info->permissions_list->size; i++)
|
for (i = 0; i < core_info->permissions_list->size; i++)
|
||||||
{
|
{
|
||||||
|
@ -2414,8 +2422,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
|
|
||||||
if (core_info->licenses_list)
|
if (core_info->licenses_list)
|
||||||
{
|
{
|
||||||
QHash<QString, QString> hash;
|
|
||||||
QString licenses;
|
QString licenses;
|
||||||
|
QHash<QString, QString> hash;
|
||||||
|
|
||||||
for (i = 0; i < core_info->licenses_list->size; i++)
|
for (i = 0; i < core_info->licenses_list->size; i++)
|
||||||
{
|
{
|
||||||
|
@ -2434,8 +2442,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
|
|
||||||
if (core_info->supported_extensions_list)
|
if (core_info->supported_extensions_list)
|
||||||
{
|
{
|
||||||
QHash<QString, QString> hash;
|
|
||||||
QString supported_extensions;
|
QString supported_extensions;
|
||||||
|
QHash<QString, QString> hash;
|
||||||
|
|
||||||
for (i = 0; i < core_info->supported_extensions_list->size; i++)
|
for (i = 0; i < core_info->supported_extensions_list->size; i++)
|
||||||
{
|
{
|
||||||
|
@ -2613,10 +2621,7 @@ void MainWindow::onSearchResetClicked()
|
||||||
onSearchEnterPressed();
|
onSearchEnterPressed();
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolButton* MainWindow::coreInfoPushButton()
|
QToolButton* MainWindow::coreInfoPushButton() { return m_coreInfoPushButton; }
|
||||||
{
|
|
||||||
return m_coreInfoPushButton;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::onTreeViewItemsSelected(QModelIndexList selectedIndexes)
|
void MainWindow::onTreeViewItemsSelected(QModelIndexList selectedIndexes)
|
||||||
{
|
{
|
||||||
|
@ -2734,7 +2739,8 @@ void MainWindow::onStartCoreClicked()
|
||||||
path_clear(RARCH_PATH_BASENAME);
|
path_clear(RARCH_PATH_BASENAME);
|
||||||
|
|
||||||
if (!task_push_start_current_core(&content_info))
|
if (!task_push_start_current_core(&content_info))
|
||||||
QMessageBox::critical(this, msg_hash_to_str(MSG_ERROR), msg_hash_to_str(MSG_FAILED_TO_LOAD_CONTENT));
|
QMessageBox::critical(this, msg_hash_to_str(MSG_ERROR),
|
||||||
|
msg_hash_to_str(MSG_FAILED_TO_LOAD_CONTENT));
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<QString, QString> MainWindow::getSelectedCore()
|
QHash<QString, QString> MainWindow::getSelectedCore()
|
||||||
|
@ -2889,8 +2895,8 @@ void MainWindow::loadContent(const QHash<QString, QString> &contentHash)
|
||||||
break;
|
break;
|
||||||
case CORE_SELECTION_PLAYLIST_DEFAULT:
|
case CORE_SELECTION_PLAYLIST_DEFAULT:
|
||||||
{
|
{
|
||||||
QString plName = contentHash["pl_name"].isEmpty() ?
|
QString plName = contentHash["pl_name"].isEmpty()
|
||||||
contentHash["db_name"] : contentHash["pl_name"];
|
? contentHash["db_name"] : contentHash["pl_name"];
|
||||||
|
|
||||||
QString defaultCorePath = getPlaylistDefaultCore(plName);
|
QString defaultCorePath = getPlaylistDefaultCore(plName);
|
||||||
|
|
||||||
|
@ -2989,10 +2995,7 @@ PlaylistEntryDialog* MainWindow::playlistEntryDialog()
|
||||||
return m_playlistEntryDialog;
|
return m_playlistEntryDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewOptionsDialog* MainWindow::viewOptionsDialog()
|
ViewOptionsDialog* MainWindow::viewOptionsDialog() {return m_viewOptionsDialog;}
|
||||||
{
|
|
||||||
return m_viewOptionsDialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::setCoreActions()
|
void MainWindow::setCoreActions()
|
||||||
{
|
{
|
||||||
|
@ -3004,7 +3007,8 @@ void MainWindow::setCoreActions()
|
||||||
|
|
||||||
m_launchWithComboBox->clear();
|
m_launchWithComboBox->clear();
|
||||||
|
|
||||||
if (sys_info->load_no_content) /* Is contentless core? */
|
/* Is contentless core? */
|
||||||
|
if (sys_info->load_no_content)
|
||||||
m_startCorePushButton->show();
|
m_startCorePushButton->show();
|
||||||
else
|
else
|
||||||
m_startCorePushButton->hide();
|
m_startCorePushButton->hide();
|
||||||
|
@ -3068,8 +3072,8 @@ void MainWindow::setCoreActions()
|
||||||
switch(m_currentBrowser)
|
switch(m_currentBrowser)
|
||||||
{
|
{
|
||||||
case BROWSER_TYPE_PLAYLISTS:
|
case BROWSER_TYPE_PLAYLISTS:
|
||||||
currentPlaylistFileName = hash["pl_name"].isEmpty() ?
|
currentPlaylistFileName = hash["pl_name"].isEmpty()
|
||||||
hash["db_name"] : hash["pl_name"];
|
? hash["db_name"] : hash["pl_name"];
|
||||||
break;
|
break;
|
||||||
case BROWSER_TYPE_FILES:
|
case BROWSER_TYPE_FILES:
|
||||||
currentPlaylistFileName = m_fileModel->rootDirectory().dirName();
|
currentPlaylistFileName = m_fileModel->rootDirectory().dirName();
|
||||||
|
@ -3167,20 +3171,17 @@ void MainWindow::setCoreActions()
|
||||||
|
|
||||||
void MainWindow::onTabWidgetIndexChanged(int index)
|
void MainWindow::onTabWidgetIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if (m_browserAndPlaylistTabWidget->tabText(index) == msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER))
|
QString str = m_browserAndPlaylistTabWidget->tabText(index);
|
||||||
|
if (str == msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER))
|
||||||
{
|
{
|
||||||
m_currentBrowser = BROWSER_TYPE_FILES;
|
m_currentBrowser = BROWSER_TYPE_FILES;
|
||||||
|
|
||||||
m_centralWidget->setCurrentWidget(m_fileTableView);
|
m_centralWidget->setCurrentWidget(m_fileTableView);
|
||||||
|
|
||||||
onCurrentFileChanged(m_fileTableView->currentIndex());
|
onCurrentFileChanged(m_fileTableView->currentIndex());
|
||||||
}
|
}
|
||||||
else if (m_browserAndPlaylistTabWidget->tabText(index) == msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_PLAYLISTS))
|
else if (str == msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_PLAYLISTS))
|
||||||
{
|
{
|
||||||
m_currentBrowser = BROWSER_TYPE_PLAYLISTS;
|
m_currentBrowser = BROWSER_TYPE_PLAYLISTS;
|
||||||
|
|
||||||
m_centralWidget->setCurrentWidget(m_playlistViewsAndFooter);
|
m_centralWidget->setCurrentWidget(m_playlistViewsAndFooter);
|
||||||
|
|
||||||
onCurrentItemChanged(m_tableView->currentIndex());
|
onCurrentItemChanged(m_tableView->currentIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3189,25 +3190,10 @@ void MainWindow::onTabWidgetIndexChanged(int index)
|
||||||
setCoreActions();
|
setCoreActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
QToolButton* MainWindow::runPushButton()
|
QToolButton* MainWindow::runPushButton() { return m_runPushButton; }
|
||||||
{
|
QToolButton* MainWindow::stopPushButton() { return m_stopPushButton; }
|
||||||
return m_runPushButton;
|
QToolButton* MainWindow::startCorePushButton() { return m_startCorePushButton;}
|
||||||
}
|
QComboBox* MainWindow::launchWithComboBox() { return m_launchWithComboBox; }
|
||||||
|
|
||||||
QToolButton* MainWindow::stopPushButton()
|
|
||||||
{
|
|
||||||
return m_stopPushButton;
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolButton* MainWindow::startCorePushButton()
|
|
||||||
{
|
|
||||||
return m_startCorePushButton;
|
|
||||||
}
|
|
||||||
|
|
||||||
QComboBox* MainWindow::launchWithComboBox()
|
|
||||||
{
|
|
||||||
return m_launchWithComboBox;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::onSearchLineEditEdited(const QString &text)
|
void MainWindow::onSearchLineEditEdited(const QString &text)
|
||||||
{
|
{
|
||||||
|
@ -3367,22 +3353,15 @@ void MainWindow::onShowHiddenDockWidgetAction()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget* MainWindow::searchWidget()
|
QWidget* MainWindow::searchWidget() { return m_searchWidget; }
|
||||||
{
|
QLineEdit* MainWindow::searchLineEdit() { return m_searchLineEdit; }
|
||||||
return m_searchWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
QLineEdit* MainWindow::searchLineEdit()
|
|
||||||
{
|
|
||||||
return m_searchLineEdit;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::onSearchEnterPressed()
|
void MainWindow::onSearchEnterPressed()
|
||||||
{
|
{
|
||||||
onSearchLineEditEdited(m_searchLineEdit->text());
|
onSearchLineEditEdited(m_searchLineEdit->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onCurrentTableItemDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
|
void MainWindow::onCurrentTableItemDataChanged(const QModelIndex &topLeft,
|
||||||
|
const QModelIndex &bottomRight, const QVector<int> &roles)
|
||||||
{
|
{
|
||||||
QHash<QString, QString> hash;
|
QHash<QString, QString> hash;
|
||||||
|
|
||||||
|
@ -3439,7 +3418,8 @@ void MainWindow::renamePlaylistItem(QListWidgetItem *item, QString newName)
|
||||||
|
|
||||||
/* Block this signal because setData() would trigger
|
/* Block this signal because setData() would trigger
|
||||||
* an infinite loop here */
|
* an infinite loop here */
|
||||||
disconnect(m_listWidget, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(onCurrentListItemDataChanged(QListWidgetItem*)));
|
disconnect(m_listWidget, SIGNAL(itemChanged(QListWidgetItem*)),
|
||||||
|
this, SLOT(onCurrentListItemDataChanged(QListWidgetItem*)));
|
||||||
|
|
||||||
oldPath = item->data(Qt::UserRole).toString();
|
oldPath = item->data(Qt::UserRole).toString();
|
||||||
|
|
||||||
|
@ -3579,15 +3559,8 @@ void MainWindow::setCurrentThumbnailType(ThumbnailType thumbnailType)
|
||||||
m_gridView->viewport()->update();
|
m_gridView->viewport()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::ViewType MainWindow::getCurrentViewType()
|
MainWindow::ViewType MainWindow::getCurrentViewType() { return m_viewType; }
|
||||||
{
|
ThumbnailType MainWindow::getCurrentThumbnailType() { return m_thumbnailType;}
|
||||||
return m_viewType;
|
|
||||||
}
|
|
||||||
|
|
||||||
ThumbnailType MainWindow::getCurrentThumbnailType()
|
|
||||||
{
|
|
||||||
return m_thumbnailType;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::onCurrentListItemChanged(
|
void MainWindow::onCurrentListItemChanged(
|
||||||
QListWidgetItem *current, QListWidgetItem *previous)
|
QListWidgetItem *current, QListWidgetItem *previous)
|
||||||
|
@ -3600,42 +3573,18 @@ void MainWindow::onCurrentListItemChanged(
|
||||||
setCoreActions();
|
setCoreActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
TableView* MainWindow::contentTableView()
|
TableView* MainWindow::contentTableView() { return m_tableView; }
|
||||||
{
|
QTableView* MainWindow::fileTableView() { return m_fileTableView; }
|
||||||
return m_tableView;
|
QStackedWidget* MainWindow::centralWidget() { return m_centralWidget; }
|
||||||
}
|
FileDropWidget* MainWindow::playlistViews() { return m_playlistViews; }
|
||||||
|
QWidget* MainWindow::playlistViewsAndFooter() {return m_playlistViewsAndFooter;}
|
||||||
QTableView* MainWindow::fileTableView()
|
GridView* MainWindow::contentGridView() { return m_gridView; }
|
||||||
{
|
|
||||||
return m_fileTableView;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStackedWidget* MainWindow::centralWidget()
|
|
||||||
{
|
|
||||||
return m_centralWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
FileDropWidget* MainWindow::playlistViews()
|
|
||||||
{
|
|
||||||
return m_playlistViews;
|
|
||||||
}
|
|
||||||
|
|
||||||
QWidget* MainWindow::playlistViewsAndFooter()
|
|
||||||
{
|
|
||||||
return m_playlistViewsAndFooter;
|
|
||||||
}
|
|
||||||
|
|
||||||
GridView* MainWindow::contentGridView()
|
|
||||||
{
|
|
||||||
return m_gridView;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::onBrowserDownloadsClicked()
|
void MainWindow::onBrowserDownloadsClicked()
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
QDir dir(settings->paths.directory_core_assets);
|
|
||||||
QString path = dir.absolutePath();
|
|
||||||
QModelIndex index;
|
QModelIndex index;
|
||||||
|
QDir dir(config_get_ptr()->paths.directory_core_assets);
|
||||||
|
QString path = dir.absolutePath();
|
||||||
|
|
||||||
m_pendingDirScrollPath = path;
|
m_pendingDirScrollPath = path;
|
||||||
|
|
||||||
|
@ -3676,22 +3625,13 @@ void MainWindow::onBrowserUpClicked()
|
||||||
|
|
||||||
void MainWindow::onBrowserStartClicked()
|
void MainWindow::onBrowserStartClicked()
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
m_dirTree->setCurrentIndex(
|
m_dirTree->setCurrentIndex(
|
||||||
m_dirModel->index(settings->paths.directory_menu_content));
|
m_dirModel->index(config_get_ptr()->paths.directory_menu_content));
|
||||||
m_dirTree->scrollTo(m_dirTree->currentIndex(), QAbstractItemView::PositionAtTop);
|
m_dirTree->scrollTo(m_dirTree->currentIndex(), QAbstractItemView::PositionAtTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
ListWidget* MainWindow::playlistListWidget()
|
ListWidget* MainWindow::playlistListWidget() { return m_listWidget; }
|
||||||
{
|
TreeView* MainWindow::dirTreeView() { return m_dirTree; }
|
||||||
return m_listWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
TreeView* MainWindow::dirTreeView()
|
|
||||||
{
|
|
||||||
return m_dirTree;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::onTimeout()
|
void MainWindow::onTimeout()
|
||||||
{
|
{
|
||||||
|
@ -3744,7 +3684,8 @@ void MainWindow::setCurrentCoreLabel()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_currentCore != libraryName && !libraryName.isEmpty())
|
if ( m_currentCore != libraryName
|
||||||
|
&& !libraryName.isEmpty())
|
||||||
{
|
{
|
||||||
m_currentCore = sysinfo->library_name;
|
m_currentCore = sysinfo->library_name;
|
||||||
m_currentCoreVersion = (string_is_empty(sysinfo->library_version) ? "" : sysinfo->library_version);
|
m_currentCoreVersion = (string_is_empty(sysinfo->library_version) ? "" : sysinfo->library_version);
|
||||||
|
@ -3832,7 +3773,9 @@ void MainWindow::onLoadCoreClicked(const QStringList &extensionFilters)
|
||||||
{
|
{
|
||||||
m_loadCoreWindow->show();
|
m_loadCoreWindow->show();
|
||||||
m_loadCoreWindow->resize(width() / 2, height());
|
m_loadCoreWindow->resize(width() / 2, height());
|
||||||
m_loadCoreWindow->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, m_loadCoreWindow->size(), geometry()));
|
m_loadCoreWindow->setGeometry(QStyle::alignedRect(
|
||||||
|
Qt::LeftToRight, Qt::AlignCenter, m_loadCoreWindow->size(),
|
||||||
|
geometry()));
|
||||||
m_loadCoreWindow->initCoreList(extensionFilters);
|
m_loadCoreWindow->initCoreList(extensionFilters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3898,10 +3841,7 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
|
||||||
QMainWindow::keyPressEvent(event);
|
QMainWindow::keyPressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSettings* MainWindow::settings()
|
QSettings* MainWindow::settings() { return m_settings; }
|
||||||
{
|
|
||||||
return m_settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString MainWindow::getCurrentViewTypeString()
|
QString MainWindow::getCurrentViewTypeString()
|
||||||
{
|
{
|
||||||
|
@ -4242,25 +4182,29 @@ static enum ui_msg_window_response
|
||||||
ui_msg_window_qt_error(ui_msg_window_state *state)
|
ui_msg_window_qt_error(ui_msg_window_state *state)
|
||||||
{
|
{
|
||||||
QFlags<QMessageBox::StandardButton> flags = ui_msg_window_qt_buttons(state);
|
QFlags<QMessageBox::StandardButton> flags = ui_msg_window_qt_buttons(state);
|
||||||
return ui_msg_window_qt_response(state, QMessageBox::critical((QWidget*)state->window, state->title, state->text, flags));
|
return ui_msg_window_qt_response(state, QMessageBox::critical(
|
||||||
|
(QWidget*)state->window, state->title, state->text, flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum ui_msg_window_response ui_msg_window_qt_information(ui_msg_window_state *state)
|
static enum ui_msg_window_response ui_msg_window_qt_information(ui_msg_window_state *state)
|
||||||
{
|
{
|
||||||
QFlags<QMessageBox::StandardButton> flags = ui_msg_window_qt_buttons(state);
|
QFlags<QMessageBox::StandardButton> flags = ui_msg_window_qt_buttons(state);
|
||||||
return ui_msg_window_qt_response(state, QMessageBox::information((QWidget*)state->window, state->title, state->text, flags));
|
return ui_msg_window_qt_response(state, QMessageBox::information(
|
||||||
|
(QWidget*)state->window, state->title, state->text, flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum ui_msg_window_response ui_msg_window_qt_question(ui_msg_window_state *state)
|
static enum ui_msg_window_response ui_msg_window_qt_question(ui_msg_window_state *state)
|
||||||
{
|
{
|
||||||
QFlags<QMessageBox::StandardButton> flags = ui_msg_window_qt_buttons(state);
|
QFlags<QMessageBox::StandardButton> flags = ui_msg_window_qt_buttons(state);
|
||||||
return ui_msg_window_qt_response(state, QMessageBox::question((QWidget*)state->window, state->title, state->text, flags));
|
return ui_msg_window_qt_response(state, QMessageBox::question(
|
||||||
|
(QWidget*)state->window, state->title, state->text, flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum ui_msg_window_response ui_msg_window_qt_warning(ui_msg_window_state *state)
|
static enum ui_msg_window_response ui_msg_window_qt_warning(ui_msg_window_state *state)
|
||||||
{
|
{
|
||||||
QFlags<QMessageBox::StandardButton> flags = ui_msg_window_qt_buttons(state);
|
QFlags<QMessageBox::StandardButton> flags = ui_msg_window_qt_buttons(state);
|
||||||
return ui_msg_window_qt_response(state, QMessageBox::warning((QWidget*)state->window, state->title, state->text, flags));
|
return ui_msg_window_qt_response(state, QMessageBox::warning(
|
||||||
|
(QWidget*)state->window, state->title, state->text, flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
static ui_msg_window_t ui_msg_window_qt = {
|
static ui_msg_window_t ui_msg_window_qt = {
|
||||||
|
@ -4322,10 +4266,10 @@ static void* ui_application_qt_initialize(void)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
QPixmap iconPixmap;
|
||||||
/* Can't declare the pixmap at the top, because:
|
/* Can't declare the pixmap at the top, because:
|
||||||
* "QPixmap: Must construct a QGuiApplication before a QPixmap" */
|
* "QPixmap: Must construct a QGuiApplication before a QPixmap" */
|
||||||
QImage iconImage(16, 16, QImage::Format_ARGB32);
|
QImage iconImage(16, 16, QImage::Format_ARGB32);
|
||||||
QPixmap iconPixmap;
|
|
||||||
unsigned char *bits = iconImage.bits();
|
unsigned char *bits = iconImage.bits();
|
||||||
|
|
||||||
memcpy(bits, retroarch_qt_icon_data, 16 * 16 * sizeof(unsigned));
|
memcpy(bits, retroarch_qt_icon_data, 16 * 16 * sizeof(unsigned));
|
||||||
|
@ -4373,13 +4317,9 @@ static ui_application_t ui_application_qt = {
|
||||||
|
|
||||||
|
|
||||||
AppHandler::AppHandler(QObject *parent) :
|
AppHandler::AppHandler(QObject *parent) :
|
||||||
QObject(parent)
|
QObject(parent) { }
|
||||||
{
|
AppHandler::~AppHandler() { }
|
||||||
}
|
void AppHandler::onLastWindowClosed() { }
|
||||||
|
|
||||||
AppHandler::~AppHandler()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void AppHandler::exit()
|
void AppHandler::exit()
|
||||||
{
|
{
|
||||||
|
@ -4389,8 +4329,6 @@ void AppHandler::exit()
|
||||||
qApp->closeAllWindows();
|
qApp->closeAllWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppHandler::onLastWindowClosed() { }
|
|
||||||
|
|
||||||
typedef struct ui_companion_qt
|
typedef struct ui_companion_qt
|
||||||
{
|
{
|
||||||
ui_application_qt_t *app;
|
ui_application_qt_t *app;
|
||||||
|
@ -4515,10 +4453,10 @@ void ThumbnailLabel::paintEvent(QPaintEvent *event)
|
||||||
|
|
||||||
if (w > 0 && h > 0 && m_pixmap && !m_pixmap->isNull())
|
if (w > 0 && h > 0 && m_pixmap && !m_pixmap->isNull())
|
||||||
{
|
{
|
||||||
int newHeight = (m_pixmap->height() / static_cast<float>(m_pixmap->width())) * width();
|
|
||||||
QPixmap pixmapScaled = *m_pixmap;
|
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
QPainter pScale;
|
QPainter pScale;
|
||||||
|
int newHeight = (m_pixmap->height() / static_cast<float>(m_pixmap->width())) * width();
|
||||||
|
QPixmap pixmapScaled = *m_pixmap;
|
||||||
int pw = 0;
|
int pw = 0;
|
||||||
int ph = 0;
|
int ph = 0;
|
||||||
unsigned *buf = new unsigned[w * h];
|
unsigned *buf = new unsigned[w * h];
|
||||||
|
@ -4635,23 +4573,33 @@ static void* ui_companion_qt_init(void)
|
||||||
|
|
||||||
qsettings = mainwindow->settings();
|
qsettings = mainwindow->settings();
|
||||||
|
|
||||||
initialPlaylist = qsettings->value("initial_playlist", mainwindow->getSpecialPlaylistPath(SPECIAL_PLAYLIST_HISTORY)).toString();
|
initialPlaylist = qsettings->value("initial_playlist",
|
||||||
|
mainwindow->getSpecialPlaylistPath(SPECIAL_PLAYLIST_HISTORY)).toString();
|
||||||
|
|
||||||
mainwindow->resize(qMin(desktopRect.width(), INITIAL_WIDTH), qMin(desktopRect.height(), INITIAL_HEIGHT));
|
mainwindow->resize(qMin(desktopRect.width(), INITIAL_WIDTH),
|
||||||
mainwindow->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, mainwindow->size(), desktopRect));
|
qMin(desktopRect.height(), INITIAL_HEIGHT));
|
||||||
|
mainwindow->setGeometry(QStyle::alignedRect(Qt::LeftToRight,
|
||||||
|
Qt::AlignCenter, mainwindow->size(), desktopRect));
|
||||||
|
|
||||||
mainwindow->setWindowTitle("RetroArch");
|
mainwindow->setWindowTitle("RetroArch");
|
||||||
mainwindow->setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks | GROUPED_DRAGGING);
|
mainwindow->setDockOptions(QMainWindow::AnimatedDocks
|
||||||
|
| QMainWindow::AllowNestedDocks
|
||||||
|
| QMainWindow::AllowTabbedDocks
|
||||||
|
| GROUPED_DRAGGING);
|
||||||
|
|
||||||
listWidget = mainwindow->playlistListWidget();
|
listWidget = mainwindow->playlistListWidget();
|
||||||
|
|
||||||
widget = mainwindow->playlistViews();
|
widget = mainwindow->playlistViews();
|
||||||
widget->setContextMenuPolicy(Qt::CustomContextMenu);
|
widget->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
|
||||||
QObject::connect(widget, SIGNAL(filesDropped(QStringList)), mainwindow, SLOT(onPlaylistFilesDropped(QStringList)));
|
QObject::connect(widget, SIGNAL(filesDropped(QStringList)),
|
||||||
QObject::connect(widget, SIGNAL(enterPressed()), mainwindow, SLOT(onDropWidgetEnterPressed()));
|
mainwindow, SLOT(onPlaylistFilesDropped(QStringList)));
|
||||||
QObject::connect(widget, SIGNAL(deletePressed()), mainwindow, SLOT(deleteCurrentPlaylistItem()));
|
QObject::connect(widget, SIGNAL(enterPressed()), mainwindow,
|
||||||
QObject::connect(widget, SIGNAL(customContextMenuRequested(const QPoint&)), mainwindow, SLOT(onFileDropWidgetContextMenuRequested(const QPoint&)));
|
SLOT(onDropWidgetEnterPressed()));
|
||||||
|
QObject::connect(widget, SIGNAL(deletePressed()), mainwindow,
|
||||||
|
SLOT(deleteCurrentPlaylistItem()));
|
||||||
|
QObject::connect(widget, SIGNAL(customContextMenuRequested(const QPoint&)),
|
||||||
|
mainwindow, SLOT(onFileDropWidgetContextMenuRequested(const QPoint&)));
|
||||||
|
|
||||||
centralWidget = mainwindow->centralWidget();
|
centralWidget = mainwindow->centralWidget();
|
||||||
|
|
||||||
|
@ -4664,15 +4612,21 @@ static void* ui_companion_qt_init(void)
|
||||||
|
|
||||||
fileMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE));
|
fileMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE));
|
||||||
|
|
||||||
loadCoreAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_LOAD_CORE), mainwindow, SLOT(onLoadCoreClicked()));
|
loadCoreAction = fileMenu->addAction(msg_hash_to_str(
|
||||||
|
MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_LOAD_CORE), mainwindow,
|
||||||
|
SLOT(onLoadCoreClicked()));
|
||||||
loadCoreAction->setShortcut(QKeySequence("Ctrl+L"));
|
loadCoreAction->setShortcut(QKeySequence("Ctrl+L"));
|
||||||
|
|
||||||
unloadCoreAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_UNLOAD_CORE), mainwindow, SLOT(onUnloadCoreMenuAction()));
|
unloadCoreAction = fileMenu->addAction(msg_hash_to_str(
|
||||||
|
MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_UNLOAD_CORE), mainwindow,
|
||||||
|
SLOT(onUnloadCoreMenuAction()));
|
||||||
unloadCoreAction->setObjectName("unloadCoreAction");
|
unloadCoreAction->setObjectName("unloadCoreAction");
|
||||||
unloadCoreAction->setEnabled(false);
|
unloadCoreAction->setEnabled(false);
|
||||||
unloadCoreAction->setShortcut(QKeySequence("Ctrl+U"));
|
unloadCoreAction->setShortcut(QKeySequence("Ctrl+U"));
|
||||||
|
|
||||||
exitAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_EXIT), mainwindow, SLOT(close()));
|
exitAction = fileMenu->addAction(msg_hash_to_str(
|
||||||
|
MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_EXIT), mainwindow,
|
||||||
|
SLOT(close()));
|
||||||
exitAction->setShortcut(QKeySequence::Quit);
|
exitAction->setShortcut(QKeySequence::Quit);
|
||||||
|
|
||||||
editMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT));
|
editMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT));
|
||||||
|
@ -4734,23 +4688,32 @@ static void* ui_companion_qt_init(void)
|
||||||
browserAndPlaylistTabWidget = mainwindow->browserAndPlaylistTabWidget();
|
browserAndPlaylistTabWidget = mainwindow->browserAndPlaylistTabWidget();
|
||||||
browserAndPlaylistTabWidget->setObjectName("browserAndPlaylistTabWidget");
|
browserAndPlaylistTabWidget->setObjectName("browserAndPlaylistTabWidget");
|
||||||
|
|
||||||
/* Several functions depend on the same tab title strings here, so if you change these, make sure to change those too
|
/* Several functions depend on the same tab title strings here,
|
||||||
|
* so if you change these, make sure to change those too
|
||||||
* setCoreActions()
|
* setCoreActions()
|
||||||
* onTabWidgetIndexChanged()
|
* onTabWidgetIndexChanged()
|
||||||
* onCurrentListItemChanged()
|
* onCurrentListItemChanged()
|
||||||
*/
|
*/
|
||||||
browserAndPlaylistTabWidget->addTab(playlistWidget, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_PLAYLISTS));
|
browserAndPlaylistTabWidget->addTab(playlistWidget,
|
||||||
browserAndPlaylistTabWidget->addTab(browserWidget, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER));
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_PLAYLISTS));
|
||||||
|
browserAndPlaylistTabWidget->addTab(browserWidget,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER));
|
||||||
|
|
||||||
browserAndPlaylistTabDock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER), mainwindow);
|
browserAndPlaylistTabDock = new QDockWidget(msg_hash_to_str(
|
||||||
|
MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER), mainwindow);
|
||||||
browserAndPlaylistTabDock->setObjectName("browserAndPlaylistTabDock");
|
browserAndPlaylistTabDock->setObjectName("browserAndPlaylistTabDock");
|
||||||
browserAndPlaylistTabDock->setProperty("default_area", Qt::LeftDockWidgetArea);
|
browserAndPlaylistTabDock->setProperty("default_area", Qt::LeftDockWidgetArea);
|
||||||
browserAndPlaylistTabDock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER));
|
browserAndPlaylistTabDock->setProperty("menu_text",
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER));
|
||||||
browserAndPlaylistTabDock->setWidget(browserAndPlaylistTabWidget);
|
browserAndPlaylistTabDock->setWidget(browserAndPlaylistTabWidget);
|
||||||
|
|
||||||
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(browserAndPlaylistTabDock->property("default_area").toInt()), browserAndPlaylistTabDock);
|
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(
|
||||||
|
browserAndPlaylistTabDock->property("default_area").toInt()),
|
||||||
|
browserAndPlaylistTabDock);
|
||||||
|
|
||||||
browserButtonsHBoxLayout->addItem(new QSpacerItem(browserAndPlaylistTabWidget->tabBar()->width(), 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
|
browserButtonsHBoxLayout->addItem(new QSpacerItem(
|
||||||
|
browserAndPlaylistTabWidget->tabBar()->width(),
|
||||||
|
20, QSizePolicy::Expanding, QSizePolicy::Minimum));
|
||||||
|
|
||||||
thumbnailWidget = new ThumbnailWidget(THUMBNAIL_TYPE_BOXART);
|
thumbnailWidget = new ThumbnailWidget(THUMBNAIL_TYPE_BOXART);
|
||||||
thumbnailWidget->setObjectName("thumbnail");
|
thumbnailWidget->setObjectName("thumbnail");
|
||||||
|
@ -4805,7 +4768,8 @@ static void* ui_companion_qt_init(void)
|
||||||
mainwindow->tabifyDockWidget(thumbnailDock, thumbnail3Dock);
|
mainwindow->tabifyDockWidget(thumbnailDock, thumbnail3Dock);
|
||||||
mainwindow->tabifyDockWidget(thumbnailDock, thumbnail4Dock);
|
mainwindow->tabifyDockWidget(thumbnailDock, thumbnail4Dock);
|
||||||
|
|
||||||
/* when tabifying the dock widgets, the last tab added is selected by default, so we need to re-select the first tab */
|
/* When tabifying the dock widgets, the last tab added is selected
|
||||||
|
* by default, so we need to re-select the first tab */
|
||||||
thumbnailDock->raise();
|
thumbnailDock->raise();
|
||||||
|
|
||||||
coreSelectionWidget = new QWidget();
|
coreSelectionWidget = new QWidget();
|
||||||
|
@ -4932,17 +4896,20 @@ static void* ui_companion_qt_init(void)
|
||||||
mainwindow->setCurrentThumbnailType(THUMBNAIL_TYPE_BOXART);
|
mainwindow->setCurrentThumbnailType(THUMBNAIL_TYPE_BOXART);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We make sure to hook up the tab widget callback only after the tabs themselves have been added,
|
/* We make sure to hook up the tab widget callback only after the tabs
|
||||||
* but before changing to a specific one, to avoid the callback firing before the view type is set.
|
* themselves have been added, but before changing to a specific one,
|
||||||
|
* to avoid the callback firing before the view type is set.
|
||||||
*/
|
*/
|
||||||
QObject::connect(browserAndPlaylistTabWidget, SIGNAL(currentChanged(int)), mainwindow, SLOT(onTabWidgetIndexChanged(int)));
|
QObject::connect(browserAndPlaylistTabWidget, SIGNAL(currentChanged(int)),
|
||||||
|
mainwindow, SLOT(onTabWidgetIndexChanged(int)));
|
||||||
|
|
||||||
/* setting the last tab must come after setting the view type */
|
/* Setting the last tab must come after setting the view type */
|
||||||
if (qsettings->contains("save_last_tab"))
|
if (qsettings->contains("save_last_tab"))
|
||||||
{
|
{
|
||||||
int lastTabIndex = qsettings->value("last_tab", 0).toInt();
|
int lastTabIndex = qsettings->value("last_tab", 0).toInt();
|
||||||
|
|
||||||
if (lastTabIndex >= 0 && browserAndPlaylistTabWidget->count() > lastTabIndex)
|
if ( lastTabIndex >= 0
|
||||||
|
&& browserAndPlaylistTabWidget->count() > lastTabIndex)
|
||||||
{
|
{
|
||||||
browserAndPlaylistTabWidget->setCurrentIndex(lastTabIndex);
|
browserAndPlaylistTabWidget->setCurrentIndex(lastTabIndex);
|
||||||
mainwindow->onTabWidgetIndexChanged(lastTabIndex);
|
mainwindow->onTabWidgetIndexChanged(lastTabIndex);
|
||||||
|
@ -5115,10 +5082,10 @@ ui_companion_driver_t ui_companion_qt = {
|
||||||
|
|
||||||
QStringList string_split_to_qt(QString str, char delim)
|
QStringList string_split_to_qt(QString str, char delim)
|
||||||
{
|
{
|
||||||
int at;
|
int at = 0;
|
||||||
QStringList list = QStringList();
|
QStringList list = QStringList();
|
||||||
|
|
||||||
for (at = 0;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
/* Find next split */
|
/* Find next split */
|
||||||
int spl = str.indexOf(delim, at);
|
int spl = str.indexOf(delim, at);
|
||||||
|
@ -5140,13 +5107,13 @@ QStringList string_split_to_qt(QString str, char delim)
|
||||||
#define CORE_VERSION_COLUMN 1
|
#define CORE_VERSION_COLUMN 1
|
||||||
|
|
||||||
LoadCoreTableWidget::LoadCoreTableWidget(QWidget *parent) :
|
LoadCoreTableWidget::LoadCoreTableWidget(QWidget *parent) :
|
||||||
QTableWidget(parent)
|
QTableWidget(parent) { }
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoadCoreTableWidget::keyPressEvent(QKeyEvent *event)
|
void LoadCoreTableWidget::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)
|
int key = event->key();
|
||||||
|
if ( key == Qt::Key_Return
|
||||||
|
|| key == Qt::Key_Enter)
|
||||||
{
|
{
|
||||||
event->accept();
|
event->accept();
|
||||||
emit enterPressed();
|
emit enterPressed();
|
||||||
|
@ -5162,7 +5129,8 @@ LoadCoreWindow::LoadCoreWindow(QWidget *parent) :
|
||||||
,m_statusLabel(new QLabel())
|
,m_statusLabel(new QLabel())
|
||||||
{
|
{
|
||||||
QHBoxLayout *hbox = new QHBoxLayout();
|
QHBoxLayout *hbox = new QHBoxLayout();
|
||||||
QPushButton *customCoreButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_LOAD_CUSTOM_CORE));
|
QPushButton *customCoreButton = new QPushButton(
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_LOAD_CUSTOM_CORE));
|
||||||
|
|
||||||
connect(customCoreButton, SIGNAL(clicked()), this, SLOT(onLoadCustomCoreClicked()));
|
connect(customCoreButton, SIGNAL(clicked()), this, SLOT(onLoadCustomCoreClicked()));
|
||||||
connect(m_table, SIGNAL(enterPressed()), this, SLOT(onCoreEnterPressed()));
|
connect(m_table, SIGNAL(enterPressed()), this, SLOT(onCoreEnterPressed()));
|
||||||
|
@ -5193,7 +5161,8 @@ void LoadCoreWindow::closeEvent(QCloseEvent *event)
|
||||||
|
|
||||||
void LoadCoreWindow::keyPressEvent(QKeyEvent *event)
|
void LoadCoreWindow::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
if (event->key() == Qt::Key_Escape)
|
int key = event->key();
|
||||||
|
if (key == Qt::Key_Escape)
|
||||||
{
|
{
|
||||||
event->accept();
|
event->accept();
|
||||||
close();
|
close();
|
||||||
|
@ -5220,7 +5189,10 @@ void LoadCoreWindow::loadCore(const char *path)
|
||||||
progress.setValue(progress.minimum());
|
progress.setValue(progress.minimum());
|
||||||
progress.show();
|
progress.show();
|
||||||
|
|
||||||
/* Because core loading will block, we need to go ahead and process pending events that would allow the progress dialog to fully show its contents before actually starting the core loading process. Must call processEvents() twice. */
|
/* Because core loading will block, we need to go ahead and
|
||||||
|
* process pending events that would allow the progress dialog
|
||||||
|
* to fully show its contents before actually starting the
|
||||||
|
* core loading process. Must call processEvents() twice. */
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
|
|
||||||
|
@ -5234,7 +5206,8 @@ void LoadCoreWindow::loadCore(const char *path)
|
||||||
|
|
||||||
if (!command_event(CMD_EVENT_LOAD_CORE, NULL))
|
if (!command_event(CMD_EVENT_LOAD_CORE, NULL))
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, msg_hash_to_str(MSG_ERROR), msg_hash_to_str(MSG_FAILED_TO_OPEN_LIBRETRO_CORE));
|
QMessageBox::critical(this, msg_hash_to_str(MSG_ERROR),
|
||||||
|
msg_hash_to_str(MSG_FAILED_TO_OPEN_LIBRETRO_CORE));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5266,16 +5239,13 @@ void LoadCoreWindow::onCoreEnterPressed()
|
||||||
|
|
||||||
void LoadCoreWindow::onLoadCustomCoreClicked()
|
void LoadCoreWindow::onLoadCustomCoreClicked()
|
||||||
{
|
{
|
||||||
size_t _len;
|
|
||||||
QString path;
|
QString path;
|
||||||
QByteArray pathArray;
|
QByteArray pathArray;
|
||||||
char filters[128];
|
char filters[128];
|
||||||
const char *pathData = NULL;
|
const char *pathData = NULL;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
const char *path_dir_libretro = settings->paths.directory_libretro;
|
const char *path_dir_libretro = settings->paths.directory_libretro;
|
||||||
|
size_t _len = strlcpy(filters, "Cores (*.", sizeof(filters));
|
||||||
|
|
||||||
_len = strlcpy(filters, "Cores (*.", sizeof(filters));
|
|
||||||
_len += frontend_driver_get_core_extension(filters + _len, sizeof(filters) - _len);
|
_len += frontend_driver_get_core_extension(filters + _len, sizeof(filters) - _len);
|
||||||
strlcpy(filters + _len, ");;All Files (*.*)", sizeof(filters) - _len);
|
strlcpy(filters + _len, ");;All Files (*.*)", sizeof(filters) - _len);
|
||||||
|
|
||||||
|
@ -5398,5 +5368,8 @@ void LoadCoreWindow::initCoreList(const QStringList &extensionFilters)
|
||||||
m_table->selectRow(0);
|
m_table->selectRow(0);
|
||||||
m_table->setAlternatingRowColors(true);
|
m_table->setAlternatingRowColors(true);
|
||||||
|
|
||||||
resize(qMin(desktopRect.width(), contentsMargins().left() + m_table->horizontalHeader()->length() + contentsMargins().right()), height());
|
resize(qMin(desktopRect.width(),
|
||||||
|
contentsMargins().left()
|
||||||
|
+ m_table->horizontalHeader()->length()
|
||||||
|
+ contentsMargins().right()), height());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue