Ejemplo n.º 1
0
runPage::runPage (QWidget *parent, RUN_PROGRESS *prog, QListWidget **cList):
  QWizardPage (parent)
{
  progress = prog;


  setTitle (tr ("Build PFM Structure(s)"));

  setPixmap (QWizard::WatermarkPixmap, QPixmap(":/icons/pfmLoadWatermark.png"));

  setFinalPage (TRUE);

  QVBoxLayout *vbox = new QVBoxLayout (this);
  vbox->setMargin (5);
  vbox->setSpacing (5);


  progress->fbox = new QGroupBox (tr ("Input file processing progress"), this);
  QVBoxLayout *fboxLayout = new QVBoxLayout;
  progress->fbox->setLayout (fboxLayout);
  fboxLayout->setSpacing (10);


  progress->fbar = new QProgressBar (this);
  progress->fbar->setRange (0, 100);
  progress->fbar->setWhatsThis (tr ("Progress of input file loading"));
  fboxLayout->addWidget (progress->fbar);


  vbox->addWidget (progress->fbox);


  progress->rbox = new QGroupBox (tr ("PFM bin recompute/filter progress"), this);
  QVBoxLayout *rboxLayout = new QVBoxLayout;
  progress->rbox->setLayout (rboxLayout);
  rboxLayout->setSpacing (10);

  progress->rbar = new QProgressBar (this);
  progress->rbar->setRange (0, 100);
  progress->rbar->setWhatsThis (tr ("Progress of PFM bin recomputation or filter process"));
  rboxLayout->addWidget (progress->rbar);


  vbox->addWidget (progress->rbox);


  QGroupBox *lbox = new QGroupBox (tr ("Process status"), this);
  QVBoxLayout *lboxLayout = new QVBoxLayout;
  lbox->setLayout (lboxLayout);
  lboxLayout->setSpacing (10);


  checkList = new QListWidget (this);
  checkList->setAlternatingRowColors (TRUE);
  lboxLayout->addWidget (checkList);


  vbox->addWidget (lbox);


  *cList = checkList;


  //  Serious cheating here ;-)  I want the finish button to be disabled when you first get to this page
  //  so I set the last progress bar to be a "mandatory" field.  I couldn't disable the damn button in
  //  initializePage in the parent for some unknown reason.

  registerField ("progress_rbar*", progress->rbar, "value");
}
Ejemplo n.º 2
0
void App::startup()
{
    qmlRegisterUncreatableType<Fixture>("org.qlcplus.classes", 1, 0, "Fixture", "Can't create a Fixture !");
    qmlRegisterUncreatableType<Function>("org.qlcplus.classes", 1, 0, "QLCFunction", "Can't create a Function !");
    qmlRegisterType<ModelSelector>("org.qlcplus.classes", 1, 0, "ModelSelector");
    qmlRegisterUncreatableType<App>("org.qlcplus.classes", 1, 0, "App", "Can't create an App !");

    setTitle(APPNAME);
    setIcon(QIcon(":/qlcplus.svg"));

    if (QFontDatabase::addApplicationFont(":/RobotoCondensed-Regular.ttf") < 0)
        qWarning() << "Roboto condensed cannot be loaded !";

    if (QFontDatabase::addApplicationFont(":/RobotoMono-Regular.ttf") < 0)
        qWarning() << "Roboto mono cannot be loaded !";

    rootContext()->setContextProperty("qlcplus", this);

    m_pixelDensity = qMax(screen()->physicalDotsPerInch() *  0.039370, (qreal)screen()->size().height() / 220.0);
    qDebug() << "Pixel density:" << m_pixelDensity << "size:" << screen()->physicalSize();

    rootContext()->setContextProperty("screenPixelDensity", m_pixelDensity);

    initDoc();

    m_ioManager = new InputOutputManager(this, m_doc);
    rootContext()->setContextProperty("ioManager", m_ioManager);

    m_fixtureBrowser = new FixtureBrowser(this, m_doc);
    m_fixtureManager = new FixtureManager(this, m_doc);
    m_fixtureGroupEditor = new FixtureGroupEditor(this, m_doc);
    m_functionManager = new FunctionManager(this, m_doc);
    m_contextManager = new ContextManager(this, m_doc, m_fixtureManager, m_functionManager);

    m_virtualConsole = new VirtualConsole(this, m_doc, m_contextManager);
    rootContext()->setContextProperty("virtualConsole", m_virtualConsole);

    m_showManager = new ShowManager(this, m_doc);
    rootContext()->setContextProperty("showManager", m_showManager);

    m_networkManager = new NetworkManager(this, m_doc);
    rootContext()->setContextProperty("networkManager", m_networkManager);

    connect(m_networkManager, &NetworkManager::clientAccessRequest, this, &App::slotClientAccessRequest);
    connect(m_networkManager, &NetworkManager::accessMaskChanged, this, &App::setAccessMask);
    connect(m_networkManager, &NetworkManager::requestProjectLoad, this, &App::slotLoadDocFromMemory);

    m_tardis = new Tardis(this, m_doc, m_networkManager, m_fixtureManager, m_functionManager,
                          m_contextManager, m_showManager, m_virtualConsole);
    rootContext()->setContextProperty("tardis", m_tardis);

    m_contextManager->registerContext(m_virtualConsole);
    m_contextManager->registerContext(m_showManager);
    m_contextManager->registerContext(m_ioManager);

    // register an uncreatable type just to use the enums in QML
    qmlRegisterUncreatableType<ContextManager>("org.qlcplus.classes", 1, 0, "ContextManager", "Can't create a ContextManager !");
    qmlRegisterUncreatableType<ShowManager>("org.qlcplus.classes", 1, 0, "ShowManager", "Can't create a ShowManager !");
    qmlRegisterUncreatableType<NetworkManager>("org.qlcplus.classes", 1, 0, "NetworkManager", "Can't create a NetworkManager !");

    // Start up in non-modified state
    m_doc->resetModified();

    // and here we go !
    setSource(QUrl("qrc:/MainView.qml"));
}
Ejemplo n.º 3
0
void NpiWidget::initialize()
{
    setTitle("Non-Pharmaceutical Intervention");

    QVBoxLayout * layout = new QVBoxLayout();
    setLayout(layout);

    QWidget * nameWidget = new QWidget();
    QHBoxLayout * nameHBox = new QHBoxLayout();
    nameWidget->setLayout(nameHBox);

    QLabel * nameLabel = new QLabel("Name");
    nameLineEdit_ = new QLineEdit();

    nameHBox->addWidget(nameLabel);
    nameHBox->addWidget(nameLineEdit_);

    layout->addWidget(nameWidget);

    // add other widgets

    // add initially-hidden execution time label
    layout->addWidget(&executionTimeLabel_);
    executionTimeLabel_.hide();

    // add duration spinbox
    {
        durationSpinBox_ = new QSpinBox();
        durationSpinBox_->setMinimum(1);
        durationSpinBox_->setMaximum(365);
        durationSpinBox_->setSuffix(" days");

        // add in horizontal layout with label
        QWidget * widget = new QWidget();
        QHBoxLayout * hBox = new QHBoxLayout();
        widget->setLayout(hBox);

        hBox->addWidget(new QLabel("Duration"));
        hBox->addWidget(durationSpinBox_);

        // reduce layout spacing
        hBox->setContentsMargins(QMargins(0,0,0,0));

        // add to main layout
        layout->addWidget(widget);
    }

    // add stratification effectiveness widgets (age group only)
    {
        QGroupBox * groupBox = new QGroupBox();
        groupBox->setTitle("Age-specific effectiveness");

        QVBoxLayout * vBox = new QVBoxLayout();
        groupBox->setLayout(vBox);

        std::vector<std::vector<std::string> > stratifications = EpidemicDataSet::getStratifications();

        // add stratification checkboxes for first stratification type
        for(unsigned int j=0; j<stratifications[0].size(); j++)
        {
            QDoubleSpinBox * spinBox = new QDoubleSpinBox();
            spinBox->setMinimum(0.);
            spinBox->setMaximum(1.0);
            spinBox->setSingleStep(0.01);

            ageEffectivenessSpinBoxes_.push_back(spinBox);

            // add in horizontal layout with label
            QWidget * widget = new QWidget();
            QHBoxLayout * hBox = new QHBoxLayout();
            widget->setLayout(hBox);

            hBox->addWidget(new QLabel(stratifications[0][j].c_str()));
            hBox->addWidget(spinBox);

            // reduce layout spacing
            hBox->setContentsMargins(QMargins(0,0,0,0));

            // add to vertical layout of group box
            vBox->addWidget(widget);
        }

        layout->addWidget(groupBox);
    }

    // add location type choices widget
    {
        locationTypeComboBox_.addItem("Statewide", "statewide");
        locationTypeComboBox_.addItem("By region", "region");
        locationTypeComboBox_.addItem("By county", "county");

        // add in horizontal layout with label
        QWidget * widget = new QWidget();
        QHBoxLayout * hBox = new QHBoxLayout();
        widget->setLayout(hBox);

        hBox->addWidget(new QLabel("Location"));
        hBox->addWidget(&locationTypeComboBox_);

        // reduce layout spacing
        hBox->setContentsMargins(QMargins(0,0,0,0));

        layout->addWidget(widget);

        connect(&locationTypeComboBox_, SIGNAL(currentIndexChanged(int)), this, SLOT(setLocationType(int)));
    }

    // add group checkboxes widgets
    {
        groupGroupBox_ = new QGroupBox();
        groupGroupBox_->setTitle("Regions");

        QVBoxLayout * vBox = new QVBoxLayout();
        groupGroupBox_->setLayout(vBox);

        std::vector<std::string> groupNames = dataSet_->getGroupNames();

        // for each group name
        for(unsigned int i=0; i<groupNames.size(); i++)
        {
            QCheckBox * checkBox = new QCheckBox(groupNames[i].c_str());
            checkBox->setCheckState(Qt::Unchecked);

            vBox->addWidget(checkBox);

            groupCheckBoxes_.push_back(checkBox);
        }

        layout->addWidget(groupGroupBox_);

        // hide by default
        groupGroupBox_->hide();
    }

    // add node checkboxes widgets
    {
        nodeGroupBox_ = new QGroupBox();
        nodeGroupBox_->setTitle("Counties");

        QVBoxLayout * vBox = new QVBoxLayout();
        nodeGroupBox_->setLayout(vBox);

        std::vector<int> nodeIds = dataSet_->getNodeIds();

        // for each node
        for(unsigned int i=0; i<nodeIds.size(); i++)
        {
            QCheckBox * checkBox = new QCheckBox(dataSet_->getNodeName(nodeIds[i]).c_str());
            checkBox->setCheckState(Qt::Unchecked);

            vBox->addWidget(checkBox);

            nodeCheckBoxes_.push_back(checkBox);
        }

        layout->addWidget(nodeGroupBox_);

        // hide by default
        nodeGroupBox_->hide();
    }

    // cancel / save buttons
    cancelSaveButtonsWidget_ = new QWidget();

    QHBoxLayout * hBox = new QHBoxLayout();
    cancelSaveButtonsWidget_->setLayout(hBox);

    QPushButton * cancelButton = new QPushButton("&Cancel");
    hBox->addWidget(cancelButton);

    QPushButton * saveButton = new QPushButton("&Execute");
    hBox->addWidget(saveButton);

    // make connections
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
    connect(saveButton, SIGNAL(clicked()), this, SLOT(save()));

    layout->addWidget(cancelSaveButtonsWidget_);
}
Ejemplo n.º 4
0
Archivo: dcp.c Proyecto: swhobbit/UUPC
static KWBoolean client( const time_t exitTime,
                       const char *hotUser,
                       const BPS hotBPS,
                       const int hotHandle,
                       const KWBoolean runUUXQT )
{

   CONN_STATE s_state = CONN_INITIALIZE;
   CONN_STATE old_state = CONN_EXIT;

   KWBoolean contacted = KWFalse;
   KWBoolean needUUXQT = KWFalse;

   char sendGrade = ALL_GRADES;

/*--------------------------------------------------------------------*/
/*                      Trap missing modem entry                      */
/*--------------------------------------------------------------------*/

   if ( E_inmodem == NULL )
   {
      printmsg(0,"No modem specified in configuration file or command line");
      panic();
   }

   if (!getmodem(E_inmodem))  /* Initialize modem configuration     */
      panic();                /* Avoid loop if bad modem name       */

   if ( ! IsNetwork() &&
        ( hotUser == NULL ) &&
        (hotHandle == -1 ) &&
        ! suspend_init(M_device))
   {

#ifdef WIN32
      if (!isWinNT())
      {
         printmsg(0,"Unable to set up pipe for suspending; "
                    "may be unsupported in this environment (use NT for modem sharing).");
      }
      else
#endif
      /* else under WIN32, otherwise unconditional */
      {
         printmsg(0,"Unable to set up pipe for suspending; "
                    "is another UUCICO running?" );
         panic();
      }
   }

   while (s_state != CONN_EXIT )
   {
      printmsg(s_state == old_state ? 10 : 4 ,
               "S state = %c", s_state);
      old_state = s_state;

      switch (s_state)
      {
         case CONN_INITIALIZE:
            if (( hotUser == NULL ) && (hotHandle == -1 ))
               s_state = CONN_ANSWER;
            else
               s_state = CONN_HOTMODEM;
            break;

         case CONN_WAIT:
#if !defined(__TURBOC__) || defined(BIT32ENV)
            setTitle("Port %s suspended", M_device);
           s_state = suspend_wait();
#else
           panic();                 /* Why are we here?!           */
#endif
           break;

         case CONN_ANSWER:
            setTitle("Monitoring port %s", M_device);
            s_state = callin( exitTime );
            break;

         case CONN_HOTMODEM:
            s_state = callhot( hotBPS, hotHandle );
            break;

         case CONN_HOTLOGIN:
            if ( hotUser == NULL )        /* User specified to login? */
               s_state = CONN_LOGIN;      /* No --> Process normally  */
            else if ( loginbypass( hotUser ) )
               s_state = CONN_INITSTAT;
            else
               s_state = CONN_DROPLINE;
            break;

         case CONN_LOGIN:
            setTitle("Processing login on %s",
                      M_device );
            if ( login( ) )
               s_state = CONN_INITSTAT;
            else
               s_state = CONN_DROPLINE;
            break;

         case CONN_INITSTAT:
            HostStatus();
            s_state = CONN_PROTOCOL;
            break;

         case CONN_PROTOCOL:
            setTitle("Establishing connection on %s",
                      M_device);
            s_state = startup_client(&sendGrade);
            break;

         case CONN_CLIENT:
            contacted = KWTrue;
            if (bflag[F_MULTITASK])
               dcupdate();

            setTitle("%s connected to %s",
                      securep->myname,
                      hostp->via,
                      M_device);
            s_state = process( POLL_PASSIVE, sendGrade );
            break;

         case CONN_TERMINATE:
            s_state = sysend();
            if ( hostp != NULL )
            {
               dcstats();
               needUUXQT = KWTrue;
            }
            break;

         case CONN_DROPLINE:
            shutDown();
            if ( locked )     /* Cause could get here w/o
                                 locking                    */
               UnlockSystem();
            s_state = CONN_CLEANUP;
            break;

         case CONN_CLEANUP:
            if ( runUUXQT && needUUXQT )
               s_state = CONN_UUXQT;
            else
               s_state = CONN_EXIT;
            break;

         case CONN_UUXQT:
            {
               char buf[100];
               sprintf( buf, "-s %s -x %d", rmtname, debuglevel );
               copylog();
               execute( "uuxqt", buf, NULL, NULL, KWFalse, KWFalse );
               openlog(NULL);
            }
            needUUXQT = KWFalse;
            s_state = CONN_EXIT;
            break;

         case CONN_EXIT:
            break;

         default:
            printmsg(0,"dcpmain: Unknown slave state = %c",s_state );
            panic();
            break;

      } /* switch */

      if ( terminate_processing )
         s_state = CONN_EXIT;

   } /* while */

   return contacted;

} /* client */
Ejemplo n.º 5
0
// Default constructor
LLFloaterAbout::LLFloaterAbout() 
:	LLFloater(std::string("floater_about"), std::string("FloaterAboutRect"), LLStringUtil::null)
{
	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml");

	// Support for changing product name.
	std::string title("About ");
	title += LLAppViewer::instance()->getSecondLifeTitle();
	setTitle(title);

	LLViewerTextEditor *support_widget = 
		getChild<LLViewerTextEditor>("support_editor", true);

	LLViewerTextEditor *credits_widget = 
		getChild<LLViewerTextEditor>("credits_editor", true);


	if (!support_widget || !credits_widget)
	{
		return;
	}

	// For some reason, adding style doesn't work unless this is true.
	support_widget->setParseHTML(TRUE);

	// Text styles for release notes hyperlinks
	LLStyleSP viewer_link_style(new LLStyle);
	viewer_link_style->setVisible(true);
	viewer_link_style->setFontName(LLStringUtil::null);
	viewer_link_style->setLinkHREF(get_viewer_release_notes_url());
	viewer_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));

	// Version string
	std::string version = get_viewer_version();
	support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
	support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style);

	std::string support("\n\n");
	support.append(get_viewer_build_version());

	// Position
	LLViewerRegion* region = gAgent.getRegion();
	if (region)
	{
		LLStyleSP server_link_style(new LLStyle);
		server_link_style->setVisible(true);
		server_link_style->setFontName(LLStringUtil::null);
		server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes"));
		server_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));

		support.append(get_viewer_region_info(getString("you_are_at")));

		support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
		support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style);

		support = "\n\n";
	}

	// *NOTE: Do not translate text like GPU, Graphics Card, etc -
	//  Most PC users that know what these mean will be used to the english versions,
	//  and this info sometimes gets sent to support
	
	// CPU
	support.append(get_viewer_misc_info());

	support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));

	// Fix views
	support_widget->setCursorPos(0);
	support_widget->setEnabled(FALSE);
	support_widget->setTakesFocus(TRUE);
	support_widget->setHandleEditKeysDirectly(TRUE);

	credits_widget->setCursorPos(0);
	credits_widget->setEnabled(FALSE);
	credits_widget->setTakesFocus(TRUE);
	credits_widget->setHandleEditKeysDirectly(TRUE);

	center();

	sInstance = this;
}
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
BOOL LLFloaterNameDesc::postBuild()
{
	LLRect r;

	std::string asset_name = mFilename;
	LLStringUtil::replaceNonstandardASCII( asset_name, '?' );
	LLStringUtil::replaceChar(asset_name, '|', '?');
	LLStringUtil::stripNonprintable(asset_name);
	LLStringUtil::trim(asset_name);

	std::string exten = gDirUtilp->getExtension(asset_name);
	if (exten == "wav")
	{
		mIsAudio = TRUE;
	}
	asset_name = gDirUtilp->getBaseFileName(asset_name, true); // no extsntion

	setTitle(mFilename);

	centerWithin(gViewerWindow->getRootView()->getRect());

	S32 line_width = getRect().getWidth() - 2 * PREVIEW_HPAD;
	S32 y = getRect().getHeight() - PREVIEW_LINE_HEIGHT;

	r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );
	y -= PREVIEW_LINE_HEIGHT;

	r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );    

	childSetCommitCallback("name_form", doCommit, this);
	childSetValue("name_form", LLSD(asset_name));

	LLLineEditor *NameEditor = getChild<LLLineEditor>("name_form");
	if (NameEditor)
	{
		NameEditor->setMaxTextLength(DB_INV_ITEM_NAME_STR_LEN);
		NameEditor->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
	}

	y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f);
	y -= PREVIEW_LINE_HEIGHT;

	r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT );  
	childSetCommitCallback("description_form", doCommit, this);
	LLLineEditor *DescEditor = getChild<LLLineEditor>("description_form");
	if (DescEditor)
	{
		DescEditor->setMaxTextLength(DB_INV_ITEM_DESC_STR_LEN);
		DescEditor->setPrevalidate(&LLLineEditor::prevalidatePrintableNotPipe);
	}

	y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f);

	// Cancel button
	childSetAction("cancel_btn", onBtnCancel, this);

	// OK button
	childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee());
	childSetAction("ok_btn", onBtnOK, this);
	setDefaultBtn("ok_btn");

	return TRUE;
}
Ejemplo n.º 7
0
Archivo: wykres.cpp Proyecto: maxbog/f1
wykres::wykres(): QwtPlot() {
    setTitle("Wyniki symulacji");
    resize(600,400);


}
Ejemplo n.º 8
0
// Default constructor
LLFloaterAbout::LLFloaterAbout() 
:	LLFloater(std::string("floater_about"), std::string("FloaterAboutRect"), LLStringUtil::null)
{
	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml");

	// Support for changing product name.
	std::string title("About ");
	title += LLAppViewer::instance()->getSecondLifeTitle();
	setTitle(title);

	LLViewerTextEditor *support_widget = 
		getChild<LLViewerTextEditor>("support_editor", true);

	LLViewerTextEditor *credits_widget = 
		getChild<LLViewerTextEditor>("credits_editor", true);
	
	childSetAction("copy_btn", onAboutClickCopyToClipboard, this);

	if (!support_widget || !credits_widget)
	{
		return;
	}

	// For some reason, adding style doesn't work unless this is true.
	support_widget->setParseHTML(TRUE);

	// Text styles for release notes hyperlinks
	LLStyleSP viewer_link_style(new LLStyle);
	viewer_link_style->setVisible(true);
	viewer_link_style->setFontName(LLStringUtil::null);
	viewer_link_style->setLinkHREF(get_viewer_release_notes_url());
	viewer_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));

	// Version string
	std::string version = std::string(LLAppViewer::instance()->getSecondLifeTitle()
#if defined(_WIN64) || defined(__x86_64__)
		+ " (64 bit)"
#endif
		+ llformat(" %d.%d.%d (%d) %s %s (%s)\n",
		gVersionMajor, gVersionMinor, gVersionPatch, gVersionBuild,
		__DATE__, __TIME__,
		gVersionChannel));
	support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
	support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style);

	std::string support;
	support.append("\n\n");
	support.append("Grid: " + gHippoGridManager->getConnectedGrid()->getGridName() + "\n\n");

