~ubuntu-branches/ubuntu/oneiric/kdeplasma-addons/oneiric

« back to all changes in this revision

Viewing changes to applets/rememberthemilk/rememberthemilk-plasmoid.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-26 13:35:18 UTC
  • mto: (0.4.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: james.westby@ubuntu.com-20101126133518-remqkgqjafk2a4jc
Tags: upstream-4.5.80
ImportĀ upstreamĀ versionĀ 4.5.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
  m_authService->setParent(this);
96
96
  connect(m_authService, SIGNAL(finished(Plasma::ServiceJob*)), SLOT(jobFinished(Plasma::ServiceJob*)));
97
97
  
98
 
  if (m_token.isNull())
99
 
    setConfigurationRequired(true, i18n("Authentication to Remember The Milk needed"));
100
 
  else {
101
 
    KConfigGroup cg = m_authService->operationDescription("AuthWithToken");
102
 
    cg.writeEntry("token", m_token);
103
 
    busyUntil(m_authService->startOperationCall(cg)); 
104
 
    busyUntil(0); // Sets busy until we manually call jobFinished(0). Busy until first tasks refresh
105
 
  }
106
 
  
107
 
  QString sortBy = config().readEntry("SortBy").toLower();  
108
 
  kDebug() << "Config says sort by " << sortBy;
109
 
  if (sortBy == "date" || sortBy == "due")
110
 
    setSortBy(SortDue);
111
 
  else if (sortBy == "priority")
112
 
    setSortBy(SortPriority);
113
 
  else
114
 
    setSortBy(SortDue); // Default
 
98
  configChanged();
115
99
 
116
100
  Plasma::Applet::init();
117
101
  setAssociatedApplicationUrls(KUrl("http://rememberthemilk.com"));
377
361
  m_graphicsWidget->setMinimumSize(250, 300);
378
362
  m_graphicsWidget->setPreferredSize(300, 500);
379
363
 
380
 
  KConfigGroup cg = config();
381
 
  m_token = cg.readEntry("token");
382
 
  kDebug() << "Token from config: " << m_token;
383
 
 
384
364
  m_taskEditor = new TaskEditor(m_engine, m_tasksView);
385
365
  m_taskEditor->hide();
386
366
  connect(m_taskEditor, SIGNAL(requestDiscardChanges()), this, SLOT(onTaskEditorHide()));
391
371
  return m_graphicsWidget;
392
372
}
393
373
 
 
374
void RememberTheMilkPlasmoid::configChanged()
 
375
{
 
376
  KConfigGroup cg = config();
 
377
  m_token = cg.readEntry("token");
 
378
  kDebug() << "Token from config: " << m_token;
 
379
 
 
380
  if (m_token.isNull())
 
381
    setConfigurationRequired(true, i18n("Authentication to Remember The Milk needed"));
 
382
  else {
 
383
    KConfigGroup cg = m_authService->operationDescription("AuthWithToken");
 
384
    cg.writeEntry("token", m_token);
 
385
    busyUntil(m_authService->startOperationCall(cg)); 
 
386
    busyUntil(0); // Sets busy until we manually call jobFinished(0). Busy until first tasks refresh
 
387
  }
 
388
  
 
389
  QString sortBy = config().readEntry("SortBy").toLower();  
 
390
  kDebug() << "Config says sort by " << sortBy;
 
391
  if (sortBy == "date" || sortBy == "due")
 
392
    setSortBy(SortDue);
 
393
  else if (sortBy == "priority")
 
394
    setSortBy(SortPriority);
 
395
  else
 
396
    setSortBy(SortDue); // Default
 
397
}
 
398
 
394
399
#include "rememberthemilk-plasmoid.moc"