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

« back to all changes in this revision

Viewing changes to kde/src/conf/dlgaccounts.h

  • 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
 *                                                                          *
21
21
 
22
22
#include "ui_dlgaccountsbase.h"
23
23
#include "../lib/account.h"
24
 
#include "../lib/callmanager_interface_singleton.h"
 
24
#include "../lib/dbus/callmanager.h"
 
25
#include "../lib/ringtonemodel.h"
 
26
#include <QtGui/QStyledItemDelegate>
25
27
 
26
28
//Qt
27
29
class QWidget;
29
31
//KDE
30
32
class KConfigDialog;
31
33
 
32
 
//Typedef
33
 
typedef QHash<QString, QString> StringHash;                          //Needed to fix a Qt foreach macro argument parsing bug
34
 
 
35
 
///RingToneListItem: Ringtone list widget
36
 
class RingToneListItem : public QWidget
37
 
{
38
 
   Q_OBJECT
39
 
   friend class DlgAccounts;
40
 
   ///Constructor
41
 
   RingToneListItem(QString path, QString name) : QWidget(0),m_Path(path) {
42
 
      QHBoxLayout* l  = new QHBoxLayout(this);
43
 
      m_pPlayPB       = new QPushButton(this);
44
 
      QLabel* lblName = new QLabel(name,this);
45
 
      l->setContentsMargins(0,0,0,0);
46
 
      m_pPlayPB->setIcon(KIcon("media-playback-start"));
47
 
      m_pPlayPB->setVisible(false);
48
 
      lblName->setStyleSheet("padding-left:5px;");
49
 
      lblName->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
50
 
      l->addWidget(lblName);
51
 
      l->addWidget(m_pPlayPB);
52
 
      connect(m_pPlayPB,SIGNAL(clicked()),this,SLOT(playRingtone()));
53
 
   }
54
 
protected:
55
 
   ///Show the button when the cursor is over the item
56
 
   virtual void enterEvent ( QEvent * event ) {
57
 
      Q_UNUSED(event)
58
 
      m_pPlayPB->setVisible(true);
59
 
   }
60
 
   ///Hide the button when the mouse leave the button
61
 
   virtual void leaveEvent ( QEvent * event ) {
62
 
      Q_UNUSED(event)
63
 
      m_pPlayPB->setVisible(false);
64
 
   }
65
 
private Q_SLOTS:
66
 
   ///Play the ringtone file when the button is clicked
67
 
   void playRingtone() {
68
 
      CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance();
69
 
      Q_NOREPLY callManager.startRecordedFilePlayback(m_Path);
70
 
   }
71
 
private:
72
 
   QString m_Path;
73
 
   QPushButton* m_pPlayPB;
74
 
};
 
34
//SFLPhone
 
35
class TipManager;
 
36
class Tip;
75
37
 
76
38
/**
77
39
 *  @author Jérémy Quentin <jeremy.quentin@gmail.com>
85
47
   explicit DlgAccounts(KConfigDialog *parent = nullptr);
86
48
   ~DlgAccounts();
87
49
 
88
 
   void saveAccount(QModelIndex item);
 
50
   void saveAccount(const QModelIndex& item);
89
51
 
90
52
   void cancel();
91
53
 
107
69
 
108
70
private:
109
71
   ///Attributes
110
 
   QList<StringHash>     codecList             ;
 
72
   QList< QHash<QString, QString> >  codecList ;
111
73
   bool                  accountListHasChanged ;
112
74
   QMap<QString,QString> m_hRingtonePath       ;
113
75
   int                   m_IsLoading           ;
 
76
   TipManager*           m_pTipManager         ;
 
77
   Tip*                  m_pTip                ;
 
78
 
 
79
   //Methods
 
80
   Account* currentAccount() const;
114
81
 
115
82
public Q_SLOTS:
116
83
   void loadAccountList                  ();
129
96
   void addCredential                    ();
130
97
   void removeCredential                 ();
131
98
   void enablePublished                  ();
132
 
   void updateAccountStates              ();
 
99
//    void updateAccountStates              ();
133
100
   void updateAccountListCommands        ();
134
101
   void main_password_field_changed      ();
135
102
   void main_credential_password_changed ();
142
109
 
143
110
   void loadVidCodecDetails        ( const QModelIndex& current, const QModelIndex& previous );
144
111
   void selectedCodecChanged       ( const QModelIndex& current, const QModelIndex& previous );
145
 
   void updateStatusLabel          ( QModelIndex item                                        );
146
 
   void accountListChanged         ( QModelIndex current, QModelIndex previous               );
147
 
   void selectCredential           ( QModelIndex item, QModelIndex previous                  );
 
112
   void updateStatusLabel          ( const QModelIndex& item                                 );
 
113
   void updateStatusLabel          (                                                         );
 
114
   void accountListChanged         ( const QModelIndex& current, const QModelIndex& previous );
 
115
   void selectCredential           ( const QModelIndex& item   , const QModelIndex& previous );
148
116
   void updateStatusLabel          ( Account*   account                                      );
149
117
   void updateCombo                ( int            value                                    );
150
118
   void saveCredential             (                                                         );