~ubuntu-branches/ubuntu/trusty/sflphone/trusty

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (4.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20140128182336-jrsv0k9u6cawc068
Tags: 1.3.0-1
* 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) 2012-2013 by Savoir-Faire Linux                          *
 
2
 *   Copyright (C) 2012-2014 by Savoir-Faire Linux                          *
3
3
 *   Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
4
4
 *                                                                          *
5
5
 *   This library is free software; you can redistribute it and/or          *
20
20
//KDE
21
21
#include <KDebug>
22
22
#include <KConfigDialog>
 
23
#include <KLocale>
23
24
 
24
25
//SFLPhone
25
26
#include "../lib/videodevice.h"
32
33
{
33
34
   setupUi(this);
34
35
   
35
 
   const QList<VideoDevice*> devices =  VideoDevice::getDeviceList();
 
36
   const QList<VideoDevice*> devices =  VideoDevice::deviceList();
36
37
   foreach(VideoDevice* dev,devices) {
37
 
      m_pDeviceCB->addItem(dev->getDeviceId());
 
38
      m_pDeviceCB->addItem(dev->deviceId());
38
39
   }
39
40
 
40
41
   connect(m_pDeviceCB    ,SIGNAL(currentIndexChanged(QString)), this   , SLOT(loadDevice(QString))    );
48
49
   m_pConfGB->setEnabled(devices.size());
49
50
 
50
51
   if (devices.size())
51
 
      loadDevice(devices[0]->getDeviceId());
 
52
      loadDevice(devices[0]->deviceId());
52
53
 
53
 
   if (VideoModel::getInstance()->isPreviewing()) {
 
54
   if (VideoModel::instance()->isPreviewing()) {
54
55
      m_pPreviewPB->setText(i18n("Stop preview"));
55
56
   }
56
57
   m_IsChanged = false;
60
61
///Destructor
61
62
DlgVideo::~DlgVideo()
62
63
{
63
 
   VideoModel::getInstance()->stopPreview();
 
64
   VideoModel::instance()->stopPreview();
64
65
}
65
66
 
66
67
///Has the dialog chnaged
77
78
      emit updateButtons();
78
79
   }
79
80
   m_pDevice = VideoDevice::getDevice(device);
80
 
   QString curChan = m_pDevice->getChannel();
 
81
   const QString curChan = m_pDevice->channel();
81
82
   if (m_pDevice) {
82
83
      m_pChannelCB->clear();
83
 
      foreach(const VideoChannel& channel,m_pDevice->getChannelList()) {
 
84
      foreach(const VideoChannel& channel,m_pDevice->channelList()) {
84
85
         m_pChannelCB->addItem(channel);
85
86
         if (channel == curChan)
86
87
            m_pChannelCB->setCurrentIndex(m_pChannelCB->count()-1);
95
96
      m_IsChanged = true;
96
97
      emit updateButtons();
97
98
   }
98
 
   Resolution current = m_pDevice->getResolution();
 
99
   Resolution current = m_pDevice->resolution();
99
100
   m_pResolutionCB->clear();
100
 
   foreach(const Resolution& res,m_pDevice->getResolutionList(channel)) {
 
101
   foreach(const Resolution& res,m_pDevice->resolutionList(channel)) {
101
102
      m_pResolutionCB->addItem(res.toString());
102
103
      if (current == res) {
103
104
         m_pResolutionCB->setCurrentIndex(m_pResolutionCB->count()-1);
114
115
      emit updateButtons();
115
116
   }
116
117
   m_pRateCB->clear();
117
 
   QString rate = m_pDevice->getRate();
118
 
   foreach(const QString& r,m_pDevice->getRateList(m_pChannelCB->currentText(),resolution)) {
 
118
   const QString rate = m_pDevice->rate();
 
119
   foreach(const QString& r,m_pDevice->rateList(m_pChannelCB->currentText(),resolution)) {
119
120
      m_pRateCB->addItem(r);
120
121
      if (r == rate)
121
122
         m_pRateCB->setCurrentIndex(m_pRateCB->count()-1);
137
138
void DlgVideo::startStopPreview()
138
139
{
139
140
   //TODO check if the preview is already running
140
 
   if (VideoModel::getInstance()->isPreviewing()) {
 
141
   if (VideoModel::instance()->isPreviewing()) {
141
142
      m_pPreviewPB->setText(i18n("Start preview"));
142
 
      VideoModel::getInstance()->stopPreview();
 
143
      VideoModel::instance()->stopPreview();
143
144
   }
144
145
   else {
145
146
      m_pPreviewPB->setText(i18n("Stop preview"));
146
 
      VideoModel::getInstance()->startPreview();
 
147
      VideoModel::instance()->startPreview();
147
148
   }
148
149
}