Redirecting logUpload vars to pasteUtility
This commit is contained in:
parent
f6cb879929
commit
ff66e4b3d5
@ -86,6 +86,7 @@ const QStringList Branding::s_styleEntryStrings =
|
|||||||
"sidebarTextSelect",
|
"sidebarTextSelect",
|
||||||
"sidebarTextHighlight"
|
"sidebarTextHighlight"
|
||||||
};
|
};
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
// *INDENT-ON*
|
// *INDENT-ON*
|
||||||
|
|
||||||
@ -510,6 +511,11 @@ Branding::initSimpleSettings( const YAML::Node& doc )
|
|||||||
{
|
{
|
||||||
m_windowHeight = WindowDimension( CalamaresUtils::windowPreferredHeight, WindowDimensionUnit::Pixies );
|
m_windowHeight = WindowDimension( CalamaresUtils::windowPreferredHeight, WindowDimensionUnit::Pixies );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_logUploadEnable = doc[ "logUpload.enable" ].as< bool >( false );
|
||||||
|
m_logUploadURL = getString( doc, "logUpload.url") ;
|
||||||
|
m_logUploadPort = doc[ "logUpload.port" ].as< int >();
|
||||||
|
m_logUploadStyle= getString(doc, "logUpload.style" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -42,6 +42,7 @@ public:
|
|||||||
* e.g. *Branding::ProductName to get the string value for
|
* e.g. *Branding::ProductName to get the string value for
|
||||||
* the product name.
|
* the product name.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enum StringEntry
|
enum StringEntry
|
||||||
{
|
{
|
||||||
ProductName,
|
ProductName,
|
||||||
@ -214,6 +215,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
void setGlobals( GlobalStorage* globalStorage ) const;
|
void setGlobals( GlobalStorage* globalStorage ) const;
|
||||||
|
|
||||||
|
|
||||||
|
//Paste functionality related
|
||||||
|
bool logUploadEnable() { return m_logUploadEnable; };
|
||||||
|
QString logUploadURL() { return m_logUploadURL; };
|
||||||
|
int logUploadPort() { return m_logUploadPort; };
|
||||||
|
QString logUploadStyle() { return m_logUploadStyle; };
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
QString string( StringEntry stringEntry ) const;
|
QString string( StringEntry stringEntry ) const;
|
||||||
QString versionedName() const { return string( VersionedName ); }
|
QString versionedName() const { return string( VersionedName ); }
|
||||||
@ -261,6 +269,11 @@ private:
|
|||||||
bool m_welcomeStyleCalamares;
|
bool m_welcomeStyleCalamares;
|
||||||
bool m_welcomeExpandingLogo;
|
bool m_welcomeExpandingLogo;
|
||||||
|
|
||||||
|
bool m_logUploadEnable;
|
||||||
|
QString m_logUploadURL;
|
||||||
|
int m_logUploadPort;
|
||||||
|
QString m_logUploadStyle;
|
||||||
|
|
||||||
WindowExpansion m_windowExpansion;
|
WindowExpansion m_windowExpansion;
|
||||||
WindowDimension m_windowHeight, m_windowWidth;
|
WindowDimension m_windowHeight, m_windowWidth;
|
||||||
WindowPlacement m_windowPlacement;
|
WindowPlacement m_windowPlacement;
|
||||||
|
@ -140,7 +140,7 @@ ViewManager::insertViewStep( int before, ViewStep* step )
|
|||||||
void
|
void
|
||||||
ViewManager::onInstallationFailed( const QString& message, const QString& details )
|
ViewManager::onInstallationFailed( const QString& message, const QString& details )
|
||||||
{
|
{
|
||||||
bool shouldOfferWebPaste = false; // TODO: config var
|
bool shouldOfferWebPaste = Calamares::Branding::instance()->logUploadEnable(); // TODO: config var
|
||||||
|
|
||||||
cError() << "Installation failed:";
|
cError() << "Installation failed:";
|
||||||
cDebug() << "- message:" << message;
|
cDebug() << "- message:" << message;
|
||||||
@ -183,8 +183,9 @@ ViewManager::onInstallationFailed( const QString& message, const QString& detail
|
|||||||
connect( msgBox, &QMessageBox::buttonClicked, [msgBox]( QAbstractButton* button ) {
|
connect( msgBox, &QMessageBox::buttonClicked, [msgBox]( QAbstractButton* button ) {
|
||||||
if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole )
|
if ( msgBox->buttonRole( button ) == QMessageBox::ButtonRole::YesRole )
|
||||||
{
|
{
|
||||||
// TODO: host and port should be configurable
|
QString pasteURLHost = Calamares::Branding::instance()->logUploadURL();
|
||||||
QString pasteUrlMsg = CalamaresUtils::sendLogToPastebin( msgBox, QStringLiteral( "termbin.com" ), 9999 );
|
int pasteURLPort = Calamares::Branding::instance()->logUploadPort();
|
||||||
|
QString pasteUrlMsg = CalamaresUtils::sendLogToPastebin( msgBox, pasteURLHost, pasteURLPort );
|
||||||
|
|
||||||
QString pasteUrlTitle = tr( "Install Log Paste URL" );
|
QString pasteUrlTitle = tr( "Install Log Paste URL" );
|
||||||
if ( pasteUrlMsg.isEmpty() )
|
if ( pasteUrlMsg.isEmpty() )
|
||||||
|
Loading…
Reference in New Issue
Block a user