#if LL_MSVC
    support.append(llformat("Built with MSVC version %d\n\n", _MSC_VER));
#endif

#if LL_CLANG
    support.append(llformat("Built with Clang version %d\n\n", CLANG_VERSION));
#endif

#if LL_ICC
    support.append(llformat("Built with ICC version %d\n\n", __ICC));
#endif

#if LL_GNUC
    support.append(llformat("Built with GCC version %d\n\n", GCC_VERSION));
#endif

	// Position
	LLViewerRegion* region = gAgent.getRegion();
	if (region)
	{
		LLStyleSP server_link_style(new LLStyle);
		server_link_style->setVisible(true);
		server_link_style->setFontName(LLStringUtil::null);
		server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes"));
		server_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));

// [RLVa:KB] - Checked: 2014-02-24 (RLVa-1.4.10)
		if (RlvActions::canShowLocation())
		{
		const LLVector3d &pos = gAgent.getPositionGlobal();
		LLUIString pos_text = getString("you_are_at");
		pos_text.setArg("[POSITION]",
						llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ]));
		support.append(pos_text);

		if (const LLViewerRegion* region = gAgent.getRegion())
		{
			const LLVector3d& coords(region->getOriginGlobal());
			std::string region_text = llformat("in %s (%.0f, %.0f) located at ", region->getName().c_str(), coords.mdV[VX]/REGION_WIDTH_METERS, coords.mdV[VY]/REGION_WIDTH_METERS);
			support.append(region_text);

			std::string buffer;
			buffer = region->getHost().getHostName();
			support.append(buffer);
			support.append(" (");
			buffer = region->getHost().getString();
			support.append(buffer);
			support.append(")");
		}
		}
		else
			support.append(RlvStrings::getString(RLV_STRING_HIDDEN_REGION));
// [/RLVa:KN]
		support.append("\n");

		support.append(gLastVersionChannel);
		support.append("\n");

		support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
		support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style);

		support = "\n\n";
	}

	// *NOTE: Do not translate text like GPU, Graphics Card, etc -
	//  Most PC users that know what these mean will be used to the english versions,
	//  and this info sometimes gets sent to support
	
	// CPU
	support.append("CPU: ");
	support.append( gSysCPU.getCPUString() );
	support.append("\n");

	/* This is confusing and WRONG.
	support.append("SSE Support:");
	if(gSysCPU.hasSSE())
		support.append(" SSE2\n");
	else if(gSysCPU.hasSSE())
		support.append(" SSE\n");
	else
		support.append(" None\n"); */

	U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024;
	// Moved hack adjustment to Windows memory size into llsys.cpp

	std::string mem_text = llformat("Memory: %u MB\n", memory );
	support.append(mem_text);

	support.append("OS Version: ");
	support.append( LLAppViewer::instance()->getOSInfo().getOSString() );
	support.append("\n");

	support.append("Graphics Card Vendor: ");
	support.append( (const char*) glGetString(GL_VENDOR) );
	support.append("\n");

	support.append("Graphics Card: ");
	support.append( (const char*) glGetString(GL_RENDERER) );
	support.append("\n");

#if LL_WINDOWS
    getWindow()->incBusyCount();
    getWindow()->setCursor(UI_CURSOR_ARROW);
    support.append("Windows Graphics Driver Version: ");
    LLSD driver_info = gDXHardware.getDisplayInfo();
    if (driver_info.has("DriverVersion"))
    {
        support.append(driver_info["DriverVersion"]);
    }
    support.append("\n");
    getWindow()->decBusyCount();
    getWindow()->setCursor(UI_CURSOR_ARROW);
#endif

	support.append("OpenGL Version: ");
	support.append( (const char*) glGetString(GL_VERSION) );
// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.2.0)
	support.append("\n");
	support.append("RLV Version: " + (RlvActions::isRlvEnabled() ? RlvStrings::getVersionAbout() : "(disabled)"));
// [/RLVa:KB]
	support.append("\n\n");

	support.append("Viewer SSE Version: ");
#if _M_IX86_FP > 0 //Windows
	support.append(llformat("SSE%i\n", _M_IX86_FP ));
#elif defined(__SSE2__) //GCC
	support.append("SSE2\n");	
#elif defined(__SSE__) //GCC
	support.append("SSE\n");
#else
	support.append("None\n");
