Ejemplo n.º 1
0
void ManagePeerBox::prepare() {
	_channel->updateFull();

	setTitle(ManagePeerTitle(_channel));
	addButton(langFactory(lng_cancel), [this] { closeBox(); });

	setupContent();
}
Ejemplo n.º 2
0
DTScheduleWidget::DTScheduleWidget(QWidget *parent) :
    QFrame(parent),
    ui(new Ui::DTScheduleWidget),
    mPosition(POS_ONCE),
    mIsClosable(false)
{
    ui->setupUi(this);
    setupContent();
    setupActions();
}
Ejemplo n.º 3
0
        MainWindow::MainWindow(QWidget *parent)
            : QMainWindow(parent)
        {
            setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);

            setupLayouts();
            setupMenus();
            setupToolbars();
            setupContent();
            setupMainWidget();

            setStyleSheet(GeneralStyles::windowStyle);
        }
Ejemplo n.º 4
0
void Widget::onPrevious()
{
    m_visible.start();
    if (m_previousStack.size() < 1)
        return;
    Message m = m_previousStack.pop();
    m_messageQueue.push_front(m);
    loadDefaults();
    setupFont();
    setupColors();
    setupIcon();
    setupTitle();
    setupContent();
    connectForPosition(m_messageQueue.front().data["pos"]->toString());
    updateFinalWidth();
}
Ejemplo n.º 5
0
KDvoid SdkSample::_setup ( RenderWindow* pWindow )
{
    // assign mRoot here in case Root was initialised after the Sample's constructor ran.
    m_pRoot = Root::getSingletonPtr ( );
    m_pWindow = pWindow;
    
    locateResources ( );
    createSceneManager ( );
    setupView ( );
    
    m_pTrayMgr = new SdkTrayManager ( "SampleControls", pWindow, this );  // create a tray interface
    
    loadResources ( );
    m_bResourcesLoaded = true;
    
    // show stats and logo and hide the cursor
    m_pTrayMgr->showFrameStats ( TL_BOTTOMLEFT );
    m_pTrayMgr->showLogo ( TL_BOTTOMRIGHT );
    m_pTrayMgr->hideCursor ( );
    
    // create a params panel for displaying sample details
    StringVector  aItems;
    aItems.push_back ( "cam.pX" );
    aItems.push_back ( "cam.pY" );
    aItems.push_back ( "cam.pZ" );
    aItems.push_back ( ""       );
    aItems.push_back ( "cam.oW" );
    aItems.push_back ( "cam.oX" );
    aItems.push_back ( "cam.oY" );
    aItems.push_back ( "cam.oZ" );
    aItems.push_back ( ""       );
    aItems.push_back ( "Filtering" );
    aItems.push_back ( "Poly Mode" );
    
    m_pDetailsPanel = m_pTrayMgr->createParamsPanel ( TL_NONE, "DetailsPanel", 200, aItems );
    m_pDetailsPanel->hide ( );
    
    m_pDetailsPanel->setParamValue (  9, "Bilinear" );
    m_pDetailsPanel->setParamValue ( 10, "Solid" );
    
    setupContent ( );
    m_bContentSetup = true;
    
    m_bDone = false;
}
Ejemplo n.º 6
0
	/*-----------------------------------------------------------------------------
	| Extended to setup a default tray interface and camera controller.
	-----------------------------------------------------------------------------*/
	void Framework::_setup(Ogre::RenderWindow* window, OIS::Keyboard* keyboard, OIS::Mouse* mouse, XRENREN::FileSystemLayer* fsLayer)
	{
		// assign mRoot here in case Root was initialised after the Sample's constructor ran.
		mRoot = Ogre::Root::getSingletonPtr();
		mWindow = window;
		mMouse = mouse;
		mFSLayer = fsLayer;

		locateResources();
		createSceneManager();
		setupView();

		mTrayMgr = new SdkTrayManager("SampleControls", window, mouse, this);  // create a tray interface

#ifdef USE_RTSHADER_SYSTEM
		// Initialize shader generator.
		// Must be before resource loading in order to allow parsing extended material attributes.
		bool success = initializeRTShaderSystem(mSceneMgr);
		if (!success) 
		{
			OGRE_EXCEPT(Ogre::Exception::ERR_FILE_NOT_FOUND, 
				"Shader Generator Initialization failed - Core shader libs path not found", 
				"SdkSample::_setup");
		}														
#endif

		loadResources();
		mResourcesLoaded = true;

		// show stats and logo and hide the cursor
		mTrayMgr->showFrameStats(TL_BOTTOMLEFT);
		mTrayMgr->hideLogo();
		mTrayMgr->showCursor();

		setupDetailsPanel();


		setupContent();
		mContentSetup = true;

		mDone = false;
	}
