void ViewController::moveCallTabToWindow(size_t tabId, size_t windowId) { if (!hasCall(tabId)) return; removeCallTab(tabId); auto tab = getCallTab(tabId); windowMap[windowId]->addTab(tab); removeEmptyWindowsWithDelay(); }
void TestPhoneCallImpl::dial( const QDialOptions& options ) { provider().beginStateTransaction(); if ( hasCall( QPhoneCall::Dialing ) ) { // There is already a dialing call. setState( QPhoneCall::HangupLocal ); provider().endStateTransaction(); return; } if ( hasCall( QPhoneCall::Connected ) ) { if ( hasCall( QPhoneCall::Hold ) ) { // No free slots for the dialing call. setState( QPhoneCall::HangupLocal ); provider().endStateTransaction(); return; } findCall( QPhoneCall::Connected )->setState( QPhoneCall::Hold ); } setNumber( options.number() ); setState( QPhoneCall::Dialing ); provider().endStateTransaction(); QTimer::singleShot( 1000, this, SLOT(connectTimeout()) ); }
void ViewController::moveCallTabToNewWindow(size_t tabId) { if (!hasCall(tabId)) return; auto newWindow = util::make_unique<gui::CallWindow>( util::makeRef<ViewController>(*this), ++max_window_id); removeCallTab(tabId); newWindow->addTab(getCallTab(tabId)); newWindow->show(); if (doesShowExitProgramButton) { newWindow->showExitProgramButton(); } windowMap[max_window_id] = std::move(newWindow); removeEmptyWindowsWithDelay(); }
void ViewController::removeCallTab(size_t tabId, bool deleteIt, bool deleteCall) { auto *curWindow = getCurrentWindowOfTab(tabId); if (curWindow->hasTab(tabId)) { getCurrentWindowOfTab(tabId)->removeTab(tabId); if (deleteIt) { callTabMap.erase(tabId); } } if (deleteCall && hasCall(tabId)) { ovPanel->removeElement(tabId); impl::dataController().removeCall(tabId); } removeEmptyWindowsWithDelay(); }
void TestPhoneCallImpl::hold() { if ( state() == QPhoneCall::Connected && !hasCall( QPhoneCall::Connected ) ) setState( QPhoneCall::Hold ); }