55
55
StelPluginInfo info;
56
56
info.id = "AngleMeasure";
57
info.displayedName = q_("Angle Measure");
57
info.displayedName = N_("Angle Measure");
58
58
info.authors = "Matthew Gates";
59
59
info.contact = "http://porpoisehead.net/";
60
info.description = q_("Provides an angle measurement tool");
60
info.description = N_("Provides an angle measurement tool");
115
115
perp2StartPoint.set(0.,0.,0.);
116
116
perp2EndPoint.set(0.,0.,0.);
118
// create action for enable/disable & hook up signals
119
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
118
StelApp& app = StelApp::getInstance();
120
// Create action for enable/disable & hook up signals
121
StelGui* gui = dynamic_cast<StelGui*>(app.getGui());
121
gui->addGuiActions("actionShow_Angle_Measure", N_("Angle measure"), "Ctrl+A", N_("Plugin Key Bindings"), true, false);
122
gui->getGuiActions("actionShow_Angle_Measure")->setChecked(flagShowAngleMeasure);
123
connect(gui->getGuiActions("actionShow_Angle_Measure"), SIGNAL(toggled(bool)), this, SLOT(enableAngleMeasure(bool)));
123
QAction* action = gui->addGuiActions("actionShow_Angle_Measure",
126
N_("Plugin Key Bindings"),
128
action->setChecked(flagShowAngleMeasure);
129
connect(action, SIGNAL(toggled(bool)), this, SLOT(enableAngleMeasure(bool)));
131
// Initialize the message strings and make sure they are translated when
132
// the language changes.
134
connect(&app, SIGNAL(languageChanged()), this, SLOT(updateMessageText()));
125
136
// Add a toolbar button
179
190
if (messageFader.getInterstate() > 0.000001f)
181
192
painter.setColor(textColor[0], textColor[1], textColor[2], messageFader.getInterstate());
182
painter.drawText(83, 120, "Angle Tool Enabled - left drag to measure, left click to clear");
183
painter.drawText(83, 95, "right click to change end point only");
195
int ls = painter.getFontMetrics().lineSpacing();
196
painter.drawText(x, y, messageEnabled);
198
painter.drawText(x, y, messageLeftButton);
200
painter.drawText(x, y, messageRightButton);
280
297
messageFader = b;
283
qDebug() << "AngleMeasure::enableAngleMeasure starting timer";
300
//qDebug() << "AngleMeasure::enableAngleMeasure starting timer";
284
301
messageTimer->start();
305
void AngleMeasure::updateMessageText()
307
// TRANSLATORS: instructions for using the AngleMeasure plugin.
308
messageEnabled = q_("The Angle Measure is enabled:");
309
// TRANSLATORS: instructions for using the AngleMeasure plugin.
310
messageLeftButton = q_("Drag with the left button to measure, left-click to clear.");
311
// TRANSLATORS: instructions for using the AngleMeasure plugin.
312
messageRightButton = q_("Right-clicking changes the end point only.");
288
315
void AngleMeasure::clearMessage()
290
qDebug() << "AngleMeasure::clearMessage";
317
//qDebug() << "AngleMeasure::clearMessage";
291
318
messageFader = false;