Esempio n. 1
0
void MainWindow::SaveSettings()
{
	QSettings settings;
	settings.setValue("geometry", saveGeometry());
	settings.setValue("splitter", ui->fSplitter->saveState());
	settings.setValue("selected_tag", CurrentTag());
}
Esempio n. 2
0
	bool TcxFileWriter::StoreTime(uint64_t timeMS)
	{
		if (CurrentTag().compare(TCX_TAG_NAME_TRACKPOINT) != 0)
			return false;
		std::string timeStr = FormatTimeMS(timeMS);
		return WriteTagAndValue(TCX_TAG_NAME_TIME, timeStr);
	}
Esempio n. 3
0
	bool TcxFileWriter::StoreHeartRateBpm(uint8_t heartRateBpm)
	{
		if (CurrentTag().compare(TCX_TAG_NAME_TRACKPOINT) != 0)
			return false;
		if (!XmlFileWriter::OpenTag(TCX_TAG_NAME_HEART_RATE_BPM))
			return false;
		if (!WriteTagAndValue(TCX_TAG_NAME_VALUE, (double)heartRateBpm))
			return false;
		return XmlFileWriter::CloseTag();
	}
Esempio n. 4
0
void MainWindow::OnAdd(const QString& text)
{
	fNotesModel->AddNote(text, CurrentTag());

	int rows = fNotesModel->rowCount();
	QModelIndex lastIndex = fNotesModel->index(rows - 1);
	QModelIndex index = fFilterModel->mapFromSource(lastIndex);

	OnSelection(index);
	ui->fNoteList->setCurrentIndex(index);
}
Esempio n. 5
0
	bool TcxFileWriter::StorePosition(double lat, double lon)
	{
		if (CurrentTag().compare(TCX_TAG_NAME_TRACKPOINT) != 0)
			return false;
		if (OpenTag(TCX_TAG_NAME_POSITION))
		{
			WriteTagAndValue(TCX_TAG_NAME_LATITUDE, lat);
			WriteTagAndValue(TCX_TAG_NAME_LONGITUDE, lon);
			CloseTag();
			return true;
		}
		return false;
	}
Esempio n. 6
0
void MainWindow::UpdateTagSelector()
{
	QString currentTag = CurrentTag();

	ui->fTagsComboBox->clear();
	ui->fTagsComboBox->addItem(tr("All Notes"));

	QHash<QString, int> tagList = fNotes.AllTags();
	QStringList tagNames = tagList.keys();
	tagNames.sort();
	for (int eachTag = 0; eachTag < tagNames.size(); ++eachTag) {
		QString tag = tagNames[eachTag];
		ui->fTagsComboBox->addItem(tag, tagList[tag]);
	}

	if (currentTag.isEmpty()) {
		ui->fTagsComboBox->setCurrentIndex(0);
	} else {
		int pos = ui->fTagsComboBox->findText(currentTag);
		if (pos < 0) pos = 0;
		ui->fTagsComboBox->setCurrentIndex(pos);
	}
}
Esempio n. 7
0
	bool TcxFileWriter::EndActivity()
	{
		if (CurrentTag().compare(TCX_TAG_NAME_ACTIVITY) == 0)
			return CloseTag();
		return false;
	}
Esempio n. 8
0
	bool TcxFileWriter::EndTrackpoint()
	{
		if (CurrentTag().compare(TCX_TAG_NAME_TRACKPOINT) == 0)
			return CloseTag();
		return false;
	}
Esempio n. 9
0
	bool TcxFileWriter::StoreCadenceRpm(uint8_t cadenceRpm)
	{
		if (CurrentTag().compare(TCX_TAG_NAME_TRACKPOINT) != 0)
			return false;
		return WriteTagAndValue(TCX_TAG_NAME_CADENCE, (uint32_t)cadenceRpm);		
	}
Esempio n. 10
0
	bool TcxFileWriter::StoreDistanceMeters(double distanceMeters)
	{
		if (CurrentTag().compare(TCX_TAG_NAME_TRACKPOINT) != 0)
			return false;
		return WriteTagAndValue(TCX_TAG_NAME_DISTANCE_METERS, distanceMeters);
	}
Esempio n. 11
0
	bool TcxFileWriter::StoreAltitudeMeters(double altitudeMeters)
	{
		if (CurrentTag().compare(TCX_TAG_NAME_TRACKPOINT) != 0)
			return false;
		return WriteTagAndValue(TCX_TAG_NAME_ALTITUDE_METERS, altitudeMeters);
	}
Esempio n. 12
0
	bool TcxFileWriter::EndLap()
	{
		if (CurrentTag().compare(TCX_TAG_NAME_LAP) == 0)
			return CloseTag();
		return false;
	}
Esempio n. 13
0
	bool TcxFileWriter::StoreLapCalories(double calories)
	{
		if (CurrentTag().compare(TCX_TAG_NAME_LAP) != 0)
			return false;
		return WriteTagAndValue(TCX_TAG_NAME_CALORIES, calories);
	}
Esempio n. 14
0
	bool TcxFileWriter::StoreLapMaxSpeed(double maxSpeed)
	{
		if (CurrentTag().compare(TCX_TAG_NAME_LAP) != 0)
			return false;
		return WriteTagAndValue(TCX_TAG_NAME_MAX_SPEED, maxSpeed);
	}
Esempio n. 15
0
	bool TcxFileWriter::StoreLapSeconds(uint64_t timeMS)
	{
		if (CurrentTag().compare(TCX_TAG_NAME_LAP) != 0)
			return false;
		return WriteTagAndValue(TCX_TAG_NAME_TOTAL_TIME_SECONDS, (double)(timeMS / 1000));
	}
Esempio n. 16
0
void MainWindow::OnTagSelected()
{
	fFilterModel->SetFilterTag(CurrentTag());
}