예제 #1
0
void MainMenu::update()
{
	if (m_seedPrompt) {
		m_seedPrompt->update();

		if (m_seedPrompt->isDone()) {
			startRound(m_specialMode, m_seedPrompt->getSeed());
			return;
		} else if (m_seedPrompt->isCanceled()) {
			reset();
		}
	} else if (m_start) {
		m_start = false;
		showSeedPrompt();
	} else if (m_viewScoreboard) {
		m_viewScoreboard = false;
		setHidden(true);
		m_scoreboard.reset(new Scoreboard(this));
	}

	if (m_reset) {
		m_reset = false;
		m_scoreboard.reset();
		m_seedPrompt.reset();
		setHidden(false);
	}

	if (m_scoreboard) {
		m_scoreboard->update();
	}
}
예제 #2
0
RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
{
  setWindowTitle(tr("Registers"));
  setAllowedAreas(Qt::AllDockWidgetAreas);

  QSettings settings;

  restoreGeometry(settings.value(QStringLiteral("registerwidget/geometry")).toByteArray());
  setFloating(settings.value(QStringLiteral("registerwidget/floating")).toBool());

  CreateWidgets();
  PopulateTable();
  ConnectWidgets();

  connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this](Core::State state) {
    if (Settings::Instance().IsDebugModeEnabled() && Core::GetState() == Core::State::Paused)
      emit RequestTableUpdate();
  });

  connect(this, &RegisterWidget::RequestTableUpdate, [this] {
    m_updating = true;
    emit UpdateTable();
    m_updating = false;
  });

  connect(&Settings::Instance(), &Settings::RegistersVisibilityChanged,
          [this](bool visible) { setHidden(!visible); });

  connect(&Settings::Instance(), &Settings::DebugModeToggled, [this](bool enabled) {
    setHidden(!enabled || !Settings::Instance().IsRegistersVisible());
  });

  setHidden(!Settings::Instance().IsRegistersVisible() ||
            !Settings::Instance().IsDebugModeEnabled());
}
예제 #3
0
bool NodeTypeItem::applyFilter(QString filter, bool categoryHidden)
{
    if (text().contains(filter, Qt::CaseInsensitive)) {
        setHidden(categoryHidden);
        return true;
    } else {
        setHidden(true);
        return false;
    }
}
caGraphics::caGraphics( QWidget *parent) :  QWidget(parent)
{
    QSizePolicy policy( QSizePolicy::Preferred, QSizePolicy::Preferred );
    policy.setHeightForWidth( true );
    setSizePolicy( policy );
    thisChannelA="";
    thisChannelB="";
    thisChannelC="";
    thisChannelD="";
    setForm(Rectangle);
    thisLineSize = 1;
    thisLineColor = Qt::black;
    thisForeColor = Qt::black;

    thisLineColorOld = QColor(255, 254, 253);
    thisForeColorOld = QColor(255, 254, 253);

    thisColorMode = Static;
    thisVisibility = StaticV;
    thisArrowSize=10;
    thisFillStyle = Outline;

    thisTiltAngle = 0;
    thisStartAngle = 0;
    thisSpanAngle = 90;

    setLineStyle(Solid);
    setHidden(false);

    setAttribute(Qt::WA_TranslucentBackground );
    setWindowFlags(Qt::FramelessWindowHint);
}
예제 #5
0
OperationItemSupplier::OperationItemSupplier(
  ItemSupplier* i, Buffer *b
  ) : supitem(i)
{
  if (!i || !b || !i->getSupplier())
    throw LogicException(
      "An OperationItemSupplier always needs to point to "
      "a itemsupplier and a buffer"
      );
  stringstream o;
  o << "Purchase " << b->getName() << " from " << i->getSupplier()->getName();
  setName(o.str());
  setDuration(i->getLeadTime());
  setSizeMultiple(i->getSizeMultiple());
  setSizeMinimum(i->getSizeMinimum());
  setLocation(b->getLocation());
  setSource(i->getSource());
  setCost(i->getCost());
  setFence(i->getFence());
  setHidden(true);
  new FlowEnd(this, b, 1);
  initType(metadata);

  // Optionally, create a load
  if (i->getResource())
    new LoadDefault(this, i->getResource(), i->getResourceQuantity());

  // Insert in the list of ItemSupplier operations.
  // The list is not sorted (for performance reasons).
  nextOperation = i->firstOperation;
  i->firstOperation = this;
}
예제 #6
0
void LogConfigWidget::ConnectWidgets()
{
  // Configuration
  connect(m_verbosity_notice, &QRadioButton::toggled, this, &LogConfigWidget::SaveSettings);
  connect(m_verbosity_error, &QRadioButton::toggled, this, &LogConfigWidget::SaveSettings);
  connect(m_verbosity_warning, &QRadioButton::toggled, this, &LogConfigWidget::SaveSettings);
  connect(m_verbosity_info, &QRadioButton::toggled, this, &LogConfigWidget::SaveSettings);

  connect(m_out_file, &QCheckBox::toggled, this, &LogConfigWidget::SaveSettings);
  connect(m_out_console, &QCheckBox::toggled, this, &LogConfigWidget::SaveSettings);
  connect(m_out_window, &QCheckBox::toggled, this, &LogConfigWidget::SaveSettings);

  connect(m_types_toggle, &QPushButton::clicked, [this] {
    m_all_enabled = !m_all_enabled;

    // Don't save every time we change an item
    m_block_save = true;

    for (int i = 0; i < m_types_list->count(); i++)
      m_types_list->item(i)->setCheckState(m_all_enabled ? Qt::Checked : Qt::Unchecked);

    m_block_save = false;

    SaveSettings();
  });

  connect(m_types_list, &QListWidget::itemChanged, this, &LogConfigWidget::SaveSettings);

  connect(&Settings::Instance(), &Settings::LogConfigVisibilityChanged, this,
          [this](bool visible) { setHidden(!visible); });
}
예제 #7
0
파일: file.cpp 프로젝트: 0-T-0/Gource
void RFile::touch(const vec3 & colour) {
    if(forced_removal) return;

    fade_start = -1.0f;
    
    //fprintf(stderr, "touch %s\n", fullpath.c_str());

    last_action = elapsed;
    touch_colour = colour;

    //un expire file
    if(expired) {
        for(std::vector<RFile*>::iterator it = gGourceRemovedFiles.begin(); it != gGourceRemovedFiles.end(); it++) {
            if((*it) == this) {
                gGourceRemovedFiles.erase(it);
                break;
            }
        }
        expired=false;
    }

    showName();
    setHidden(false);
    dir->fileUpdated(true);
}
예제 #8
0
PopupMenu::PopupMenu(QWidget *parent, const char *name)
 : QLabel(parent, name), KommanderWidget(this)
{
  QStringList states;
  states << "default";
  setStates(states);
  setDisplayStates(states);
  if (KommanderWidget::inEditor)
  {
    setPixmap(KGlobal::iconLoader()->loadIcon("contents", KIcon::NoGroup, KIcon::SizeMedium));
    setFrameStyle(QFrame::Box | QFrame::Plain);
    setLineWidth(1);
    setFixedSize(pixmap()->size());
  }
  else
    setHidden(true);

  m_menu = new KPopupMenu(this);
  connect(m_menu, SIGNAL(activated(int)), this, SLOT(slotMenuItemActivated(int)));

  KommanderPlugin::setDefaultGroup(Group::DCOP);
  KommanderPlugin::registerFunction(INSERTMENUITEM, "insertMenuItem(QString widget, QString text, QString executeWidget, int index, QString icon)",  i18n("Insert an item into the popup menu. The executeWidget's execute method will be run when this item is selected. Returns the id of the inserted item. Use -1 for index to insert to the end. The icon is optional."), 4, 5);
  KommanderPlugin::registerFunction(INSERTSEPARATOR, "insertSeparator(QString widget, int index)",  i18n("Insert a separator item into the popup menu. Use -1 for index to insert to the end."), 2);
  KommanderPlugin::registerFunction(CHANGEMENUITEM, "changeMenuItem(QString widget, int id, QString text, QString executeWidget, QString icon)",  i18n("Change an item specified by id in the popup menu. The executeWidget's execute method will be run when this item is selected."), 4, 5);
  KommanderPlugin::registerFunction(SETITEMENABLED, "setItemEnabled(QString widget, int id, bool enable)",  i18n("Enable the item specified by id in the popup menu."), 3);
  KommanderPlugin::registerFunction(ITEMENABLED, "itemEnabled(QString widget, int id)",  i18n("Check if the item specified by id is enabled."), 2);
  KommanderPlugin::registerFunction(SETITEMVISIBLE, "setItemVisible(QString widget, int id, bool enable)",  i18n("Make the item specified by id visible."), 3);
  KommanderPlugin::registerFunction(SETITEMCHECKED, "setItemChecked(QString widget, int id, bool enable)",  i18n("Apply checked status for the item specified by id."), 3);
  KommanderPlugin::registerFunction(ITEMVISIBLE, "itemVisible(QString widget, int id)",  i18n("Check if the item specified by id is visible."), 2);
  KommanderPlugin::registerFunction(ITEMCHECKED, "itemChecked(QString widget, int id)",  i18n("Verify if the item specified by id is checked."), 2);
  KommanderPlugin::registerFunction(INSERTSUBMENU, "insertSubmenu(QString widget, QString text, QString menuWidget, int index, QString icon)",  i18n("Insert submenu widget into the popup menu. Use -1 for index to insert to the end. The icon is optional."), 4, 5);
}
예제 #9
0
PointSymbol* OgrFileImport::getSymbolForOgrSymbol(OGRStyleToolH tool, const QByteArray& style_string)
{
	Q_ASSERT(OGR_ST_GetType(tool) == OGRSTCSymbol);
	
	auto raw_tool_key = OGR_ST_GetStyleString(tool);
	auto tool_key = QByteArray::fromRawData(raw_tool_key, qstrlen(raw_tool_key));
	auto symbol = point_symbols.value(tool_key);
	if (symbol && symbol->getType() == Symbol::Point)
		return static_cast<PointSymbol*>(symbol);
	
	int is_null;
	auto color_string = OGR_ST_GetParamStr(tool, OGRSTSymbolColor, &is_null);
	if (is_null)
		return nullptr;
	
	auto point_symbol = static_cast<PointSymbol*>(default_point_symbol->duplicate());
	auto color = makeColor(tool, color_string);
	if (color)
		point_symbol->setInnerColor(color);
	else
		point_symbol->setHidden(true);
	
	auto key = style_string;
	key.detach();
	point_symbols.insert(key, point_symbol);
	
	if (key != tool_key)
	{
		tool_key.detach();
		point_symbols.insert(tool_key, point_symbol);
	}
	
	map->addSymbol(point_symbol, map->getNumSymbols());
	return point_symbol;
}
 SrtRowTreeWidgetItem(QTreeWidgetItem *parent, const srt_procedure_t *procedure) :
     QTreeWidgetItem (parent, srt_row_type_),
     procedure_(procedure)
 {
     setText(SRT_COLUMN_PROCEDURE, procedure_->procedure);
     setHidden(true);
 }