Ejemplo n.º 7
0
void Widget::onNext()
{
    m_visible.start();
    if (m_messageQueue.size() < 2)
        return;
    Message m = m_messageQueue.front();
    boost::optional<QVariant> tmpManual = m.data["manually_shown"];
    m.data["manually_shown"] = boost::optional<QVariant>(true);
    m_previousStack.push(m);
    m_messageQueue.pop_front();
    loadDefaults();
    setupFont();
    setupColors();
    setupIcon();
    setupTitle();
    setupContent();
    connectForPosition(m_messageQueue.front().data["pos"]->toString());
    updateFinalWidth();
    if (m_messageQueue.front().data["bounce"] && !tmpManual)
        startBounce();
}
Ejemplo n.º 8
0
void Widget::processMessageQueue()
{
    if (m_messageQueue.empty()) {
        return;
    }

    if (m_animation.state() == QAbstractAnimation::Running ||
            m_visible.isActive()) {
       //(m_animation.totalDuration() - m_animation.currentTime()) < 50) {
        return;
    }

    QFont boldFont = font();
    boldFont.setBold(true);
    Message& m = m_messageQueue.front();
    loadDefaults();
    if (m.data["aot"]->toBool()) {
        setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
        raise();
    }
    setupFont();
    setupColors();
    setupIcon();
    setupTitle();
    setupContent();
    connectForPosition(m.data["pos"]->toString());
    m_animation.setDirection(QAnimationGroup::Forward);
    int width = computeWidth();
    qobject_cast<QPropertyAnimation*>(m_animation.animationAt(0))->setEasingCurve(QEasingCurve::Type(m_settings.get("gui/in_animation").toInt()));
    qobject_cast<QPropertyAnimation*>(m_animation.animationAt(0))->setStartValue(0);
    qobject_cast<QPropertyAnimation*>(m_animation.animationAt(0))->setEndValue(width);
    m_animation.start();
    QString soundCommand = m.data["sc"]->toString();
    if (!soundCommand.isEmpty())
        QProcess::startDetached(soundCommand);
   // m_shortcutGrabber.enableShortcuts();
}
Ejemplo n.º 9
0
bool Widget::update(const Message &m)
{
    bool found = false;
    for (QQueue<Message>::iterator it = m_messageQueue.begin(); it != m_messageQueue.end(); ++it) {
        if (it->data["id"] && it->data["id"]->toInt() == m.data["id"]->toInt()) {
            it->data = m.data;
            found = true;
            break;
        }
    }
    if (found && !m_messageQueue.isEmpty() && m_messageQueue.front().data["id"]
        && m_messageQueue.front().data["id"]->toInt() == m.data["id"]->toInt()) {
        loadDefaults();
        setupFont();
        setupColors();
        setupIcon();
        setupTitle();
        setupContent();
        updateFinalWidth();
        connectForPosition(m_messageQueue.front().data["pos"]->toString());
        m_visible.start();
    }
    return found;
}
PlotItemDialog::PlotItemDialog(PlotItem *item, QWidget *parent)
    : ViewItemDialog(item, parent), _plotItem(item), _defaultTagString("<Auto Name>") {

  Q_ASSERT(_plotItem);

  _store = kstApp->mainWindow()->document()->objectStore();

  setWindowTitle(tr("Edit Plot Item"));

  _contentTab = new ContentTab(this, _store);
  connect(_contentTab, SIGNAL(apply()), this, SLOT(contentChanged()));
  DialogPage *contentsPage = new DialogPage(this);
  contentsPage->setPageTitle(tr("Contents"));
  contentsPage->addDialogTab(_contentTab);
  addDialogPage(contentsPage, true);

  _labelTab = new LabelTab(_plotItem, this);
  _topLabelTab = new OverrideLabelTab(tr("Top Font"), this);
  _bottomLabelTab = new OverrideLabelTab(tr("Bottom Font"), this);
  _leftLabelTab = new OverrideLabelTab(tr("Left Font"), this);
  _rightLabelTab = new OverrideLabelTab(tr("Right Font"), this);
  _axisLabelTab = new OverrideLabelTab(tr("Axis Font"), this);

  _labelPage = new DialogPageTab(this);
  _labelPage->setPageTitle(tr("Labels"));
  _labelPage->addDialogTab(_labelTab);
  _labelPage->addDialogTab(_topLabelTab);
  _labelPage->addDialogTab(_bottomLabelTab);
  _labelPage->addDialogTab(_leftLabelTab);
  _labelPage->addDialogTab(_rightLabelTab);
  _labelPage->addDialogTab(_axisLabelTab);
  addDialogPage(_labelPage, true);

  connect(_labelTab, SIGNAL(apply()), this, SLOT(labelsChanged()));
  connect(_labelTab, SIGNAL(globalFontUpdate()), this, SLOT(globalFontUpdate()));

  connect(_topLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useTopDefaultChanged(bool)));
  connect(_bottomLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useBottomDefaultChanged(bool)));
  connect(_leftLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useLeftDefaultChanged(bool)));
  connect(_rightLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useRightDefaultChanged(bool)));
  connect(_axisLabelTab, SIGNAL(useDefaultChanged(bool)), this, SLOT(useAxisDefaultChanged(bool)));

  _rangeTab = new RangeTab(_plotItem, this);
  DialogPage *rangePage = new DialogPage(this);
  rangePage->setPageTitle(tr("Range/Zoom"));
  rangePage->addDialogTab(_rangeTab);
  addDialogPage(rangePage, true);
  connect(_rangeTab, SIGNAL(apply()), this, SLOT(rangeChanged()));

  _xAxisTab = new AxisTab(this);
  _xAxisPage = new DialogPage(this);
  _xAxisPage->setPageTitle(tr("X-Axis"));
  _xAxisPage->addDialogTab(_xAxisTab);
  addDialogPage(_xAxisPage, true);
  connect(_xAxisTab, SIGNAL(apply()), this, SLOT(xAxisChanged()));

  _yAxisTab = new AxisTab(this);
  _yAxisTab->setAsYAxis();
  _yAxisPage = new DialogPage(this);
  _yAxisPage->setPageTitle(tr("Y-Axis"));
  _yAxisPage->addDialogTab(_yAxisTab);
  addDialogPage(_yAxisPage, true);
  connect(_yAxisTab, SIGNAL(apply()), this, SLOT(yAxisChanged()));

  _xMarkersTab = new MarkersTab(this);
  DialogPage *xMarkersPage = new DialogPage(this);
  xMarkersPage->setPageTitle(tr("X-Axis Markers"));
  xMarkersPage->addDialogTab(_xMarkersTab);
  addDialogPage(xMarkersPage, true);
  _xMarkersTab->setObjectStore(_store);
  connect(_xMarkersTab, SIGNAL(apply()), this, SLOT(xAxisPlotMarkersChanged()));

  _yMarkersTab = new MarkersTab(this);
  DialogPage *yMarkersPage = new DialogPage(this);
  yMarkersPage->setPageTitle(tr("Y-Axis Markers"));
  yMarkersPage->addDialogTab(_yMarkersTab);
  addDialogPage(yMarkersPage, true);
  _yMarkersTab->setObjectStore(_store);
  connect(yMarkersPage, SIGNAL(apply()), this, SLOT(yAxisPlotMarkersChanged()));

  // addRelations(); This tends to clutter the plot dialog, let's test skipping it

  setupContent();
  setupAxis();
  setupRange();
  setupLabels();
  setupMarkers();

  setSupportsMultipleEdit(true);

  if (_plotItem->descriptiveNameIsManual()) {
    setTagString(_plotItem->descriptiveName());
  } else {
    setTagString(_defaultTagString);
  }

  QList<PlotItem*> list = ViewItem::getItems<PlotItem>();
  clearMultipleEditOptions();
  foreach(PlotItem* plot, list) {
    addMultipleEditOption(plot->plotName(), plot->descriptionTip(), plot->shortName());
  }