mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-20 07:58:44 +00:00
Tell the user if the report couldn't be sent.
--HG-- branch : hotfix
This commit is contained in:
parent
3c61e39ce3
commit
bb9f6261d7
4 changed files with 22 additions and 4 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <QNetworkAccessManager>
|
||||
#include <QUrl>
|
||||
#include <QNetworkRequest>
|
||||
#include <QNetworkReply>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -37,7 +38,7 @@ QObject( parent )
|
|||
{
|
||||
m_pvt = new RCErrorSocketPvt();
|
||||
|
||||
connect( &m_pvt->mgr, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( onFinished() ) );
|
||||
connect( &m_pvt->mgr, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( onFinished( QNetworkReply* ) ) );
|
||||
}
|
||||
|
||||
RCErrorSocket::~RCErrorSocket()
|
||||
|
@ -59,8 +60,11 @@ void RCErrorSocket::sendReport( const RCErrorData &data )
|
|||
m_pvt->mgr.post( request, params.encodedQuery() );
|
||||
}
|
||||
|
||||
void RCErrorSocket::onFinished()
|
||||
void RCErrorSocket::onFinished( QNetworkReply *reply )
|
||||
{
|
||||
Q_EMIT reportSent();
|
||||
if( reply->error() != QNetworkReply::NoError )
|
||||
Q_EMIT reportFailed();
|
||||
else
|
||||
Q_EMIT reportSent();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "rcerror_data.h"
|
||||
|
||||
class RCErrorSocketPvt;
|
||||
class QNetworkReply;
|
||||
|
||||
class RCErrorSocket : public QObject
|
||||
{
|
||||
|
@ -37,9 +38,10 @@ public:
|
|||
|
||||
Q_SIGNALS:
|
||||
void reportSent();
|
||||
void reportFailed();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onFinished();
|
||||
void onFinished( QNetworkReply *reply );
|
||||
|
||||
private:
|
||||
RCErrorSocketPvt *m_pvt;
|
||||
|
|
|
@ -39,6 +39,7 @@ QWidget( parent )
|
|||
connect( m_ui.emailCB, SIGNAL( stateChanged( int ) ), this, SLOT( onCBClicked() ) );
|
||||
|
||||
connect( m_socket, SIGNAL( reportSent() ), this, SLOT( onReportSent() ) );
|
||||
connect( m_socket, SIGNAL( reportFailed() ), this, SLOT( onReportFailed() ) );
|
||||
}
|
||||
|
||||
RCErrorWidget::~RCErrorWidget()
|
||||
|
@ -97,3 +98,13 @@ void RCErrorWidget::onReportSent()
|
|||
close();
|
||||
}
|
||||
|
||||
void RCErrorWidget::onReportFailed()
|
||||
{
|
||||
QApplication::setOverrideCursor( Qt::ArrowCursor );
|
||||
|
||||
QMessageBox::information( this,
|
||||
tr( "Report failed" ),
|
||||
tr( "Failed to send the report..." ) );
|
||||
|
||||
close();
|
||||
}
|
|
@ -41,6 +41,7 @@ private Q_SLOTS:
|
|||
void onCBClicked();
|
||||
|
||||
void onReportSent();
|
||||
void onReportFailed();
|
||||
|
||||
private:
|
||||
Ui::RCErrorWidget m_ui;
|
||||
|
|
Loading…
Reference in a new issue