/*!
    \fn SearchEntryItem::setFilter(Filter& filter)
 */
void SearchEntryItem::setFilter(Filter& filter) {
    bool ok = true
        && (size_ >= filter.minSize)
        && (size_ <= filter.maxSize)
        && (!filter.type.isValid() || filter.type.indexIn(filename_) >=0);
    setHidden(!ok);
}
예제 #12
0
void Sidebar::setSidebarVisibility(bool visible)
{
    if (visible != m_table->isHidden())
        return;

    static bool sideWasVisible = !isHidden();

    m_table->setHidden(!visible);
    if (visible) {
        setHidden(!sideWasVisible);
        sideWasVisible = true;
    } else {
        sideWasVisible = !isHidden();
        setHidden(true);
    }
}
예제 #13
0
OperationItemDistribution::OperationItemDistribution(
  ItemDistribution* i, Buffer *src, Buffer* dest
  ) : itemdist(i)
{
  if (!i || !src || !dest)
    throw LogicException(
      "An OperationItemDistribution always needs to point to "
      "a ItemDistribution, a source buffer and a destination buffer"
      );
  stringstream o;
  o << "Ship " << dest->getItem()->getName() << " from " << src->getName() << " to " << dest->getName();
  setName(o.str());
  setDuration(i->getLeadTime());
  setSizeMultiple(i->getSizeMultiple());
  setSizeMinimum(i->getSizeMinimum());
  setLocation(dest->getLocation());
  setSource(i->getSource());
  setCost(i->getCost());
  setFence(i->getFence());
  setHidden(true);
  new FlowEnd(this, dest, 1);
  new FlowStart(this, src, -1);
  initType(metadata);

  // Optionally, create a load
  if (i->getResource())
    new LoadDefault(this, i->getResource(), i->getResourceQuantity());

  // Insert in the list of ItemDistribution operations.
  // The list is not sorted (for performance reasons).
  nextOperation = i->firstOperation;
  i->firstOperation = this;
}
예제 #14
0
void VSCVidItemCamConf::VidFilter(astring strFilter)
{
	if (strFilter.size() == 0)
	{
		setHidden(false);
		return;
	}
	std::size_t found = m_cCam.strname().find(strFilter);
	if (found != std::string::npos)
	{
		setHidden(false);
	}else
	{
		setHidden(true);
	}
}
ArtworkCalligraphicShapeFactory::ArtworkCalligraphicShapeFactory(QObject *parent)
        : KShapeFactoryBase(parent, ArtworkCalligraphicShapeId, i18n("A calligraphic shape"))
{
    setToolTip(i18n("Calligraphic Shape"));
    setIcon("calligraphy");
    setLoadingPriority(1);
    setHidden(true);
}
예제 #16
0
파일: tGauge.cpp 프로젝트: dulton/53_hero
//-----------------------------------------------------------------------------
//! Forces the gauge to be hidden or shown. Sometimes when changing from full screen
//  to half screen instrument page layouts, gauges must be hidden as there is not
//  enough room. This should be the only time this property is used, and it must
//  only be used programatically, and not exposed to the user.
//-----------------------------------------------------------------------------
void tGauge::SetForcedHide( bool enabled )
{
    if( m_ForcedHide != enabled )
    {
        m_ForcedHide = enabled;
        setHidden( enabled );
    }
}
예제 #17
0
SettingsMenu::SettingsMenu(QWidget *parent) :
	QDialog(parent),
	ui(new Ui::SettingsMenu)
{
	ui->setupUi(this);
	setHidden(true);

}
 RtdTimeStatTreeWidgetItem(QTreeWidget *parent, const QString type, const rtd_timestat *timestat) :
     QTreeWidgetItem (parent, rtd_time_stat_type_),
     type_(type),
     timestat_(timestat)
 {
     setText(col_type_, type_);
     setHidden(true);
 }
