void MainWindow::SaveSettings() { QSettings settings; settings.setValue("geometry", saveGeometry()); settings.setValue("splitter", ui->fSplitter->saveState()); settings.setValue("selected_tag", CurrentTag()); }
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); }
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(); }
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); }
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; }
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); } }
bool TcxFileWriter::EndActivity() { if (CurrentTag().compare(TCX_TAG_NAME_ACTIVITY) == 0) return CloseTag(); return false; }
bool TcxFileWriter::EndTrackpoint() { if (CurrentTag().compare(TCX_TAG_NAME_TRACKPOINT) == 0) return CloseTag(); return false; }
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); }
bool TcxFileWriter::StoreDistanceMeters(double distanceMeters) { if (CurrentTag().compare(TCX_TAG_NAME_TRACKPOINT) != 0) return false; return WriteTagAndValue(TCX_TAG_NAME_DISTANCE_METERS, distanceMeters); }
bool TcxFileWriter::StoreAltitudeMeters(double altitudeMeters) { if (CurrentTag().compare(TCX_TAG_NAME_TRACKPOINT) != 0) return false; return WriteTagAndValue(TCX_TAG_NAME_ALTITUDE_METERS, altitudeMeters); }
bool TcxFileWriter::EndLap() { if (CurrentTag().compare(TCX_TAG_NAME_LAP) == 0) return CloseTag(); return false; }
bool TcxFileWriter::StoreLapCalories(double calories) { if (CurrentTag().compare(TCX_TAG_NAME_LAP) != 0) return false; return WriteTagAndValue(TCX_TAG_NAME_CALORIES, calories); }
bool TcxFileWriter::StoreLapMaxSpeed(double maxSpeed) { if (CurrentTag().compare(TCX_TAG_NAME_LAP) != 0) return false; return WriteTagAndValue(TCX_TAG_NAME_MAX_SPEED, maxSpeed); }
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)); }
void MainWindow::OnTagSelected() { fFilterModel->SetFilterTag(CurrentTag()); }