@@ -95,7 +95,9 @@ ArchaeoLines::ArchaeoLines()
9595 , flagShowCustomDeclination1(false )
9696 , flagShowCustomDeclination2(false )
9797 , lastJDE(0.0 )
98+ #ifndef NO_GUI
9899 , toolbarButton(Q_NULLPTR)
100+ #endif
99101{
100102 setObjectName (" ArchaeoLines" );
101103 core=StelApp::getInstance ().getCore ();
@@ -140,7 +142,9 @@ ArchaeoLines::ArchaeoLines()
140142 customDeclination1Line = new ArchaeoLine (ArchaeoLine::CustomDeclination1, 0.0 );
141143 customDeclination2Line = new ArchaeoLine (ArchaeoLine::CustomDeclination2, 0.0 );
142144
145+ #ifndef NO_GUI
143146 configDialog = new ArchaeoLinesDialog ();
147+ #endif
144148 conf = StelApp::getInstance ().getSettings ();
145149
146150 connect (core, SIGNAL (locationChanged (StelLocation)), this , SLOT (updateObserverLocation (StelLocation)));
@@ -180,14 +184,20 @@ ArchaeoLines::~ArchaeoLines()
180184 delete customDeclination1Line; customDeclination1Line=Q_NULLPTR;
181185 delete customDeclination2Line; customDeclination2Line=Q_NULLPTR;
182186
187+ #ifndef NO_GUI
183188 delete configDialog; configDialog=Q_NULLPTR;
189+ #endif
184190}
185191
186192bool ArchaeoLines::configureGui (bool show)
187193{
194+ #ifdef NO_GUI
195+ return false ;
196+ #else
188197 if (show)
189198 configDialog->setVisible (true );
190199 return true ;
200+ #endif
191201}
192202
193203// ! Determine which "layer" the plugin's drawing will happen on.
@@ -269,8 +279,8 @@ void ArchaeoLines::init()
269279 // Create action for enable/disable & hook up signals
270280 QString section=N_ (" ArchaeoLines" );
271281 addAction (" actionShow_ArchaeoLines" , section, N_ (" ArchaeoLines" ), " enabled" , " Ctrl+U" );
282+ #ifndef NO_GUI
272283 addAction (" actionShow_ArchaeoLines_dialog" , section, N_ (" Show settings dialog" ), configDialog, " visible" , " Ctrl+Shift+U" );
273-
274284 // Add a toolbar button
275285 StelApp& app=StelApp::getInstance ();
276286 try
@@ -292,6 +302,7 @@ void ArchaeoLines::init()
292302 {
293303 qWarning () << " Unable to create toolbar button for ArchaeoLines plugin: " << e.what ();
294304 }
305+ #endif
295306 addAction (" actionAL_showEquinoxLine" , section, N_ (" Show Line for Equinox" ), " flagShowEquinox" ); // No Shortcuts configured.
296307 addAction (" actionAL_showSolsticeLines" , section, N_ (" Show Line for Solstices" ), " flagShowSolstices" ); // No Shortcuts configured.
297308 addAction (" actionAL_showCrossquarterLines" , section, N_ (" Show Line for Crossquarter" ), " flagShowCrossquarters" ); // No Shortcuts configured.
0 commit comments