~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to kde/src/conf/dlggeneral.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 *   Copyright (C) 2009-2013 by Savoir-Faire Linux                          *
 
2
 *   Copyright (C) 2009-2014 by Savoir-Faire Linux                          *
3
3
 *   Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com>          *
4
4
 *            Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
5
5
 *                                                                          *
24
24
 
25
25
//KDE
26
26
#include <KMessageBox>
 
27
#include <KLocale>
 
28
#include <KIcon>
27
29
 
28
30
//SFLPhone
29
 
#include "klib/configurationskeleton.h"
 
31
#include "klib/kcfg_settings.h"
30
32
#include "conf/configurationdialog.h"
31
 
#include "lib/configurationmanager_interface_singleton.h"
 
33
#include "lib/dbus/configurationmanager.h"
 
34
#include "lib/historymodel.h"
32
35
 
33
36
///Constructor
34
37
DlgGeneral::DlgGeneral(KConfigDialog *parent)
37
40
   setupUi(this);
38
41
   connect(toolButton_historyClear, SIGNAL(clicked()), this, SLOT(slotClearCallHistoryAsked()));
39
42
   toolButton_historyClear->setIcon(KIcon("edit-clear-history"));
 
43
   const bool isLimited = HistoryModel::instance()->isHistoryLimited();
 
44
   m_pKeepHistory->setChecked(!isLimited);
 
45
   m_pHistoryMax ->setEnabled(isLimited );
40
46
 
41
 
   kcfg_historyMax->setValue(ConfigurationSkeleton::historyMax());
 
47
   m_pHistoryMax->setValue(HistoryModel::instance()->historyLimit());
 
48
   m_HasChanged = false;
42
49
   connect(this             , SIGNAL(updateButtons())                , parent, SLOT(updateButtons()));
43
50
}
44
51
 
68
75
///Save current settings
69
76
void DlgGeneral::updateSettings()
70
77
{
71
 
//    QMutableMapIterator<QString, QString> iter(m_lCallDetails);
72
 
//    while (iter.hasNext()) {
73
 
//       iter.next();
74
 
//       ConfigurationSkeleton::self()->findItem(iter.value())->setProperty(m_lItemList[iter.value()]->checkState() == Qt::Checked);
75
 
//    }
76
 
   ConfigurationSkeleton::setHistoryMax(kcfg_historyMax->value());
 
78
   HistoryModel::instance()->setHistoryLimited(m_pKeepHistory->isChecked());
 
79
   if (!m_pKeepHistory->isChecked())
 
80
      HistoryModel::instance()->setHistoryLimit(m_pHistoryMax->value());
77
81
 
78
82
   m_HasChanged = false;
79
83
}
80
84
 
81
85
void DlgGeneral::slotClearCallHistoryAsked()
82
86
{
83
 
   int ret = KMessageBox::questionYesNo(this, i18n("Are you sure you want to clear history?"), i18n("Clear history"));
 
87
   const int ret = KMessageBox::questionYesNo(this, i18n("Are you sure you want to clear history?"), i18n("Clear history"));
84
88
   if (ret == KMessageBox::Yes) {
85
 
      ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
 
89
      ConfigurationManagerInterface& configurationManager = DBus::ConfigurationManager::instance();
86
90
      configurationManager.clearHistory();
87
91
   }
88
92
}