#endif

	support.append("libcurl Version: ");
	support.append( LLCurl::getVersionString() );
	support.append("\n");

	support.append("J2C Decoder Version: ");
	support.append( LLImageJ2C::getEngineInfo() );
	support.append("\n");

	support.append("Audio Driver Version: ");
	bool want_fullname = true;
	support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : "(none)" );
	support.append("\n");

	// TODO: Implement media plugin version query

	support.append("Qt Webkit Version: ");
	support.append(
#if LL_LINUX && defined(__x86_64__)
	"4.8.6"
#else
	"4.7.1"
#endif
	);
	support.append(" (version number hard-coded)");
	support.append("\n");

	if (gPacketsIn > 0)
	{
		std::string packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)", 
			LLViewerStats::getInstance()->mPacketsLostStat.getCurrent(),
			F32(gPacketsIn),
			100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) );
		support.append(packet_loss);
		support.append("\n");
	}

	support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));

	// Fix views
	support_widget->setCursorPos(0);
	support_widget->setEnabled(FALSE);
	support_widget->setTakesFocus(TRUE);
	support_widget->setHandleEditKeysDirectly(TRUE);

	credits_widget->setCursorPos(0);
	credits_widget->setEnabled(FALSE);
	credits_widget->setTakesFocus(TRUE);
	credits_widget->setHandleEditKeysDirectly(TRUE);

	center();

	sInstance = this;
}
Ejemplo n.º 9
0
//
//  Initialize main window
//
DataPlot::DataPlot(QWidget *parent):
    QwtPlot(parent),
    d_interval(0),
    d_timerId(-1)
{
    // Disable polygon clipping
    QwtPainter::setDeviceClipping(false);

    // We don't need the cache here
    canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
    canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);

#if QT_VERSION >= 0x040000
#ifdef Q_WS_X11
    /*
       Qt::WA_PaintOnScreen is only supported for X11, but leads
       to substantial bugs with Qt 4.2.x/Windows
     */
    canvas()->setAttribute(Qt::WA_PaintOnScreen, true);
#endif
#endif

    alignScales();
    
    //  Initialize data
    for (int i = 0; i< PLOT_SIZE; i++)
    {
        d_x[i] = 0.5 * i;     // time axis
        d_y[i] = 0;
        d_z[i] = 0;
    }

    // Assign a title
    setTitle("A Test for High Refresh Rates");
    insertLegend(new QwtLegend(), QwtPlot::BottomLegend);

    // Insert new curves
    QwtPlotCurve *cRight = new QwtPlotCurve("Data Moving Right");
    cRight->attach(this);

    QwtPlotCurve *cLeft = new QwtPlotCurve("Data Moving Left");
    cLeft->attach(this);

    // Set curve styles
    cRight->setPen(QPen(Qt::red));
    cLeft->setPen(QPen(Qt::blue));

    // Attach (don't copy) data. Both curves use the same x array.
    cRight->setRawData(d_x, d_y, PLOT_SIZE);
    cLeft->setRawData(d_x, d_z, PLOT_SIZE);

#if 0
    //  Insert zero line at y = 0
    QwtPlotMarker *mY = new QwtPlotMarker();
    mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
    mY->setLineStyle(QwtPlotMarker::HLine);
    mY->setYValue(0.0);
    mY->attach(this);
