(QT/UI) Cleanups
This commit is contained in:
parent
254c48707d
commit
c662da11c3
|
@ -284,9 +284,7 @@ void CoreOptionsDialog::buildLayout()
|
||||||
comboBox = new QComboBox(this);
|
comboBox = new QComboBox(this);
|
||||||
|
|
||||||
for (k = 0; k < option->vals->size; k++)
|
for (k = 0; k < option->vals->size; k++)
|
||||||
{
|
|
||||||
comboBox->addItem(option->vals->elems[k].data, option->key);
|
comboBox->addItem(option->vals->elems[k].data, option->key);
|
||||||
}
|
|
||||||
|
|
||||||
comboBox->setCurrentText(val);
|
comboBox->setCurrentText(val);
|
||||||
|
|
||||||
|
|
|
@ -178,29 +178,32 @@ void MainWindow::onFileDropWidgetContextMenuRequested(const QPoint &pos)
|
||||||
{
|
{
|
||||||
if (selectedAction == addFilesAction.data())
|
if (selectedAction == addFilesAction.data())
|
||||||
{
|
{
|
||||||
QStringList filePaths = QFileDialog::getOpenFileNames(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_SELECT_FILES));
|
QStringList filePaths = QFileDialog::getOpenFileNames(
|
||||||
|
this,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_SELECT_FILES));
|
||||||
|
|
||||||
if (!filePaths.isEmpty())
|
if (!filePaths.isEmpty())
|
||||||
addFilesToPlaylist(filePaths);
|
addFilesToPlaylist(filePaths);
|
||||||
}
|
}
|
||||||
else if (selectedAction == addEntryAction.data())
|
else if (selectedAction == addEntryAction.data())
|
||||||
{
|
|
||||||
addFilesToPlaylist(QStringList());
|
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);
|
||||||
|
|
||||||
if (!dirPath.isEmpty())
|
if (!dirPath.isEmpty())
|
||||||
addFilesToPlaylist(QStringList() << dirPath);
|
addFilesToPlaylist(QStringList() << dirPath);
|
||||||
}
|
}
|
||||||
else if (selectedAction == editAction.data())
|
else if (selectedAction == editAction.data())
|
||||||
{
|
{
|
||||||
PlaylistEntryDialog *playlistDialog = playlistEntryDialog();
|
|
||||||
QHash<QString, QString> selectedCore;
|
|
||||||
QString selectedDatabase;
|
QString selectedDatabase;
|
||||||
QString selectedName;
|
QString selectedName;
|
||||||
QString selectedPath;
|
QString selectedPath;
|
||||||
|
QHash<QString, QString> selectedCore;
|
||||||
|
PlaylistEntryDialog *playlistDialog = playlistEntryDialog();
|
||||||
QString currentPlaylistPath = getCurrentPlaylistPath();
|
QString currentPlaylistPath = getCurrentPlaylistPath();
|
||||||
|
|
||||||
if (!playlistDialog->showDialog(contentHash))
|
if (!playlistDialog->showDialog(contentHash))
|
||||||
|
@ -218,9 +221,7 @@ void MainWindow::onFileDropWidgetContextMenuRequested(const QPoint &pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedDatabase.isEmpty())
|
if (selectedDatabase.isEmpty())
|
||||||
{
|
|
||||||
selectedDatabase = QFileInfo(currentPlaylistPath).fileName().remove(file_path_str(FILE_PATH_LPL_EXTENSION));
|
selectedDatabase = QFileInfo(currentPlaylistPath).fileName().remove(file_path_str(FILE_PATH_LPL_EXTENSION));
|
||||||
}
|
|
||||||
|
|
||||||
contentHash["label"] = selectedName;
|
contentHash["label"] = selectedName;
|
||||||
contentHash["path"] = selectedPath;
|
contentHash["path"] = selectedPath;
|
||||||
|
@ -235,8 +236,6 @@ void MainWindow::onFileDropWidgetContextMenuRequested(const QPoint &pos)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (selectedAction == deleteAction.data())
|
else if (selectedAction == deleteAction.data())
|
||||||
{
|
|
||||||
deleteCurrentPlaylistItem();
|
deleteCurrentPlaylistItem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -430,8 +430,10 @@ QString GridView::getLayout() const
|
||||||
return "anchored";
|
return "anchored";
|
||||||
case Centered:
|
case Centered:
|
||||||
default:
|
default:
|
||||||
return "centered";
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return "centered";
|
||||||
}
|
}
|
||||||
|
|
||||||
void GridView::setLayout(QString layout)
|
void GridView::setLayout(QString layout)
|
||||||
|
@ -480,8 +482,10 @@ QString GridItem::getThumbnailVerticalAlign() const
|
||||||
return "center";
|
return "center";
|
||||||
case Qt::AlignBottom:
|
case Qt::AlignBottom:
|
||||||
default:
|
default:
|
||||||
return "bottom";
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return "bottom";
|
||||||
}
|
}
|
||||||
|
|
||||||
void GridItem::setThumbnailVerticalAlign(const QString valign)
|
void GridItem::setThumbnailVerticalAlign(const QString valign)
|
||||||
|
|
|
@ -132,10 +132,10 @@ void PlaylistEntryDialog::loadPlaylistOptions()
|
||||||
|
|
||||||
for (i = 0; i < core_info_list->count; i++)
|
for (i = 0; i < core_info_list->count; i++)
|
||||||
{
|
{
|
||||||
|
QString ui_display_name;
|
||||||
|
QHash<QString, QString> hash;
|
||||||
const core_info_t *core = &core_info_list->list[i];
|
const core_info_t *core = &core_info_list->list[i];
|
||||||
QStringList databases = QString(core->databases).split("|");
|
QStringList databases = QString(core->databases).split("|");
|
||||||
QHash<QString, QString> hash;
|
|
||||||
QString ui_display_name;
|
|
||||||
|
|
||||||
hash["core_name"] = core->core_name;
|
hash["core_name"] = core->core_name;
|
||||||
hash["core_display_name"] = core->display_name;
|
hash["core_display_name"] = core->display_name;
|
||||||
|
@ -147,7 +147,9 @@ void PlaylistEntryDialog::loadPlaylistOptions()
|
||||||
if (ui_display_name.isEmpty())
|
if (ui_display_name.isEmpty())
|
||||||
ui_display_name = hash.value("core_display_name");
|
ui_display_name = hash.value("core_display_name");
|
||||||
if (ui_display_name.isEmpty())
|
if (ui_display_name.isEmpty())
|
||||||
ui_display_name = QFileInfo(hash.value("core_path")).fileName();
|
ui_display_name = QFileInfo(
|
||||||
|
hash.value("core_path")).fileName();
|
||||||
|
|
||||||
if (ui_display_name.isEmpty())
|
if (ui_display_name.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -191,7 +193,8 @@ bool PlaylistEntryDialog::nameFieldEnabled()
|
||||||
return m_nameLineEdit->isEnabled();
|
return m_nameLineEdit->isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaylistEntryDialog::setEntryValues(const QHash<QString, QString> &contentHash)
|
void PlaylistEntryDialog::setEntryValues(
|
||||||
|
const QHash<QString, QString> &contentHash)
|
||||||
{
|
{
|
||||||
QString db;
|
QString db;
|
||||||
QString coreName = contentHash.value("core_name");
|
QString coreName = contentHash.value("core_name");
|
||||||
|
|
|
@ -293,9 +293,7 @@ void MainWindow::downloadNextPlaylistThumbnail(QString system, QString title, QS
|
||||||
void MainWindow::downloadPlaylistThumbnails(QString playlistPath)
|
void MainWindow::downloadPlaylistThumbnails(QString playlistPath)
|
||||||
{
|
{
|
||||||
QFile playlistFile(playlistPath);
|
QFile playlistFile(playlistPath);
|
||||||
QString system;
|
QString system, title, type;
|
||||||
QString title;
|
|
||||||
QString type;
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
int i;
|
int i;
|
||||||
int count;
|
int count;
|
||||||
|
|
|
@ -94,7 +94,8 @@ Qt::ItemFlags PlaylistModel::flags(const QModelIndex &index) const
|
||||||
|
|
||||||
bool PlaylistModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
bool PlaylistModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||||
{
|
{
|
||||||
if (index.isValid() && role == Qt::EditRole) {
|
if (index.isValid() && role == Qt::EditRole)
|
||||||
|
{
|
||||||
QHash<QString, QString> hash = m_contents.at(index.row());
|
QHash<QString, QString> hash = m_contents.at(index.row());
|
||||||
|
|
||||||
hash["label"] = value.toString();
|
hash["label"] = value.toString();
|
||||||
|
@ -114,7 +115,6 @@ QVariant PlaylistModel::headerData(int section, Qt::Orientation orientation, int
|
||||||
|
|
||||||
if (orientation == Qt::Horizontal)
|
if (orientation == Qt::Horizontal)
|
||||||
return msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_NAME);
|
return msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_NAME);
|
||||||
else
|
|
||||||
return section + 1;
|
return section + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,10 +151,8 @@ bool PlaylistModel::isSupportedImage(const QString path) const
|
||||||
extensionStr = path.mid(lastIndex + 1);
|
extensionStr = path.mid(lastIndex + 1);
|
||||||
|
|
||||||
if (!extensionStr.isEmpty())
|
if (!extensionStr.isEmpty())
|
||||||
{
|
|
||||||
extension = extensionStr.toLower().toUtf8();
|
extension = extensionStr.toLower().toUtf8();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!extension.isEmpty() && m_imageFormats.contains(extension))
|
if (!extension.isEmpty() && m_imageFormats.contains(extension))
|
||||||
return true;
|
return true;
|
||||||
|
@ -174,10 +172,9 @@ QString PlaylistModel::getThumbnailPath(const QHash<QString, QString> &hash, QSt
|
||||||
/* use thumbnail widgets to show regular image files */
|
/* use thumbnail widgets to show regular image files */
|
||||||
return hash["path"];
|
return hash["path"];
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return getPlaylistThumbnailsDir(hash.value("db_name"))
|
||||||
return getPlaylistThumbnailsDir(hash.value("db_name")) + "/" + type + "/" + getSanitizedThumbnailName(hash["label_noext"]);
|
+ "/" + type + "/" + getSanitizedThumbnailName(hash["label_noext"]);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PlaylistModel::getCurrentTypeThumbnailPath(const QModelIndex &index) const
|
QString PlaylistModel::getCurrentTypeThumbnailPath(const QModelIndex &index) const
|
||||||
|
@ -191,13 +188,16 @@ QString PlaylistModel::getCurrentTypeThumbnailPath(const QModelIndex &index) con
|
||||||
case THUMBNAIL_TYPE_TITLE_SCREEN:
|
case THUMBNAIL_TYPE_TITLE_SCREEN:
|
||||||
return getThumbnailPath(index, THUMBNAIL_TITLE);
|
return getThumbnailPath(index, THUMBNAIL_TITLE);
|
||||||
default:
|
default:
|
||||||
return QString();
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaylistModel::reloadThumbnail(const QModelIndex &index)
|
void PlaylistModel::reloadThumbnail(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (index.isValid()) {
|
if (index.isValid())
|
||||||
|
{
|
||||||
reloadThumbnailPath(getCurrentTypeThumbnailPath(index));
|
reloadThumbnailPath(getCurrentTypeThumbnailPath(index));
|
||||||
loadThumbnail(index);
|
loadThumbnail(index);
|
||||||
}
|
}
|
||||||
|
@ -281,16 +281,16 @@ bool MainWindow::addDirectoryFilesToList(QProgressDialog *dialog, QStringList &l
|
||||||
if (dialog->wasCanceled())
|
if (dialog->wasCanceled())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* Needed to update progress dialog while doing
|
||||||
|
* a lot of stuff on the main thread. */
|
||||||
if (i % 25 == 0)
|
if (i % 25 == 0)
|
||||||
{
|
|
||||||
/* Needed to update progress dialog while doing a lot of stuff on the main thread. */
|
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
}
|
|
||||||
|
|
||||||
if (fileInfo.isDir())
|
if (fileInfo.isDir())
|
||||||
{
|
{
|
||||||
QDir fileInfoDir(path);
|
QDir fileInfoDir(path);
|
||||||
bool success = addDirectoryFilesToList(dialog, list, fileInfoDir, extensions);
|
bool success = addDirectoryFilesToList(
|
||||||
|
dialog, list, fileInfoDir, extensions);
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
return false;
|
return false;
|
||||||
|
@ -449,11 +449,10 @@ void MainWindow::addFilesToPlaylist(QStringList files)
|
||||||
if (dialog->wasCanceled())
|
if (dialog->wasCanceled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Needed to update progress dialog while
|
||||||
|
* doing a lot of stuff on the main thread. */
|
||||||
if (i % 25 == 0)
|
if (i % 25 == 0)
|
||||||
{
|
|
||||||
/* Needed to update progress dialog while doing a lot of stuff on the main thread. */
|
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
}
|
|
||||||
|
|
||||||
if (fileInfo.isDir())
|
if (fileInfo.isDir())
|
||||||
{
|
{
|
||||||
|
@ -517,9 +516,11 @@ void MainWindow::addFilesToPlaylist(QStringList files)
|
||||||
const char *coreNameData = NULL;
|
const char *coreNameData = NULL;
|
||||||
const char *databaseData = NULL;
|
const char *databaseData = NULL;
|
||||||
|
|
||||||
|
/* Cancel out of everything, the
|
||||||
|
* current progress will not be written
|
||||||
|
* to the playlist at all. */
|
||||||
if (dialog->wasCanceled())
|
if (dialog->wasCanceled())
|
||||||
{
|
{
|
||||||
/* Cancel out of everything, the current progress will not be written to the playlist at all. */
|
|
||||||
playlist_free(playlist);
|
playlist_free(playlist);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1202,9 +1203,7 @@ void MainWindow::reloadPlaylists()
|
||||||
if (!foundCurrent)
|
if (!foundCurrent)
|
||||||
{
|
{
|
||||||
if (foundInitial && initialItem)
|
if (foundInitial && initialItem)
|
||||||
{
|
|
||||||
m_listWidget->setCurrentItem(initialItem);
|
m_listWidget->setCurrentItem(initialItem);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* the previous playlist must be gone now, just select the first one */
|
/* the previous playlist must be gone now, just select the first one */
|
||||||
|
@ -1218,8 +1217,8 @@ void MainWindow::reloadPlaylists()
|
||||||
|
|
||||||
QString MainWindow::getCurrentPlaylistPath()
|
QString MainWindow::getCurrentPlaylistPath()
|
||||||
{
|
{
|
||||||
QListWidgetItem *playlistItem = m_listWidget->currentItem();
|
|
||||||
QString playlistPath;
|
QString playlistPath;
|
||||||
|
QListWidgetItem *playlistItem = m_listWidget->currentItem();
|
||||||
|
|
||||||
if (!playlistItem)
|
if (!playlistItem)
|
||||||
return playlistPath;
|
return playlistPath;
|
||||||
|
@ -1231,14 +1230,14 @@ QString MainWindow::getCurrentPlaylistPath()
|
||||||
|
|
||||||
bool MainWindow::currentPlaylistIsSpecial()
|
bool MainWindow::currentPlaylistIsSpecial()
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
QDir playlistDir(settings->paths.directory_playlist);
|
|
||||||
QString playlistDirAbsPath = playlistDir.absolutePath();
|
|
||||||
QFileInfo currentPlaylistFileInfo;
|
QFileInfo currentPlaylistFileInfo;
|
||||||
QString currentPlaylistPath;
|
QString currentPlaylistPath;
|
||||||
QString currentPlaylistDirPath;
|
QString currentPlaylistDirPath;
|
||||||
QListWidgetItem *currentPlaylistItem = m_listWidget->currentItem();
|
|
||||||
bool specialPlaylist = false;
|
bool specialPlaylist = false;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
QDir playlistDir(settings->paths.directory_playlist);
|
||||||
|
QString playlistDirAbsPath = playlistDir.absolutePath();
|
||||||
|
QListWidgetItem *currentPlaylistItem = m_listWidget->currentItem();
|
||||||
|
|
||||||
if (!currentPlaylistItem)
|
if (!currentPlaylistItem)
|
||||||
return false;
|
return false;
|
||||||
|
@ -1247,7 +1246,8 @@ bool MainWindow::currentPlaylistIsSpecial()
|
||||||
currentPlaylistFileInfo = QFileInfo(currentPlaylistPath);
|
currentPlaylistFileInfo = QFileInfo(currentPlaylistPath);
|
||||||
currentPlaylistDirPath = currentPlaylistFileInfo.absoluteDir().absolutePath();
|
currentPlaylistDirPath = currentPlaylistFileInfo.absoluteDir().absolutePath();
|
||||||
|
|
||||||
/* Don't just compare strings in case there are case differences on Windows that should be ignored. */
|
/* Don't just compare strings in case there are
|
||||||
|
* case differences on Windows that should be ignored. */
|
||||||
if (QDir(currentPlaylistDirPath) != QDir(playlistDirAbsPath))
|
if (QDir(currentPlaylistDirPath) != QDir(playlistDirAbsPath))
|
||||||
specialPlaylist = true;
|
specialPlaylist = true;
|
||||||
|
|
||||||
|
@ -1262,7 +1262,8 @@ bool MainWindow::currentPlaylistIsAll()
|
||||||
if (!currentPlaylistItem)
|
if (!currentPlaylistItem)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (currentPlaylistItem->data(Qt::UserRole).toString() == ALL_PLAYLISTS_TOKEN)
|
if (currentPlaylistItem->data(Qt::UserRole).toString()
|
||||||
|
== ALL_PLAYLISTS_TOKEN)
|
||||||
all = true;
|
all = true;
|
||||||
|
|
||||||
return all;
|
return all;
|
||||||
|
@ -1310,10 +1311,12 @@ void MainWindow::deleteCurrentPlaylistItem()
|
||||||
|
|
||||||
QVector<QHash<QString, QString> > MainWindow::getPlaylistDefaultCores()
|
QVector<QHash<QString, QString> > MainWindow::getPlaylistDefaultCores()
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
struct string_list *playlists = string_split(settings->arrays.playlist_names, ";");
|
|
||||||
struct string_list *cores = string_split(settings->arrays.playlist_cores, ";");
|
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
struct string_list *playlists = string_split(
|
||||||
|
settings->arrays.playlist_names, ";");
|
||||||
|
struct string_list *cores = string_split(
|
||||||
|
settings->arrays.playlist_cores, ";");
|
||||||
QVector<QHash<QString, QString> > coreList;
|
QVector<QHash<QString, QString> > coreList;
|
||||||
|
|
||||||
if (!playlists || !cores)
|
if (!playlists || !cores)
|
||||||
|
@ -1433,9 +1436,7 @@ void PlaylistModel::addPlaylistItems(const QStringList &paths, bool add)
|
||||||
m_contents.clear();
|
m_contents.clear();
|
||||||
|
|
||||||
for (i = 0; i < paths.size(); i++)
|
for (i = 0; i < paths.size(); i++)
|
||||||
{
|
|
||||||
getPlaylistItems(paths.at(i));
|
getPlaylistItems(paths.at(i));
|
||||||
}
|
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,8 @@ static enum ui_msg_window_response ui_msg_window_qt_response(ui_msg_window_state
|
||||||
return UI_MSG_RESPONSE_NA;
|
return UI_MSG_RESPONSE_NA;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QFlags<QMessageBox::StandardButton> ui_msg_window_qt_buttons(ui_msg_window_state *state)
|
static QFlags<QMessageBox::StandardButton>
|
||||||
|
ui_msg_window_qt_buttons(ui_msg_window_state *state)
|
||||||
{
|
{
|
||||||
switch (state->buttons)
|
switch (state->buttons)
|
||||||
{
|
{
|
||||||
|
@ -74,7 +75,8 @@ static QFlags<QMessageBox::StandardButton> ui_msg_window_qt_buttons(ui_msg_windo
|
||||||
return QMessageBox::NoButton;
|
return QMessageBox::NoButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum ui_msg_window_response ui_msg_window_qt_error(ui_msg_window_state *state)
|
static enum ui_msg_window_response
|
||||||
|
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));
|
||||||
|
|
|
@ -730,19 +730,19 @@ MainWindow::~MainWindow()
|
||||||
delete m_proxyFileModel;
|
delete m_proxyFileModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::startTimer() {
|
void MainWindow::startTimer()
|
||||||
|
{
|
||||||
if (m_thumbnailTimer->isActive())
|
if (m_thumbnailTimer->isActive())
|
||||||
{
|
{
|
||||||
m_thumbnailTimer->stop();
|
m_thumbnailTimer->stop();
|
||||||
m_thumbnailTimer->start(50);
|
m_thumbnailTimer->start(50);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
m_thumbnailTimer->start(50);
|
m_thumbnailTimer->start(50);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
@ -1194,14 +1194,10 @@ void MainWindow::onLaunchWithComboBoxIndexChanged(int)
|
||||||
m_coreInfoLabel->setText(coreInfoText);
|
m_coreInfoLabel->setText(coreInfoText);
|
||||||
|
|
||||||
if (coreSelection == CORE_SELECTION_LOAD_CORE)
|
if (coreSelection == CORE_SELECTION_LOAD_CORE)
|
||||||
{
|
|
||||||
onLoadCoreClicked();
|
onLoadCoreClicked();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
m_loadCoreWindow->setProperty("last_launch_with_index", m_launchWithComboBox->currentIndex());
|
m_loadCoreWindow->setProperty("last_launch_with_index", m_launchWithComboBox->currentIndex());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MainWindow::Theme MainWindow::getThemeFromString(QString themeString)
|
MainWindow::Theme MainWindow::getThemeFromString(QString themeString)
|
||||||
{
|
{
|
||||||
|
@ -1286,8 +1282,8 @@ QString MainWindow::changeThumbnail(const QImage &image, QString type)
|
||||||
const char *dirData = dirArray.constData();
|
const char *dirData = dirArray.constData();
|
||||||
QByteArray thumbArray = QDir::toNativeSeparators(thumbPath).toUtf8();
|
QByteArray thumbArray = QDir::toNativeSeparators(thumbPath).toUtf8();
|
||||||
const char *thumbData = thumbArray.constData();
|
const char *thumbData = thumbArray.constData();
|
||||||
QDir dir(dirString);
|
|
||||||
int quality = -1;
|
int quality = -1;
|
||||||
|
QDir dir(dirString);
|
||||||
QImage scaledImage(image);
|
QImage scaledImage(image);
|
||||||
|
|
||||||
if (!dir.exists())
|
if (!dir.exists())
|
||||||
|
@ -1325,7 +1321,8 @@ QString MainWindow::changeThumbnail(const QImage &image, QString type)
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onThumbnailDropped(const QImage &image, ThumbnailType thumbnailType)
|
void MainWindow::onThumbnailDropped(const QImage &image,
|
||||||
|
ThumbnailType thumbnailType)
|
||||||
{
|
{
|
||||||
switch (thumbnailType)
|
switch (thumbnailType)
|
||||||
{
|
{
|
||||||
|
@ -1381,11 +1378,11 @@ void MainWindow::onThumbnailDropped(const QImage &image, ThumbnailType thumbnail
|
||||||
|
|
||||||
QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
{
|
{
|
||||||
|
unsigned i;
|
||||||
QVector<QHash<QString, QString> > infoList;
|
QVector<QHash<QString, QString> > infoList;
|
||||||
QHash<QString, QString> currentCore = getSelectedCore();
|
QHash<QString, QString> currentCore = getSelectedCore();
|
||||||
core_info_list_t *core_info_list = NULL;
|
core_info_list_t *core_info_list = NULL;
|
||||||
const core_info_t *core_info = NULL;
|
const core_info_t *core_info = NULL;
|
||||||
unsigned i = 0;
|
|
||||||
|
|
||||||
core_info_get_list(&core_info_list);
|
core_info_get_list(&core_info_list);
|
||||||
|
|
||||||
|
@ -1407,7 +1404,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
{
|
{
|
||||||
QHash<QString, QString> hash;
|
QHash<QString, QString> hash;
|
||||||
|
|
||||||
hash["key"] = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE_INFORMATION_AVAILABLE);
|
hash["key"] = msg_hash_to_str(
|
||||||
|
MENU_ENUM_LABEL_VALUE_NO_CORE_INFORMATION_AVAILABLE);
|
||||||
hash["value"] = "";
|
hash["value"] = "";
|
||||||
|
|
||||||
infoList.append(hash);
|
infoList.append(hash);
|
||||||
|
@ -1419,7 +1417,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
{
|
{
|
||||||
QHash<QString, QString> hash;
|
QHash<QString, QString> hash;
|
||||||
|
|
||||||
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME)) + ":";
|
hash["key"] = QString(
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME)) + ":";
|
||||||
hash["value"] = core_info->core_name;
|
hash["value"] = core_info->core_name;
|
||||||
|
|
||||||
infoList.append(hash);
|
infoList.append(hash);
|
||||||
|
@ -1429,7 +1428,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
{
|
{
|
||||||
QHash<QString, QString> hash;
|
QHash<QString, QString> hash;
|
||||||
|
|
||||||
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL)) + ":";
|
hash["key"] = QString(
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL)) + ":";
|
||||||
hash["value"] = core_info->display_name;
|
hash["value"] = core_info->display_name;
|
||||||
|
|
||||||
infoList.append(hash);
|
infoList.append(hash);
|
||||||
|
@ -1468,7 +1468,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
categories += ", ";
|
categories += ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_CATEGORIES)) + ":";
|
hash["key"] = QString(
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_CATEGORIES)) + ":";
|
||||||
hash["value"] = categories;
|
hash["value"] = categories;
|
||||||
|
|
||||||
infoList.append(hash);
|
infoList.append(hash);
|
||||||
|
@ -1487,7 +1488,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
authors += ", ";
|
authors += ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_AUTHORS)) + ":";
|
hash["key"] = QString(
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_AUTHORS)) + ":";
|
||||||
hash["value"] = authors;
|
hash["value"] = authors;
|
||||||
|
|
||||||
infoList.append(hash);
|
infoList.append(hash);
|
||||||
|
@ -1506,7 +1508,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
permissions += ", ";
|
permissions += ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_PERMISSIONS)) + ":";
|
hash["key"] = QString(
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_PERMISSIONS)) + ":";
|
||||||
hash["value"] = permissions;
|
hash["value"] = permissions;
|
||||||
|
|
||||||
infoList.append(hash);
|
infoList.append(hash);
|
||||||
|
@ -1525,7 +1528,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
licenses += ", ";
|
licenses += ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES)) + ":";
|
hash["key"] = QString(
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES)) + ":";
|
||||||
hash["value"] = licenses;
|
hash["value"] = licenses;
|
||||||
|
|
||||||
infoList.append(hash);
|
infoList.append(hash);
|
||||||
|
@ -1544,7 +1548,8 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
|
||||||
supported_extensions += ", ";
|
supported_extensions += ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_SUPPORTED_EXTENSIONS)) + ":";
|
hash["key"] = QString(
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_SUPPORTED_EXTENSIONS)) + ":";
|
||||||
hash["value"] = supported_extensions;
|
hash["value"] = supported_extensions;
|
||||||
|
|
||||||
infoList.append(hash);
|
infoList.append(hash);
|
||||||
|
@ -1957,7 +1962,8 @@ void MainWindow::loadContent(const QHash<QString, QString> &contentHash)
|
||||||
corePath, contentPath, contentLabel, &content_info,
|
corePath, contentPath, contentLabel, &content_info,
|
||||||
NULL, NULL))
|
NULL, NULL))
|
||||||
{
|
{
|
||||||
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));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1995,7 +2001,8 @@ bool MainWindow::isContentLessCore()
|
||||||
|
|
||||||
bool MainWindow::isCoreLoaded()
|
bool MainWindow::isCoreLoaded()
|
||||||
{
|
{
|
||||||
if (m_currentCore.isEmpty() || m_currentCore == msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE))
|
if ( m_currentCore.isEmpty() ||
|
||||||
|
m_currentCore == msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -2109,9 +2116,9 @@ void MainWindow::setCoreActions()
|
||||||
{
|
{
|
||||||
if (allPlaylists)
|
if (allPlaylists)
|
||||||
{
|
{
|
||||||
|
QFileInfo info;
|
||||||
QListWidgetItem *listItem = m_listWidget->item(row);
|
QListWidgetItem *listItem = m_listWidget->item(row);
|
||||||
QString listItemString = listItem->data(Qt::UserRole).toString();
|
QString listItemString = listItem->data(Qt::UserRole).toString();
|
||||||
QFileInfo info;
|
|
||||||
|
|
||||||
info.setFile(listItemString);
|
info.setFile(listItemString);
|
||||||
|
|
||||||
|
@ -2397,8 +2404,8 @@ void MainWindow::renamePlaylistItem(QListWidgetItem *item, QString newName)
|
||||||
QFileInfo playlistInfo;
|
QFileInfo playlistInfo;
|
||||||
QString playlistPath;
|
QString playlistPath;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
QDir playlistDir(settings->paths.directory_playlist);
|
|
||||||
bool specialPlaylist = false;
|
bool specialPlaylist = false;
|
||||||
|
QDir playlistDir(settings->paths.directory_playlist);
|
||||||
|
|
||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
@ -2407,7 +2414,8 @@ void MainWindow::renamePlaylistItem(QListWidgetItem *item, QString newName)
|
||||||
playlistInfo = playlistPath;
|
playlistInfo = playlistPath;
|
||||||
oldName = playlistInfo.completeBaseName();
|
oldName = playlistInfo.completeBaseName();
|
||||||
|
|
||||||
/* Don't just compare strings in case there are case differences on Windows that should be ignored. */
|
/* Don't just compare strings in case there are
|
||||||
|
* case differences on Windows that should be ignored. */
|
||||||
if (QDir(playlistInfo.absoluteDir()) != QDir(playlistDir))
|
if (QDir(playlistInfo.absoluteDir()) != QDir(playlistDir))
|
||||||
{
|
{
|
||||||
/* special playlists like history etc. can't have an association */
|
/* special playlists like history etc. can't have an association */
|
||||||
|
@ -3025,15 +3033,15 @@ void MainWindow::onShowInfoMessage(QString msg)
|
||||||
|
|
||||||
int MainWindow::onExtractArchive(QString path, QString extractionDir, QString tempExtension, retro_task_callback_t cb)
|
int MainWindow::onExtractArchive(QString path, QString extractionDir, QString tempExtension, retro_task_callback_t cb)
|
||||||
{
|
{
|
||||||
|
unsigned i;
|
||||||
|
file_archive_transfer_t state;
|
||||||
|
struct archive_extract_userdata userdata;
|
||||||
QByteArray pathArray = path.toUtf8();
|
QByteArray pathArray = path.toUtf8();
|
||||||
QByteArray dirArray = extractionDir.toUtf8();
|
QByteArray dirArray = extractionDir.toUtf8();
|
||||||
const char *file = pathArray.constData();
|
const char *file = pathArray.constData();
|
||||||
const char *dir = dirArray.constData();
|
const char *dir = dirArray.constData();
|
||||||
file_archive_transfer_t state;
|
|
||||||
struct archive_extract_userdata userdata;
|
|
||||||
struct string_list *file_list = file_archive_get_file_list(file, NULL);
|
struct string_list *file_list = file_archive_get_file_list(file, NULL);
|
||||||
bool returnerr = true;
|
bool returnerr = true;
|
||||||
unsigned i;
|
|
||||||
|
|
||||||
if (!file_list || file_list->size == 0)
|
if (!file_list || file_list->size == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,6 +109,7 @@ void MainWindow::onUpdateNetworkSslErrors(const QList<QSslError> &errors)
|
||||||
QString string = QString("Ignoring SSL error code ") + QString::number(error.error()) + ": " + error.errorString();
|
QString string = QString("Ignoring SSL error code ") + QString::number(error.error()) + ": " + error.errorString();
|
||||||
QByteArray stringArray = string.toUtf8();
|
QByteArray stringArray = string.toUtf8();
|
||||||
const char *stringData = stringArray.constData();
|
const char *stringData = stringArray.constData();
|
||||||
|
|
||||||
RARCH_ERR("[Qt]: %s\n", stringData);
|
RARCH_ERR("[Qt]: %s\n", stringData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +130,10 @@ void MainWindow::onRetroArchUpdateDownloadFinished()
|
||||||
|
|
||||||
m_updateProgressDialog->cancel();
|
m_updateProgressDialog->cancel();
|
||||||
|
|
||||||
/* At least on Linux, the progress dialog will refuse to hide itself and will stay on screen in a corrupted way if we happen to show an error message in this function. processEvents() will sometimes fix it, other times not... seems random. */
|
/* At least on Linux, the progress dialog will refuse to hide itself and
|
||||||
|
* will stay onscreen in a corrupted way if we happen to show an error
|
||||||
|
* message in this function. processEvents() will sometimes fix it,
|
||||||
|
* other times not... seems random. */
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
|
|
||||||
if (!reply)
|
if (!reply)
|
||||||
|
@ -143,7 +147,9 @@ void MainWindow::onRetroArchUpdateDownloadFinished()
|
||||||
|
|
||||||
if (code != 200)
|
if (code != 200)
|
||||||
{
|
{
|
||||||
emit showErrorMessageDeferred(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_NETWORK_ERROR)) + ": HTTP Code " + QString::number(code));
|
emit showErrorMessageDeferred(QString(
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_NETWORK_ERROR))
|
||||||
|
+ ": HTTP Code " + QString::number(code));
|
||||||
RARCH_ERR("[Qt]: RetroArch update failed with HTTP status code: %d\n", code);
|
RARCH_ERR("[Qt]: RetroArch update failed with HTTP status code: %d\n", code);
|
||||||
reply->disconnect();
|
reply->disconnect();
|
||||||
reply->abort();
|
reply->abort();
|
||||||
|
|
|
@ -70,14 +70,16 @@ private:
|
||||||
void resizeEvent(QResizeEvent *event) final
|
void resizeEvent(QResizeEvent *event) final
|
||||||
{
|
{
|
||||||
QWidget *inner = widget();
|
QWidget *inner = widget();
|
||||||
|
|
||||||
if (inner)
|
if (inner)
|
||||||
{
|
{
|
||||||
int fw = frameWidth() * 2;
|
int fw = frameWidth() * 2;
|
||||||
QSize innerSize = event->size() - QSize(fw, fw);
|
QSize innerSize = event->size() - QSize(fw, fw);
|
||||||
QSize innerSizeHint = inner->minimumSizeHint();
|
QSize innerSizeHint = inner->minimumSizeHint();
|
||||||
|
|
||||||
|
/* Widget wants to be bigger than available space */
|
||||||
if (innerSizeHint.height() > innerSize.height())
|
if (innerSizeHint.height() > innerSize.height())
|
||||||
{ /* Widget wants to be bigger than available space */
|
{
|
||||||
innerSize.setWidth(innerSize.width() - scrollBarWidth());
|
innerSize.setWidth(innerSize.width() - scrollBarWidth());
|
||||||
innerSize.setHeight(innerSizeHint.height());
|
innerSize.setHeight(innerSizeHint.height());
|
||||||
}
|
}
|
||||||
|
@ -89,10 +91,12 @@ private:
|
||||||
QSize minimumSizeHint() const final
|
QSize minimumSizeHint() const final
|
||||||
{
|
{
|
||||||
QWidget *inner = widget();
|
QWidget *inner = widget();
|
||||||
if (inner) {
|
|
||||||
int fw = frameWidth() * 2;
|
|
||||||
|
|
||||||
|
if (inner)
|
||||||
|
{
|
||||||
|
int fw = frameWidth() * 2;
|
||||||
QSize minSize = inner->minimumSizeHint();
|
QSize minSize = inner->minimumSizeHint();
|
||||||
|
|
||||||
minSize += QSize(fw, fw);
|
minSize += QSize(fw, fw);
|
||||||
minSize += QSize(scrollBarWidth(), 0);
|
minSize += QSize(scrollBarWidth(), 0);
|
||||||
minSize.setWidth(qMin(minSize.width(), MAX_MIN_WIDTH));
|
minSize.setWidth(qMin(minSize.width(), MAX_MIN_WIDTH));
|
||||||
|
@ -124,20 +128,21 @@ ViewOptionsDialog::ViewOptionsDialog(MainWindow *mainwindow, QWidget *parent) :
|
||||||
,m_optionsList(new QListWidget(this))
|
,m_optionsList(new QListWidget(this))
|
||||||
,m_optionsStack(new QStackedLayout)
|
,m_optionsStack(new QStackedLayout)
|
||||||
{
|
{
|
||||||
|
int width;
|
||||||
QGridLayout *layout = new QGridLayout(this);
|
QGridLayout *layout = new QGridLayout(this);
|
||||||
QLabel *m_headerLabel = new QLabel(this);
|
QLabel *m_headerLabel = new QLabel(this);
|
||||||
// Header label with large font and a bit of spacing (align with group boxes)
|
/* Header label with large font and a bit of spacing
|
||||||
|
* (align with group boxes) */
|
||||||
QFont headerLabelFont = m_headerLabel->font();
|
QFont headerLabelFont = m_headerLabel->font();
|
||||||
const int pointSize = headerLabelFont.pointSize();
|
const int pointSize = headerLabelFont.pointSize();
|
||||||
QHBoxLayout *headerHLayout = new QHBoxLayout;
|
QHBoxLayout *headerHLayout = new QHBoxLayout;
|
||||||
const int leftMargin = QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin);
|
const int leftMargin = QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin);
|
||||||
int width;
|
|
||||||
|
|
||||||
m_optionsStack->setMargin(0);
|
m_optionsStack->setMargin(0);
|
||||||
|
|
||||||
headerLabelFont.setBold(true);
|
headerLabelFont.setBold(true);
|
||||||
|
|
||||||
// Paranoia: Should a font be set in pixels...
|
/* Paranoia: Should a font be set in pixels... */
|
||||||
if (pointSize > 0)
|
if (pointSize > 0)
|
||||||
headerLabelFont.setPointSize(pointSize + 2);
|
headerLabelFont.setPointSize(pointSize + 2);
|
||||||
|
|
||||||
|
@ -216,13 +221,11 @@ void ViewOptionsDialog::addCategory(OptionsCategory *category)
|
||||||
|
|
||||||
void ViewOptionsDialog::repaintIcons()
|
void ViewOptionsDialog::repaintIcons()
|
||||||
{
|
{
|
||||||
int i;
|
unsigned i;
|
||||||
|
|
||||||
for (i = 0; i < m_categoryList.size(); i++)
|
for (i = 0; i < m_categoryList.size(); i++)
|
||||||
{
|
|
||||||
m_optionsList->item(i)->setIcon(getIcon(m_categoryList.at(i)));
|
m_optionsList->item(i)->setIcon(getIcon(m_categoryList.at(i)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -256,11 +259,9 @@ void ViewOptionsDialog::showDialog()
|
||||||
#ifndef HAVE_MENU
|
#ifndef HAVE_MENU
|
||||||
m_viewOptionsWidget->loadViewOptions();
|
m_viewOptionsWidget->loadViewOptions();
|
||||||
#else
|
#else
|
||||||
int i;
|
unsigned i;
|
||||||
for (i = 0; i < m_categoryList.size(); i++)
|
for (i = 0; i < m_categoryList.size(); i++)
|
||||||
{
|
|
||||||
m_categoryList.at(i)->load();
|
m_categoryList.at(i)->load();
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
show();
|
show();
|
||||||
activateWindow();
|
activateWindow();
|
||||||
|
@ -277,9 +278,7 @@ void ViewOptionsDialog::onRejected()
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < m_categoryList.size(); i++)
|
for (i = 0; i < m_categoryList.size(); i++)
|
||||||
{
|
|
||||||
m_categoryList.at(i)->apply();
|
m_categoryList.at(i)->apply();
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,13 +394,13 @@ void ViewOptionsWidget::onHighlightColorChoose()
|
||||||
|
|
||||||
void ViewOptionsWidget::loadViewOptions()
|
void ViewOptionsWidget::loadViewOptions()
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
int themeIndex = 0;
|
||||||
|
int playlistIndex = 0;
|
||||||
QColor highlightColor = m_settings->value("highlight_color", QApplication::palette().highlight().color()).value<QColor>();
|
QColor highlightColor = m_settings->value("highlight_color", QApplication::palette().highlight().color()).value<QColor>();
|
||||||
QPixmap highlightPixmap(m_highlightColorPushButton->iconSize());
|
QPixmap highlightPixmap(m_highlightColorPushButton->iconSize());
|
||||||
QVector<QPair<QString, QString> > playlists = m_mainwindow->getPlaylists();
|
QVector<QPair<QString, QString> > playlists = m_mainwindow->getPlaylists();
|
||||||
QString initialPlaylist = m_settings->value("initial_playlist", m_mainwindow->getSpecialPlaylistPath(SPECIAL_PLAYLIST_HISTORY)).toString();
|
QString initialPlaylist = m_settings->value("initial_playlist", m_mainwindow->getSpecialPlaylistPath(SPECIAL_PLAYLIST_HISTORY)).toString();
|
||||||
int themeIndex = 0;
|
|
||||||
int playlistIndex = 0;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
m_saveGeometryCheckBox->setChecked(m_settings->value("save_geometry", false).toBool());
|
m_saveGeometryCheckBox->setChecked(m_settings->value("save_geometry", false).toBool());
|
||||||
m_saveDockPositionsCheckBox->setChecked(m_settings->value("save_dock_positions", false).toBool());
|
m_saveDockPositionsCheckBox->setChecked(m_settings->value("save_dock_positions", false).toBool());
|
||||||
|
|
Loading…
Reference in New Issue