summaryrefslogtreecommitdiff
path: root/raveos-calamares/0007-raveos-naplo-hozzajarulas.patch
diff options
context:
space:
mode:
authorNippy <nippy@Nippy-Mac-mini.local>2026-11-01 18:13:54 +0100
committerNippy <nippy@Nippy-Mac-mini.local>2026-11-01 18:13:54 +0100
commita64ef966534f8dba6af889ba4bfce15691bfc85b (patch)
treeb30f284d05b80fa115569ab220deae13797fad6f /raveos-calamares/0007-raveos-naplo-hozzajarulas.patch
parent919f977b40016f588b0c8532c8a57f6035056b95 (diff)
downloadRaveOS-PKGBUILD-a64ef966534f8dba6af889ba4bfce15691bfc85b.tar.gz
RaveOS-PKGBUILD-a64ef966534f8dba6af889ba4bfce15691bfc85b.zip
új telepítő
Diffstat (limited to 'raveos-calamares/0007-raveos-naplo-hozzajarulas.patch')
-rw-r--r--raveos-calamares/0007-raveos-naplo-hozzajarulas.patch263
1 files changed, 263 insertions, 0 deletions
diff --git a/raveos-calamares/0007-raveos-naplo-hozzajarulas.patch b/raveos-calamares/0007-raveos-naplo-hozzajarulas.patch
new file mode 100644
index 0000000..91d835a
--- /dev/null
+++ b/raveos-calamares/0007-raveos-naplo-hozzajarulas.patch
@@ -0,0 +1,263 @@
+--- a/src/libcalamaresui/ViewManager.cpp
++++ b/src/libcalamaresui/ViewManager.cpp
+@@ -34,6 +34,7 @@
+ #include <QFile>
+ #include <QMessageBox>
+ #include <QMetaObject>
++#include <QProcess>
+
+ #define UPDATE_BUTTON_PROPERTY( name, value ) \
+ do \
+@@ -171,12 +172,14 @@
+ QString heading = Calamares::Settings::instance()->isSetupMode() ? tr( "Setup Failed", "@title" )
+ : tr( "Installation Failed", "@title" );
+
+- ErrorDialog* errorDialog = new ErrorDialog();
++ ErrorDialog* errorDialog = new ErrorDialog( m_widget->window() );
++ errorDialog->setWindowModality( Qt::ApplicationModal );
+ errorDialog->setWindowTitle( tr( "Error", "@title" ) );
+ errorDialog->setHeading( "<strong>" + heading + "</strong>" );
+ errorDialog->setInformativeText( message );
+ errorDialog->setShouldOfferWebPaste( Calamares::Branding::instance()->uploadServer() );
+ errorDialog->setDetails( details );
++ errorDialog->adjustSize();
+ errorDialog->show();
+
+ cDebug() << "Calamares will quit when the dialog closes.";
+@@ -184,9 +187,10 @@
+ &QDialog::finished,
+ [ errorDialog ]( int result )
+ {
+- if ( result == QDialog::Accepted && errorDialog->shouldOfferWebPaste() )
++ if ( result == QDialog::Accepted && errorDialog->shouldOfferWebPaste()
++ && !Calamares::Paste::doLogUploadUI( errorDialog->parentWidget() ).isEmpty() )
+ {
+- Calamares::Paste::doLogUploadUI( errorDialog );
++ QProcess::startDetached( QStringLiteral( "systemctl" ), { QStringLiteral( "reboot" ) } );
+ }
+ #if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
+ QApplication::quit();
+--- a/src/libcalamaresui/widgets/ErrorDialog.cpp
++++ b/src/libcalamaresui/widgets/ErrorDialog.cpp
+@@ -12,6 +12,7 @@
+
+ #include "widgets/TranslationFix.h"
+ #include <QDialogButtonBox>
++#include <QPushButton>
+ #include <QIcon>
+
+ namespace Calamares
+@@ -25,6 +26,7 @@
+ ui->iconLabel->setPixmap( QIcon::fromTheme( "dialog-error" ).pixmap( 64 ) );
+ ui->detailsWidget->hide();
+ ui->offerWebPasteLabel->hide();
++ ui->detailsBrowser->setMinimumHeight( 180 );
+ }
+
+ ErrorDialog::~ErrorDialog()
+@@ -98,6 +100,15 @@
+ ui->buttonBox->setStandardButtons( m_shouldOfferWebPaste ? ( QDialogButtonBox::Yes | QDialogButtonBox::No )
+ : QDialogButtonBox::Close );
+ fixButtonLabels( ui->buttonBox );
++ if ( m_shouldOfferWebPaste )
++ {
++ QPushButton* nem = ui->buttonBox->button( QDialogButtonBox::No );
++ nem->setDefault( true );
++ nem->setFocus();
++ ui->offerWebPasteLabel->setMinimumWidth( 520 );
++ ui->offerWebPasteLabel->setMinimumHeight( ui->offerWebPasteLabel->heightForWidth( 520 ) );
++ adjustSize();
++ }
+
+ emit shouldOfferWebPasteChanged();
+ }
+--- a/src/libcalamaresui/widgets/ErrorDialog.ui
++++ b/src/libcalamaresui/widgets/ErrorDialog.ui
+@@ -53,8 +53,15 @@
+ <string/>
+ </property>
+ <property name="text">
+- <string>Would you like to paste the install log to the web?</string>
++ <string>Would you like to send the installation log to the RaveOS developers? It helps us find and fix the problem.
++
++The log contains the steps of the installer and their error messages, your hardware (processor, graphics card, disks and partitions), the settings you chose (language, time zone, keyboard, desktop, user name and computer name) and the output of the package installation. It contains no passwords.
++
++It is sent over an encrypted connection, only the RaveOS developers can see it, and it is deleted automatically after 30 days.</string>
+ </property>
++ <property name="wordWrap">
++ <bool>true</bool>
++ </property>
+ </widget>
+ </item>
+ <item row="8" column="0" colspan="2">
+--- a/src/libcalamaresui/utils/Paste.cpp
++++ b/src/libcalamaresui/utils/Paste.cpp
+@@ -17,9 +17,17 @@
+
+ #include <QApplication>
+ #include <QClipboard>
++#include <QEventLoop>
+ #include <QFile>
+ #include <QFileInfo>
++#include <QJsonDocument>
++#include <QJsonObject>
+ #include <QMessageBox>
++#include <QNetworkAccessManager>
++#include <QNetworkReply>
++#include <QNetworkRequest>
++#include <QProcess>
++#include <QPushButton>
+ #include <QTcpSocket>
+ #include <QUrl>
+ #include <QWidget>
+@@ -115,6 +123,66 @@
+ }
+ }
+
++STATICTEST QByteArray
++raveosHardwareSummary()
++{
++ static QByteArray summary;
++ static bool collected = false;
++ if ( collected )
++ {
++ return summary;
++ }
++ collected = true;
++ const QString script = QStringLiteral( "/etc/calamares/modules/raveos-hwinfo.sh" );
++ if ( !QFileInfo::exists( script ) )
++ {
++ return QByteArray();
++ }
++ QProcess process;
++ process.start( QStringLiteral( "/bin/bash" ), { script } );
++ if ( !process.waitForFinished( 15000 ) )
++ {
++ process.kill();
++ process.waitForFinished();
++ cWarning() << "Hardware summary timed out";
++ return QByteArray();
++ }
++ summary = process.readAllStandardOutput();
++ return summary;
++}
++
++STATICTEST QString
++raveosLogUpload( const QByteArray& logData, const QUrl& serverUrl )
++{
++ const QByteArray pasteData = raveosHardwareSummary() + logData;
++ QNetworkAccessManager manager;
++ QNetworkRequest request( serverUrl );
++ request.setHeader( QNetworkRequest::ContentTypeHeader, QStringLiteral( "text/plain; charset=utf-8" ) );
++ request.setTransferTimeout( 60000 );
++
++ QNetworkReply* reply = manager.post( request, pasteData );
++ QEventLoop loop;
++ QObject::connect( reply, &QNetworkReply::finished, &loop, &QEventLoop::quit );
++ loop.exec( QEventLoop::ExcludeUserInputEvents );
++
++ const QByteArray response = reply->readAll();
++ const QNetworkReply::NetworkError error = reply->error();
++ delete reply;
++
++ if ( error != QNetworkReply::NoError )
++ {
++ cError() << "Log upload failed" << error;
++ return QString();
++ }
++
++ const QString identifier = QJsonDocument::fromJson( response ).object().value( QStringLiteral( "azonosito" ) ).toString();
++ if ( identifier.isEmpty() )
++ {
++ cError() << "No identifier from log upload server";
++ }
++ return identifier;
++}
++
+ QString
+ Calamares::Paste::doLogUpload( QObject* parent )
+ {
+@@ -149,6 +217,10 @@
+ cWarning() << "No upload configured.";
+ return QString();
+ case Calamares::Branding::UploadServerType::Fiche:
++ if ( serverUrl.scheme() == QStringLiteral( "https" ) )
++ {
++ return raveosLogUpload( pasteData, serverUrl );
++ }
+ return ficheLogUpload( pasteData, serverUrl, parent );
+ }
+ return QString();
+@@ -157,32 +229,52 @@
+ QString
+ Calamares::Paste::doLogUploadUI( QWidget* parent )
+ {
+- // These strings originated in the ViewManager class
+- QString pasteUrl = Calamares::Paste::doLogUpload( parent );
+- QString pasteUrlMessage;
+- if ( pasteUrl.isEmpty() )
++ QString pasteUrl;
++ while ( true )
+ {
+- pasteUrlMessage = QCoreApplication::translate( "Calamares::ViewManager",
+- "The upload was unsuccessful. No web-paste was done." );
+- }
+- else
+- {
+- QClipboard* clipboard = QApplication::clipboard();
+- clipboard->setText( pasteUrl, QClipboard::Clipboard );
+-
+- if ( clipboard->supportsSelection() )
++ QApplication::setOverrideCursor( Qt::WaitCursor );
++ pasteUrl = Calamares::Paste::doLogUpload( parent );
++ QApplication::restoreOverrideCursor();
++ if ( !pasteUrl.isEmpty() )
+ {
+- clipboard->setText( pasteUrl, QClipboard::Selection );
++ break;
+ }
+- QString pasteUrlFmt = QCoreApplication::translate( "Calamares::ViewManager",
+- "Install log posted to\n\n%1\n\nLink copied to clipboard" );
+- pasteUrlMessage = pasteUrlFmt.arg( pasteUrl );
++ QMessageBox retry( QMessageBox::Warning,
++ QCoreApplication::translate( "Calamares::ViewManager", "Installation log" ),
++ QCoreApplication::translate( "Calamares::ViewManager",
++ "The installation log could not be sent. There is probably no "
++ "internet connection.\n\nCheck the network connection and "
++ "try again." ),
++ QMessageBox::Retry | QMessageBox::Close,
++ parent );
++ Calamares::fixButtonLabels( &retry );
++ retry.button( QMessageBox::Retry )
++ ->setText( QCoreApplication::translate( "Calamares::ViewManager", "Try again" ) );
++ retry.setDefaultButton( QMessageBox::Retry );
++ if ( retry.exec() != QMessageBox::Retry )
++ {
++ return QString();
++ }
+ }
+
+- QMessageBox mb( QMessageBox::Critical,
+- QCoreApplication::translate( "Calamares::ViewManager", "Install Log Paste URL" ),
++ QClipboard* clipboard = QApplication::clipboard();
++ clipboard->setText( pasteUrl, QClipboard::Clipboard );
++ if ( clipboard->supportsSelection() )
++ {
++ clipboard->setText( pasteUrl, QClipboard::Selection );
++ }
++
++ const QString pasteUrlMessage
++ = QCoreApplication::translate(
++ "Calamares::ViewManager",
++ "The installation log has been sent to the RaveOS developers.\n\nIdentifier: %1\n\nThank you!" )
++ .arg( pasteUrl );
++
++ QMessageBox mb( QMessageBox::Information,
++ QCoreApplication::translate( "Calamares::ViewManager", "Installation log" ),
+ pasteUrlMessage,
+- QMessageBox::Ok );
++ QMessageBox::Ok,
++ parent );
+ Calamares::fixButtonLabels( &mb );
+ mb.exec();
+ return pasteUrl;