/* * Strawberry Music Player * Copyright 2020-2023, Jonas Kvinge * * Strawberry is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Strawberry is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Strawberry. If not, see . * */ #include "core/logging.h" #include "core/iconloader.h" #include "core/mainwindow.h" #include "utilities/screenutils.h" #include "snapdialog.h" #include "ui_messagedialog.h" using namespace Qt::StringLiterals; SnapDialog::SnapDialog(QWidget *parent) : MessageDialog(parent) { setWindowTitle(tr("Strawberry is running as a Snap")); const QIcon icon = IconLoader::Load(QStringLiteral("dialog-warning")); const QPixmap pixmap = icon.pixmap(QSize(64, 64), devicePixelRatioF()); ui_->label_logo->setPixmap(pixmap); QString text; text += "

"_L1; text += tr("It is detected that Strawberry is running as a Snap"); text += "

"_L1; text += "

"_L1; text += tr("Strawberry is slower, and has restrictions when running as a Snap. Accessing the root filesystem (/) will not work. There also might be other restrictions such as accessing certain devices or network shares."); text += "

"_L1; text += "

"_L1; text += "Strawberry is available natively in the official package repositories for Fedora, openSUSE, Mageia, Arch, Manjaro, MX Linux and most other popular Linux distributions."_L1; text += "

"_L1; text += "

"_L1; text += tr("For Ubuntu there is an official PPA repository available at %1.").arg(QStringLiteral("https://launchpad.net/~jonaski/+archive/ubuntu/strawberry").arg(palette().text().color().name())); text += "

"_L1; text += "

"_L1; text += tr("Official releases are available for Debian and Ubuntu which also work on most of their derivatives. See %1 for more information.").arg(QStringLiteral("https://www.strawberrymusicplayer.org/").arg(palette().text().color().name())); text += "

"_L1; text += "

"_L1; text += tr("For a better experience please consider the other options above."); text += "

"_L1; text += "

"_L1; text += tr("Copy your strawberry.conf and strawberry.db from your ~/snap directory to avoid losing configuration before you uninstall the snap:"); text += "
"_L1; text += "cp ~/snap/strawberry/current/.config/strawberry/strawberry.conf ~/.config/strawberry/strawberry.conf
"_L1; text += "cp ~/snap/strawberry/current/.local/share/strawberry/strawberry/strawberry.db ~/.local/share/strawberry/strawberry/strawberry.db
"_L1; text += "

"_L1; text += "

"_L1; text += tr("Uninstall the snap with:"); text += "
"_L1; text += "snap remove strawberry"_L1; text += "

"_L1; text += "

"_L1; text += tr("Install strawberry through PPA:"); text += "
"_L1; text += "sudo add-apt-repository ppa:jonaski/strawberry
"_L1; text += "sudo apt-get update
"_L1; text += "sudo apt install strawberry"_L1; text += "

"_L1; text += "

"_L1; ui_->label_text->setText(text); ui_->label_text->adjustSize(); adjustSize(); settings_group_ = QLatin1String(MainWindow::kSettingsGroup); do_not_show_message_again_ = "ignore_snap"_L1; if (parent) { Utilities::CenterWidgetOnScreen(Utilities::GetScreen(parent), this); } }