Пример #1
0
void SpectrumCanvas::OnMouseMoved(wxMouseEvent& event) {
    InteractiveCanvas::OnMouseMoved(event);
    if (mouseTracker.mouseDown()) {
        int freqChange = mouseTracker.getDeltaMouseX() * getBandwidth();

        if (freqChange != 0) {
            moveCenterFrequency(freqChange);
        }
    }
    else if (scaleFactorEnabled && mouseTracker.mouseRightDown()) {
        
        float yDelta = mouseTracker.getDeltaMouseY();

        scaleFactor += yDelta*2.0;
        if (scaleFactor < 0.25) {
            scaleFactor = 0.25;
        }
        if (scaleFactor > 10.0) {
            scaleFactor = 10.0;
        }
        
        resetScaleFactor = false;
        updateScaleFactor(scaleFactor);
    } else {
        if (scaleFactorEnabled) {
            setStatusText("Drag horizontal to adjust center frequency. Right-drag or SHIFT+UP/DOWN to adjust vertical scale; right-click to reset. 'B' to toggle decibels display.");
        } else {
            setStatusText("Displaying spectrum of active demodulator.");
        }
    }
}
Пример #2
0
ToolBoxWidget::ToolBoxWidget(QWidget *parent) :
    QDockWidget(parent),
    ui(new Ui::ToolBoxWidget)
{
    ui->setupUi(this);

    emptyPage = new QWidget; //index 0
    this-ui->stackedWidget->addWidget(emptyPage);
    createBlockW = new CreateBlockWidget; //index 1
    this->ui->stackedWidget->addWidget(createBlockW);
    moveVerticesW = new MoveVerticesWidget; //index 2
    this->ui->stackedWidget->addWidget(moveVerticesW);
    setBCsW = new SetBCsWidget; //index 3
    this->ui->stackedWidget->addWidget(setBCsW);
    edgePropsW = new EdgePropsWidget; //index 4
    this->ui->stackedWidget->addWidget(edgePropsW);
    this->ui->stackedWidget->setCurrentIndex(1);

    connect(createBlockW,SIGNAL(cancel()),this,SLOT(slotCancel()));
    connect(setBCsW,SIGNAL(done()),this,SLOT(slotCancel()));
    connect(moveVerticesW,SIGNAL(setStatusText(QString)),this,SLOT(slotSetStatusText(QString)));
    connect(moveVerticesW,SIGNAL(moveDone()),this,SLOT(slotCancel()));
    connect(createBlockW,SIGNAL(setStatusText(QString)),this,SLOT(slotSetStatusText(QString)));
    connect(setBCsW,SIGNAL(setStatusText(QString)),this,SLOT(slotSetStatusText(QString)));
    connect(edgePropsW,SIGNAL(cancel()),this,SLOT(slotCancel()));
    connect(edgePropsW,SIGNAL(setStatusText(QString)),this,SLOT(slotSetStatusText(QString)));

}
Пример #3
0
void BasketStatusBar::setStatusBarHint(const QString &hint)
{
    if (hint.isEmpty())
        updateStatusBarHint();
    else
        setStatusText(hint);
}
Пример #4
0
void SpectrumCanvas::moveCenterFrequency(long long freqChange) {
    long long freq = wxGetApp().getFrequency();

    if (isView) {
        if (centerFreq - freqChange < bandwidth/2) {
            centerFreq = bandwidth/2;
        } else {
            centerFreq -= freqChange;
        }

        if (waterfallCanvas) {
            waterfallCanvas->setCenterFrequency(centerFreq);
        }

        long long bwOfs = (centerFreq > freq) ? ((long long) bandwidth / 2) : (-(long long) bandwidth / 2);
        long long freqEdge = centerFreq + bwOfs;

        if (abs(freq - freqEdge) > (wxGetApp().getSampleRate() / 2)) {
            freqChange = -((centerFreq > freq) ? (freqEdge - freq - (wxGetApp().getSampleRate() / 2)) : (freqEdge - freq + (wxGetApp().getSampleRate() / 2)));
        } else {
            freqChange = 0;
        }
    }

    if (freqChange) {
        if (freq - freqChange < wxGetApp().getSampleRate()/2) {
            freq = wxGetApp().getSampleRate()/2;
        } else {
            freq -= freqChange;
        }
        wxGetApp().setFrequency(freq);
        setStatusText("Set center frequency: %s", freq);
    }
}
Пример #5
0
void ScopeCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
    InteractiveCanvas::OnMouseEnterWindow(event);
    if (!helpTip.empty()) {
        setStatusText(helpTip);
    }
    SetCursor(wxCURSOR_SIZEWE);
}
Пример #6
0
void QDeclarativeWebView::setPage(QWebPage* page)
{
    if (d->view->page() == page)
        return;

    d->view->setPage(page);
    updateContentsSize();
    page->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
    page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
    connect(page->mainFrame(), SIGNAL(urlChanged(QUrl)), this, SLOT(pageUrlChanged()));
    connect(page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
    connect(page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(iconChanged()));
    connect(page->mainFrame(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged()));
    connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayout()));
    connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), this, SIGNAL(contentsSizeChanged(QSize)));

    connect(page, SIGNAL(loadStarted()), this, SLOT(doLoadStarted()));
    connect(page, SIGNAL(loadProgress(int)), this, SLOT(doLoadProgress(int)));
    connect(page, SIGNAL(loadFinished(bool)), this, SLOT(doLoadFinished(bool)));
    connect(page, SIGNAL(statusBarMessage(QString)), this, SLOT(setStatusText(QString)));

    connect(page->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(windowObjectCleared()));

    page->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true);

}
Пример #7
0
void IEToolbar::dataUpdated(unsigned long dataId) {
  UserDataObserver& dataObserver = UserDataObserver::getInstance();

  //LOG4CPLUS_DEBUG(LogUtils::getLogger(), "IEToolbar::dataUpdated dataId = " << dataId);
  switch (dataId) {
  case FBM_POKES_COUNT_UPDATED:
    return setPokesCount(dataObserver.getPokesCount(false));
  case FBM_MESSAGES_CONT_UPDATED:
    return setMessagesCount(dataObserver.getMessagesCount(false));
  case FBM_REQUESTS_COUNT_PDATED:
    return setRequestsCount(dataObserver.getRequestsCount(false));
  case FBM_EVENTS_INVINTAIONS_COUNT_UPDATED:
    return setEventInvsCount(dataObserver.getEventsCount(false));
  case FBM_GROUPS_INVINTAIONS_COUNT_UPDATED:
    return setGroupInvsCount(dataObserver.getGroupsInvsCount(false));
  case FBM_MY_STATUS_UPDATED:
    setProfileName(dataObserver.getLoggedInUser(false).getName());
    setStatusText(dataObserver.getLoggedInUser(false).getStatusMessage());
    return;
  case FBM_JUST_LOGGED_IN:
    return loggedIn();
  case FBM_LOGOUT_INITIATED:
    return loggedOut();
  case FBM_UPDATE_VIEW:
    //updateView();
    break;
  }
}
Пример #8
0
void XMLHttpRequest::onReplyFinished() {
    const QString redirect = QString::fromUtf8(m_reply->rawHeader("Location"));
    
    if (!redirect.isEmpty()) {
        Logger::log("XMLHttpRequest::onReplyFinished(): Redirect: " + redirect);
        
        if (m_redirects < MAX_REDIRECTS) {
            QUrl url(redirect);
            
            if (url.scheme().isEmpty()) {
                url.setScheme(m_reply->url().scheme());
            }
            
            if (url.authority().isEmpty()) {
                url.setAuthority(m_reply->url().authority());
            }
            
            m_reply->deleteLater();
            m_reply = 0;
            followRedirect(url);
            return;
        }
    }
    
    if (m_reply->bytesAvailable() > 0) {
        m_response += m_reply->readAll();
    }
    
    setStatus(m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
    setStatusText(m_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString());
    setReadyState(DONE);
    m_reply->deleteLater();
    m_reply = 0;
}
Пример #9
0
QXmppPresence JabberPresenceService::statusToPresence(const Status &status)
{
	auto result = QXmppPresence{};
	result.setType(QXmppPresence::Available);
	result.setStatusText(status.description());

	switch (status.type())
	{
		case StatusType::FreeForChat:
			result.setAvailableStatusType(QXmppPresence::Chat);
			break;
		case StatusType::Online:
			result.setAvailableStatusType(QXmppPresence::Online);
			break;
		case StatusType::Away:
			result.setAvailableStatusType(QXmppPresence::Away);
			break;
		case StatusType::NotAvailable:
			result.setAvailableStatusType(QXmppPresence::XA);
			break;
		case StatusType::DoNotDisturb:
			result.setAvailableStatusType(QXmppPresence::DND);
			break;
		case StatusType::Invisible:
			result.setAvailableStatusType(QXmppPresence::DND);
			break;
		case StatusType::Offline:
		default:
			result.setType(QXmppPresence::Unavailable);
			break;
	}

	return result;
}
void InitVirtualDriveDialog::onDownloadRepoSuccess(const RepoDownloadInfo& info)
{
    int ret;
    QString worktree = seafApplet->configurator()->worktreeDir();
    QString error;

    ret = seafApplet->rpcClient()->downloadRepo(info.repo_id,
                                                info.repo_version, info.relay_id,
                                                info.repo_name, worktree,
                                                info.token, QString(),
                                                info.magic, info.relay_addr,
                                                info.relay_port, info.email,
                                                info.random_key, info.enc_version,
                                                info.more_info,
                                                &error);

    if (ret < 0) {
        fail(tr("Failed to download default library:\n %1").arg(error));
    } else {
        check_download_timer_ = new QTimer(this);
        connect(check_download_timer_, SIGNAL(timeout()), this, SLOT(checkDownloadProgress()));
        check_download_timer_->start(kCheckDownloadInterval);

        setStatusText(tr("Downloading default library..."));

        mRunInBackgroundBtn->setVisible(true);
        connect(mRunInBackgroundBtn, SIGNAL(clicked()), this, SLOT(hide()));
    }
}
Пример #11
0
void AMLoopAction3::internalDoNextAction()
{
	// did an action just finish completing?
	if(currentSubActionIndex_ >= 0) {

		internalDisconnectAction(currentSubAction_);
		// delete it later (since we might still be executing inside the action's functions).
		currentSubAction_->scheduleForDeletion();
		//currentSubAction_->deleteLater();
	}

	// Check if we are stopping now.
	if (skipAfterCurrentAction_)
		setSkipped();

	// do we have a next action in this loop? [This will also trigger the start of the very first action]
	else if(currentSubActionIndex_ < subActionCount()-1) {
		emit currentSubActionChanged(++currentSubActionIndex_);

		currentSubAction_ = subActions_.at(currentSubActionIndex_)->createCopy();
		internalConnectAction(currentSubAction_);

		if(state() == AMAction3::Pausing)
			setPaused();
		else if(state() == AMAction3::Running)
			currentSubAction_->start();
	}
	else {
		// done this loop.
		emit currentIterationChanged(++currentIteration_);

		if(generateScanActionMessages_){
			AMAgnosticDataAPILoopIncrementMessage loopIncrementedMessage(info()->shortDescription(), currentIteration_);
			AMAgnosticDataAPISupport::handlerFromLookupKey("ScanActions")->postMessage(loopIncrementedMessage);
		}

		// Are we stopping now that we are at the end of this iteration?
		if (skipAfterCurrentIteration_)
			setSkipped();

		// Is there a next one?
		else if(currentIteration_ < loopCount()) {
			setStatusText(QString("Loop %1 of %2.").arg(currentIteration_+1).arg(loopCount()));
			emit currentSubActionChanged(currentSubActionIndex_ = 0);

			currentSubAction_ = subActions_.at(currentSubActionIndex_)->createCopy();
			internalConnectAction(currentSubAction_);

			if(state() == AMAction3::Pausing)
				setPaused();
			else if(state() == AMAction3::Running)
				currentSubAction_->start();
		}
		// Nope, that's the end.
		else {
			setSucceeded();
		}
	}
}
Пример #12
0
void AMScanAction::pauseImplementation()
{
	if (controller_->pause()){

		setStatusText("Paused");
		setPaused();
	}
}
Пример #13
0
/// Called when we want to administrate our list of users
void App::adminUsers() {
    // Check if we have the rights
    dbo::ptr<User> user = userSession()->user();
    if (!user) {
        go(urls::home);
        setStatusText(WString::tr("access-denied"));
    }
}
Пример #14
0
void StatusBar::showColor(int msecs, const char* text, const app::Color& color, int alpha)
{
  if (setStatusText(msecs, text)) {
    m_state = SHOW_COLOR;
    m_color = color;
    m_alpha = alpha;
  }
}
Пример #15
0
void XMLHttpRequest::reset() {
    setReadyState(UNSENT);
    setStatus(0);
    setStatusText(QString());
    m_request = QNetworkRequest();
    m_response = QByteArray();
    m_responseHeaders.clear();
}
Пример #16
0
void AMScanAction::resumeImplementation()
{
	if (controller_->resume()){

		setStatusText("Running");
		setResumed();
	}
}
void InitVirtualDriveDialog::fail(const QString& reason)
{
    ensureVisible();

    setStatusText(reason);
    mFinishBtn->setVisible(true);
    connect(mFinishBtn, SIGNAL(clicked()), this, SLOT(reject()));
}
Пример #18
0
void ModeSelectorCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
    InteractiveCanvas::mouseTracker.OnMouseEnterWindow(event);
    SetCursor (wxCURSOR_HAND);
    if (!helpTip.empty()) {
        setStatusText(helpTip);
    }
    Refresh();
}
Пример #19
0
void PeerListRow::refreshStatus() {
	if (!_initialized || _statusType == StatusType::Custom) {
		return;
	}
	_statusType = StatusType::LastSeen;
	_statusValidTill = 0;
	if (auto user = peer()->asUser()) {
		if (_isSavedMessagesChat) {
			setStatusText(lang(lng_saved_forward_here));
		} else {
			auto time = unixtime();
			setStatusText(Data::OnlineText(user, time));
			if (Data::OnlineTextActive(user, time)) {
				_statusType = StatusType::Online;
			}
			_statusValidTill = crl::now()
				+ Data::OnlineChangeTimeout(user, time);
		}
	} else if (auto chat = peer()->asChat()) {
		if (!chat->amIn()) {
			setStatusText(lang(lng_chat_status_unaccessible));
		} else if (chat->count > 0) {
			setStatusText(lng_chat_status_members(lt_count_decimal, chat->count));
		} else {
			setStatusText(lang(lng_group_status));
		}
	} else if (peer()->isMegagroup()) {
		setStatusText(lang(lng_group_status));
	} else if (peer()->isChannel()) {
		setStatusText(lang(lng_channel_status));
	}
}
Пример #20
0
void MyXmppClient::setMyPresence( StatusXmpp status, QString textStatus ) { //Q_INVOKABLE
    qDebug() << "MyXmppClient:: setMyPresence() called";
    if( textStatus != m_statusText ) {
        m_statusText =textStatus;
        emit statusTextChanged();
    }

    setStatus( status );
    setStatusText( textStatus );
}
void RegistrationHandler::registrationFailed()
{
  // A generic error message is provided here.
  // You could provide a different error for each failure code to instruct the
  // user on how to continue.
  setStatusText("BBM registration failed. Registration is required connect with BlackBerry Messenger. Please restart the application to try again.");

  mRegistered = false;
  emit registeredChanged(mRegistered);
}
Пример #22
0
void AMScanAction::cancelImplementation()
{
	if(controller_){

		setStatusText("Cancelling");
		controller_->cancel();
	}
	else
		setCancelled();
}
Пример #23
0
void AMScanAction::onControllerFailed()
{
	// If the scan was successfully added to the database then store whatever state it made it to.
	if (scanInfo_->scanID() != -1)
		if (!controller_->scan()->storeToDb(AMDatabase::database("user")))
			AMErrorMon::alert(this, AMSCANACTION_CANT_SAVE_TO_DB, "The scan action was unable to update the scan in the database.");

	setStatusText("Failed");
	setFailed();
}
Пример #24
0
void SetBCsWidget::slotSelectPatches()
{
    //If none selected
    QList<QTreeWidgetItem*> selectedTreeItem = ui->treeWidget->selectedItems();
    if(selectedTreeItem.count()>0)
    {
        SetBCsItem *bcItem = static_cast<SetBCsItem*>(selectedTreeItem[0]);
        vtkIdType hexBCId = hexBlocker->hexBCs->IsItemPresent(bcItem->hexBC)-1;
        HexBC *hexBC = HexBC::SafeDownCast(hexBlocker->hexBCs->GetItemAsObject(hexBCId));
        setStatusText("Select patches with left mouse button, deselect with right, middle when done.");
        vtkSmartPointer<vtkIdList> bcIds = vtkSmartPointer<vtkIdList>::New();
        hexBC->getLocalPatchesIdsInGlobal(bcIds);
        emit startSelectPatches(bcIds);
    }
    else
    {
        setStatusText("Select a boundary condition in the list first");
    }
}
Пример #25
0
void AMScanAction::skipImplementation(const QString &command)
{
	if (controller_){

		controller_->stop(command);
		setStatusText(QString("Skipping - %1").arg(command));
	}

	else
		setSucceeded();
}
Пример #26
0
void MeterCanvas::OnMouseMoved(wxMouseEvent& event) {
    InteractiveCanvas::OnMouseMoved(event);

    if (mouseTracker.mouseDown()) {
        userInputValue = mouseTracker.getMouseY() * (level_max-level_min) + level_min;
    } else {
        if (!helpTip.empty()) {
            setStatusText(helpTip);
        }
    }
}
Пример #27
0
void IEToolbar::retrieveInitialData() {
  const UserData loggedInUser =
      UserDataObserver::getInstance().getLoggedInUser();
  setProfileName(loggedInUser.getName());
  setStatusText(loggedInUser.getStatusMessage());
  setPokesCount(UserDataObserver::getInstance().getPokesCount());
  setRequestsCount(UserDataObserver::getInstance().getRequestsCount());
  setMessagesCount(UserDataObserver::getInstance().getMessagesCount());
  setEventInvsCount(UserDataObserver::getInstance().getEventsCount());
  setGroupInvsCount(UserDataObserver::getInstance().getGroupsInvsCount());
}
Пример #28
0
bool Updater::updateComponent(Launcher::Component& component)
{
	Logger::writeToLog(String("updating component ") + component.getName());

	setStatusText(String(TRANS("Fetching info for ")) + component.getName());
    if (!component.getRemoteInfo()) {
        return false;
    }

    startNextTask();
    setStatusText(String(TRANS("Checking if ")) + component.getName() + String(TRANS(" is already installed")));
    if (component.alreadyInstalled()) {
        startNextTask();
        startNextTask();
        startNextTask();
        startNextTask();
        return true;
    }

    startNextTask();
    setStatusText(String(TRANS("Downloading ")) + component.getName());
    if (!component.download()) {
        return false;
    }

    startNextTask();
    setStatusText(String(TRANS("Verifying ")) + component.getName());
    if (!component.verify()) {
        return false;
    }

    startNextTask();
    setStatusText(String(TRANS("Installing ")) + component.getName());
    if (!component.install()) {
        return false;
    }

    startNextTask();

    return true;
}
Пример #29
0
void AMScanAction::onControllerSucceeded()
{
	if (controller_){

		setStatusText("Exporting");
		autoExportScan();
	}
	else
		AMErrorMon::alert(this, AMSCANACTION_CONTROLLER_NOT_VALID_FOR_AUTOEXPORT, "Could not export, somehow the scan controller is not available.");

	setSucceeded();
}
Пример #30
0
void SpectrumCanvas::OnMouseMoved(wxMouseEvent& event) {
    InteractiveCanvas::OnMouseMoved(event);
    if (mouseTracker.mouseDown()) {
        int freqChange = mouseTracker.getDeltaMouseX() * getBandwidth();

        if (freqChange != 0) {
            moveCenterFrequency(freqChange);
        }
    } else {
        setStatusText("Click and drag to adjust center frequency.");
    }
}