MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / buttonClicked

Method buttonClicked

gui/browserWidgets/locationeditor.cpp:71–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70
71void LocationEditor::buttonClicked() {
72 const QWeakPointer<LocationDialog> dialogPtr(new LocationDialog(this));
73 if (LocationDialog *const dialog = dialogPtr.data()) {
74 dialog->setLongitude(this->startLongitude);
75 dialog->setLatitude(this->startLatitude);
76 dialog->setAltitude(this->startAltitude);
77 dialog->exec();
78 }
79
80 if (LocationDialog *const dialog = dialogPtr.data()) {
81 const double lon = dialog->getLongitude();
82 const double lat = dialog->getLatitude();
83 const double alt = dialog->getAltitude();
84 startAltitude = alt;
85 startLongitude = lon;
86 startLatitude = lat;
87 if (dialog->okPressed()) {
88 NoteTable ntable(global.db);
89 if (lon == 0.0 && lat == 0.0) {
90 setText(defaultText);
91 ntable.resetGeography(currentLid, true);
92 } else {
93 setText(dialog->locationText());
94 ntable.setGeography(currentLid, lon,lat,alt, true);
95 }
96 }
97 delete dialog;
98 }
99}
100
101
102void LocationEditor::setGeography(qint32 lid, double longitude, double latitude, double altitude, QString placeName) {

Callers

nothing calls this directly

Calls 12

dataMethod · 0.80
setLongitudeMethod · 0.80
setLatitudeMethod · 0.80
setAltitudeMethod · 0.80
getLongitudeMethod · 0.80
getLatitudeMethod · 0.80
getAltitudeMethod · 0.80
resetGeographyMethod · 0.80
locationTextMethod · 0.80
execMethod · 0.45
okPressedMethod · 0.45
setGeographyMethod · 0.45

Tested by

no test coverage detected