#endif

    // Axis 
    setAxisTitle(QwtPlot::xBottom, "Time/seconds");
    setAxisScale(QwtPlot::xBottom, 0, 100);

    setAxisTitle(QwtPlot::yLeft, "Values");
    setAxisScale(QwtPlot::yLeft, -1.5, 1.5);
    
    setTimerInterval(0.0); 
}
Ejemplo n.º 10
0
MeasuresTabView::MeasuresTabView()
  : PatMainTabView()
{
  setTitle("Organize and Edit Measures for Project");

  // Main Content

  mainContent = new QWidget();

  auto mainContentVLayout = new QVBoxLayout();
  mainContentVLayout->setContentsMargins(0,0,0,0);
  mainContentVLayout->setSpacing(0);
  mainContentVLayout->setAlignment(Qt::AlignTop);
  mainContent->setLayout(mainContentVLayout);

  viewSwitcher->setView(mainContent);

  // Select Baseline Header

  auto selectBaselineHeader = new QWidget();
  selectBaselineHeader->setFixedHeight(30);
  selectBaselineHeader->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
  selectBaselineHeader->setObjectName("SelectBaselineHeader");
  selectBaselineHeader->setStyleSheet("QWidget#SelectBaselineHeader { background: #494949; }");

  mainContentVLayout->addWidget(selectBaselineHeader);

  auto baselineHeaderHLayout = new QHBoxLayout(); 
  baselineHeaderHLayout->setContentsMargins(5,5,5,5);
  baselineHeaderHLayout->setSpacing(10);

  selectBaselineHeader->setLayout(baselineHeaderHLayout);

  baselineCautionLabel = new QLabel();
  baselineCautionLabel->setPixmap(QPixmap(":shared_gui_components/images/warning_icon.png"));
  baselineHeaderHLayout->addWidget(baselineCautionLabel);

  QLabel * selectBaselineLabel = new QLabel("Select Your Baseline Model");
  selectBaselineLabel->setStyleSheet("QLabel { color: white; font: bold; }");
  baselineHeaderHLayout->addWidget(selectBaselineLabel);

  baselineNameBackground = new QWidget();
  baselineNameBackground->setObjectName("BaselineNameBackground");
  baselineNameBackground->setStyleSheet("QWidget#BaselineNameBackground { background: #D9D9D9 }");
  baselineNameBackground->setMinimumWidth(250);
  auto baselineNameBackgroundLayout = new QHBoxLayout();
  baselineNameBackgroundLayout->setContentsMargins(5,2,5,2);
  baselineNameBackgroundLayout->setSpacing(5);
  baselineNameBackground->setLayout(baselineNameBackgroundLayout);
  baselineHeaderHLayout->addWidget(baselineNameBackground);

  baselineLabel = new QLabel();
  baselineNameBackgroundLayout->addWidget(baselineLabel);

  selectBaselineButton = new GrayButton();
  selectBaselineButton->setText("Browse");
  baselineHeaderHLayout->addWidget(selectBaselineButton);

  baselineHeaderHLayout->addStretch();

  variableGroupListView = new OSListView(true);
  variableGroupListView->setContentsMargins(0,0,0,0);
  variableGroupListView->setSpacing(0);
  mainContentVLayout->addWidget(variableGroupListView);

  QString style;
  style.append("QWidget#Footer {");
  style.append("border-top: 1px solid black; ");
  style.append("background-color: qlineargradient(x1:0,y1:0,x2:0,y2:1,stop: 0 #B6B5B6, stop: 1 #737172); ");
  style.append("}");

  auto footer = new QWidget();
  footer->setObjectName("Footer");
  footer->setStyleSheet(style);
  mainContentVLayout->addWidget(footer);

  auto layout = new QHBoxLayout();
  layout->setSpacing(0);
  footer->setLayout(layout);

  m_updateMeasuresButton = new BlueButton();
  m_updateMeasuresButton->setText("Sync Project Measures with Library");
  m_updateMeasuresButton->setToolTip("Check the Library for Newer Versions of the Measures in Your Project and Provides Sync Option");
  layout->addStretch();
  layout->addWidget(m_updateMeasuresButton);

  connect(m_updateMeasuresButton, &QPushButton::clicked, this, &MeasuresTabView::openUpdateMeasuresDlg);
}
Ejemplo n.º 11
0
KCheckGroupBox::KCheckGroupBox(const char *title, QWidget *parent, const char *name) :
  KGroupBoxBase(parent, name)
{
  setTitle(title);
}
Ejemplo n.º 12
0
pfmPage::pfmPage (QWidget *parent, PFM_DEFINITION *pfmDef, PFM_GLOBAL *pfmg, NV_INT32 page_num):
    QWizardPage (parent)
{
    setPixmap (QWizard::WatermarkPixmap, QPixmap(":/icons/pfmLoadMWatermark.png"));

    pfm_def = pfmDef;
    pfm_global = pfmg;
    pfm_def->existing = NVFalse;
    l_page_num = page_num;
    pfmIndex.sprintf ("%02d", page_num - 1);
    prev_mbin = pfm_def->mbin_size;
    prev_gbin = pfm_def->gbin_size;

    QString title;
    title = tr ("PFM ") + pfmIndex + tr (" Options");
    setTitle (title);


    QVBoxLayout *pageLayout = new QVBoxLayout (this);
    pageLayout->setMargin (5);
    pageLayout->setSpacing (5);


    QHBoxLayout *pfm_file_box = new QHBoxLayout;
    pfm_file_box->setSpacing (5);

    pageLayout->addLayout (pfm_file_box);


    QString pfl = tr ("PFM file ") + pfmIndex;
    pfm_file_label = new QLabel (pfl, this);

    pfm_file_box->addWidget (pfm_file_label, 1);

    pfm_file_edit = new QLineEdit (this);
    pfm_file_edit->setToolTip (tr ("Set the PFM file name manually"));
    connect (pfm_file_edit, SIGNAL (textChanged (const QString &)), this, SLOT (slotPFMFileEdit (const QString &)));


    pfm_file_box->addWidget (pfm_file_edit, 10);

    pfm_file_browse = new QPushButton (tr ("Browse..."), this);
    pfm_file_browse->setToolTip (tr ("Select a preexisting PFM file to append to or create file in new directory"));

    pfm_file_label->setWhatsThis (pfm_fileText);
    pfm_file_edit->setWhatsThis (pfm_fileText);
    pfm_file_browse->setWhatsThis (pfm_fileBrowseText);

    connect (pfm_file_browse, SIGNAL (clicked ()), this, SLOT (slotPFMFileBrowse ()));

    pfm_file_box->addWidget (pfm_file_browse, 1);


    QGroupBox *limBox = new QGroupBox (tr ("Limits"), this);
    QHBoxLayout *limBoxLayout = new QHBoxLayout;
    limBox->setLayout (limBoxLayout);
    limBoxLayout->setSpacing (10);


    QGroupBox *mBinsBox = new QGroupBox (tr ("Bin size (meters)"), this);
    QHBoxLayout *mBinsBoxLayout = new QHBoxLayout;
    mBinsBox->setLayout (mBinsBoxLayout);
    mBinsBoxLayout->setSpacing (10);

    mBinSize = new QDoubleSpinBox (this);
    mBinSize->setDecimals (2);
    mBinSize->setRange (0.0, 1000.0);
    mBinSize->setSingleStep (1.0);
    mBinSize->setValue (pfm_def->mbin_size);
    mBinSize->setWrapping (TRUE);
    mBinSize->setToolTip (tr ("Set the PFM bin size in meters"));
    mBinSize->setWhatsThis (mBinSizeText);
    connect (mBinSize, SIGNAL (valueChanged (double)), this, SLOT (slotMBinSizeChanged (double)));
    mBinsBoxLayout->addWidget (mBinSize);


    limBoxLayout->addWidget (mBinsBox);


    QGroupBox *gBinsBox = new QGroupBox (tr ("Bin size (minutes)"), this);
    QHBoxLayout *gBinsBoxLayout = new QHBoxLayout;
    gBinsBox->setLayout (gBinsBoxLayout);
    gBinsBoxLayout->setSpacing (10);

    gBinSize = new QDoubleSpinBox (this);
    gBinSize->setDecimals (3);
    gBinSize->setRange (0.0, 200.0);
    gBinSize->setSingleStep (0.05);
    gBinSize->setValue (pfm_def->gbin_size);
    gBinSize->setWrapping (TRUE);
    gBinSize->setToolTip (tr ("Set the PFM bin size in minutes"));
    gBinSize->setWhatsThis (gBinSizeText);
    connect (gBinSize, SIGNAL (valueChanged (double)), this, SLOT (slotGBinSizeChanged (double)));
    gBinsBoxLayout->addWidget (gBinSize);


    limBoxLayout->addWidget (gBinsBox);


    QGroupBox *minDBox = new QGroupBox (tr ("Minimum depth"), this);
    QHBoxLayout *minDBoxLayout = new QHBoxLayout;
    minDBox->setLayout (minDBoxLayout);
    minDBoxLayout->setSpacing (10);

    minDepth = new QDoubleSpinBox (this);
    minDepth->setDecimals (1);
    minDepth->setRange (-10000.0, 12000.0);
    minDepth->setSingleStep (1000.0);
    minDepth->setValue (pfm_def->min_depth);
    minDepth->setWrapping (TRUE);
    minDepth->setToolTip (tr ("Set the minimum allowable depth for the PFM structure"));
    minDepth->setWhatsThis (minDepthText);
    minDBoxLayout->addWidget (minDepth);


    limBoxLayout->addWidget (minDBox);


    QGroupBox *maxDBox = new QGroupBox (tr ("Maximum depth"), this);
    QHBoxLayout *maxDBoxLayout = new QHBoxLayout;
    maxDBox->setLayout (maxDBoxLayout);
    maxDBoxLayout->setSpacing (10);

    maxDepth = new QDoubleSpinBox (this);
    maxDepth->setDecimals (1);
    maxDepth->setRange (-10000.0, 12000.0);
    maxDepth->setSingleStep (1000.0);
    maxDepth->setValue (pfm_def->max_depth);
    maxDepth->setWrapping (TRUE);
    maxDepth->setToolTip (tr ("Set the maximum allowable depth for the PFM structure"));
    maxDepth->setWhatsThis (maxDepthText);
    maxDBoxLayout->addWidget (maxDepth);


    limBoxLayout->addWidget (maxDBox);


    QGroupBox *precBox = new QGroupBox (tr ("Precision"), this);
    QHBoxLayout *precBoxLayout = new QHBoxLayout;
    precBox->setLayout (precBoxLayout);
    precBoxLayout->setSpacing (10);

    precision = new QComboBox (this);
    precision->setToolTip (tr ("Set the PFM structure depth precision"));
    precision->setWhatsThis (precisionText);
    precision->setEditable (FALSE);
    precision->addItem ("0.01 " + tr ("(one centimeter)"));
    precision->addItem ("0.10 " + tr ("(one decimeter)"));
    precision->addItem ("1.00 " + tr ("(one meter)"));
    precBoxLayout->addWidget (precision);


    limBoxLayout->addWidget (precBox);


    pageLayout->addWidget (limBox);


    QGroupBox *areaBox = new QGroupBox (tr ("Area file"), this);
    QHBoxLayout *areaBoxLayout = new QHBoxLayout;
    areaBox->setLayout (areaBoxLayout);
    areaBoxLayout->setSpacing (10);

    area_edit = new QLineEdit (this);
    area_edit->setReadOnly (TRUE);
    area_edit->setToolTip (tr ("Area file name for this PFM"));
    area_edit->setWhatsThis (areaText);
    areaBoxLayout->addWidget (area_edit);

    area_browse = new QPushButton (tr ("Browse..."), this);
    area_browse->setToolTip (tr ("Select an area file to define the PFM area"));
    area_browse->setWhatsThis (areaBrowseText);
    connect (area_browse, SIGNAL (clicked ()), this, SLOT (slotAreaFileBrowse ()));
    areaBoxLayout->addWidget (area_browse);

    area_map = new QPushButton (tr ("Map..."), this);
    area_map->setToolTip (tr ("Create an area file using areaCheck"));
    area_map->setWhatsThis (area_mapText);
    connect (area_map, SIGNAL (clicked ()), this, SLOT (slotAreaMap ()));
    areaBoxLayout->addWidget (area_map);

    area_pfm = new QPushButton (tr ("PFM..."), this);
    area_pfm->setToolTip (tr ("Use the area in an already existing PFM structure"));
    area_pfm->setWhatsThis (area_PFMText);
    connect (area_pfm, SIGNAL (clicked ()), this, SLOT (slotAreaPFM ()));
    areaBoxLayout->addWidget (area_pfm);

    area_nsew = new QPushButton (tr ("NSEW..."), this);
    area_nsew->setToolTip (tr ("Create an area file by defining North, South, East, and West bounds"));
    area_nsew->setWhatsThis (area_nsewText);
    connect (area_nsew, SIGNAL (clicked ()), this, SLOT (slotAreaNSEW ()));
    areaBoxLayout->addWidget (area_nsew);


    pageLayout->addWidget (areaBox, 1);



    QGroupBox *optBox = new QGroupBox (tr ("Optional files"), this);
    QHBoxLayout *optBoxLayout = new QHBoxLayout;
    optBox->setLayout (optBoxLayout);
    optBoxLayout->setSpacing (10);


    QGroupBox *mosaicBox = new QGroupBox (tr ("Mosaic file"), this);
    QHBoxLayout *mosaicBoxLayout = new QHBoxLayout;
    mosaicBox->setLayout (mosaicBoxLayout);
    mosaicBoxLayout->setSpacing (10);

    mosaic_edit = new QLineEdit (this);
    mosaic_edit->setReadOnly (TRUE);
    mosaic_edit->setToolTip (tr ("Mosaic file name for this PFM"));
    mosaic_edit->setWhatsThis (mosaicText);
    mosaicBoxLayout->addWidget (mosaic_edit);

    mosaic_browse = new QPushButton (tr ("Browse..."), this);
    mosaic_browse->setToolTip (tr ("Select a mosaic file for this PFM"));
    mosaic_browse->setWhatsThis (mosaicBrowseText);
    mosaic_edit->setText (pfm_def->mosaic);
    connect (mosaic_browse, SIGNAL (clicked ()), this, SLOT (slotMosaicFileBrowse ()));
    mosaicBoxLayout->addWidget (mosaic_browse);


    optBoxLayout->addWidget (mosaicBox);


    QGroupBox *featureBox = new QGroupBox (tr ("Feature file"), this);
    QHBoxLayout *featureBoxLayout = new QHBoxLayout;
    featureBox->setLayout (featureBoxLayout);
    featureBoxLayout->setSpacing (10);

    feature_edit = new QLineEdit (this);
    feature_edit->setReadOnly (TRUE);
    feature_edit->setToolTip (tr ("Feature file name for this PFM"));
    feature_edit->setWhatsThis (featureText);
    featureBoxLayout->addWidget (feature_edit);

    feature_browse = new QPushButton (tr ("Browse..."), this);
    feature_browse->setToolTip (tr ("Select a feature file for this PFM"));
    feature_browse->setWhatsThis (featureBrowseText);
    feature_edit->setText (pfm_def->feature);
    connect (feature_browse, SIGNAL (clicked ()), this, SLOT (slotFeatureFileBrowse ()));
    featureBoxLayout->addWidget (feature_browse);


    optBoxLayout->addWidget (featureBox);


    pageLayout->addWidget (optBox, 1);


    QGroupBox *filtBox = new QGroupBox (tr ("Area filter settings"), this);
    QHBoxLayout *filtBoxLayout = new QHBoxLayout;
    filtBox->setLayout (filtBoxLayout);
    filtBoxLayout->setSpacing (10);


    QGroupBox *aBox = new QGroupBox (tr ("Apply area filter"), this);
    QHBoxLayout *aBoxLayout = new QHBoxLayout;
    aBox->setLayout (aBoxLayout);
    aBoxLayout->setSpacing (10);

    applyFilter = new QCheckBox (this);
    applyFilter->setToolTip (tr ("Apply the area filter for this PFM"));
    applyFilter->setWhatsThis (applyFilterText);
    applyFilter->setChecked (pfm_def->apply_area_filter);
    connect (applyFilter, SIGNAL (stateChanged (int)), this, SLOT (slotApplyFilterStateChanged (int)));
    aBoxLayout->addWidget (applyFilter);


    filtBoxLayout->addWidget (aBox);


    QGroupBox *dBox = new QGroupBox (tr ("Deep filter only"), this);
    QHBoxLayout *dBoxLayout = new QHBoxLayout;
    dBox->setLayout (dBoxLayout);
    dBoxLayout->setSpacing (10);

    deepFilter = new QCheckBox (this);
    deepFilter->setToolTip (tr ("Only filter values deeper than the average surface"));
    deepFilter->setWhatsThis (deepFilterText);
    deepFilter->setChecked (pfm_def->deep_filter_only);
    if (!pfm_def->apply_area_filter) deepFilter->setEnabled (FALSE);
    dBoxLayout->addWidget (deepFilter);


    filtBoxLayout->addWidget (dBox);


    QGroupBox *bBox = new QGroupBox (tr ("Bin standard deviation"), this);
    QHBoxLayout *bBoxLayout = new QHBoxLayout;
    bBox->setLayout (bBoxLayout);
    bBoxLayout->setSpacing (10);

    stdSpin = new QDoubleSpinBox (this);
    stdSpin->setDecimals (2);
    stdSpin->setRange (0.3, 3.0);
    stdSpin->setSingleStep (0.1);
    stdSpin->setValue (pfm_def->cellstd);
    stdSpin->setWrapping (TRUE);
    stdSpin->setToolTip (tr ("Set the area filter standard deviation"));
    stdSpin->setWhatsThis (stdText);
    if (!pfm_def->apply_area_filter) stdSpin->setEnabled (FALSE);
    bBoxLayout->addWidget (stdSpin);


    filtBoxLayout->addWidget (bBox);


    QGroupBox *tBox = new QGroupBox (tr ("Feature Radius"), this);
    QHBoxLayout *tBoxLayout = new QHBoxLayout;
    tBox->setLayout (tBoxLayout);
    tBoxLayout->setSpacing (10);

    featureRadius = new QDoubleSpinBox (this);
    featureRadius->setDecimals (2);
    featureRadius->setRange (0.0, 200.0);
    featureRadius->setSingleStep (10.0);
    featureRadius->setValue (pfm_def->radius);
    featureRadius->setWrapping (TRUE);
    featureRadius->setToolTip (tr ("Set the radius of the area around features to exclude from filtering"));
    featureRadius->setWhatsThis (featureRadiusText);
    if (!pfm_def->apply_area_filter) featureRadius->setEnabled (FALSE);
    tBoxLayout->addWidget (featureRadius);


    filtBoxLayout->addWidget (tBox);


    pageLayout->addWidget (filtBox, 1);


    //  Register fields.

    pfm_file_edit_field = "pfm_file_edit" + pfmIndex;
    registerField (pfm_file_edit_field, pfm_file_edit);

    area_edit_field = "area_edit" + pfmIndex;
    registerField (area_edit_field, area_edit);

    mBinSizeField = "mBinSize" + pfmIndex;
    registerField (mBinSizeField, mBinSize, "value", "valueChanged");

    gBinSizeField = "gBinSize" + pfmIndex;
    registerField (gBinSizeField, gBinSize, "value", "valueChanged");

    minDepthField = "minDepth" + pfmIndex;
    registerField (minDepthField, minDepth, "value", "valueChanged");

    maxDepthField = "maxDepth" + pfmIndex;
    registerField (maxDepthField, maxDepth, "value", "valueChanged");

    precisionField = "precision" + pfmIndex;
    registerField (precisionField, precision);

    mosaic_edit_field = "mosaic_edit" + pfmIndex;
    registerField (mosaic_edit_field, mosaic_edit);

    feature_edit_field = "feature_edit" + pfmIndex;
    registerField (feature_edit_field, feature_edit);

    applyFilterField = "applyFilter" + pfmIndex;
    registerField (applyFilterField, applyFilter);

    deepFilterField = "deepFilter" + pfmIndex;
    registerField (deepFilterField, deepFilter);

    stdSpinField = "stdSpin" + pfmIndex;
    registerField (stdSpinField, stdSpin, "value", "valueChanged");

    featureRadiusField = "featureRadius" + pfmIndex;
    registerField (featureRadiusField, featureRadius, "value", "valueChanged");


    setFields (pfmDef);
}
Ejemplo n.º 13
0
/*!
  \brief Paint the plot into a given rectangle.
  Paint the contents of a QwtPlot instance into a given rectangle (Qwt modified code).

  \param painter Painter
  \param plotRect Bounding rectangle
  \param pfilter Print filter
*/
void Plot::print(QPainter *painter, const QRect &plotRect,
        const QwtPlotPrintFilter &pfilter)
{
    int axisId;

    if ( painter == 0 || !painter->isActive() ||
            !plotRect.isValid() || size().isNull() )
       return;

    QwtText t = title();
	printFrame(painter, plotRect);

    painter->save();

    // All paint operations need to be scaled according to
    // the paint device metrics.

    QwtPainter::setMetricsMap(this, painter->device());
    const QwtMetricsMap &metricsMap = QwtPainter::metricsMap();

    // It is almost impossible to integrate into the Qt layout
    // framework, when using different fonts for printing
    // and screen. To avoid writing different and Qt unconform
    // layout engines we change the widget attributes, print and
    // reset the widget attributes again. This way we produce a lot of
    // useless layout events ...

    pfilter.apply((QwtPlot *)this);

    int baseLineDists[QwtPlot::axisCnt];
    if ( !(pfilter.options() & QwtPlotPrintFilter::PrintCanvasBackground) ){
        // In case of no background we set the backbone of
        // the scale on the frame of the canvas.

        for (axisId = 0; axisId < QwtPlot::axisCnt; axisId++ ){
            QwtScaleWidget *scaleWidget = (QwtScaleWidget *)axisWidget(axisId);
            if ( scaleWidget ){
                baseLineDists[axisId] = scaleWidget->margin();
                scaleWidget->setMargin(0);
            }
        }
    }
    // Calculate the layout for the print.

    int layoutOptions = QwtPlotLayout::IgnoreScrollbars
        | QwtPlotLayout::IgnoreFrames;
    if ( !(pfilter.options() & QwtPlotPrintFilter::PrintMargin) )
        layoutOptions |= QwtPlotLayout::IgnoreMargin;
    if ( !(pfilter.options() & QwtPlotPrintFilter::PrintLegend) )
        layoutOptions |= QwtPlotLayout::IgnoreLegend;

    ((QwtPlot *)this)->plotLayout()->activate(this,
        QwtPainter::metricsMap().deviceToLayout(plotRect),
        layoutOptions);

    if ((pfilter.options() & QwtPlotPrintFilter::PrintTitle)
        && (!titleLabel()->text().isEmpty())){
        printTitle(painter, plotLayout()->titleRect());
    }

    QRect canvasRect = plotLayout()->canvasRect();

    for ( axisId = 0; axisId < QwtPlot::axisCnt; axisId++ ){
        QwtScaleWidget *scaleWidget = (QwtScaleWidget *)axisWidget(axisId);
        if (scaleWidget){
            int baseDist = scaleWidget->margin();

            int startDist, endDist;
            scaleWidget->getBorderDistHint(startDist, endDist);

            QRect scaleRect = plotLayout()->scaleRect(axisId);
            if (!scaleWidget->margin()){
                switch(axisId){
                    case xBottom:
                        scaleRect.translate(0, canvasRect.bottom() - scaleRect.top());
                    break;
                    case xTop:
                        scaleRect.translate(0, canvasRect.top() - scaleRect.bottom());
                    break;
                    case yLeft:
                        scaleRect.translate(canvasRect.left() - scaleRect.right(), 0);
                    break;
                    case yRight:
                        scaleRect.translate(canvasRect.right() - scaleRect.left(), 0);
                    break;
                }
            }
            printScale(painter, axisId, startDist, endDist, baseDist, scaleRect);
        }
    }

    if ( !(pfilter.options() & QwtPlotPrintFilter::PrintCanvasBackground) )
    {
        QRect boundingRect(
            canvasRect.left() - 1, canvasRect.top() - 1,
            canvasRect.width() + 2, canvasRect.height() + 2);
        boundingRect = metricsMap.layoutToDevice(boundingRect);
        boundingRect.setWidth(boundingRect.width() - 1);
        boundingRect.setHeight(boundingRect.height() - 1);

        painter->setPen(QPen(Qt::black));
        painter->setBrush(QBrush(Qt::NoBrush));
        painter->drawRect(boundingRect);
    }

    canvasRect = metricsMap.layoutToDevice(canvasRect);

    // When using QwtPainter all sizes where computed in pixel
    // coordinates and scaled by QwtPainter later. This limits
    // the precision to screen resolution. A much better solution
    // is to scale the maps and print in unlimited resolution.

    QwtScaleMap map[axisCnt];
    for (axisId = 0; axisId < axisCnt; axisId++){
        map[axisId].setTransformation(axisScaleEngine(axisId)->transformation());

        const QwtScaleDiv &scaleDiv = *axisScaleDiv(axisId);
        map[axisId].setScaleInterval(scaleDiv.lBound(), scaleDiv.hBound());

        double from, to;
        if ( axisEnabled(axisId) ){
            const int sDist = axisWidget(axisId)->startBorderDist();
            const int eDist = axisWidget(axisId)->endBorderDist();
            const QRect &scaleRect = plotLayout()->scaleRect(axisId);

            if ( axisId == xTop || axisId == xBottom ){
                from = metricsMap.layoutToDeviceX(scaleRect.left() + sDist);
                to = metricsMap.layoutToDeviceX(scaleRect.right() + 1 - eDist);
            } else {
                from = metricsMap.layoutToDeviceY(scaleRect.bottom() + 1 - eDist );
                to = metricsMap.layoutToDeviceY(scaleRect.top() + sDist);
            }
        } else {
            const int margin = plotLayout()->canvasMargin(axisId);
            if ( axisId == yLeft || axisId == yRight ){
                from = metricsMap.layoutToDeviceX(canvasRect.bottom() - margin);
                to = metricsMap.layoutToDeviceX(canvasRect.top() + margin);
            } else {
                from = metricsMap.layoutToDeviceY(canvasRect.left() + margin);
                to = metricsMap.layoutToDeviceY(canvasRect.right() - margin);
            }
        }
        map[axisId].setPaintXInterval(from, to);
    }

    // The canvas maps are already scaled.
    QwtPainter::setMetricsMap(painter->device(), painter->device());
    printCanvas(painter, canvasRect, map, pfilter);
    QwtPainter::resetMetricsMap();

    ((QwtPlot *)this)->plotLayout()->invalidate();

    // reset all widgets with their original attributes.
    if ( !(pfilter.options() & QwtPlotPrintFilter::PrintCanvasBackground) ){
        // restore the previous base line dists
        for (axisId = 0; axisId < QwtPlot::axisCnt; axisId++ ){
            QwtScaleWidget *scaleWidget = (QwtScaleWidget *)axisWidget(axisId);
            if ( scaleWidget  )
                scaleWidget->setMargin(baseLineDists[axisId]);
        }
    }

    pfilter.reset((QwtPlot *)this);
    painter->restore();
    setTitle(t);//hack used to avoid bug in Qwt::printTitle(): the title attributes are overwritten
}
Ejemplo n.º 14
0
void ICResultChart::setChartTitle(QString title)
{
    setTitle(title);
}
Ejemplo n.º 15
0
//------------------------------------------------------------------------
CCheckBox::~CCheckBox ()
{
	setTitle (0);
	setFont (0);
}
Ejemplo n.º 16
0
void
PfPvPlot::setData(RideItem *_rideItem)
{
    rideItem = _rideItem;

    RideFile *ride = rideItem->ride;

    if (ride) {
	setTitle(ride->startTime().toString(GC_DATETIME_FORMAT));

	// quickly erase old data
	curve->setVisible(false);

	// handle zone stuff
	refreshZoneItems();

	// due to the discrete power and cadence values returned by the
	// power meter, there will very likely be many duplicate values.
	// Rather than pass them all to the curve, use a set to strip
	// out duplicates.
	std::set<std::pair<double, double> > dataSet;

	long tot_cad = 0;
	long tot_cad_points = 0;


        foreach(const RideFilePoint *p1, ride->dataPoints()) {

	    if (p1->watts != 0 && p1->cad != 0) {
		double aepf = (p1->watts * 60.0) / (p1->cad * cl_ * 2.0 * PI);
		double cpv = (p1->cad * cl_ * 2.0 * PI) / 60.0;

		dataSet.insert(std::make_pair<double, double>(aepf, cpv));
            
		tot_cad += p1->cad;
		tot_cad_points++;

        
	    }
	}

	if (tot_cad_points == 0) {
	    setTitle("no cadence");
	    refreshZoneItems();
	    curve->setVisible(false);
	}
	    
	else {
	    // Now that we have the set of points, transform them into the
	    // QwtArrays needed to set the curve's data.
	    QwtArray<double> aepfArray;
	    QwtArray<double> cpvArray;
	    std::set<std::pair<double, double> >::const_iterator j(dataSet.begin());
	    while (j != dataSet.end()) {
		const std::pair<double, double>& dataPoint = *j;

		aepfArray.push_back(dataPoint.first);
		cpvArray.push_back(dataPoint.second);

		++j;
	    }
	
	    setCAD(tot_cad / tot_cad_points);
        
	    curve->setData(cpvArray, aepfArray);

	    // now show the data (zone shading would already be visible)
	    curve->setVisible(true);
	}
    }
    else {
Ejemplo n.º 17
0
void TagSet::setTitle(const QString &title)
{
    setTitle(QTextCodec::codecForName(ENC_CODEC)->fromUnicode(title), true);
}
Ejemplo n.º 18
0
//Initialization from DB (Editor, Server)
CurrentNPC::CurrentNPC(SqliteResult sqliteResult, Location* location) :
	CurrentMapObject<NPC>::CurrentMapObject(sqliteResult, Game::instance->resources->npcs, Game::instance->resources->npcsCount, location)
{
	if (node)
		setTitle(base->name);
}
Ejemplo n.º 19
0
GuiSettingsStack_messaging::GuiSettingsStack_messaging(QWidget *parent)
{
  this->setUpUI(LayoutStyle::Linear);

  setIcon(":/img/img/messaging.png");
  setTitle("Settings");
  setSubTitle("messaging");

  addTag("Text Bubble");
  in_bubble_picker = new GuiColorPicker(&GlobalData::settings_struct.chat_bubble_color_i, this);
  addItem("\tReceived message bubble colour:", in_bubble_picker);
  out_bubble_picker = new GuiColorPicker(&GlobalData::settings_struct.chat_bubble_color_o, this);
  addItem("\tSent message bubble colour:       ", out_bubble_picker);
  QPushButton *push_btn = new QPushButton("reset", this);
  push_btn->setMaximumWidth(70);
  connect(push_btn, &QPushButton::clicked,
          [this](){
            GlobalData::settings_struct.chat_bubble_color_i = GlobalData::color_defaultChatBubbleI;
            GlobalData::settings_struct.chat_bubble_color_o = GlobalData::color_defaultChatBubbleO;
            GlobalData::settings_struct.modified_lock = true;
            in_bubble_picker->repaint();
            out_bubble_picker->repaint();
          });
  addItem("\tDefault color scheme:      ", push_btn);


  addTag("Notifications");
  QCheckBox *enable_notify_box = new QCheckBox(this);
  enable_notify_box->setChecked(GlobalData::settings_struct.notification.message_notification);
  connect(enable_notify_box, &QCheckBox::toggled,
          [this](bool toggled){
            GlobalData::settings_struct.notification.message_notification = toggled;
            GlobalData::settings_struct.modified_lock = true;
          });
#ifndef Q_OS_WIN
  addItem("\tEnable notifications\t\t\t          ", enable_notify_box);
#else
  addItem("\tEnable notifications\t\t\t\t", enable_notify_box);
#endif
  QCheckBox *show_detail_box = new QCheckBox(this);
  show_detail_box->setChecked(GlobalData::settings_struct.notification.message_detail_notification);
  connect(show_detail_box, &QCheckBox::toggled,
          [this](bool toggled){
            GlobalData::settings_struct.notification.message_detail_notification = toggled;
            GlobalData::settings_struct.modified_lock = true;
          });
#ifndef Q_OS_WIN
  addItem("\tShow message detail\t\t          ", show_detail_box);
#else
  addItem("\tShow message detail\t\t\t\t", show_detail_box);
#endif
	addTag("History Cleaner");
	clear_btn = new QPushButton("clear", this);
	clear_btn->setMaximumWidth(70);
	connect(clear_btn, &QPushButton::clicked,
					[this](){
						if(make_sure == 0)
							{
								clear_btn->setText("sure?");
								make_sure ++;
							}
						else if(make_sure == 1)
							{
								clear_btn->setText("go!");
								make_sure ++;
							}
						if(make_sure == 2)
							{
								QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation).append("/usr/"));
								if(dir.removeRecursively())
									{
										clear_btn->setText("cleared");
										clear_btn->setDisabled(true);
									}
								else
									{
										clear_btn->setText("failed");
									}
							}
					});
	addItem("\tDelete ALL Message History:      ", clear_btn);



  this->setParent(parent);
}
Ejemplo n.º 20
0
//Initialization from incoming packet (Client)
CurrentNPC::CurrentNPC(char* currentMapObjectSpawnedPacket) :
	CurrentMapObject<NPC>::CurrentMapObject(currentMapObjectSpawnedPacket, Game::instance->resources->npcs, Game::instance->resources->npcsCount)
{
	if (node)
		setTitle(base->name);
}
Ejemplo n.º 21
0
Archivo: dcp.c Proyecto: swhobbit/UUPC
static KWBoolean master( const char recvGrade,
                       const KWBoolean overrideGrade,
                       const KWBoolean runUUXQT )
{

   CONN_STATE m_state = CONN_INITSTAT;
   CONN_STATE old_state = CONN_EXIT;

   char sendGrade = ALL_GRADES;

   KWBoolean contacted = KWFalse;
   KWBoolean needUUXQT = KWFalse;

/*--------------------------------------------------------------------*/
/*                    Validate the system to call                     */
/*--------------------------------------------------------------------*/

   if ( !equal( Rmtname, "any" ) && !equal( Rmtname, "all" ))
   {
      if ( checkreal( Rmtname ) == NULL )
      {
         printmsg(0,"%s is not \"any\", \"all\", or a valid system to call",
                     Rmtname);
         printmsg(0,"Run UUNAME for a list of callable systems");
         panic();
      }

   }

   if ((fsys = FOPEN(E_systems, "r",TEXT_MODE)) == nil(FILE))
   {
      printerr(E_systems);
      panic();
   }

   setvbuf( fsys, NULL, _IONBF, 0);

   while (m_state != CONN_EXIT )
   {
      printmsg(old_state == m_state ? 10 : 4 ,
               "M state = %c", m_state);
      old_state = m_state;

      switch (m_state)
      {
         case CONN_INITSTAT:
            HostStatus();
            m_state = CONN_INITIALIZE;
            break;

         case CONN_INITIALIZE:
            setTitle("Determining system to call");
            hostp = NULL;

            if ( locked )
               UnlockSystem();

            m_state = getsystem(recvGrade);
            if ( hostp != NULL )
               remote_stats.hstatus = hostp->status.hstatus;
            break;

         case CONN_CHECKTIME:
            sendGrade = checktime(flds[FLD_CCTIME]);

            if ( (overrideGrade && sendGrade) || callnow )
               sendGrade = recvGrade;

            if ( !CallWindow( sendGrade ))
               m_state = CONN_INITIALIZE;
            else if ( LockSystem( hostp->hostname , B_UUCICO))
            {
               dialed = KWTrue;
               time(&hostp->status.ltime);
                              /* Save time of last attempt to call  */
               hostp->status.hstatus = HS_AUTODIAL;
               m_state = CONN_MODEM;
            }
            else
               m_state = CONN_INITIALIZE;

            break;

         case CONN_NOGRADE:
            CallWindow( 0 );        /* Simply to update last time called */
            m_state = CONN_INITIALIZE;
            break;

         case CONN_MODEM:
            if (getmodem(flds[FLD_TYPE]))
               m_state = CONN_DIALOUT;
            else {
               hostp->status.hstatus = HS_INVALID_DEVICE;
               m_state = CONN_INITIALIZE;
            }
            break;

         case CONN_DIALOUT:
            if ( !IsNetwork() )
            {
               setTitle( "Allocating modem on %s", M_device);
               if (suspend_other(KWTrue, M_device ) < 0 )
               {
                  hostp->status.hstatus = HS_NODEVICE;
                  suspend_other(KWFalse, M_device );  /* Resume modem   */
                  m_state = CONN_INITIALIZE;    /* Try next system      */
                  break;
               }
            } /* if */

            setTitle( "Calling %s on %s", rmtname, M_device );
            m_state = callup( );
            break;

         case CONN_PROTOCOL:
            m_state = startup_server( (char)
                                       (bflag[F_SYMMETRICGRADES] ?
                                       sendGrade  : recvGrade) );
            break;

         case CONN_SERVER:
            if (bflag[F_MULTITASK])
               dcupdate();

            setTitle("%s connected to %s", securep->myname, hostp->via );
            m_state = process( POLL_ACTIVE, sendGrade );
            contacted = KWTrue;
            break;

         case CONN_TERMINATE:
            m_state = sysend();

            if ( hostp != NULL )
            {
               if (hostp->status.hstatus == HS_INPROGRESS)
                  hostp->status.hstatus = HS_CALL_FAILED;
               dcstats();
               needUUXQT = KWTrue;
            }
            break;

         case CONN_TIMESET:
            contacted = KWTrue;
            m_state = CONN_DROPLINE;
            break;

         case CONN_DROPLINE:
            setTitle("Closing port %s", M_device);
            shutDown();
            UnlockSystem();
            setTitle("Not connected");

            m_state = CONN_CLEANUP;
            break;

         case CONN_CLEANUP:
            if ( runUUXQT && needUUXQT )
               m_state = CONN_UUXQT;
            else
               m_state = CONN_INITIALIZE;
            break;

         case CONN_UUXQT:
            {
               char buf[100];
               sprintf( buf, "-s %s -x %d", rmtname, debuglevel );
               copylog();
               execute( "uuxqt", buf, NULL, NULL, KWFalse, KWFalse );
               openlog(NULL);
            }
            needUUXQT = KWFalse;
            m_state = CONN_INITIALIZE;
            break;

         case CONN_EXIT:
            break;

         default:
            printmsg(0,"dcpmain: Unknown master state = %c",m_state );
            panic();
            break;
      } /* switch */

      if ( terminate_processing )
         m_state = CONN_EXIT;

   } /* while */

   setTitle("Exiting");

   fclose(fsys);

   return contacted;

} /* master */
Ejemplo n.º 22
0
CpCertTrustView::CpCertTrustView( TInt certificateIndex, CpCertDataContainer& certDataContainer, QGraphicsItem *parent /*= 0*/)
		: CpBaseSettingView(0,parent), mCertDataContainer(certDataContainer), mCertificateIndex(certificateIndex)
		{
		setTitle(tr("Trust Settings"));
		viewTrustSettings();	 
		}