KarbonCalligraphicShapeFactory::KarbonCalligraphicShapeFactory()
        : KoShapeFactoryBase(KarbonCalligraphicShapeId, i18n("A calligraphic shape"))
{
    setToolTip(i18n("Calligraphic Shape"));
    setIconName(koIconName("calligraphy"));
    setLoadingPriority(1);
    setHidden(true);
}
예제 #20
0
void LogDialog::on_lineEditSearch_textChanged(const QString &text)
{
    auto list = ui->listLog;
    for ( int row = 0; row < list->count(); ++row ) {
        auto item = list->item(row);
        item->setHidden( isFilteredOut(item, text) );
    }
}
예제 #21
0
void VSCVidItemCam::VidFilter(astring strFilter)
{
	VDC_DEBUG( "%s %d Filter %s name %s\n",__FUNCTION__, __LINE__, 
		strFilter.c_str(), m_cCam.strname().c_str());
	if (strFilter.size() == 0)
	{
		setHidden(false);
		return;
	}
	std::size_t found = m_cCam.strname().find(strFilter);
	if (found != std::string::npos)
	{
		setHidden(false);
	}else
	{
		setHidden(true);
	}
}
예제 #22
0
SvgShapeFactory::SvgShapeFactory()
    : KoShapeFactoryBase(SVGSHAPEFACTORYID, QObject::tr("Embedded svg shape"))
{
    setLoadingPriority(10);
    setXmlElementNames(QString(KoXmlNS::draw), QStringList("image"));
    // hide from add shapes docker as the shape is not able to be dragged onto 
    // the canvas as createDefaultShape returns 0.
    setHidden(true);
}
예제 #23
0
colorCompareSaver::colorCompareSaver(const QDomElement& xmlElement)
  : modeSaver(::getElementText(xmlElement, "index").toInt(), 0),
    creationMode_(::getElementText(xmlElement, "creation_mode")),
    colors_(::loadColorListFromText(::getElementText(xmlElement,
                                                     "color_list"))) {

  const bool hidden = ::stringToBool(::getElementText(xmlElement, "hidden"));
  setHidden(hidden);
}
예제 #24
0
void Task::resetHiddenStatus()
{
     if (d->status == NeedsAttention) {
        //tasks don't get moved anymore
        setOrder(Normal);
        if (hidden() & AutoHidden) {
            setHidden(hidden() ^ AutoHidden);
        }
    } else {
        if (d->status == Active && (hidden() & AutoHidden)) {
            setHidden(hidden() ^ AutoHidden);
        } else if (d->status == Passive) {
            setHidden(hidden() | AutoHidden);
        }

        setOrder(Normal);
    }
}
예제 #25
0
caVisibility::caVisibility( QWidget *parent) :  QWidget(parent)
{

    thisChannelA="";
    thisChannelB="";
    thisChannelC="";
    thisChannelD="";
    setHidden(false);
}
예제 #26
0
KoConnectionShapeFactory::KoConnectionShapeFactory()
        : KoShapeFactoryBase(KOCONNECTIONSHAPEID, i18n("Tie"))
{
    setToolTip(i18n("A connection between two other shapes"));
    setIconName(koIconNameCStr("x-shape-connection"));
    setXmlElementNames(KoXmlNS::draw, QStringList("connector"));
    setLoadingPriority(1);
    setHidden(true); // Don't show this shape in collections. Only ConnectionTool should create
}
예제 #27
0
TextSymbol* OgrFileImport::getSymbolForLabel(OGRStyleToolH tool, const QByteArray&)
{
	Q_ASSERT(OGR_ST_GetType(tool) == OGRSTCLabel);
	
	int is_null;
	auto label_string = OGR_ST_GetParamStr(tool, OGRSTLabelTextString, &is_null);
	if (is_null)
		return nullptr;
	
	auto color_string = OGR_ST_GetParamStr(tool, OGRSTLabelFColor, &is_null);
	auto font_size_string = OGR_ST_GetParamStr(tool, OGRSTLabelSize, &is_null);
	
	// Don't use the style string as a key: The style contains the label.
	QByteArray key;
	key.reserve(qstrlen(color_string) + qstrlen(font_size_string) + 1);
	key.append(color_string);
	key.append(font_size_string);
	auto text_symbol = static_cast<TextSymbol*>(text_symbols.value(key));
	if (!text_symbol)
	{
		text_symbol = static_cast<TextSymbol*>(default_text_symbol->duplicate());
		
		auto color = makeColor(tool, color_string);
		if (color)
			text_symbol->setColor(color);
		else
			text_symbol->setHidden(true);
		
		auto font_size = OGR_ST_GetParamDbl(tool, OGRSTLabelSize, &is_null);
		if (!is_null && font_size > 0.0)
			text_symbol->scale(font_size / text_symbol->getFontSize());
		
		key.detach();
		text_symbols.insert(key, text_symbol);
		
		map->addSymbol(text_symbol, map->getNumSymbols());
	}
	
	auto anchor = qBound(1, OGR_ST_GetParamNum(tool, OGRSTLabelAnchor, &is_null), 12);
	if (is_null)
		anchor = 1;
	
	auto angle = OGR_ST_GetParamDbl(tool, OGRSTLabelAngle, &is_null);
	if (is_null)
		angle = 0.0;
	
	QString description;
	description.reserve(qstrlen(label_string) + 100);
	description.append(QString::number(100 + anchor));
	description.append(QString::number(angle, 'g', 1));
	description.append(QLatin1Char(' '));
	description.append(label_string);
	text_symbol->setDescription(description);
	
	return text_symbol;
}
예제 #28
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void IssuesDockWidget::readSettings(QMainWindow* main, DREAM3DSettings& prefs)
{
  main->restoreDockWidget(this);

  bool b = prefs.value(objectName(), QVariant(false)).toBool();
  setHidden(b);

  QByteArray headerState = prefs.value("Horizontal Header State", QByteArray());
  errorTableWidget->horizontalHeader()->restoreState(headerState);
}
KPrPlaceholderShapeFactory::KPrPlaceholderShapeFactory()
: KoShapeFactoryBase(KPrPlaceholderShapeId, i18n( "Placeholder shape" ) )
{
    QStringList elementNames;
    elementNames << "text-box" << "object" << "image";
    setOdfElementNames( KoXmlNS::draw, elementNames );
    // use a really high number as we want to be used before the normal shapes try to load it
    setLoadingPriority( 1000 );
    setHidden(true);
}
예제 #30
0
squareWindowSaver::squareWindowSaver(const QDomElement& xmlElement)
  : modeSaver(::getElementText(xmlElement, "index").toInt(),
              ::getElementText(xmlElement, "parent_index").toInt()),
    creationMode_(::getElementText(xmlElement, "creation_mode")),
    squareDimension_(::getElementText(xmlElement,
                                      "square_dimension").toInt()) {

  bool hidden = ::stringToBool(::getElementText(xmlElement, "hidden"));
  setHidden(hidden);
}