mirror of
https://github.com/libretro/RetroArch
synced 2025-03-31 01:21:03 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
c1bba50567
@ -19,7 +19,7 @@
|
|||||||
- MENU/QT/WIMP: QT QSlider styling for Dark Theme.
|
- MENU/QT/WIMP: QT QSlider styling for Dark Theme.
|
||||||
- MENU/QT/WIMP: Remove button ghostly inside highlighting.
|
- MENU/QT/WIMP: Remove button ghostly inside highlighting.
|
||||||
- MENU/QT/WIMP: Initial grid view.
|
- MENU/QT/WIMP: Initial grid view.
|
||||||
- MENU/QT/WIMP: Drag&drop to add new playlist items, add option to add/delete playlists.
|
- MENU/QT/WIMP: Drag&drop to add new playlist items, add option to add/edit/delete playlists.
|
||||||
- METAL: Initial work-in-progress video driver for Metal. macOS-only right now, and currently requires macOS 10.13.
|
- METAL: Initial work-in-progress video driver for Metal. macOS-only right now, and currently requires macOS 10.13.
|
||||||
- METAL: Supports XMB/MaterialUI, has a menu display driver. Has a font rendering driver.
|
- METAL: Supports XMB/MaterialUI, has a menu display driver. Has a font rendering driver.
|
||||||
- METAL/SLANG: Slang shaders should be compatible with Metal video driver.
|
- METAL/SLANG: Slang shaders should be compatible with Metal video driver.
|
||||||
|
25
command.c
25
command.c
@ -264,23 +264,26 @@ static bool command_read_ram(const char *arg)
|
|||||||
{
|
{
|
||||||
cheevos_var_t var;
|
cheevos_var_t var;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
char *reply = NULL;
|
char *reply = NULL;
|
||||||
const uint8_t * data = NULL;
|
const uint8_t * data = NULL;
|
||||||
char *reply_at = NULL;
|
char *reply_at = NULL;
|
||||||
unsigned int nbytes = 0;
|
unsigned int nbytes = 0;
|
||||||
unsigned int alloc_size = 0;
|
unsigned int alloc_size = 0;
|
||||||
int addr = -1;
|
int addr = -1;
|
||||||
|
|
||||||
if (sscanf(arg, "%x %d", &addr, &nbytes) != 2)
|
if (sscanf(arg, "%x %d", &addr, &nbytes) != 2)
|
||||||
return true;
|
return true;
|
||||||
alloc_size = 40 + nbytes * 3; //We alloc more than needed, saving 20 bytes is not really relevant
|
|
||||||
reply = (char*) malloc(alloc_size);
|
|
||||||
reply[0] = '\0';
|
|
||||||
reply_at = reply + sprintf(reply, SMY_CMD_STR " %x", addr);
|
|
||||||
|
|
||||||
var.value = addr;
|
alloc_size = 40 + nbytes * 3; /* We alloc more than needed, saving 20 bytes is not really relevant */
|
||||||
|
reply = (char*) malloc(alloc_size);
|
||||||
|
reply[0] = '\0';
|
||||||
|
reply_at = reply + sprintf(reply, SMY_CMD_STR " %x", addr);
|
||||||
|
|
||||||
|
var.value = addr;
|
||||||
|
|
||||||
cheevos_var_patch_addr(&var, cheevos_get_console());
|
cheevos_var_patch_addr(&var, cheevos_get_console());
|
||||||
data = cheevos_var_get_memory(&var);
|
|
||||||
|
data = cheevos_var_get_memory(&var);
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
|
@ -223,8 +223,8 @@ static const struct wl_keyboard_listener keyboard_listener = {
|
|||||||
keyboard_handle_enter,
|
keyboard_handle_enter,
|
||||||
keyboard_handle_leave,
|
keyboard_handle_leave,
|
||||||
keyboard_handle_key,
|
keyboard_handle_key,
|
||||||
keyboard_handle_modifiers
|
keyboard_handle_modifiers,
|
||||||
//keyboard_handle_repeat_info
|
keyboard_handle_repeat_info
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gfx_ctx_wl_show_mouse(void *data, bool state);
|
static void gfx_ctx_wl_show_mouse(void *data, bool state);
|
||||||
|
@ -3672,6 +3672,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CANNOT_ADD_TO_ALL_PLAYLISTS,
|
|||||||
"まずひとつのプレイリストを選択してください。")
|
"まずひとつのプレイリストを選択してください。")
|
||||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_DELETE,
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_DELETE,
|
||||||
"削除")
|
"削除")
|
||||||
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADD_ENTRY,
|
||||||
|
"エントリー作成...")
|
||||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADD_FILES,
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADD_FILES,
|
||||||
"ファイルを追加...")
|
"ファイルを追加...")
|
||||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADD_FOLDER,
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADD_FOLDER,
|
||||||
@ -3686,3 +3688,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FIELD_MULTIPLE,
|
|||||||
"<複数>")
|
"<複数>")
|
||||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY,
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY,
|
||||||
"プレイリストエントリーを更新するに失敗しました。")
|
"プレイリストエントリーを更新するに失敗しました。")
|
||||||
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_PLEASE_FILL_OUT_REQUIRED_FIELDS,
|
||||||
|
"必須フィールドがすべて入力されていることを確認してください。")
|
||||||
|
@ -4196,6 +4196,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CANNOT_ADD_TO_ALL_PLAYLISTS,
|
|||||||
"Please choose a single playlist first.")
|
"Please choose a single playlist first.")
|
||||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_DELETE,
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_DELETE,
|
||||||
"Delete")
|
"Delete")
|
||||||
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADD_ENTRY,
|
||||||
|
"Add Entry...")
|
||||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADD_FILES,
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADD_FILES,
|
||||||
"Add File(s)...")
|
"Add File(s)...")
|
||||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADD_FOLDER,
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_ADD_FOLDER,
|
||||||
@ -4210,3 +4212,5 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_FIELD_MULTIPLE,
|
|||||||
"<multiple>")
|
"<multiple>")
|
||||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY,
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY,
|
||||||
"Error updating playlist entry.")
|
"Error updating playlist entry.")
|
||||||
|
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_PLEASE_FILL_OUT_REQUIRED_FIELDS,
|
||||||
|
"Please fill out all required fields.")
|
||||||
|
@ -922,7 +922,7 @@ void fill_pathname_join_delim(char *out_path, const char *dir,
|
|||||||
const char *path, const char delim, size_t size)
|
const char *path, const char delim, size_t size)
|
||||||
{
|
{
|
||||||
size_t copied;
|
size_t copied;
|
||||||
// behavior of strlcpy is undefined if dst and src overlap
|
/* behavior of strlcpy is undefined if dst and src overlap */
|
||||||
if (out_path == dir)
|
if (out_path == dir)
|
||||||
copied = strlen(dir);
|
copied = strlen(dir);
|
||||||
else
|
else
|
||||||
|
@ -52,7 +52,7 @@ enum cheat_search_type
|
|||||||
CHEAT_SEARCH_TYPE_EQ,
|
CHEAT_SEARCH_TYPE_EQ,
|
||||||
CHEAT_SEARCH_TYPE_NEQ,
|
CHEAT_SEARCH_TYPE_NEQ,
|
||||||
CHEAT_SEARCH_TYPE_EQPLUS,
|
CHEAT_SEARCH_TYPE_EQPLUS,
|
||||||
CHEAT_SEARCH_TYPE_EQMINUS,
|
CHEAT_SEARCH_TYPE_EQMINUS
|
||||||
};
|
};
|
||||||
|
|
||||||
enum cheat_match_action_type
|
enum cheat_match_action_type
|
||||||
@ -113,19 +113,19 @@ struct item_cheat
|
|||||||
* 1 : 11110000
|
* 1 : 11110000
|
||||||
*/
|
*/
|
||||||
unsigned int address_mask ;
|
unsigned int address_mask ;
|
||||||
//Whether to apply the cheat based on big-endian console memory or not
|
/* Whether to apply the cheat based on big-endian console memory or not */
|
||||||
bool big_endian ;
|
bool big_endian ;
|
||||||
unsigned int rumble_type ;
|
unsigned int rumble_type ;
|
||||||
unsigned int rumble_value ;
|
unsigned int rumble_value ;
|
||||||
unsigned int rumble_prev_value ;
|
unsigned int rumble_prev_value ;
|
||||||
unsigned int rumble_initialized ;
|
unsigned int rumble_initialized ;
|
||||||
unsigned int rumble_port ; //0-15 for specific port, anything else means "all ports"
|
unsigned int rumble_port ; /* 0-15 for specific port, anything else means "all ports" */
|
||||||
unsigned int rumble_primary_strength ; //0-65535
|
unsigned int rumble_primary_strength ; /* 0-65535 */
|
||||||
unsigned int rumble_primary_duration ; //in milliseconds
|
unsigned int rumble_primary_duration ; /* in milliseconds */
|
||||||
retro_time_t rumble_primary_end_time ; //clock value for when rumbling should stop
|
retro_time_t rumble_primary_end_time ; /* clock value for when rumbling should stop */
|
||||||
unsigned int rumble_secondary_strength ; //0-65535
|
unsigned int rumble_secondary_strength ; /* 0-65535 */
|
||||||
unsigned int rumble_secondary_duration ; //in milliseconds
|
unsigned int rumble_secondary_duration ; /* in milliseconds */
|
||||||
retro_time_t rumble_secondary_end_time ; //clock value for when rumbling should stop
|
retro_time_t rumble_secondary_end_time ; /* clock value for when rumbling should stop */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cheat_manager
|
struct cheat_manager
|
||||||
|
@ -1955,6 +1955,7 @@ enum msg_hash_enums
|
|||||||
MENU_ENUM_LABEL_VALUE_QT_FOR_THUMBNAILS,
|
MENU_ENUM_LABEL_VALUE_QT_FOR_THUMBNAILS,
|
||||||
MENU_ENUM_LABEL_VALUE_QT_CANNOT_ADD_TO_ALL_PLAYLISTS,
|
MENU_ENUM_LABEL_VALUE_QT_CANNOT_ADD_TO_ALL_PLAYLISTS,
|
||||||
MENU_ENUM_LABEL_VALUE_QT_DELETE,
|
MENU_ENUM_LABEL_VALUE_QT_DELETE,
|
||||||
|
MENU_ENUM_LABEL_VALUE_QT_ADD_ENTRY,
|
||||||
MENU_ENUM_LABEL_VALUE_QT_ADD_FILES,
|
MENU_ENUM_LABEL_VALUE_QT_ADD_FILES,
|
||||||
MENU_ENUM_LABEL_VALUE_QT_ADD_FOLDER,
|
MENU_ENUM_LABEL_VALUE_QT_ADD_FOLDER,
|
||||||
MENU_ENUM_LABEL_VALUE_QT_EDIT,
|
MENU_ENUM_LABEL_VALUE_QT_EDIT,
|
||||||
@ -1962,6 +1963,7 @@ enum msg_hash_enums
|
|||||||
MENU_ENUM_LABEL_VALUE_QT_SELECT_FOLDER,
|
MENU_ENUM_LABEL_VALUE_QT_SELECT_FOLDER,
|
||||||
MENU_ENUM_LABEL_VALUE_QT_FIELD_MULTIPLE,
|
MENU_ENUM_LABEL_VALUE_QT_FIELD_MULTIPLE,
|
||||||
MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY,
|
MENU_ENUM_LABEL_VALUE_QT_COULD_NOT_UPDATE_PLAYLIST_ENTRY,
|
||||||
|
MENU_ENUM_LABEL_VALUE_QT_PLEASE_FILL_OUT_REQUIRED_FIELDS,
|
||||||
|
|
||||||
MENU_LABEL(MIDI_INPUT),
|
MENU_LABEL(MIDI_INPUT),
|
||||||
MENU_LABEL(MIDI_OUTPUT),
|
MENU_LABEL(MIDI_OUTPUT),
|
||||||
|
11
retroarch.c
11
retroarch.c
@ -2713,16 +2713,17 @@ static enum runloop_state runloop_check_state(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( global->menu.prev_action == action && global->menu.noop_press_time < 200000) //250ms
|
if ( global->menu.prev_action == action &&
|
||||||
|
global->menu.noop_press_time < 200000) /* 250ms */
|
||||||
{
|
{
|
||||||
global->menu.action_start_time = global->menu.prev_start_time ;
|
global->menu.action_start_time = global->menu.prev_start_time ;
|
||||||
global->menu.action_press_time = cpu_features_get_time_usec() - global->menu.action_start_time;
|
global->menu.action_press_time = cpu_features_get_time_usec() - global->menu.action_start_time;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
global->menu.prev_start_time = cpu_features_get_time_usec() ;
|
global->menu.prev_start_time = cpu_features_get_time_usec() ;
|
||||||
global->menu.prev_action = action ;
|
global->menu.prev_action = action;
|
||||||
global->menu.action_press_time = 0 ;
|
global->menu.action_press_time = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,6 @@ static const QString qt_theme_dark_stylesheet = QStringLiteral(""
|
|||||||
"}\n"
|
"}\n"
|
||||||
"QPushButton[flat=\"true\"] {\n"
|
"QPushButton[flat=\"true\"] {\n"
|
||||||
" background-color: transparent;\n"
|
" background-color: transparent;\n"
|
||||||
" border: 1px solid #ddd;\n"
|
|
||||||
"}\n"
|
"}\n"
|
||||||
"QRadioButton::indicator {\n"
|
"QRadioButton::indicator {\n"
|
||||||
" width:18px;\n"
|
" width:18px;\n"
|
||||||
|
@ -217,6 +217,19 @@ FileDropWidget::FileDropWidget(QWidget *parent) :
|
|||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FileDropWidget::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
QStyleOption o;
|
||||||
|
QPainter p;
|
||||||
|
o.initFrom(this);
|
||||||
|
p.begin(this);
|
||||||
|
style()->drawPrimitive(
|
||||||
|
QStyle::PE_Widget, &o, &p, this);
|
||||||
|
p.end();
|
||||||
|
|
||||||
|
QWidget::paintEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
void FileDropWidget::keyPressEvent(QKeyEvent *event)
|
void FileDropWidget::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
if (event->key() == Qt::Key_Delete)
|
if (event->key() == Qt::Key_Delete)
|
||||||
@ -380,7 +393,14 @@ PlaylistEntryDialog::PlaylistEntryDialog(MainWindow *mainwindow, QWidget *parent
|
|||||||
QFormLayout *form = new QFormLayout();
|
QFormLayout *form = new QFormLayout();
|
||||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
QVBoxLayout *databaseVBoxLayout = new QVBoxLayout();
|
QVBoxLayout *databaseVBoxLayout = new QVBoxLayout();
|
||||||
|
QHBoxLayout *pathHBoxLayout = new QHBoxLayout();
|
||||||
QLabel *databaseLabel = new QLabel(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FOR_THUMBNAILS), this);
|
QLabel *databaseLabel = new QLabel(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FOR_THUMBNAILS), this);
|
||||||
|
QToolButton *pathPushButton = new QToolButton(this);
|
||||||
|
|
||||||
|
pathPushButton->setText("...");
|
||||||
|
|
||||||
|
pathHBoxLayout->addWidget(m_pathLineEdit);
|
||||||
|
pathHBoxLayout->addWidget(pathPushButton);
|
||||||
|
|
||||||
databaseVBoxLayout->addWidget(m_databaseComboBox);
|
databaseVBoxLayout->addWidget(m_databaseComboBox);
|
||||||
databaseVBoxLayout->addWidget(databaseLabel);
|
databaseVBoxLayout->addWidget(databaseLabel);
|
||||||
@ -399,13 +419,25 @@ PlaylistEntryDialog::PlaylistEntryDialog(MainWindow *mainwindow, QWidget *parent
|
|||||||
connect(this, SIGNAL(rejected()), this, SLOT(onRejected()));
|
connect(this, SIGNAL(rejected()), this, SLOT(onRejected()));
|
||||||
|
|
||||||
form->addRow(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLAYLIST_ENTRY_NAME), m_nameLineEdit);
|
form->addRow(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLAYLIST_ENTRY_NAME), m_nameLineEdit);
|
||||||
form->addRow(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLAYLIST_ENTRY_PATH), m_pathLineEdit);
|
form->addRow(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLAYLIST_ENTRY_PATH), pathHBoxLayout);
|
||||||
form->addRow(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLAYLIST_ENTRY_CORE), m_coreComboBox);
|
form->addRow(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLAYLIST_ENTRY_CORE), m_coreComboBox);
|
||||||
form->addRow(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLAYLIST_ENTRY_DATABASE), databaseVBoxLayout);
|
form->addRow(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLAYLIST_ENTRY_DATABASE), databaseVBoxLayout);
|
||||||
|
|
||||||
qobject_cast<QVBoxLayout*>(layout())->addLayout(form);
|
qobject_cast<QVBoxLayout*>(layout())->addLayout(form);
|
||||||
layout()->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
layout()->addItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||||
layout()->addWidget(buttonBox);
|
layout()->addWidget(buttonBox);
|
||||||
|
|
||||||
|
connect(pathPushButton, SIGNAL(clicked()), this, SLOT(onPathClicked()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlaylistEntryDialog::onPathClicked()
|
||||||
|
{
|
||||||
|
QString filePath = QFileDialog::getOpenFileName(this);
|
||||||
|
|
||||||
|
if (filePath.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_pathLineEdit->setText(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaylistEntryDialog::loadPlaylistOptions()
|
void PlaylistEntryDialog::loadPlaylistOptions()
|
||||||
@ -1146,14 +1178,21 @@ void MainWindow::addFilesToPlaylist(QStringList files)
|
|||||||
playlist_t *playlist = NULL;
|
playlist_t *playlist = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (files.count() == 1)
|
/* Assume a blank list means we will manually enter in all fields. */
|
||||||
|
if (files.isEmpty())
|
||||||
|
{
|
||||||
|
/* Make sure hash isn't blank, that would mean there's multiple entries to add at once. */
|
||||||
|
itemToAdd["label"] = "";
|
||||||
|
itemToAdd["path"] = "";
|
||||||
|
}
|
||||||
|
else if (files.count() == 1)
|
||||||
{
|
{
|
||||||
QString path = files.at(0);
|
QString path = files.at(0);
|
||||||
QFileInfo info(path);
|
QFileInfo info(path);
|
||||||
|
|
||||||
if (info.isFile())
|
if (info.isFile())
|
||||||
{
|
{
|
||||||
itemToAdd["label"] = info.baseName();
|
itemToAdd["label"] = info.completeBaseName();
|
||||||
itemToAdd["path"] = path;
|
itemToAdd["path"] = path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1192,6 +1231,16 @@ void MainWindow::addFilesToPlaylist(QStringList files)
|
|||||||
dialog.reset(new QProgressDialog(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_GATHERING_LIST_OF_FILES), "Cancel", 0, 0, this));
|
dialog.reset(new QProgressDialog(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_GATHERING_LIST_OF_FILES), "Cancel", 0, 0, this));
|
||||||
dialog->setWindowModality(Qt::ApplicationModal);
|
dialog->setWindowModality(Qt::ApplicationModal);
|
||||||
|
|
||||||
|
if (selectedName.isEmpty() || selectedPath.isEmpty() ||
|
||||||
|
selectedDatabase.isEmpty())
|
||||||
|
{
|
||||||
|
ui_window.qtWindow->showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_PLEASE_FILL_OUT_REQUIRED_FIELDS), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (files.isEmpty())
|
||||||
|
files.append(selectedPath);
|
||||||
|
|
||||||
for (i = 0; i < files.count(); i++)
|
for (i = 0; i < files.count(); i++)
|
||||||
{
|
{
|
||||||
QString path(files.at(i));
|
QString path(files.at(i));
|
||||||
@ -1211,8 +1260,12 @@ void MainWindow::addFilesToPlaylist(QStringList files)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fileInfo.isFile())
|
if (fileInfo.isFile())
|
||||||
{
|
|
||||||
list.append(fileInfo.absoluteFilePath());
|
list.append(fileInfo.absoluteFilePath());
|
||||||
|
else if (files.count() == 1)
|
||||||
|
{
|
||||||
|
/* If adding a single file, tell user that it doesn't exist. */
|
||||||
|
ui_window.qtWindow->showMessageBox(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_DOES_NOT_EXIST), MainWindow::MSGBOX_TYPE_ERROR, Qt::ApplicationModal, false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1250,12 +1303,12 @@ void MainWindow::addFilesToPlaylist(QStringList files)
|
|||||||
if (files.count() == 1 && list.count() == 1 && i == 0)
|
if (files.count() == 1 && list.count() == 1 && i == 0)
|
||||||
{
|
{
|
||||||
fileBaseNameArray = selectedName.toUtf8();
|
fileBaseNameArray = selectedName.toUtf8();
|
||||||
pathArray = selectedPath.toUtf8();
|
pathArray = QDir::toNativeSeparators(selectedPath).toUtf8();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fileBaseNameArray = fileInfo.baseName().toUtf8();
|
fileBaseNameArray = fileInfo.completeBaseName().toUtf8();
|
||||||
pathArray = fileName.toUtf8();
|
pathArray = QDir::toNativeSeparators(fileName).toUtf8();
|
||||||
}
|
}
|
||||||
|
|
||||||
fileNameNoExten = fileBaseNameArray.constData();
|
fileNameNoExten = fileBaseNameArray.constData();
|
||||||
@ -1272,7 +1325,7 @@ void MainWindow::addFilesToPlaylist(QStringList files)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
corePathArray = selectedCore.value("core_path").toUtf8();
|
corePathArray = QDir::toNativeSeparators(selectedCore.value("core_path")).toUtf8();
|
||||||
coreNameArray = selectedCore.value("core_name").toUtf8();
|
coreNameArray = selectedCore.value("core_name").toUtf8();
|
||||||
corePathData = corePathArray.constData();
|
corePathData = corePathArray.constData();
|
||||||
coreNameData = coreNameArray.constData();
|
coreNameData = coreNameArray.constData();
|
||||||
@ -1290,7 +1343,7 @@ void MainWindow::addFilesToPlaylist(QStringList files)
|
|||||||
if (list->size == 1)
|
if (list->size == 1)
|
||||||
{
|
{
|
||||||
/* assume archives with one file should have that file loaded directly */
|
/* assume archives with one file should have that file loaded directly */
|
||||||
pathArray = (QString(pathData) + "#" + list->elems[0].data).toUtf8();
|
pathArray = QDir::toNativeSeparators(QString(pathData) + "#" + list->elems[0].data).toUtf8();
|
||||||
pathData = pathArray.constData();
|
pathData = pathArray.constData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1592,10 +1645,10 @@ bool MainWindow::updateCurrentPlaylistEntry(const QHash<QString, QString> &conte
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
playlistPathArray = playlistPath.toUtf8();
|
playlistPathArray = playlistPath.toUtf8();
|
||||||
pathArray = path.toUtf8();
|
pathArray = QDir::toNativeSeparators(path).toUtf8();
|
||||||
labelArray = label.toUtf8();
|
labelArray = label.toUtf8();
|
||||||
coreNameArray = coreName.toUtf8();
|
coreNameArray = coreName.toUtf8();
|
||||||
corePathArray = corePath.toUtf8();
|
corePathArray = QDir::toNativeSeparators(corePath).toUtf8();
|
||||||
dbNameArray = (dbName + file_path_str(FILE_PATH_LPL_EXTENSION)).toUtf8();
|
dbNameArray = (dbName + file_path_str(FILE_PATH_LPL_EXTENSION)).toUtf8();
|
||||||
crc32Array = crc32.toUtf8();
|
crc32Array = crc32.toUtf8();
|
||||||
|
|
||||||
@ -1607,6 +1660,23 @@ bool MainWindow::updateCurrentPlaylistEntry(const QHash<QString, QString> &conte
|
|||||||
dbNameData = dbNameArray.constData();
|
dbNameData = dbNameArray.constData();
|
||||||
crc32Data = crc32Array.constData();
|
crc32Data = crc32Array.constData();
|
||||||
|
|
||||||
|
if (path_is_compressed_file(pathData))
|
||||||
|
{
|
||||||
|
struct string_list *list = file_archive_get_file_list(pathData, NULL);
|
||||||
|
|
||||||
|
if (list)
|
||||||
|
{
|
||||||
|
if (list->size == 1)
|
||||||
|
{
|
||||||
|
/* assume archives with one file should have that file loaded directly */
|
||||||
|
pathArray = QDir::toNativeSeparators(QString(pathData) + "#" + list->elems[0].data).toUtf8();
|
||||||
|
pathData = pathArray.constData();
|
||||||
|
}
|
||||||
|
|
||||||
|
string_list_free(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
playlist = playlist_init(playlistPathData, COLLECTION_SIZE);
|
playlist = playlist_init(playlistPathData, COLLECTION_SIZE);
|
||||||
|
|
||||||
playlist_update(playlist, index, pathData, labelData,
|
playlist_update(playlist, index, pathData, labelData,
|
||||||
@ -1622,6 +1692,7 @@ bool MainWindow::updateCurrentPlaylistEntry(const QHash<QString, QString> &conte
|
|||||||
void MainWindow::onFileDropWidgetContextMenuRequested(const QPoint &pos)
|
void MainWindow::onFileDropWidgetContextMenuRequested(const QPoint &pos)
|
||||||
{
|
{
|
||||||
QScopedPointer<QMenu> menu;
|
QScopedPointer<QMenu> menu;
|
||||||
|
QScopedPointer<QAction> addEntryAction;
|
||||||
QScopedPointer<QAction> addFilesAction;
|
QScopedPointer<QAction> addFilesAction;
|
||||||
QScopedPointer<QAction> addFolderAction;
|
QScopedPointer<QAction> addFolderAction;
|
||||||
QScopedPointer<QAction> editAction;
|
QScopedPointer<QAction> editAction;
|
||||||
@ -1632,11 +1703,13 @@ void MainWindow::onFileDropWidgetContextMenuRequested(const QPoint &pos)
|
|||||||
|
|
||||||
menu.reset(new QMenu(this));
|
menu.reset(new QMenu(this));
|
||||||
|
|
||||||
|
addEntryAction.reset(new QAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_ADD_ENTRY)), this));
|
||||||
addFilesAction.reset(new QAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_ADD_FILES)), this));
|
addFilesAction.reset(new QAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_ADD_FILES)), this));
|
||||||
addFolderAction.reset(new QAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_ADD_FOLDER)), this));
|
addFolderAction.reset(new QAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_ADD_FOLDER)), this));
|
||||||
editAction.reset(new QAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_EDIT)), this));
|
editAction.reset(new QAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_EDIT)), this));
|
||||||
deleteAction.reset(new QAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_DELETE)), this));
|
deleteAction.reset(new QAction(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_DELETE)), this));
|
||||||
|
|
||||||
|
menu->addAction(addEntryAction.data());
|
||||||
menu->addAction(addFilesAction.data());
|
menu->addAction(addFilesAction.data());
|
||||||
menu->addAction(addFolderAction.data());
|
menu->addAction(addFolderAction.data());
|
||||||
|
|
||||||
@ -1658,6 +1731,10 @@ void MainWindow::onFileDropWidgetContextMenuRequested(const QPoint &pos)
|
|||||||
if (!filePaths.isEmpty())
|
if (!filePaths.isEmpty())
|
||||||
addFilesToPlaylist(filePaths);
|
addFilesToPlaylist(filePaths);
|
||||||
}
|
}
|
||||||
|
else if (selectedAction == addEntryAction.data())
|
||||||
|
{
|
||||||
|
addFilesToPlaylist(QStringList());
|
||||||
|
}
|
||||||
else if (selectedAction == addFolderAction.data())
|
else if (selectedAction == addFolderAction.data())
|
||||||
{
|
{
|
||||||
QString dirPath = QFileDialog::getExistingDirectory(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_SELECT_FOLDER), QString(), QFileDialog::ShowDirsOnly);
|
QString dirPath = QFileDialog::getExistingDirectory(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_SELECT_FOLDER), QString(), QFileDialog::ShowDirsOnly);
|
||||||
@ -2650,7 +2727,7 @@ void MainWindow::selectBrowserDir(QString path)
|
|||||||
|
|
||||||
hash["path"] = filePath;
|
hash["path"] = filePath;
|
||||||
hash["label"] = hash["path"];
|
hash["label"] = hash["path"];
|
||||||
hash["label_noext"] = fileInfo.fileName().remove(QString(".") + fileInfo.completeSuffix());
|
hash["label_noext"] = fileInfo.completeBaseName();
|
||||||
hash["db_name"] = fileInfo.dir().dirName();
|
hash["db_name"] = fileInfo.dir().dirName();
|
||||||
|
|
||||||
item->setData(Qt::UserRole, QVariant::fromValue<QHash<QString, QString> >(hash));
|
item->setData(Qt::UserRole, QVariant::fromValue<QHash<QString, QString> >(hash));
|
||||||
@ -2987,13 +3064,20 @@ void MainWindow::onRunClicked()
|
|||||||
ViewType viewType = getCurrentViewType();
|
ViewType viewType = getCurrentViewType();
|
||||||
QHash<QString, QString> contentHash;
|
QHash<QString, QString> contentHash;
|
||||||
|
|
||||||
if (!item)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (viewType == VIEW_TYPE_LIST)
|
if (viewType == VIEW_TYPE_LIST)
|
||||||
|
{
|
||||||
|
if (!item)
|
||||||
|
return;
|
||||||
|
|
||||||
contentHash = item->data(Qt::UserRole).value<QHash<QString, QString> >();
|
contentHash = item->data(Qt::UserRole).value<QHash<QString, QString> >();
|
||||||
|
}
|
||||||
else if (viewType == VIEW_TYPE_ICONS)
|
else if (viewType == VIEW_TYPE_ICONS)
|
||||||
|
{
|
||||||
contentHash = m_currentGridHash;
|
contentHash = m_currentGridHash;
|
||||||
|
|
||||||
|
if (contentHash.isEmpty())
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -153,6 +153,7 @@ protected:
|
|||||||
void dragEnterEvent(QDragEnterEvent *event);
|
void dragEnterEvent(QDragEnterEvent *event);
|
||||||
void dropEvent(QDropEvent *event);
|
void dropEvent(QDropEvent *event);
|
||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
void paintEvent(QPaintEvent *event);
|
||||||
};
|
};
|
||||||
|
|
||||||
class TableWidget : public QTableWidget
|
class TableWidget : public QTableWidget
|
||||||
@ -196,6 +197,8 @@ public slots:
|
|||||||
void hideDialog();
|
void hideDialog();
|
||||||
void onAccepted();
|
void onAccepted();
|
||||||
void onRejected();
|
void onRejected();
|
||||||
|
private slots:
|
||||||
|
void onPathClicked();
|
||||||
private:
|
private:
|
||||||
void loadPlaylistOptions();
|
void loadPlaylistOptions();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user