AngleSpinBox.cpp   AngleSpinBox.cpp 
skipping to change at line 17 skipping to change at line 17
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. *
************************************************************************** */ ************************************************************************** */
#include "AngleSpinBox.hpp" #include "AngleSpinBox.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include <QDebug> #include <QDebug>
#include <QString> #include <QString>
#include <QLineEdit> #include <QLineEdit>
#include <QWidget> #include <QWidget>
#include <QLocale> #include <QLocale>
#include <cmath> #include <cmath>
skipping to change at line 130 skipping to change at line 130
const int cusorPos = lineEdit()->cursorPosition(); const int cusorPos = lineEdit()->cursorPosition();
const AngleSpinBox::AngleSpinboxSection sec = getCurrentSection(); const AngleSpinBox::AngleSpinboxSection sec = getCurrentSection();
switch (sec) switch (sec)
{ {
case SectionPrefix: case SectionPrefix:
{ {
radAngle = -radAngle; radAngle = -radAngle;
break; break;
} }
case SectionDegreesHours: case SectionDegreesHours:
case SectionNone:
{ {
if (angleSpinBoxFormat==DMSLetters || angleSpinBoxFo rmat==DMSSymbols || angleSpinBoxFormat==DecimalDeg) if (angleSpinBoxFormat==DMSLetters || angleSpinBoxFo rmat==DMSSymbols || angleSpinBoxFormat==DecimalDeg)
radAngle += M_PI/180.*steps; radAngle += M_PI/180.*steps;
else else
radAngle += M_PI/12.*steps; radAngle += M_PI/12.*steps;
break; break;
} }
case SectionMinutes: case SectionMinutes:
{ {
if (angleSpinBoxFormat==DMSLetters || angleSpinBoxFo rmat==DMSSymbols || angleSpinBoxFormat==DecimalDeg) if (angleSpinBoxFormat==DMSLetters || angleSpinBoxFo rmat==DMSSymbols || angleSpinBoxFormat==DecimalDeg)
radAngle += M_PI/180.*steps/60.; radAngle += M_PI/180.*steps/60.;
else else
radAngle += M_PI/12.*steps/60.; radAngle += M_PI/12.*steps/60.;
break; break;
} }
case SectionSeconds: case SectionSeconds:
case SectionNone:
{ {
if (angleSpinBoxFormat==DMSLetters || angleSpinBoxFo rmat==DMSSymbols || angleSpinBoxFormat==DecimalDeg) if (angleSpinBoxFormat==DMSLetters || angleSpinBoxFo rmat==DMSSymbols || angleSpinBoxFormat==DecimalDeg)
radAngle += M_PI/180.*steps/3600.; radAngle += M_PI/180.*steps/3600.;
else else
radAngle += M_PI/12.*steps/3600.; radAngle += M_PI/12.*steps/3600.;
break; break;
} }
default: default:
{ {
return; return;
skipping to change at line 425 skipping to change at line 425
if (angleSpinBoxFormat == HMSLetters) if (angleSpinBoxFormat == HMSLetters)
lineEdit()->setText(QString("%1h %2m %3s") lineEdit()->setText(QString("%1h %2m %3s")
.arg(h).arg(m).arg(s, 0, 'f', decimalPl aces, ' ')); .arg(h).arg(m).arg(s, 0, 'f', decimalPl aces, ' '));
else else
lineEdit()->setText(QString("%1h %2' %3\"") lineEdit()->setText(QString("%1h %2' %3\"")
.arg(h).arg(m).arg(s, 0, 'f', decimalPl aces, ' ')); .arg(h).arg(m).arg(s, 0, 'f', decimalPl aces, ' '));
break; break;
} }
case DecimalDeg: case DecimalDeg:
{ {
bool sign=true;
double angle = radAngle; double angle = radAngle;
QString signInd = positivePrefix(currentPrefixType); QString signInd = positivePrefix(currentPrefixType);
if (radAngle<0) if (radAngle<0)
{ {
angle *= -1; angle *= -1;
sign = false;
signInd = negativePrefix(currentPrefixType); signInd = negativePrefix(currentPrefixType);
} }
lineEdit()->setText(QString("%1%2%3") lineEdit()->setText(QString("%1%2%3")
.arg(signInd) .arg(signInd)
.arg(fmod(angle * 180.0 / M_PI, 360.0), 0, 'f', decimalPlaces, ' ') .arg(fmod(angle * 180.0 / M_PI, 360.0), 0, 'f', decimalPlaces, ' ')
.arg(QChar(176))); .arg(QChar(176)));
break; break;
} }
default: default:
 End of changes. 5 change blocks. 
4 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/