Example #1
0
	// /////////////////////////////////////////////////////////////////
	// 
	// /////////////////////////////////////////////////////////////////
	void GameLog::Log(const LogLevel level, const string &messageRef)
	{
		if(!m_logger.is_open())
		{
			return;
		}
		
		// Check if message should be logged.
		if(level <= m_logLevel)
		{
			// Create highlight text to make ERR or FAT logs stand out.
			string highlightText("");
			if(level == FAT)
			{
				highlightText.assign(string(" #### "));
			}
			else if(level == ERR)
			{
				highlightText.assign(string(" **** "));
			}
			
			// Log error.
			if(m_timestamp)
			{
				m_logger << GetTimeStamp() << ": " << highlightText << messageRef << "." << highlightText << endl;
			}
			else
			{
				m_logger << highlightText << messageRef << "." << highlightText << endl;
			}
		}
	}
Example #2
0
void QgsNewNameDialog::nameChanged()
{
  QgsDebugMsg( "entered" );

  QString namesString = tr( "Full names" ) + ": ";
  if ( !mExtensions.isEmpty() )
  {
    mNamesLabel->setText( namesString );
  }
  mErrorLabel->setText( " " ); // space to keep vertical space
  QPushButton* okButton = buttonBox()->button( QDialogButtonBox::Ok );
  okButton->setText( mOkString );
  okButton->setEnabled( true );

  QString newName = name();

  if ( newName.length() == 0 || ( !mRegexp.isEmpty() && !mRegexp.exactMatch( newName ) ) )
  {
    //mErrorLabel->setText( highlightText( tr( "Enter new name" ) );
    okButton->setEnabled( false );
    return;
  }

  QStringList newNames = fullNames( newName, mExtensions );
  if ( !mExtensions.isEmpty() )
  {
    namesString += ' ' + newNames.join( ", " );
    mNamesLabel->setText( namesString );
  }

  QStringList conflicts = matching( newNames, mExiting, mCaseSensitivity );

  if ( !conflicts.isEmpty() )
  {
    QString warning = !mConflictingNameWarning.isEmpty() ? mConflictingNameWarning
                      : tr( "%n Name(s) %1 exists", nullptr, conflicts.size() ).arg( conflicts.join( ", " ) );
    mErrorLabel->setText( highlightText( warning ) );
    if ( mOverwriteEnabled )
    {
      okButton->setText( tr( "Overwrite" ) );
    }
    else
    {
      okButton->setEnabled( false );
    }
    return;
  }
}
Example #3
0
void BtFindWidget::textChanged(const QString& text) {
    bool caseSensitive = m_caseCheckBox->checkState() == Qt::Checked;
    emit highlightText(text, caseSensitive);
    emit findNext(text, caseSensitive);
}
Example #4
0
void BtFindWidget::returnPressed() {
    bool caseSensitive = m_caseCheckBox->checkState() == Qt::Checked;
    QString text = m_textEditor->text();
    emit highlightText(text, caseSensitive);
    emit findNext(text, caseSensitive);
}