Ejemplo n.º 23
0
void FrameLoaderClientWx::didChangeTitle(DocumentLoader *l)
{
    setTitle(l->title(), l->url());
}
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
BOOL LLFloaterAnimPreview::postBuild()
{
	LLRect r;
	LLKeyframeMotion* motionp = NULL;
	LLBVHLoader* loaderp = NULL;

	if (!LLFloaterNameDesc::postBuild())
	{
		return FALSE;
	}

	mInWorld = gSavedSettings.getBOOL("PreviewAnimInWorld");

	childSetCommitCallback("name_form", onCommitName, this);

	if (gSavedSettings.getBOOL("AscentPowerfulWizard"))
	{
		childSetMaxValue("priority", 7);
	}

	childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee());
	childSetAction("ok_btn", onBtnOK, this);
	setDefaultBtn();

	if (mInWorld)
	{
		r = getRect();
		translate(0, 230);
		reshape(r.getWidth(), r.getHeight() - 230);
		childSetValue("bad_animation_text", getString("in_world"));
		childShow("bad_animation_text");
	}
	else
	{
		childHide("bad_animation_text");
	}

	mPreviewRect.set(PREVIEW_HPAD, 
		PREVIEW_TEXTURE_HEIGHT,
		getRect().getWidth() - PREVIEW_HPAD, 
		PREVIEW_HPAD + PREF_BUTTON_HEIGHT + PREVIEW_HPAD);
	mPreviewImageRect.set(0.f, 1.f, 1.f, 0.f);

	S32 y = mPreviewRect.mTop + BTN_HEIGHT;
	S32 btn_left = PREVIEW_HPAD;

	r.set( btn_left, y, btn_left + 32, y - BTN_HEIGHT );
	mPlayButton = getChild<LLButton>( "play_btn");
	if (!mPlayButton)
	{
		mPlayButton = new LLButton(std::string("play_btn"), LLRect(0,0,0,0));
	}
	mPlayButton->setClickedCallback(onBtnPlay);
	mPlayButton->setCallbackUserData(this);

	mPlayButton->setImages(std::string("button_anim_play.tga"),
						   std::string("button_anim_play_selected.tga"));
	mPlayButton->setDisabledImages(LLStringUtil::null,LLStringUtil::null);

	mPlayButton->setScaleImage(TRUE);

	mStopButton = getChild<LLButton>( "stop_btn");
	if (!mStopButton)
	{
		mStopButton = new LLButton(std::string("stop_btn"), LLRect(0,0,0,0));
	}
	mStopButton->setClickedCallback(onBtnStop);
	mStopButton->setCallbackUserData(this);

	mStopButton->setImages(std::string("button_anim_stop.tga"),
						   std::string("button_anim_stop_selected.tga"));
	mStopButton->setDisabledImages(LLStringUtil::null,LLStringUtil::null);

	mStopButton->setScaleImage(TRUE);

	r.set(r.mRight + PREVIEW_HPAD, y, getRect().getWidth() - PREVIEW_HPAD, y - BTN_HEIGHT);
	//childSetCommitCallback("playback_slider", onSliderMove, this);

	//childSetCommitCallback("preview_base_anim", onCommitBaseAnim, this);
	//childSetValue("preview_base_anim", "Standing");

	//childSetCommitCallback("priority", onCommitPriority, this);
	//childSetCommitCallback("loop_check", onCommitLoop, this);
	//childSetCommitCallback("loop_in_point", onCommitLoopIn, this);
	//childSetValidate("loop_in_point", validateLoopIn);
	//childSetCommitCallback("loop_out_point", onCommitLoopOut, this);
	//childSetValidate("loop_out_point", validateLoopOut);

	//childSetCommitCallback("hand_pose_combo", onCommitHandPose, this);
	
	//childSetCommitCallback("emote_combo", onCommitEmote, this);
	//childSetValue("emote_combo", "[None]");

	//childSetCommitCallback("ease_in_time", onCommitEaseIn, this);
	//childSetValidate("ease_in_time", validateEaseIn);
	//childSetCommitCallback("ease_out_time", onCommitEaseOut, this);
	//childSetValidate("ease_out_time", validateEaseOut);

	// <edit> moved declaration from below
	BOOL success = false;
	// </edit>

	std::string exten = gDirUtilp->getExtension(mFilename);
	if (exten == "bvh")
	{
		// loading a bvh file

		// now load bvh file
		S32 file_size;
		
		LLAPRFile infile ;
		infile.open(mFilenameAndPath, LL_APR_RB, LLAPRFile::global, &file_size);
		
		if (!infile.getFileHandle())
		{
			llwarns << "Can't open BVH file:" << mFilename << llendl;	
		}
		else
		{
			char*	file_buffer;

			file_buffer = new char[file_size + 1];

			if (file_size == infile.read(file_buffer, file_size))
			{
				file_buffer[file_size] = '\0';
				llinfos << "Loading BVH file " << mFilename << llendl;
				ELoadStatus load_status = E_ST_OK;
				S32 line_number = 0; 
				loaderp = new LLBVHLoader(file_buffer, load_status, line_number);
				std::string status = getString(STATUS[load_status]);
				
				if(load_status == E_ST_NO_XLT_FILE)
				{
					llwarns << "NOTE: No translation table found." << llendl;
				}
				else
				{
					llwarns << "ERROR: [line: " << line_number << "] " << status << llendl;
				}
			}

			infile.close() ;
			delete[] file_buffer;

			// <edit> moved everything bvh from below
			if(loaderp && loaderp->isInitialized() && loaderp->getDuration() <= MAX_ANIM_DURATION)
	{
		mTransactionID.generate();
		mMotionID = mTransactionID.makeAssetID(gAgent.getSecureSessionID());

		mAnimPreview = new LLPreviewAnimation(256, 256);

		// motion will be returned, but it will be in a load-pending state, as this is a new motion
		// this motion will not request an asset transfer until next update, so we have a chance to 
		// load the keyframe data locally
		if (mInWorld)
		{
			motionp = (LLKeyframeMotion*)gAgent.getAvatarObject()->createMotion(mMotionID);
		}
		else
		{
			motionp = (LLKeyframeMotion*)mAnimPreview->getDummyAvatar()->createMotion(mMotionID);
		}

		// create data buffer for keyframe initialization
		S32 buffer_size = loaderp->getOutputSize();
		U8* buffer = new U8[buffer_size];

		LLDataPackerBinaryBuffer dp(buffer, buffer_size);

		// pass animation data through memory buffer
		loaderp->serialize(dp);
		dp.reset();
				success = motionp && motionp->deserialize(dp);
			}
			else
			{
				success = false;
				if ( loaderp )
				{
					if (loaderp->getDuration() > MAX_ANIM_DURATION)
					{
						LLUIString out_str = getString("anim_too_long");
						out_str.setArg("[LENGTH]", llformat("%.1f", loaderp->getDuration()));
						out_str.setArg("[MAX_LENGTH]", llformat("%.1f", MAX_ANIM_DURATION));
						getChild<LLUICtrl>("bad_animation_text")->setValue(out_str.getString());
					}
					else
					{
						LLUIString out_str = getString("failed_file_read");
						out_str.setArg("[STATUS]", getString(STATUS[loaderp->getStatus()])); 
						getChild<LLUICtrl>("bad_animation_text")->setValue(out_str.getString());
					}
				}

				//setEnabled(FALSE);
				mMotionID.setNull();
				mAnimPreview = NULL;
			}
			// </edit>
		}
	}
	// <edit>
	else if(exten == "anim" || exten == "animatn" || exten == "neil")
	{
		S32 file_size;
		LLAPRFile raw_animatn;
		raw_animatn.open(mFilenameAndPath, LL_APR_RB, LLAPRFile::global, &file_size);

		if (!raw_animatn.getFileHandle())
		{
			llwarns << "Can't open animatn file:" << mFilename << llendl;	
		}
		else
		{
			char*	file_buffer;

			file_buffer = new char[file_size + 1];

			if (file_size == raw_animatn.read(file_buffer, file_size))
			{
				file_buffer[file_size] = '\0';
				llinfos << "Loading animatn file " << mFilename << llendl;
				mTransactionID.generate();
				mMotionID = mTransactionID.makeAssetID(gAgent.getSecureSessionID());
				mAnimPreview = new LLPreviewAnimation(256, 256);
				motionp = (LLKeyframeMotion*)mAnimPreview->getDummyAvatar()->createMotion(mMotionID);
				LLDataPackerBinaryBuffer dp((U8*)file_buffer, file_size);
				dp.reset();
				success = motionp && motionp->deserialize(dp);
			}

			raw_animatn.close();
			delete[] file_buffer;
		}
	}
	// </edit>

		if (success)
		{
			setAnimCallbacks() ;

			if (!mInWorld)
			{
				const LLBBoxLocal &pelvis_bbox = motionp->getPelvisBBox();

				LLVector3 temp = pelvis_bbox.getCenter();
				// only consider XY?
				//temp.mV[VZ] = 0.f;
				F32 pelvis_offset = temp.magVec();

				temp = pelvis_bbox.getExtent();
				//temp.mV[VZ] = 0.f;
				F32 pelvis_max_displacement = pelvis_offset + (temp.magVec() * 0.5f) + 1.f;

				F32 camera_zoom = LLViewerCamera::getInstance()->getDefaultFOV() / (2.f * atan(pelvis_max_displacement / PREVIEW_CAMERA_DISTANCE));

				mAnimPreview->setZoom(camera_zoom);
			}

			motionp->setName(childGetValue("name_form").asString());
			if (!mInWorld)
			{
				mAnimPreview->getDummyAvatar()->startMotion(mMotionID);
			}
			childSetMinValue("playback_slider", 0.0);
			childSetMaxValue("playback_slider", 1.0);

			childSetValue("loop_check", LLSD(motionp->getLoop()));
			childSetValue("loop_in_point", LLSD(motionp->getLoopIn() / motionp->getDuration() * 100.f));
			childSetValue("loop_out_point", LLSD(motionp->getLoopOut() / motionp->getDuration() * 100.f));
			childSetValue("priority", LLSD((F32)motionp->getPriority()));
			childSetValue("hand_pose_combo", LLHandMotion::getHandPoseName(motionp->getHandPose()));
			childSetValue("ease_in_time", LLSD(motionp->getEaseInDuration()));
			childSetValue("ease_out_time", LLSD(motionp->getEaseOutDuration()));
			setEnabled(TRUE);
			std::string seconds_string;
			seconds_string = llformat(" - %.2f seconds", motionp->getDuration());

			setTitle(mFilename + std::string(seconds_string));
		}
		else
		{
			delete mAnimPreview;
			mAnimPreview = NULL;
			mMotionID.setNull();
			childSetValue("bad_animation_text", getString("failed_to_initialize"));
		}


	refresh();

	delete loaderp;

	return TRUE;
}
Ejemplo n.º 25
0
RootMenu::RootMenu(): Menu(_L("menu"), 0) {
	Q_ASSERT(obj == nullptr);
	obj = this;

	setTitle("Root Menu");

	auto &open = *addMenu(_L("open"));
	open.addAction(_L("file"));
	open.addAction(_L("folder"));
	open.addAction(_L("url"));
	open.addAction(_L("dvd"));
	open.addAction(_L("bluray"));
	open.addSeparator();
	auto &recent = *open.addMenu(_L("recent"));
		recent.addSeparator();
		recent.addAction(_L("clear"));

	auto &play = *addMenu(_L("play"));
	play.addAction(_L("pause"));
	play.addAction(_L("stop"));
	play.addSeparator();
	auto prev = play.addAction(_L("prev"));
	auto next = play.addAction(_L("next"));
	play.addSeparator();
	addStepActions(*play.addMenu("speed"), 10, 100, 1000);
	auto &repeat = *play.addMenu(_L("repeat"));
		repeat.addActionToGroup(_L("range"), false)->setData(int('r'));
		repeat.addActionToGroup(_L("subtitle"), false)->setData(int('s'));
		repeat.addActionToGroup(_L("quit"), false)->setData(int('q'));
	play.addSeparator();
	play.addAction(_L("dvd-menu"));
	auto &seek = *play.addMenu(_L("seek"));
		auto forward1 = seek.addActionToGroup(_L("forward1"), false, _L("relative"));
		auto forward2 = seek.addActionToGroup(_L("forward2"), false, _L("relative"));
		auto forward3 = seek.addActionToGroup(_L("forward3"), false, _L("relative"));
		auto backward1 = seek.addActionToGroup(_L("backward1"), false, _L("relative"));
		auto backward2 = seek.addActionToGroup(_L("backward2"), false, _L("relative"));
		auto backward3 = seek.addActionToGroup(_L("backward3"), false, _L("relative"));
		seek.addSeparator();
		seek.addActionToGroup(_L("prev-subtitle"), false, _L("subtitle"))->setData(-1);
		seek.addActionToGroup(_L("current-subtitle"), false, _L("subtitle"))->setData(0);
		seek.addActionToGroup(_L("next-subtitle"), false, _L("subtitle"))->setData(1);
	play.addMenu(_L("title"))->setEnabled(false);
	auto &chapter = *play.addMenu(_L("chapter"));
	chapter.setEnabled(false);
	chapter.g()->setExclusive(true);
	chapter.addAction(_L("prev"));
	chapter.addAction(_L("next"));
	chapter.addSeparator();

	auto &subtitle = *addMenu(_L("subtitle"));
	auto &spu = *subtitle.addMenu(_L("track"));
		spu.addGroup("internal")->setExclusive(false);
		spu.addGroup("external")->setExclusive(false);
		spu.addAction(_L("open"));
		spu.addAction(_L("clear"));
		spu.addSeparator();
		spu.addAction(_L("next"));
		spu.addAction(_L("all"));
		spu.addAction(_L("hide"), true);
		spu.addSeparator();
	subtitle.addSeparator();
	addEnumMenuCheckable<SubtitleDisplay>(subtitle, true);
	addEnumActionsCheckable(*subtitle.addMenu("align"), {VerticalAlignment::Top, VerticalAlignment::Bottom}, true);
	subtitle.addSeparator();
	addStepActions(*subtitle.addMenu("position"), 0, 100, 100);
	addStepActions(*subtitle.addMenu("sync"), 0, 1e-3);

	auto &video = *addMenu(_L("video"));
	video.addMenu(_L("track"))->setEnabled(false);
	video.addSeparator();
	video.addAction(_L("snapshot"));
	video.addSeparator();
	addEnumActionsCheckable<VideoRatio>(*video.addMenu(_L("aspect")), true);
	addEnumActionsCheckable<VideoRatio>(*video.addMenu(_L("crop")), true);
	auto &align = *video.addMenu(_L("align"));
	addEnumActionsCheckable<VerticalAlignment>(align, false);
	align.addSeparator();
	addEnumActionsCheckable<HorizontalAlignment>(align, false);
	auto &move = *video.addMenu(_L("move"));
	addEnumActions<MoveToward>(move);
	video.addSeparator();

	addEnumMenuCheckable<ColorRange>(video, true);
	addEnumActionsCheckable<InterpolatorType>(*video.addMenu("chroma-upscaler"), true);
	addEnumActionsCheckable<InterpolatorType>(*video.addMenu("interpolator"), true);
	addEnumMenuCheckable<Dithering>(video, true);
	addEnumMenuCheckable<DeintMode>(video, true);

	auto &effect = *video.addMenu(_L("filter"));
	effect.g()->setExclusive(false);
	effect.addActionToGroup(_L("flip-v"), true)->setData((int)VideoRendererItem::FlipVertically);
	effect.addActionToGroup(_L("flip-h"), true)->setData((int)VideoRendererItem::FlipHorizontally);
	effect.addSeparator();
	effect.addActionToGroup(_L("blur"), true)->setData((int)VideoRendererItem::Blur);
	effect.addActionToGroup(_L("sharpen"), true)->setData((int)VideoRendererItem::Sharpen);
	effect.addSeparator();
	effect.addActionToGroup(_L("gray"), true)->setData((int)VideoRendererItem::Grayscale);
	effect.addActionToGroup(_L("invert"), true)->setData((int)VideoRendererItem::InvertColor);
	effect.addSeparator();
	effect.addActionToGroup(_L("disable"), true)->setData((int)VideoRendererItem::Disable);

	addEnumActions<AdjustColor>(*video.addMenu("color"));

	auto &audio = *addMenu(_L("audio"));
	auto &track = *audio.addMenu(_L("track"));
	track.setEnabled(false);
	track.g()->setExclusive(true);
	track.addAction(_L("next"));
	track.addSeparator();
	addStepActions(*audio.addMenu("sync"), 0, 1e-3);
	audio.addSeparator();
	auto &volume = *audio.addMenu("volume");
	volume.addAction(_L("mute"), true);
	volume.addSeparator();
	addStepActions(volume, 0, 100, 100, false);
	auto &amp = *audio.addMenu("amp");
	addStepActions(amp, 10, 100, 1000);
	addEnumMenuCheckable<ChannelLayout>(audio, true);
	audio.addSeparator();

	audio.addSeparator();
	audio.addAction(_L("normalizer"), true)->setShortcut(Qt::Key_N);
	audio.addAction(_L("tempo-scaler"), true)->setShortcut(Qt::Key_Z);


	auto &tool = *addMenu(_L("tool"));
	tool.addAction(_L("undo"))->setShortcut(Qt::CTRL + Qt::Key_Z);
	tool.addAction(_L("redo"))->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Z);
	tool.addSeparator();
		auto &playlist = *tool.addMenu(_L("playlist"));
		playlist.addAction(_L("toggle"))->setShortcut(Qt::Key_L);
		playlist.addSeparator();
		playlist.addAction(_L("open"));
		playlist.addAction(_L("save"));
		playlist.addAction(_L("clear"));
		playlist.addSeparator();
		playlist.addAction(_L("append-file"));
		playlist.addAction(_L("append-url"));
		playlist.addAction(_L("remove"));
		playlist.addSeparator();
		playlist.addAction(_L("move-up"));
		playlist.addAction(_L("move-down"));

	tool.addAction(_L("favorites"))->setVisible(false);
		auto &history = *tool.addMenu(_L("history"));
		history.addAction(_L("toggle"))->setShortcut(Qt::Key_C);
		history.addAction(_L("clear"));

	tool.addAction(_L("subtitle"))->setShortcut(Qt::Key_V);
	tool.addAction(_L("find-subtitle"));
	tool.addAction(_L("playinfo"));
	tool.addSeparator();
	tool.addAction(_L("pref"))->setMenuRole(QAction::PreferencesRole);
	tool.addAction(_L("reload-skin"));
	tool.addSeparator();
	tool.addAction(_L("auto-exit"), true);
	tool.addAction(_L("auto-shutdown"), true);

	auto &window = *addMenu(_L("window"));
	addEnumMenuCheckable<StaysOnTop>(window, true);
	window.addSeparator();
	window.addActionToGroup(_L("proper"), false, _L("size"))->setData(0.0);
	window.addActionToGroup(_L("100%"), false, _L("size"))->setData(1.0);
	window.addActionToGroup(_L("200%"), false, _L("size"))->setData(2.0);
	window.addActionToGroup(_L("300%"), false, _L("size"))->setData(3.0);
	window.addActionToGroup(_L("400%"), false, _L("size"))->setData(4.0);
	window.addActionToGroup(_L("full"), false, _L("size"))->setData(-1.0);
	window.addSeparator();
	window.addAction(_L("minimize"));
	window.addAction(_L("maximize"));
	window.addAction(_L("close"));

	auto &help = *addMenu(_L("help"));
	help.addAction(_L("about"))->setMenuRole(QAction::AboutRole);

	addAction(_L("exit"))->setMenuRole(QAction::QuitRole);

	m_click[ClickAction::OpenFile] = open["file"];
	m_click[ClickAction::Fullscreen] = window["full"];
	m_click[ClickAction::Pause] = play["pause"];
	m_click[ClickAction::Mute] = volume["mute"];
	m_wheel[WheelAction::Seek1] = WheelActionPair(forward1, backward1);
	m_wheel[WheelAction::Seek2] = WheelActionPair(forward2, backward2);
	m_wheel[WheelAction::Seek3] = WheelActionPair(forward3, backward3);
	m_wheel[WheelAction::PrevNext] = WheelActionPair(prev, next);
	m_wheel[WheelAction::Volume] = WheelActionPair(volume["increase"], volume["decrease"]);
	m_wheel[WheelAction::Amp] = WheelActionPair(amp["increase"], amp["decrease"]);

	play("title").setEnabled(false);
	play("chapter").setEnabled(false);
	video("track").setEnabled(false);
	audio("track").setEnabled(false);

	fillId(this, "");
}
QFilmWidget::QFilmWidget(QWidget* pParent) :
	QGroupBox(pParent),
	m_GridLayout(),
	m_PresetType(),
	m_PresetsLayout(),
	m_WidthSpinner(),
	m_HeightSpinner(),
	m_ExposureSlider(),
	m_ExposureSpinner(),
	m_NoiseReduction()
{
	setTitle("Film");
	setStatusTip("Film properties");
	setToolTip("Film properties");

	// Create grid layout
	m_GridLayout.setColumnMinimumWidth(0, 75);
	setLayout(&m_GridLayout);

	m_PresetType.addItem("NTSC D-1 (video)");
	m_PresetType.addItem("NTSC DV (video)");
	m_PresetType.addItem("PAL (video)");
	m_PresetType.addItem("PAL D-1 (video)");
	m_PresetType.addItem("HDTV (video)");

	m_GridLayout.addWidget(new QLabel("Type"), 0, 0);
	m_GridLayout.addWidget(&m_PresetType, 0, 1);
	
	m_GridLayout.addLayout(&m_PresetsLayout, 1, 2, 2, 1);
	
	m_PresetsLayout.addWidget(&m_Preset[0], 0, 1);
	m_PresetsLayout.addWidget(&m_Preset[1], 0, 2);
	m_PresetsLayout.addWidget(&m_Preset[2], 1, 1);
	m_PresetsLayout.addWidget(&m_Preset[3], 1, 2);

	QObject::connect(&m_PresetType, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(SetPresetType(const QString&)));
	
	QObject::connect(&m_Preset[0], SIGNAL(SetPreset(QFilmResolutionPreset&)), this, SLOT(SetPreset(QFilmResolutionPreset&)));
	QObject::connect(&m_Preset[1], SIGNAL(SetPreset(QFilmResolutionPreset&)), this, SLOT(SetPreset(QFilmResolutionPreset&)));
	QObject::connect(&m_Preset[2], SIGNAL(SetPreset(QFilmResolutionPreset&)), this, SLOT(SetPreset(QFilmResolutionPreset&)));
	QObject::connect(&m_Preset[3], SIGNAL(SetPreset(QFilmResolutionPreset&)), this, SLOT(SetPreset(QFilmResolutionPreset&)));

	m_PresetType.setCurrentIndex(4);

	const int ResMin = powf(2.0f, 5);
	const int ResMax = powf(2.0f, 11);

	// Film width
	m_GridLayout.addWidget(new QLabel("Film width"), 1, 0);

    m_WidthSpinner.setRange(ResMin, ResMax);
	m_GridLayout.addWidget(&m_WidthSpinner, 1, 1);
	
 	QObject::connect(&m_WidthSpinner, SIGNAL(valueChanged(int)), this, SLOT(SetWidth(int)));

	QPushButton B;
	
	// Film height
	m_GridLayout.addWidget(new QLabel("Film height"), 2, 0);

    m_HeightSpinner.setRange(ResMin, ResMax);
	m_GridLayout.addWidget(&m_HeightSpinner, 2, 1);
	
 	QObject::connect(&m_HeightSpinner, SIGNAL(valueChanged(int)), this, SLOT(SetHeight(int)));

	// Exposure
	m_GridLayout.addWidget(new QLabel("Exposure"), 3, 0);

	m_ExposureSlider.setOrientation(Qt::Horizontal);
	m_ExposureSlider.setRange(0.0f, 1.0f);
	m_GridLayout.addWidget(&m_ExposureSlider, 3, 1);

	m_ExposureSpinner.setRange(0.0f, 1.0f);
	m_GridLayout.addWidget(&m_ExposureSpinner, 3, 2);

 	QObject::connect(&m_ExposureSlider, SIGNAL(valueChanged(double)), &m_ExposureSpinner, SLOT(setValue(double)));
 	QObject::connect(&m_ExposureSlider, SIGNAL(valueChanged(double)), this, SLOT(SetExposure(double)));
 	QObject::connect(&m_ExposureSpinner, SIGNAL(valueChanged(double)), &m_ExposureSlider, SLOT(setValue(double)));

	gStatus.SetStatisticChanged("Camera", "Film", "", "", "");

	m_NoiseReduction.setText("Noise Reduction");
	m_GridLayout.addWidget(&m_NoiseReduction, 4, 1);

	QObject::connect(&m_NoiseReduction, SIGNAL(stateChanged(const int&)), this, SLOT(OnNoiseReduction(const int&)));

	QObject::connect(&gStatus, SIGNAL(RenderBegin()), this, SLOT(OnRenderBegin()));
	QObject::connect(&gStatus, SIGNAL(RenderEnd()), this, SLOT(OnRenderEnd()));

	QObject::connect(&gCamera.GetFilm(), SIGNAL(Changed(const QFilm&)), this, SLOT(OnFilmChanged(const QFilm&)));
}
Ejemplo n.º 27
0
// Default constructor
LLFloaterAbout::LLFloaterAbout() 
:	LLFloater(std::string("floater_about"), std::string("FloaterAboutRect"), LLStringUtil::null)
{
	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml");

	// Support for changing product name.
	std::string title("About ");
	title += LLAppViewer::instance()->getSecondLifeTitle();
	setTitle(title);

	LLViewerTextEditor *support_widget = 
		getChild<LLViewerTextEditor>("support_editor", true);

	LLViewerTextEditor *credits_widget = 
		getChild<LLViewerTextEditor>("credits_editor", true);


	if (!support_widget || !credits_widget)
	{
		return;
	}

	// For some reason, adding style doesn't work unless this is true.
	support_widget->setParseHTML(TRUE);

	// Text styles for release notes hyperlinks
	LLStyleSP viewer_link_style(new LLStyle);
	viewer_link_style->setVisible(true);
	viewer_link_style->setFontName(LLStringUtil::null);
	viewer_link_style->setLinkHREF(get_viewer_release_notes_url());
	viewer_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));

	// Version string
	std::string version = llformat(
	  "%s %d.%d.%d %s (%s %s)\n",
	  ViewerVersion::getImpViewerName().c_str(),
	  ViewerVersion::getImpMajorVersion(), ViewerVersion::getImpMinorVersion(), ViewerVersion::getImpPatchVersion(), ViewerVersion::getImpTestVersion().c_str(),
	  __DATE__, __TIME__);

	support_widget->appendColoredText(version, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
	support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style);

	std::string support;
	support.append("\n\n");
	support.append("Grid: " + gHippoGridManager->getConnectedGrid()->getGridName()
					+ " (" + gHippoGridManager->getConnectedGrid()->getGridNick() + ")\n\n");

