Git commit 13eccbb830483cbce0855cf407902bb64462c151 by Emmanuel Lepage Vall= ee. Committed on 30/04/2015 at 23:38. Pushed by lepagevalleeemmanuel into branch 'master'. ux: Hide the video dock when there is no calls Refs #71995 M +14 -2 src/ring.cpp M +1 -0 src/ring.h M +1 -0 src/widgets/bookmarkdock.cpp http://commits.kde.org/ring-kde/13eccbb830483cbce0855cf407902bb64462c151 diff --git a/src/ring.cpp b/src/ring.cpp index 0e6ac3d..e0a6628 100644 --- a/src/ring.cpp +++ b/src/ring.cpp @@ -72,6 +72,7 @@ #include "extensions/presencecollectionextension.h" #include "delegates/profilepersisterdelegate.h" #include "klib/kdeprofilepersistor.h" +#include "video/renderer.h" = = //Ring @@ -271,7 +272,8 @@ Ring::Ring(QWidget* parent) connect(CallModel::instance()->selectionModel(),SIGNAL(currentRowChange= d(QModelIndex,QModelIndex)),this,SLOT(selectCallTab())); = #ifdef ENABLE_VIDEO - connect(CallModel::instance(),SIGNAL(rendererAdded(Call*,Video::Rendere= r*)),this,SLOT(displayVideoDock(Call*,Video::Renderer*))); + connect(CallModel::instance(),&CallModel::rendererAdded,this,&Ring::dis= playVideoDock); + connect(CallModel::instance(),&CallModel::rendererRemoved,this,&Ring::h= ideVideoDock); #endif = statusBar()->addWidget(m_pStatusBarWidget); @@ -586,14 +588,24 @@ void Ring::hidePresenceDock() void Ring::displayVideoDock(Call* c, Video::Renderer* r) { Q_UNUSED(c) + if (!m_pVideoDW) { m_pVideoDW =3D new VideoDock(this); addDockWidget( Qt::TopDockWidgetArea, m_pVideoDW ); - m_pVideoDW->setFloating(true); +// m_pVideoDW->setFloating(true); } m_pVideoDW->addRenderer(r); m_pVideoDW->show(); } + +void Ring::hideVideoDock(Call* c, Video::Renderer* r) +{ + Q_UNUSED(c) + Q_UNUSED(r) + if (m_pVideoDW) { + m_pVideoDW->hide(); + } +} #endif = ///The daemon is not found diff --git a/src/ring.h b/src/ring.h index b767837..9a18b2a 100644 --- a/src/ring.h +++ b/src/ring.h @@ -132,6 +132,7 @@ private Q_SLOTS: void slotPresenceEnabled ( bool state = ); #ifdef ENABLE_VIDEO void displayVideoDock ( Call* c, Video::Rendere= r* r ); + void hideVideoDock ( Call* c, Video::Rendere= r* r ); #endif = public Q_SLOTS: diff --git a/src/widgets/bookmarkdock.cpp b/src/widgets/bookmarkdock.cpp index fb5ffcf..ff8481f 100644 --- a/src/widgets/bookmarkdock.cpp +++ b/src/widgets/bookmarkdock.cpp @@ -94,6 +94,7 @@ m_pBookmark(nullptr) setWidget(mainWidget); = m_pMostUsedCK->setText(i18n("Show most called contacts")); + m_pMostUsedCK->setVisible(false); //FIXME = m_pTopWidget->layout()->addWidget ( m_pMostUsedCK ); =20