From 566be48f1601b8ecec604dfc808ef9d041adce47 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 30 Jul 2019 15:46:37 +0200 Subject: [PATCH] libcalamaresui: rename and document pastebin method --- src/libcalamaresui/ViewManager.cpp | 3 ++- src/libcalamaresui/utils/Paste.cpp | 2 +- src/libcalamaresui/utils/Paste.h | 10 ++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 4b1842bfc..b27b36f80 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -245,7 +245,7 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole ) { // TODO: host and port should be configurable - QString pasteUrlMsg = CalamaresUtils::pastebin( msgBox, QStringLiteral( "termbin.com" ), 9999 ); + QString pasteUrlMsg = CalamaresUtils::sendLogToPastebin( msgBox, QStringLiteral( "termbin.com" ), 9999 ); QString pasteUrlTitle = tr( "Install Log Paste URL" ); if ( pasteUrlMsg.isEmpty() ) @@ -253,6 +253,7 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail pasteUrlMsg = tr( "The upload was unsuccessful. No web-paste was done." ); } + // TODO: make the URL clickable, or copy it to the clipboard automatically QMessageBox::critical(nullptr, pasteUrlTitle, pasteUrlMsg); diff --git a/src/libcalamaresui/utils/Paste.cpp b/src/libcalamaresui/utils/Paste.cpp index 7833d18d6..6fead59e6 100644 --- a/src/libcalamaresui/utils/Paste.cpp +++ b/src/libcalamaresui/utils/Paste.cpp @@ -29,7 +29,7 @@ namespace CalamaresUtils { QString -pastebin( QObject* parent, const QString& ficheHost, int fichePort ) +sendLogToPastebin( QObject* parent, const QString& ficheHost, int fichePort ) { QString pasteUrlFmt = parent->tr( "Install log posted to:\n%1" ); QFile pasteSourceFile( Logger::logFile() ); diff --git a/src/libcalamaresui/utils/Paste.h b/src/libcalamaresui/utils/Paste.h index 4def700fd..2ac77f2f3 100644 --- a/src/libcalamaresui/utils/Paste.h +++ b/src/libcalamaresui/utils/Paste.h @@ -24,7 +24,13 @@ class QString; namespace CalamaresUtils { -QString pastebin( QObject* parent, const QString& ficheHost, int fichePort ); -} + +/** @brief Send the current log file to a pastebin + * + * Returns the (string) URL that the pastebin gives us. + */ +QString sendLogToPastebin( QObject* parent, const QString& ficheHost, int fichePort ); + +} // namespace CalamaresUtils #endif