CodePaster: Do better checking on hosts.

Do an initial connection check on the host
(once per host). Add utility function to
NetworkProtocol, displaying connection check
message box.
Move the 'Paste' handling into the PasteView
dialog, such that the checking happens there
and the dialog stays open if something fails.

Task-number: QTCREATORBUG-2117
This commit is contained in:
Friedemann Kleint
2010-08-20 17:08:09 +02:00
parent a18c8f9e96
commit 94babbd9ca
11 changed files with 122 additions and 38 deletions

View File

@@ -208,25 +208,10 @@ void CodepasterPlugin::post(QString data, const QString &mimeType)
QString comment;
QString protocolName;
PasteView view(m_protocols, 0);
PasteView view(m_protocols, mimeType, 0);
view.setProtocol(m_settings->protocol);
if (!view.show(username, description, comment, lst))
return; // User canceled post
username = view.user();
description = view.description();
comment = view.comment();
data = view.content();
protocolName = view.protocol();
foreach(Protocol *protocol, m_protocols) {
if (protocol->name() == protocolName) {
const Protocol::ContentType ct = Protocol::contentType(mimeType);
if (Protocol::ensureConfiguration(protocol))
protocol->paste(data, ct, username, comment, description);
break;
}
}
view.show(username, description, comment, lst);
}
void CodepasterPlugin::fetch()