#if LL_MSVC
    support.append(llformat("Built with MSVC version %d\n\n", _MSC_VER));
#endif

#if LL_GNUC
    support.append(llformat("Built with GCC version %d\n\n", GCC_VERSION));
#endif

	// Position
	LLViewerRegion* region = gAgent.getRegion();
// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a)
	if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
	{
		support.append(rlv_handler_t::cstrHidden);
		support.append("\n\n");
	}
	else if (region)
// [/RLVa:KB]
//	if (region)
	{
		LLStyleSP server_link_style(new LLStyle);
		server_link_style->setVisible(true);
		server_link_style->setFontName(LLStringUtil::null);
		server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes"));
		server_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));

		const LLVector3d &pos = gAgent.getPositionGlobal();
		LLUIString pos_text = getString("you_are_at");
		pos_text.setArg("[POSITION]",
						llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ]));
		support.append(pos_text);

		std::string region_text = llformat("in %s located at ",
										gAgent.getRegion()->getName().c_str());
		support.append(region_text);

		std::string buffer;
		buffer = gAgent.getRegion()->getHost().getHostName();
		support.append(buffer);
		support.append(" (");
		buffer = gAgent.getRegion()->getHost().getString();
		support.append(buffer);
		support.append(")\n");
		support.append(gLastVersionChannel);
		support.append("\n");

		support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));
		support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style);

		support = "\n\n";
	}

	// *NOTE: Do not translate text like GPU, Graphics Card, etc -
	//  Most PC users that know what these mean will be used to the english versions,
	//  and this info sometimes gets sent to support
	
	// CPU
	support.append("CPU: ");
	support.append( gSysCPU.getCPUString() );
	support.append("\n");

	U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024;
	// Moved hack adjustment to Windows memory size into llsys.cpp

	std::string mem_text = llformat("Memory: %u MB\n", memory );
	support.append(mem_text);

	support.append("OS Version: ");
	support.append( LLAppViewer::instance()->getOSInfo().getOSString() );
	support.append("\n");

	support.append("Graphics Card Vendor: ");
	support.append( (const char*) glGetString(GL_VENDOR) );
	support.append("\n");

	support.append("Graphics Card: ");
	support.append( (const char*) glGetString(GL_RENDERER) );
	support.append("\n");

