コード例 #1
0
void
OptionsWidget::equalizeIlluminationToggled(bool const checked)
{
	ColorGrayscaleOptions opt(m_colorParams.colorGrayscaleOptions());
	opt.setNormalizeIllumination(checked);
	m_colorParams.setColorGrayscaleOptions(opt);
	m_ptrSettings->setColorParams(m_pageId, m_colorParams);
	emit reloadRequested();
}
コード例 #2
0
void
OptionsWidget::colorModeChanged(int const idx)
{
	int const mode = colorModeSelector->itemData(idx).toInt();
	m_colorParams.setColorMode((ColorParams::ColorMode)mode);
	m_ptrSettings->setColorParams(m_pageId, m_colorParams);
	updateColorsDisplay();
	emit reloadRequested();
}
コード例 #3
0
QDeclarativeViewInspector::QDeclarativeViewInspector(QDeclarativeView *view, QObject *parent) :
    QObject(parent), data(new QDeclarativeViewInspectorPrivate(this))
{
    data->view = view;
    data->manipulatorLayer = new LiveLayerItem(view->scene());
    data->selectionTool = new LiveSelectionTool(this);
    data->zoomTool = new ZoomTool(this);
    data->colorPickerTool = new ColorPickerTool(this);
    data->boundingRectHighlighter = new BoundingRectHighlighter(this);
    data->currentTool = data->selectionTool;

    // to capture ChildRemoved event when viewport changes
    data->view->installEventFilter(this);

    data->setViewport(data->view->viewport());

    data->debugService = QDeclarativeInspectorService::instance();

    connect(data->debugService, SIGNAL(designModeBehaviorChanged(bool)),
            SLOT(setDesignModeBehavior(bool)));
    connect(data->debugService, SIGNAL(showAppOnTopChanged(bool)),
            SLOT(setShowAppOnTop(bool)));
    connect(data->debugService, SIGNAL(reloadRequested()), data.data(), SLOT(_q_reloadView()));
    connect(data->debugService, SIGNAL(currentObjectsChanged(QList<QObject*>)),
            data.data(), SLOT(_q_onCurrentObjectsChanged(QList<QObject*>)));
    connect(data->debugService, SIGNAL(animationSpeedChangeRequested(qreal)),
            SLOT(animationSpeedChangeRequested(qreal)));
    connect(data->debugService, SIGNAL(executionPauseChangeRequested(bool)),
            SLOT(animationPausedChangeRequested(bool)));
    connect(data->debugService, SIGNAL(colorPickerToolRequested()),
            data.data(), SLOT(_q_changeToColorPickerTool()));
    connect(data->debugService, SIGNAL(selectMarqueeToolRequested()),
            data.data(), SLOT(_q_changeToMarqueeSelectTool()));
    connect(data->debugService, SIGNAL(selectToolRequested()), data.data(), SLOT(_q_changeToSingleSelectTool()));
    connect(data->debugService, SIGNAL(zoomToolRequested()), data.data(), SLOT(_q_changeToZoomTool()));
    connect(data->debugService,
            SIGNAL(objectCreationRequested(QString,QObject*,QStringList,QString,int)),
            data.data(), SLOT(_q_createQmlObject(QString,QObject*,QStringList,QString,int)));
    connect(data->debugService,
            SIGNAL(objectDeletionRequested(QObject *)), data.data(), SLOT(_q_deleteQmlObject(QObject *)));
    connect(data->debugService,
            SIGNAL(objectReparentRequested(QObject *, QObject *)),
            data.data(), SLOT(_q_reparentQmlObject(QObject *, QObject *)));
    connect(data->debugService, SIGNAL(clearComponentCacheRequested()),
            data.data(), SLOT(_q_clearComponentCache()));
    connect(data->view, SIGNAL(statusChanged(QDeclarativeView::Status)),
            data.data(), SLOT(_q_onStatusChanged(QDeclarativeView::Status)));

    connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
            SIGNAL(selectedColorChanged(QColor)));
    connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
            data->debugService, SLOT(selectedColorChanged(QColor)));

    data->_q_changeToSingleSelectTool();
}
コード例 #4
0
void
OptionsWidget::whiteMarginsToggled(bool const checked)
{
	ColorGrayscaleOptions opt(m_colorParams.colorGrayscaleOptions());
	opt.setWhiteMargins(checked);
	if (!checked) {
		opt.setNormalizeIllumination(false);
		equalizeIlluminationCB->setChecked(false);
	}
	m_colorParams.setColorGrayscaleOptions(opt);
	m_ptrSettings->setColorParams(m_pageId, m_colorParams);
	equalizeIlluminationCB->setEnabled(checked);
	emit reloadRequested();
}
コード例 #5
0
void
OptionsWidget::modeChanged(bool const auto_mode)
{
	if (m_ignoreAutoManualToggle) {
		return;
	}
	
	if (auto_mode) {
		m_uiData.setMode(MODE_AUTO);
		m_ptrSettings->clearPageParams(m_pageId);
		emit reloadRequested();
	} else {
		m_uiData.setMode(MODE_MANUAL);
		commitCurrentParams();
	}
}
コード例 #6
0
ファイル: Tab.cpp プロジェクト: Allanis/SaraWeb
Tab::Tab(const QUrl& url, QWidget* parent) : QWidget(parent) {
  _webView = new WebView(url, this);
  _toolBar = new ToolBar(_webView->history(), url, this);
  _searchBar = new SearchBar(this);
  _statusBar = new StatusBar(this);
  
  _layout = new QVBoxLayout(this);
  _layout->setMargin(0);
  _layout->setSpacing(0);
  _layout->addWidget(_toolBar,    0);
  _layout->addWidget(_webView,    1);
  _layout->addWidget(_searchBar,  0);
  _layout->addWidget(_statusBar,  0);

  _showSearchShortcut = new QShortcut(QKeySequence::Find, this);
  _focusAddressShortcut = new QShortcut(Qt::Key_F6, this);

  _searchBar->hide();

  connect(_toolBar, SIGNAL(goBackRequested()), _webView, SLOT(back()));
  connect(_toolBar, SIGNAL(goForwardRequested()), _webView, SLOT(forward()));
  connect(_toolBar, SIGNAL(reloadRequested()), _webView, SLOT(reload()));
  connect(_toolBar, SIGNAL(stopRequested()), _webView, SLOT(stop()));
  connect(_toolBar, SIGNAL(loadRequested(const QUrl&)), _webView, SLOT(setFocus()));
  connect(_toolBar, SIGNAL(loadRequested(const QUrl&)), _webView, SLOT(load(const QUrl&)));
  connect(_webView, SIGNAL(urlChanged(const QUrl&)), _toolBar, SLOT(setUrl(const QUrl&)));
  connect(_webView, SIGNAL(urlChanged(const QUrl&)), _toolBar, SLOT(updateActions()));
  connect(_webView, SIGNAL(loadStarted()), _toolBar, SLOT(enableStopAction()));
  connect(_webView, SIGNAL(loadFinished(bool)), _toolBar, SLOT(disableStopAction()));
  connect(_webView, SIGNAL(titleChanged(const QString&)), this, SLOT(updateTitle()));
  connect(_webView, SIGNAL(iconChanged()), this, SLOT(updateIcon()));
  connect(_searchBar, SIGNAL(searchDataChanged(const QString&, bool, bool)), _webView,
        SLOT(find(const QString&, bool, bool)));
  connect(_searchBar, SIGNAL(closeRequested()), _searchBar, SLOT(hide()));
  connect(_searchBar, SIGNAL(closeRequested()), _webView, SLOT(setFocus()));
  connect(_webView->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)),
        _statusBar, SLOT(showMessage(const QString&)));
  connect(_webView, SIGNAL(loadProgress(int)), _statusBar->progressBar(), SLOT(setValue(int)));
  connect(_statusBar->slider(), SIGNAL(valueChanged(int)), _webView, SLOT(setZoom(int)));
  connect(_showSearchShortcut, SIGNAL(activated()), _searchBar, SLOT(show()));
  connect(_focusAddressShortcut, SIGNAL(activated()), _toolBar->addressBar(), SLOT(setFocus()));
}
コード例 #7
0
void
OptionsWidget::bwThresholdChanged()
{
	int const value = thresholdSlider->value();
	QString const tooltip_text(QString::number(value));
	thresholdSlider->setToolTip(tooltip_text);
	
	thresholLabel->setText(QString::number(value));
	
	if (m_ignoreThresholdChanges) {
		return;
	}
	
	// Show the tooltip immediately.
	QPoint const center(thresholdSlider->rect().center());
	QPoint tooltip_pos(thresholdSlider->mapFromGlobal(QCursor::pos()));
	tooltip_pos.setY(center.y());
	tooltip_pos.setX(qBound(0, tooltip_pos.x(), thresholdSlider->width()));
	tooltip_pos = thresholdSlider->mapToGlobal(tooltip_pos);
	QToolTip::showText(tooltip_pos, tooltip_text, thresholdSlider);
	
	if (thresholdSlider->isSliderDown()) {
		// Wait for it to be released.
		// We could have just disabled tracking, but in that case we wouldn't
		// be able to show tooltips with a precise value.
		return;
	}

	BlackWhiteOptions opt(m_colorParams.blackWhiteOptions());
	if (opt.thresholdAdjustment() == value) {
		// Didn't change.
		return;
	}

	opt.setThresholdAdjustment(value);
	m_colorParams.setBlackWhiteOptions(opt);
	m_ptrSettings->setColorParams(m_pageId, m_colorParams);
	emit reloadRequested();
	
	emit invalidateThumbnail(m_pageId);
}
コード例 #8
0
ファイル: userhelper.cpp プロジェクト: killmaster/Shinjiru
void MainWindow::userLoaded() {
  progress_bar->setValue(20);
  progress_bar->setFormat(tr("User Loaded"));

  User::sharedUser()->disconnect(this);
  this->disconnect(User::sharedUser());

  connect(User::sharedUser(), SIGNAL(reloadRequested()),
          this, SLOT(userListLoaded()));

  connect(User::sharedUser(), SIGNAL(new_image()), SLOT(repaint()));
  repaint();

  if (!hasUser) {
    loadUserList();
  } else {
    userListLoaded();
  }

  hasUser = true;
}
コード例 #9
0
ファイル: uiinfo.cpp プロジェクト: ycaihua/fourchan
UIInfo::UIInfo(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::UIInfo)
{
    QString text;
    ui->setupUi(this);
    updateStatistics();
    uiPendingRequests = new UIPendingRequests(this);

    timer = new QTimer(this);
    timer->setInterval(3000);
    timer->setSingleShot(false);
    timer->start();

    text = ui->label_2->text();
#ifdef __DEBUG__
    text.replace("%%VERSION%%", "DEBUG");
#else
    text.replace("%%VERSION%%", PROGRAM_VERSION);
#endif
    text.replace("%%BUILDDATE%%", BUILDDATE);
    text.replace("%%QT_VERSION%%", QT_VERSION_STR);
    ui->label_2->setText(text);

    connect(timer, SIGNAL(timeout()), this, SLOT(updateStatistics()));
    connect(timer, SIGNAL(timeout()), this, SLOT(updateDebugInformation()));

    connect(ui->btnShowRequests, SIGNAL(clicked()), this, SLOT(showRequests()));
    connect(uiPendingRequests, SIGNAL(reloadRequested()), this, SLOT(reloadRequests()));
    connect(this, SIGNAL(rejected()), uiPendingRequests, SLOT(hide()));

    logFile = new QFile();
    logFile->setFileName("fourchan-dl.log");
    logFile->open(QIODevice::ReadOnly | QIODevice::Unbuffered | QIODevice::Text);

    if (logFile->isReadable()) {
        connect(timer, SIGNAL(timeout()), this, SLOT(updateLogFile()));
    }
}
コード例 #10
0
void QDeclarativeViewInspector::reloadView()
{
    data->clearHighlight();
    emit reloadRequested();
}
コード例 #11
0
void DiffEditorController::requestReload()
{
    emit reloadRequested();
}
コード例 #12
0
void SGViewInspector::reloadView()
{
    // TODO
    emit reloadRequested();
}
void QDeclarativeInspectorService::messageReceived(const QByteArray &message)
{
    QDataStream ds(message);

    InspectorProtocol::Message type;
    ds >> type;

    switch (type) {
    case InspectorProtocol::SetCurrentObjects: {
        int itemCount = 0;
        ds >> itemCount;

        QList<QObject*> selectedObjects;
        for (int i = 0; i < itemCount; ++i) {
            int debugId = -1;
            ds >> debugId;
            if (QObject *obj = objectForId(debugId))
                selectedObjects << obj;
        }

        emit currentObjectsChanged(selectedObjects);
        break;
    }
    case InspectorProtocol::Reload: {
        emit reloadRequested();
        break;
    }
    case InspectorProtocol::SetAnimationSpeed: {
        qreal speed;
        ds >> speed;
        emit animationSpeedChangeRequested(speed);
        break;
    }
    case InspectorProtocol::SetAnimationPaused: {
        bool paused;
        ds >> paused;
        emit executionPauseChangeRequested(paused);
        break;
    }
    case InspectorProtocol::ChangeTool: {
        InspectorProtocol::Tool tool;
        ds >> tool;
        switch (tool) {
        case InspectorProtocol::ColorPickerTool:
            emit colorPickerToolRequested();
            break;
        case InspectorProtocol::SelectTool:
            emit selectToolRequested();
            break;
        case InspectorProtocol::SelectMarqueeTool:
            emit selectMarqueeToolRequested();
            break;
        case InspectorProtocol::ZoomTool:
            emit zoomToolRequested();
            break;
        default:
            qWarning() << "Warning: Unhandled tool:" << tool;
        }
        break;
    }
    case InspectorProtocol::SetDesignMode: {
        bool inDesignMode;
        ds >> inDesignMode;
        emit designModeBehaviorChanged(inDesignMode);
        break;
    }
    case InspectorProtocol::ShowAppOnTop: {
        bool showOnTop;
        ds >> showOnTop;
        emit showAppOnTopChanged(showOnTop);
        break;
    }
    case InspectorProtocol::CreateObject: {
        QString qml;
        int parentId;
        QString filename;
        QStringList imports;
        ds >> qml >> parentId >> imports >> filename;
        int order = -1;
        if (!ds.atEnd()) {
            ds >> order;
        }
        emit objectCreationRequested(qml, objectForId(parentId), imports, filename, order);
        break;
    }
    case InspectorProtocol::DestroyObject: {
        int debugId;
        ds >> debugId;
        if (QObject* obj = objectForId(debugId)) {
            emit objectDeletionRequested(obj);
        }
        break;
    }
    case InspectorProtocol::MoveObject: {
        int debugId, newParent;
        ds >> debugId >> newParent;
        emit objectReparentRequested(objectForId(debugId), objectForId(newParent));
        break;
    }
    case InspectorProtocol::ObjectIdList: {
        int itemCount;
        ds >> itemCount;
        m_stringIdForObjectId.clear();
        for (int i = 0; i < itemCount; ++i) {
            int itemDebugId;
            QString itemIdString;
            ds >> itemDebugId
               >> itemIdString;

            m_stringIdForObjectId.insert(itemDebugId, itemIdString);
        }
        break;
    }
    case InspectorProtocol::ClearComponentCache: {
        emit clearComponentCacheRequested();
        break;
    }
    default:
        qWarning() << "Warning: Not handling message:" << type;
    }