From f22b64f2670ac45ac4c9b7c0c760bf5752086ede Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 1 Feb 2021 00:50:48 -0500 Subject: final commit for qt --- library.cpp | 18 ++++++++ library.h | 3 ++ main.cpp | 6 ++- player.cpp | 7 +++- player.h | 3 ++ player.ui | 82 ++++++++++++++++++++----------------- translations/en_CA.ts | 95 +++++++++++++++++++++++------------------- translations/fr_CA.ts | 109 +++++++++++++++++++++++++++++++------------------ translations/vi_VN.ts | 111 +++++++++++++++++++++++++++++++------------------- 9 files changed, 268 insertions(+), 166 deletions(-) diff --git a/library.cpp b/library.cpp index ffba966..f1baf83 100644 --- a/library.cpp +++ b/library.cpp @@ -22,6 +22,24 @@ Library::Library(QObject *parent) { } +QVariant Library::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (role == Qt::DisplayRole) { + switch (section) { + case 0: + return "Name"; + case 1: + return "Artist"; + case 2: + return "Album"; + } + } else if (role == Qt::SizeHintRole) { + return QSize(500, 29); + } + return QAbstractItemModel::headerData(section, orientation, role); +} + + int Library::rowCount(const QModelIndex &parent) const { // For list models only the root node (an invalid parent) should return the list's size. For all diff --git a/library.h b/library.h index c88f49d..ff685c2 100644 --- a/library.h +++ b/library.h @@ -20,6 +20,7 @@ #include #include +#include class Library : public QAbstractListModel { @@ -28,6 +29,8 @@ class Library : public QAbstractListModel public: explicit Library(QObject *parent = nullptr); + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + // Basic functionality: int rowCount(const QModelIndex &parent = QModelIndex()) const override; diff --git a/main.cpp b/main.cpp index e417938..e74a4f5 100644 --- a/main.cpp +++ b/main.cpp @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) qDebug() << "Creating files..."; //Change this to appdata or .local/share in linux - //QDir directory(QDir::homePath() + "/.alee-productions/Alee Audio Player"); + //QDir directory(QDir::homePath() + "/.aleeaudioplayer"); //File file(directory.absoluteFilePath("test.txt")); @@ -39,6 +39,10 @@ int main(int argc, char *argv[]) //file.close(); QApplication a(argc, argv); + a.setApplicationName("Alee Audio Player"); + a.setApplicationVersion("0.2.0"); + a.setOrganizationName("Alee Productions"); + QTranslator translator; translator.load(QLocale(), "/home/andrew/Documents/GitHub/Alee Audio Player/translations/"); a.installTranslator(&translator); diff --git a/player.cpp b/player.cpp index 4991824..0c18979 100644 --- a/player.cpp +++ b/player.cpp @@ -24,7 +24,7 @@ void Player::loadFile() { QMessageBox msgbox; - mFile = QFileDialog::getOpenFileName(this, tr("Open any audio file"), QDir::homePath(), tr("Audio Files (*.mp3 *.wav *.ogg *.flac)")); + mFile = QFileDialog::getOpenFileName(this, tr("Open any audio file"), QDir::homePath(), tr("Audio Files (*.mp3 *.wav *.ogg *.flac *.wma)")); if (mFile == NULL) { qDebug() << tr("File cannot be found"); msgbox.setWindowTitle(tr("Uh oh! An error has occured!")); @@ -148,3 +148,8 @@ void Player::on_durationChanged(qint64 position) { ui->playbackSlider->setMaximum(position); } + +void Player::on_actionBugReport_triggered() +{ + QDesktopServices::openUrl(QUrl("https://github.com/aleeproductions/Alee-Audio-Player/issues", QUrl::TolerantMode)); +} diff --git a/player.h b/player.h index a95ff16..c629503 100644 --- a/player.h +++ b/player.h @@ -23,6 +23,7 @@ #include #include #include +#include #include QT_BEGIN_NAMESPACE @@ -65,6 +66,8 @@ private slots: void on_durationChanged(qint64 position); + void on_actionBugReport_triggered(); + private: Ui::Player *ui; QStringListModel *model; diff --git a/player.ui b/player.ui index 22babe4..6ae9451 100644 --- a/player.ui +++ b/player.ui @@ -6,7 +6,7 @@ 0 0 - 837 + 1127 680 @@ -19,42 +19,6 @@ - - - - - - - 0 - - - - Library - - - - - - - - - - Playlist - - - - - - - - - false - - - Qt::Horizontal - - - @@ -178,6 +142,42 @@ + + + + false + + + Qt::Horizontal + + + + + + + + + + 0 + + + + Library + + + + + + + + + + Visualization + + + + + @@ -185,7 +185,7 @@ 0 0 - 837 + 1127 23 @@ -202,6 +202,7 @@ Help + @@ -228,6 +229,11 @@ Ctrl+O + + + Bug Report + + diff --git a/translations/en_CA.ts b/translations/en_CA.ts index 090d22b..be1be26 100644 --- a/translations/en_CA.ts +++ b/translations/en_CA.ts @@ -5,17 +5,17 @@ About - About - Alee Music Player + About - Alee Audio Player - Alee Music Player 0.2 by Alee Productions + Alee Audio Player 0.2 by Alee Productions - Licensed with GPL-3.0 + Written in C++ and Qt, Licensed with GPL-3.0 @@ -30,7 +30,7 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Alee Music Player: An audio player written in Qt</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Alee Audio Player: An audio player written in Qt</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Copyright (C) 2020 Alee Productions</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> This program is free software: you can redistribute it and/or modify</p> @@ -52,149 +52,158 @@ p, li { white-space: pre-wrap; } Player - - Alee Music Player - - - - + Library - - Playlist + + Alee Audio Player - + Stop - + Browse - + Volume - + Title - - - + + Play - + + Author + + + + + Visualization + + + + File - - View + + Help + + + + + Bug Report - + Quit - + Ctrl+Q - + About - + Open - + Ctrl+O - + Open any audio file - - Audio Files (*.mp3 *.wav *.ogg *.flac *.mp4) + + Audio Files (*.mp3 *.wav *.ogg *.flac *.wma) - + File cannot be found - + Uh oh! An error has occured! - + File is invalid. Maybe try loading a valid audio file. - + Opening - + Success! - + This audio file has been loaded. - - Closing AleePlayer... + + Closing Alee Audio Player... - + Pausing music... - + Playing music... - + Pause - + Stopping music... - + Opening about dialog diff --git a/translations/fr_CA.ts b/translations/fr_CA.ts index ce4ff90..b810599 100644 --- a/translations/fr_CA.ts +++ b/translations/fr_CA.ts @@ -5,17 +5,17 @@ About - About - Alee Music Player + About - Alee Audio Player - Alee Music Player 0.2 by Alee Productions + Alee Audio Player 0.2 by Alee Productions - Licensed with GPL-3.0 + Written in C++ and Qt, Licensed with GPL-3.0 @@ -30,7 +30,7 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Alee Music Player: An audio player written in Qt</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Alee Audio Player: An audio player written in Qt</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Copyright (C) 2020 Alee Productions</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> This program is free software: you can redistribute it and/or modify</p> @@ -52,149 +52,178 @@ p, li { white-space: pre-wrap; } Player - Alee Music Player - Alee Music Player + Alee Music Player - + Library Bibliothèque - Playlist - Liste de chansons + Liste de chansons - + + Alee Audio Player + + + + Stop Arrêt - + Browse Feuilleter - + Volume Le volume - + Title Titre - - - + + Play Jouer - + + Author + + + + + Visualization + + + + File Fichier - + + Help + + + + + Bug Report + + + View - Vue + Vue - + Quit Quitter - + Ctrl+Q Ctrl + Q - + About À propos du logiciel - + Open Ouvrir - + Ctrl+O Ctrl+O - + Open any audio file Ouvrir n'importe quel fichier audio - Audio Files (*.mp3 *.wav *.ogg *.flac *.mp4) - Fichiers Audio (*.mp3 *.wav *.ogg *.flac *.mp4) + Fichiers Audio (*.mp3 *.wav *.ogg *.flac *.mp4) + + + + Audio Files (*.mp3 *.wav *.ogg *.flac *.wma) + - + File cannot be found Le fichier est introuvable - + Uh oh! An error has occured! Euh oh! Une erreur est survenue! - + File is invalid. Maybe try loading a valid audio file. Le fichier n'est pas valide. Essayez peut-être de charger un fichier audio valide. - + Opening Overture - + Success! Succès! - + This audio file has been loaded. Ce fichier audio a été chargé. - + + Closing Alee Audio Player... + + + Closing AleePlayer... - Fermeture AleePlayer... + Fermeture AleePlayer... - + Pausing music... Pause la musique... - + Playing music... Jouer la musique... - + Pause Pause - + Stopping music... Arrêtez la musique... - + Opening about dialog Boîte de dialogue d'ouverture diff --git a/translations/vi_VN.ts b/translations/vi_VN.ts index 85ffb90..a787544 100644 --- a/translations/vi_VN.ts +++ b/translations/vi_VN.ts @@ -5,17 +5,17 @@ About - About - Alee Music Player + About - Alee Audio Player - Alee Music Player 0.2 by Alee Productions + Alee Audio Player 0.2 by Alee Productions - Licensed with GPL-3.0 + Written in C++ and Qt, Licensed with GPL-3.0 @@ -30,7 +30,7 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Alee Music Player: An audio player written in Qt</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Alee Audio Player: An audio player written in Qt</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Copyright (C) 2020 Alee Productions</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> This program is free software: you can redistribute it and/or modify</p> @@ -52,149 +52,174 @@ p, li { white-space: pre-wrap; } Player - - Alee Music Player - - - - + Library Thư viện - Playlist - Hàng phát + Hàng phát - + + Alee Audio Player + + + + Stop Dừng lại - + Browse Duyệt - + Volume Âm lượng - + Title Tiêu đề - - - + + Play Phát - + + Author + + + + + Visualization + + + + File Tệp - + + Help + + + + + Bug Report + + + View - Xem + Xem - + Quit Thoát - + Ctrl+Q Ctrl+Q - + About Giới Thiệu - + Open Mở - + Ctrl+O - + Open any audio file Mở bất kỳ tệp nhạc nào - Audio Files (*.mp3 *.wav *.ogg *.flac *.mp4) - Tệp nhạc (*.mp3 *.wav *.ogg *.flac *.mp4) + Tệp nhạc (*.mp3 *.wav *.ogg *.flac *.mp4) - + + Audio Files (*.mp3 *.wav *.ogg *.flac *.wma) + + + + File cannot be found Không thể tìm tệp - + Uh oh! An error has occured! Chà, một lỗi đã xảy ra! - + File is invalid. Maybe try loading a valid audio file. Tệp không hợp lệ. Hãy tải một tệp nhạc hợp lệ. - + Opening Đang mở - + Success! Tốt đẹp! - + This audio file has been loaded. Tệp nhạc đã bị tải. - + + Closing Alee Audio Player... + + + Closing AleePlayer... - Đang thoát AleePlayer... + Đang thoát AleePlayer... - + Pausing music... Đang tạm dừng nhạc... - + Playing music... Đang phát nhạc... - + Pause Tạm dừng - + Stopping music... Đang dừng lại nhắc... - + Opening about dialog Đang mở cửa sổ giới thiệu -- cgit v1.2.3