#if LL_WINDOWS
    getWindow()->incBusyCount();
    getWindow()->setCursor(UI_CURSOR_ARROW);
    support.append("Windows Graphics Driver Version: ");
    LLSD driver_info = gDXHardware.getDisplayInfo();
    if (driver_info.has("DriverVersion"))
    {
        support.append(driver_info["DriverVersion"]);
    }
    support.append("\n");
    getWindow()->decBusyCount();
    getWindow()->setCursor(UI_CURSOR_ARROW);
#endif

	support.append("OpenGL Version: ");
	support.append( (const char*) glGetString(GL_VERSION) );
	support.append("\n");

	support.append("\n");

	support.append("libcurl Version: ");
	support.append( LLCurl::getVersionString() );
	support.append("\n");

	support.append("J2C Decoder Version: ");
	support.append( LLImageJ2C::getEngineInfo() );
	support.append("\n");

	support.append("Audio Driver Version: ");
	bool want_fullname = true;
	support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : "(none)" );

	support.append("\n");

	LLMediaManager *mgr = LLMediaManager::getInstance();
	if (mgr)
	{
		LLMediaBase *gstreamer = mgr->createSourceFromMimeType("http", "audio/mpeg");
		if (gstreamer)
		{
			support.append("GStreamer Version: ");
			support.append( gstreamer->getVersion() );
			support.append("\n");
		} 

		LLMediaBase *media_source = mgr->createSourceFromMimeType("http", "text/html");
		if (media_source)
		{
			support.append("LLMozLib Version: ");
			support.append(media_source->getVersion());
			support.append("\n");
			mgr->destroySource(media_source);
		}
	}

	if (gPacketsIn > 0)
	{
		std::string packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)", 
			LLViewerStats::getInstance()->mPacketsLostStat.getCurrent(),
			F32(gPacketsIn),
			100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) );
		support.append(packet_loss);
		support.append("\n");
	}

	support_widget->appendColoredText(support, FALSE, FALSE, gColors.getColor("TextFgReadOnlyColor"));

	// Fix views
	support_widget->setCursorPos(0);
	support_widget->setEnabled(FALSE);
	support_widget->setTakesFocus(TRUE);
	support_widget->setHandleEditKeysDirectly(TRUE);

	credits_widget->setCursorPos(0);
	credits_widget->setEnabled(FALSE);
	credits_widget->setTakesFocus(TRUE);
	credits_widget->setHandleEditKeysDirectly(TRUE);

	center();

	sInstance = this;
}
Ejemplo n.º 28
0
bool CCToggleGroupTest::init()
{
	CCToggleTestSceneBase::init();
	setTitle("CCToggleBasicTest");
	setDescription("Toggle button in group");

	CCToggle* pToggle1 = CCToggle::create("toggle1_2.png", "toggle1_1.png");
	pToggle1->setCheckSelector(this, check_selector(CCToggleGroupTest::onCheck));
	pToggle1->setPosition(ccp(200, 450));
	pToggle1->setExclusion(1);
	m_pLayout->addChild(pToggle1);

	CCToggle* pToggle2 = CCToggle::create("toggle1_2.png", "toggle1_1.png");
	pToggle2->setCheckSelector(this, check_selector(CCToggleGroupTest::onCheck));
	pToggle2->setPosition(ccp(200, 350));
	pToggle2->setExclusion(1);
	m_pLayout->addChild(pToggle2);

	CCToggle* pToggle3 = CCToggle::create("toggle1_2.png", "toggle1_1.png");
	pToggle3->setCheckSelector(this, check_selector(CCToggleGroupTest::onCheck));
	pToggle3->setPosition(ccp(200, 250));
	pToggle3->setExclusion(1);
	m_pLayout->addChild(pToggle3);

	CCTextTTF* pText1 = CCTextTTF::create();
	pText1->setAnchorPoint(ccp(0, 0.5));
	pText1->setPosition(ccp(350, 450));
	pText1->setFontSize(35.0f);
	pText1->setString("none");
	m_pLayout->addChild(pText1);
	pToggle1->setUserObject(pText1);

	CCTextTTF* pText2 = CCTextTTF::create();
	pText2->setAnchorPoint(ccp(0, 0.5));
	pText2->setPosition(ccp(350, 350));
	pText2->setFontSize(35.0f);
	pText2->setString("none");
	m_pLayout->addChild(pText2);
	pToggle2->setUserObject(pText2);

	CCTextTTF* pText3 = CCTextTTF::create();
	pText3->setAnchorPoint(ccp(0, 0.5));
	pText3->setPosition(ccp(350, 250));
	pText3->setFontSize(35.0f);
	pText3->setString("none");
	m_pLayout->addChild(pText3);
	pToggle3->setUserObject(pText3);


	CCToggle* pToggle4 = CCToggle::create("toggle1_2.png", "toggle1_1.png");
	pToggle4->setPosition(ccp(700, 250));
	pToggle4->setExclusion(2);
	m_pLayout->addChild(pToggle4);

	CCToggle* pToggle5 = CCToggle::create("toggle1_2.png", "toggle1_1.png");
	pToggle5->setPosition(ccp(700, 350));
	pToggle5->setExclusion(2);
	m_pLayout->addChild(pToggle5);

	return true;
}
Ejemplo n.º 29
0
 /// Set the title of the last-added series
 bool setLastTitle(std::string& newtitle)
 {
   return setTitle(titles.size()-1,newtitle);
 }
