(UI/QT) Fix Travis OSX build hopefully

This commit is contained in:
twinaphex 2019-04-16 00:46:27 +02:00
parent bd843857de
commit 1baebdbd47
11 changed files with 142 additions and 132 deletions

View File

@ -78,7 +78,6 @@ UI
#include "../ui/drivers/qt/options/ui.cpp"
#include "../ui/drivers/qt/options/achievements.cpp"
#include "../ui/drivers/qt/options/network.cpp"
#include "../ui/drivers/qt/moc_settingswidgets.cpp"
#include "../ui/drivers/qt/options/moc_options.cpp"
#endif
#include "../ui/drivers/moc_ui_qt.cpp"

View File

@ -27,7 +27,8 @@ QWidget *ConfigurationPage::widget()
QWidget *widget = new QWidget;
FormLayout *layout = new FormLayout;
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
unsigned count = menu_displaylist_build_list(
menu_displaylist_build_list(
list, DISPLAYLIST_CONFIGURATION_SETTINGS_LIST);
for (i = 0; i < list->size; i++)

View File

@ -27,7 +27,8 @@ QWidget *CorePage::widget()
QWidget *widget = new QWidget;
FormLayout *layout = new FormLayout;
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
unsigned count = menu_displaylist_build_list(
menu_displaylist_build_list(
list, DISPLAYLIST_CORE_SETTINGS_LIST);
for (i = 0; i < list->size; i++)

View File

@ -27,7 +27,8 @@ QWidget *DirectoryPage::widget()
QWidget *widget = new QWidget;
FormLayout *layout = new FormLayout;
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
unsigned count = menu_displaylist_build_list(
menu_displaylist_build_list(
list, DISPLAYLIST_DIRECTORY_SETTINGS_LIST);
for (i = 0; i < list->size; i++)

View File

@ -28,7 +28,8 @@ QWidget *DriversPage::widget()
QWidget *widget = new QWidget;
FormLayout *layout = new FormLayout;
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
unsigned count = menu_displaylist_build_list(
menu_displaylist_build_list(
list, DISPLAYLIST_DRIVER_SETTINGS_LIST);
for (i = 0; i < list->size; i++)

View File

@ -107,7 +107,6 @@ UserBindsPage::UserBindsPage(QObject *parent) :
QWidget *UserBindsPage::widget()
{
unsigned p, retro_id;
unsigned count = 0;
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
QWidget *widget = new QWidget;
QGridLayout *layout = new QGridLayout;

View File

@ -27,7 +27,8 @@ QWidget *LoggingPage::widget()
QWidget *widget = new QWidget;
FormLayout *layout = new FormLayout;
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
unsigned count = menu_displaylist_build_list(
menu_displaylist_build_list(
list, DISPLAYLIST_LOGGING_SETTINGS_LIST);
for (i = 0; i < list->size; i++)

View File

@ -29,7 +29,8 @@ QWidget *FrameThrottlePage::widget()
QWidget *widget = new QWidget;
FormLayout *layout = new FormLayout;
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
unsigned count = menu_displaylist_build_list(
menu_displaylist_build_list(
list, DISPLAYLIST_FRAME_THROTTLE_SETTINGS_LIST);
for (i = 0; i < list->size; i++)
@ -59,7 +60,8 @@ QWidget *RewindPage::widget()
QWidget *widget = new QWidget;
FormLayout *layout = new FormLayout;
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
unsigned count = menu_displaylist_build_list(
menu_displaylist_build_list(
list, DISPLAYLIST_REWIND_SETTINGS_LIST);
for (i = 0; i < list->size; i++)

View File

@ -164,7 +164,8 @@ QWidget *QuickMenuPage::widget()
QWidget * widget = new QWidget;
FormLayout *layout = new FormLayout;
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
unsigned count = menu_displaylist_build_list(
menu_displaylist_build_list(
list, DISPLAYLIST_QUICK_MENU_VIEWS_SETTINGS_LIST);
for (i = 0; i < list->size; i++)
@ -193,10 +194,9 @@ QWidget *AppearancePage::widget()
unsigned i;
QWidget * widget = new QWidget;
FormLayout *layout = new FormLayout;
rarch_setting_t *thumbnails = menu_setting_find_enum(
MENU_ENUM_LABEL_THUMBNAILS);
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
unsigned count = menu_displaylist_build_list(
menu_displaylist_build_list(
list, DISPLAYLIST_MENU_SETTINGS_LIST);
/* TODO/FIXME - we haven't yet figured out how to
@ -233,58 +233,63 @@ QWidget *AppearancePage::widget()
file_list_free(list);
#if 0
layout->add(MENU_ENUM_LABEL_MENU_WALLPAPER);
layout->add(MENU_ENUM_LABEL_DYNAMIC_WALLPAPER);
layout->add(MENU_ENUM_LABEL_MENU_WALLPAPER_OPACITY);
layout->add(MENU_ENUM_LABEL_MENU_FRAMEBUFFER_OPACITY);
layout->add(MENU_ENUM_LABEL_MENU_HORIZONTAL_ANIMATION);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_ENABLE);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_FULL_WIDTH_LAYOUT);
layout->add(MENU_ENUM_LABEL_MENU_LINEAR_FILTER);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_INTERNAL_UPSCALE_LEVEL);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_ASPECT_RATIO_LOCK);
layout->add(MENU_ENUM_LABEL_RGUI_MENU_COLOR_THEME);
layout->add(MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET);
layout->add(MENU_ENUM_LABEL_DPI_OVERRIDE_ENABLE);
layout->add(MENU_ENUM_LABEL_DPI_OVERRIDE_VALUE);
layout->add(MENU_ENUM_LABEL_XMB_ALPHA_FACTOR);
layout->add(MENU_ENUM_LABEL_XMB_SCALE_FACTOR);
layout->add(MENU_ENUM_LABEL_XMB_FONT);
layout->addUIntColorButton("Menu Font Color: ",
MENU_ENUM_LABEL_MENU_FONT_COLOR_RED,
MENU_ENUM_LABEL_MENU_FONT_COLOR_GREEN,
MENU_ENUM_LABEL_MENU_FONT_COLOR_BLUE);
layout->add(MENU_ENUM_LABEL_XMB_LAYOUT);
layout->add(MENU_ENUM_LABEL_XMB_THEME);
layout->add(MENU_ENUM_LABEL_XMB_SHADOWS_ENABLE);
layout->add(MENU_ENUM_LABEL_XMB_RIBBON_ENABLE);
layout->add(MENU_ENUM_LABEL_XMB_MENU_COLOR_THEME);
layout->add(MENU_ENUM_LABEL_OZONE_MENU_COLOR_THEME);
layout->add(MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE);
layout->add(MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME);
layout->add(MENU_ENUM_LABEL_MATERIALUI_MENU_HEADER_OPACITY);
layout->add(MENU_ENUM_LABEL_MATERIALUI_MENU_FOOTER_OPACITY);
layout->add(MENU_ENUM_LABEL_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME);
if (thumbnails)
{
QHBoxLayout *thumbsLayout = new QHBoxLayout;
rarch_setting_t *leftThumbnails = menu_setting_find_enum(MENU_ENUM_LABEL_LEFT_THUMBNAILS);
rarch_setting_t *thumbnails = menu_setting_find_enum(
MENU_ENUM_LABEL_THUMBNAILS);
thumbsLayout->addWidget(new UIntRadioButtons(thumbnails));
layout->add(MENU_ENUM_LABEL_MENU_WALLPAPER);
layout->add(MENU_ENUM_LABEL_DYNAMIC_WALLPAPER);
layout->add(MENU_ENUM_LABEL_MENU_WALLPAPER_OPACITY);
layout->add(MENU_ENUM_LABEL_MENU_FRAMEBUFFER_OPACITY);
layout->add(MENU_ENUM_LABEL_MENU_HORIZONTAL_ANIMATION);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_BACKGROUND_FILLER_THICKNESS_ENABLE);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_ENABLE);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_BORDER_FILLER_THICKNESS_ENABLE);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_FULL_WIDTH_LAYOUT);
layout->add(MENU_ENUM_LABEL_MENU_LINEAR_FILTER);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_INTERNAL_UPSCALE_LEVEL);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_ASPECT_RATIO_LOCK);
layout->add(MENU_ENUM_LABEL_RGUI_MENU_COLOR_THEME);
layout->add(MENU_ENUM_LABEL_RGUI_MENU_THEME_PRESET);
layout->add(MENU_ENUM_LABEL_DPI_OVERRIDE_ENABLE);
layout->add(MENU_ENUM_LABEL_DPI_OVERRIDE_VALUE);
layout->add(MENU_ENUM_LABEL_XMB_ALPHA_FACTOR);
layout->add(MENU_ENUM_LABEL_XMB_SCALE_FACTOR);
layout->add(MENU_ENUM_LABEL_XMB_FONT);
layout->addUIntColorButton("Menu Font Color: ",
MENU_ENUM_LABEL_MENU_FONT_COLOR_RED,
MENU_ENUM_LABEL_MENU_FONT_COLOR_GREEN,
MENU_ENUM_LABEL_MENU_FONT_COLOR_BLUE);
layout->add(MENU_ENUM_LABEL_XMB_LAYOUT);
layout->add(MENU_ENUM_LABEL_XMB_THEME);
layout->add(MENU_ENUM_LABEL_XMB_SHADOWS_ENABLE);
layout->add(MENU_ENUM_LABEL_XMB_RIBBON_ENABLE);
layout->add(MENU_ENUM_LABEL_XMB_MENU_COLOR_THEME);
layout->add(MENU_ENUM_LABEL_OZONE_MENU_COLOR_THEME);
layout->add(MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE);
layout->add(MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME);
layout->add(MENU_ENUM_LABEL_MATERIALUI_MENU_HEADER_OPACITY);
layout->add(MENU_ENUM_LABEL_MATERIALUI_MENU_FOOTER_OPACITY);
layout->add(MENU_ENUM_LABEL_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME);
if (leftThumbnails)
thumbsLayout->addWidget(new UIntRadioButtons(leftThumbnails));
if (thumbnails)
{
QHBoxLayout *thumbsLayout = new QHBoxLayout;
rarch_setting_t *leftThumbnails = menu_setting_find_enum(MENU_ENUM_LABEL_LEFT_THUMBNAILS);
layout->addRow(thumbsLayout);
thumbsLayout->addWidget(new UIntRadioButtons(thumbnails));
if (leftThumbnails)
thumbsLayout->addWidget(new UIntRadioButtons(leftThumbnails));
layout->addRow(thumbsLayout);
}
layout->add(MENU_ENUM_LABEL_XMB_VERTICAL_THUMBNAILS);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_THUMBNAIL_DOWNSCALER);
layout->add(MENU_ENUM_LABEL_MENU_TICKER_TYPE);
layout->add(MENU_ENUM_LABEL_MENU_TICKER_SPEED);
}
layout->add(MENU_ENUM_LABEL_XMB_VERTICAL_THUMBNAILS);
layout->add(MENU_ENUM_LABEL_MENU_RGUI_THUMBNAIL_DOWNSCALER);
layout->add(MENU_ENUM_LABEL_MENU_TICKER_TYPE);
layout->add(MENU_ENUM_LABEL_MENU_TICKER_SPEED);
#endif
widget->setLayout(layout);

View File

@ -2070,9 +2070,9 @@ ViewOptionsDialog* MainWindow::viewOptionsDialog()
void MainWindow::setCoreActions()
{
QListWidgetItem *currentPlaylistItem = m_listWidget->currentItem();
ViewType viewType = getCurrentViewType();
QHash<QString, QString> hash = getCurrentContentHash();
QString currentPlaylistFileName = QString();
ViewType viewType = getCurrentViewType();
QHash<QString, QString> hash = getCurrentContentHash();
QString currentPlaylistFileName = QString();
m_launchWithComboBox->clear();
@ -2097,9 +2097,7 @@ void MainWindow::setCoreActions()
QString coreName = hash["core_name"];
if (coreName.isEmpty())
{
coreName = "<n/a>";
}
else
{
const char *detect_str = file_path_str(FILE_PATH_DETECT);
@ -2882,9 +2880,8 @@ void MainWindow::onLoadCoreClicked(const QStringList &extensionFilters)
void MainWindow::initContentTableWidget()
{
QListWidgetItem *item = m_listWidget->currentItem();
QString path;
int i = 0;
QListWidgetItem *item = m_listWidget->currentItem();
if (!item)
return;
@ -2904,10 +2901,10 @@ void MainWindow::initContentTableWidget()
if (path == ALL_PLAYLISTS_TOKEN)
{
unsigned i;
settings_t *settings = config_get_ptr();
QDir playlistDir(settings->paths.directory_playlist);
QStringList playlists;
int i = 0;
for (i = 0; i < m_playlistFiles.count(); i++)
{
@ -2933,12 +2930,13 @@ void MainWindow::initContentTableWidget()
void MainWindow::updateItemsCount()
{
m_itemsCountLabel->setText(m_itemsCountLiteral.arg(m_proxyModel->rowCount()));
m_itemsCountLabel->setText(
m_itemsCountLiteral.arg(m_proxyModel->rowCount()));
}
void MainWindow::keyPressEvent(QKeyEvent *event)
{
/*
#if 0
if (event->key() == Qt::Key_F5)
{
event->accept();
@ -2946,7 +2944,7 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
return;
}
*/
#endif
QMainWindow::keyPressEvent(event);
}

View File

@ -97,7 +97,9 @@ void ThumbnailWidget::dragEnterEvent(QDragEnterEvent *event)
event->acceptProposedAction();
}
/* Workaround for QTBUG-72844. Without it, you can't drop on this if you first drag over another widget that doesn't accept drops. */
/* Workaround for QTBUG-72844. Without it, you can't
* drop on this if you first drag over another
* widget that doesn't accept drops. */
void ThumbnailWidget::dragMoveEvent(QDragMoveEvent *event)
{
event->acceptProposedAction();
@ -155,10 +157,10 @@ QSize ThumbnailLabel::sizeHint() const
void ThumbnailLabel::paintEvent(QPaintEvent *event)
{
int w = width();
int h = height();
QStyleOption o;
QPainter p;
int w = width();
int h = height();
event->accept();
@ -234,70 +236,70 @@ static void ui_companion_qt_deinit(void *data)
static void* ui_companion_qt_init(void)
{
ui_companion_qt_t *handle = (ui_companion_qt_t*)calloc(1, sizeof(*handle));
MainWindow *mainwindow = NULL;
QHBoxLayout *browserButtonsHBoxLayout = NULL;
QVBoxLayout *layout = NULL;
QVBoxLayout *playlistViewsLayout = NULL;
QVBoxLayout *launchWithWidgetLayout = NULL;
QHBoxLayout *coreComboBoxLayout = NULL;
QMenuBar *menu = NULL;
QDesktopWidget *desktop = NULL;
QMenu *fileMenu = NULL;
QMenu *editMenu = NULL;
QMenu *viewMenu = NULL;
QMenu *viewClosedDocksMenu = NULL;
#ifdef Q_OS_WIN
QMenu *toolsMenu = NULL;
QMenu *updaterMenu = NULL;
#endif
QMenu *helpMenu = NULL;
QRect desktopRect;
QDockWidget *thumbnailDock = NULL;
QDockWidget *thumbnail2Dock = NULL;
QDockWidget *thumbnail3Dock = NULL;
QDockWidget *browserAndPlaylistTabDock = NULL;
QDockWidget *coreSelectionDock = NULL;
QTabWidget *browserAndPlaylistTabWidget = NULL;
QStackedWidget *centralWidget = NULL;
QStackedWidget *widget = NULL;
QFrame *browserWidget = NULL;
QFrame *playlistWidget = NULL;
QWidget *coreSelectionWidget = NULL;
QWidget *launchWithWidget = NULL;
ThumbnailWidget *thumbnailWidget = NULL;
ThumbnailWidget *thumbnail2Widget = NULL;
ThumbnailWidget *thumbnail3Widget = NULL;
QPushButton *browserDownloadsButton = NULL;
QPushButton *browserUpButton = NULL;
QPushButton *browserStartButton = NULL;
ThumbnailLabel *thumbnail = NULL;
ThumbnailLabel *thumbnail2 = NULL;
ThumbnailLabel *thumbnail3 = NULL;
QAction *editSearchAction = NULL;
QAction *loadCoreAction = NULL;
QAction *unloadCoreAction = NULL;
QAction *exitAction = NULL;
QComboBox *launchWithComboBox = NULL;
QSettings *qsettings = NULL;
QListWidget *listWidget = NULL;
QString initialPlaylist;
bool foundPlaylist = false;
int i = 0;
QString initialPlaylist;
QRect desktopRect;
ui_companion_qt_t *handle = (ui_companion_qt_t*)
calloc(1, sizeof(*handle));
MainWindow *mainwindow = NULL;
QHBoxLayout *browserButtonsHBoxLayout = NULL;
QVBoxLayout *layout = NULL;
QVBoxLayout *launchWithWidgetLayout = NULL;
QHBoxLayout *coreComboBoxLayout = NULL;
QMenuBar *menu = NULL;
QDesktopWidget *desktop = NULL;
QMenu *fileMenu = NULL;
QMenu *editMenu = NULL;
QMenu *viewMenu = NULL;
QMenu *viewClosedDocksMenu = NULL;
#ifdef Q_OS_WIN
QMenu *toolsMenu = NULL;
QMenu *updaterMenu = NULL;
#endif
QMenu *helpMenu = NULL;
QDockWidget *thumbnailDock = NULL;
QDockWidget *thumbnail2Dock = NULL;
QDockWidget *thumbnail3Dock = NULL;
QDockWidget *browserAndPlaylistTabDock = NULL;
QDockWidget *coreSelectionDock = NULL;
QTabWidget *browserAndPlaylistTabWidget = NULL;
QStackedWidget *centralWidget = NULL;
QStackedWidget *widget = NULL;
QFrame *browserWidget = NULL;
QFrame *playlistWidget = NULL;
QWidget *coreSelectionWidget = NULL;
QWidget *launchWithWidget = NULL;
ThumbnailWidget *thumbnailWidget = NULL;
ThumbnailWidget *thumbnail2Widget = NULL;
ThumbnailWidget *thumbnail3Widget = NULL;
QPushButton *browserDownloadsButton = NULL;
QPushButton *browserUpButton = NULL;
QPushButton *browserStartButton = NULL;
ThumbnailLabel *thumbnail = NULL;
ThumbnailLabel *thumbnail2 = NULL;
ThumbnailLabel *thumbnail3 = NULL;
QAction *editSearchAction = NULL;
QAction *loadCoreAction = NULL;
QAction *unloadCoreAction = NULL;
QAction *exitAction = NULL;
QComboBox *launchWithComboBox = NULL;
QSettings *qsettings = NULL;
QListWidget *listWidget = NULL;
bool foundPlaylist = false;
if (!handle)
return NULL;
handle->app = static_cast<ui_application_qt_t*>(ui_application_qt.initialize());
handle->window = static_cast<ui_window_qt_t*>(ui_window_qt.init());
handle->app = static_cast<ui_application_qt_t*>
(ui_application_qt.initialize());
handle->window = static_cast<ui_window_qt_t*>(ui_window_qt.init());
desktop = qApp->desktop();
desktopRect = desktop->availableGeometry();
desktop = qApp->desktop();
desktopRect = desktop->availableGeometry();
mainwindow = handle->window->qtWindow;
mainwindow = handle->window->qtWindow;
qsettings = mainwindow->settings();
qsettings = mainwindow->settings();
initialPlaylist = qsettings->value("initial_playlist", mainwindow->getSpecialPlaylistPath(SPECIAL_PLAYLIST_HISTORY)).toString();
@ -307,9 +309,9 @@ static void* ui_companion_qt_init(void)
mainwindow->setWindowTitle("RetroArch");
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);
QObject::connect(widget, SIGNAL(filesDropped(QStringList)), mainwindow, SLOT(onPlaylistFilesDropped(QStringList)));