34
34
#include <KMessageBox>
35
35
#include <KStandardDirs>
36
36
#include <KStandardGuiItem>
38
39
#include <QtCore/QFile>
40
#include <QtCore/QPointer>
39
41
#include <QtGui/QGridLayout>
40
42
#include <QtGui/QMenu>
41
43
#include <QtGui/QPushButton>
42
#include <QtGui/QTextEdit>
43
44
#include <QDBusInterface>
44
45
#include <QDBusMessage>
45
46
#include <QDBusReply>
120
121
void AgentWidget::addAgent()
122
Akonadi::AgentTypeDialog dlg( this );
124
const AgentType agentType = dlg.agentType();
123
QPointer<Akonadi::AgentTypeDialog> dlg = new Akonadi::AgentTypeDialog( this );
125
const AgentType agentType = dlg->agentType();
126
127
if ( agentType.isValid() ) {
127
128
AgentInstanceCreateJob *job = new AgentInstanceCreateJob( agentType, this );
194
196
AgentInstance agent = ui.instanceWidget->currentAgentInstance();
195
197
if ( agent.isValid() ) {
196
AgentConfigDialog dlg( this );
197
dlg.setAgentInstance( agent );
198
QPointer<AgentConfigDialog> dlg = new AgentConfigDialog( this );
199
dlg->setAgentInstance( agent );
231
234
txt = reply.error().message();
234
TextDialog dlg( this );
235
dlg.setCaption( QLatin1String( "Resource Task List" ) );
237
QPointer<TextDialog> dlg = new TextDialog( this );
238
dlg->setCaption( QLatin1String( "Resource Task List" ) );
240
244
void AgentWidget::showChangeNotifications()
254
258
txt = reply.error().message();
257
TextDialog dlg( this );
258
dlg.setCaption( QLatin1String( "Change Notification Log" ) );
261
QPointer<TextDialog> dlg = new TextDialog( this );
262
dlg->setCaption( QLatin1String( "Change Notification Log" ) );
264
269
void AgentWidget::synchronizeTree()
366
371
QString onlineStatus = ( instance.isOnline() ? i18n( "Online" ) : i18n( "Offline" ) );
367
372
QString agentStatus;
368
373
switch( instance.status() ) {
369
case AgentInstance::Idle: agentStatus = i18n( "Idle" ); break;
370
case AgentInstance::Running: agentStatus = i18n( "Running (%1%)", instance.progress() ); break;
371
case AgentInstance::Broken: agentStatus = i18n( "Broken" ); break;
374
case AgentInstance::Idle: agentStatus =
375
i18nc( "agent is in an idle state", "Idle" );
377
case AgentInstance::Running: agentStatus =
378
i18nc( "agent is running", "Running (%1%)", instance.progress() );
380
case AgentInstance::Broken: agentStatus =
381
i18nc( "agent is broken somehow", "Broken" );
373
ui.statusLabel->setText( i18nc( "Two statuses, for example \"Online, Running (66%)\" or \"Offline, Broken\"",
374
"%1, %2", onlineStatus, agentStatus ) );
384
ui.statusLabel->setText(
385
i18nc( "Two statuses, for example \"Online, Running (66%)\" or \"Offline, Broken\"",
386
"%1, %2", onlineStatus, agentStatus ) );
375
387
ui.statusMessageLabel->setText( instance.statusMessage() );
376
388
ui.capabilitiesLabel->setText( instance.type().capabilities().join( ", " ) );
377
389
ui.mimeTypeLabel->setText( instance.type().mimeTypes().join( ", " ) );