AutoConfigVideoPage::AutoConfigVideoPage(QWidget *parent)
	: QWizardPage (parent),
	  ui          (new Ui_AutoConfigVideoPage)
{
	ui->setupUi(this);

	setTitle(QTStr("Basic.AutoConfig.VideoPage"));
	setSubTitle(QTStr("Basic.AutoConfig.VideoPage.SubTitle"));

	obs_video_info ovi;
	obs_get_video_info(&ovi);

	long double fpsVal =
		(long double)ovi.fps_num / (long double)ovi.fps_den;

	QString fpsStr = (ovi.fps_den > 1)
		? QString::number(fpsVal, 'f', 2)
		: QString::number(fpsVal, 'g', 2);

	ui->fps->addItem(QTStr(FPS_PREFER_HIGH_FPS),
			(int)AutoConfig::FPSType::PreferHighFPS);
	ui->fps->addItem(QTStr(FPS_PREFER_HIGH_RES),
			(int)AutoConfig::FPSType::PreferHighRes);
	ui->fps->addItem(QTStr(FPS_USE_CURRENT).arg(fpsStr),
			(int)AutoConfig::FPSType::UseCurrent);
	ui->fps->addItem(QStringLiteral("30"), (int)AutoConfig::FPSType::fps30);
	ui->fps->addItem(QStringLiteral("60"), (int)AutoConfig::FPSType::fps60);
	ui->fps->setCurrentIndex(0);

	QString cxStr = QString::number(ovi.base_width);
	QString cyStr = QString::number(ovi.base_height);

	int encRes = int(ovi.base_width << 16) | int(ovi.base_height);
	ui->canvasRes->addItem(QTStr(RES_USE_CURRENT).arg(cxStr, cyStr),
			(int)encRes);

	QList<QScreen*> screens = QGuiApplication::screens();
	for (int i = 0; i < screens.size(); i++) {
		QScreen *screen = screens[i];
		QSize as = screen->size();

		encRes = int(as.width() << 16) | int(as.height());

		QString str = QTStr(RES_USE_DISPLAY)
			.arg(QString::number(i + 1),
			     QString::number(as.width()),
			     QString::number(as.height()));

		ui->canvasRes->addItem(str, encRes);
	}

	auto addRes = [&] (int cx, int cy)
	{
		encRes = (cx << 16) | cy;
		QString str = QString("%1x%2").arg(
				QString::number(cx),
				QString::number(cy));
		ui->canvasRes->addItem(str, encRes);
	};

	addRes(1920, 1080);
	addRes(1280, 720);

	ui->canvasRes->setCurrentIndex(0);
}