chore: add about dialog
to make it easier to know if taglib and/or libchardet are used.
This commit is contained in:
parent
b88ee1d0f1
commit
618a350e0d
|
@ -68,19 +68,13 @@ if (WIN32)
|
|||
endif ()
|
||||
|
||||
if (NOT TagLib_FOUND)
|
||||
message (WARNING "TagLib not found!")
|
||||
target_compile_definitions(${EXE_NAME} PRIVATE
|
||||
NO_TAGLIB=1
|
||||
)
|
||||
target_compile_definitions(${EXE_NAME} PRIVATE NO_TAGLIB=1)
|
||||
else ()
|
||||
target_link_libraries(${EXE_NAME} PRIVATE PkgConfig::TagLib)
|
||||
endif ()
|
||||
|
||||
if (NOT uchardet_FOUND)
|
||||
message (WARNING "uchardet not found!")
|
||||
target_compile_definitions(${EXE_NAME} PRIVATE
|
||||
NO_UCHARDET=1
|
||||
)
|
||||
target_compile_definitions(${EXE_NAME} PRIVATE NO_UCHARDET=1)
|
||||
else ()
|
||||
target_link_libraries (${EXE_NAME} PRIVATE uchardet::libuchardet)
|
||||
endif ()
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
#include <QStandardPaths>
|
||||
#include <QMediaDevices>
|
||||
#include <QAudioDevice>
|
||||
#include <QMessageBox>
|
||||
#include <QStringBuilder>
|
||||
|
||||
constexpr QSize miniSize(490, 160);
|
||||
constexpr QSize fullSize(490, 420);
|
||||
|
@ -50,6 +52,9 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
m_mediaPlayer->setLoops(QMediaPlayer::Infinite);
|
||||
ui->playlistView->setModel(m_playlistManager->model());
|
||||
|
||||
ui->actionHelp->setShortcut(QKeySequence::HelpContents);
|
||||
addAction(ui->actionHelp);
|
||||
|
||||
setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint);
|
||||
setAttribute(Qt::WA_TranslucentBackground, true);
|
||||
|
||||
|
@ -599,3 +604,31 @@ void MainWindow::on_lrcBtn_clicked()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionHelp_triggered()
|
||||
{
|
||||
QMessageBox infoBox(this);
|
||||
infoBox.setIcon(QMessageBox::Information);
|
||||
infoBox.setWindowTitle(tr("About"));
|
||||
infoBox.setStandardButtons(QMessageBox::Ok);
|
||||
infoBox.setText(
|
||||
tr("Pineapple Music") %
|
||||
"\n\n" %
|
||||
tr("Based on the following free software libraries:") %
|
||||
"\n\n" %
|
||||
QStringLiteral("- [Qt](https://www.qt.io/) %1\n").arg(QT_VERSION_STR) %
|
||||
#ifndef NO_TAGLIB
|
||||
QStringLiteral("- [TagLib](https://github.com/taglib/taglib)\n") %
|
||||
#endif // NO_TAGLIB
|
||||
#ifndef NO_UCHARDET
|
||||
QStringLiteral("- [uchardet](https://www.freedesktop.org/wiki/Software/uchardet/)\n") %
|
||||
#endif // NO_TAGLIB
|
||||
"\n"
|
||||
"[Source Code](https://github.com/BLumia/pineapple-music)\n"
|
||||
"\n"
|
||||
"Copyright © 2024 [BLumia](https://github.com/BLumia/)"
|
||||
);
|
||||
infoBox.setTextFormat(Qt::MarkdownText);
|
||||
infoBox.exec();
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ private slots:
|
|||
void on_playListBtn_clicked();
|
||||
void on_playlistView_activated(const QModelIndex &index);
|
||||
void on_lrcBtn_clicked();
|
||||
void on_actionHelp_triggered();
|
||||
|
||||
signals:
|
||||
void playbackModeChanged(enum PlaybackMode mode);
|
||||
|
|
|
@ -657,6 +657,17 @@ QListView {
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<action name="actionHelp">
|
||||
<property name="text">
|
||||
<string>help</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>F1</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
Loading…
Reference in New Issue
Block a user