Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immediate-store all of view dialog #3987

Merged
merged 16 commits into from
Dec 8, 2024
Merged
9 changes: 7 additions & 2 deletions guide/app_config_ini.tex
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ \subsection{\big[astro\big]}
nebula\_hints\_amount & float & 3.0 & Sets the amount of hints [0\ldots10]. \\%\midrule
nebula\_labels\_amount & float & 3.0 & Sets the amount of labels [0\ldots10].\\%\midrule
flag\_milky\_way & bool & true & Set to \emph{false} to hide the Milky Way.\\%\midrule
milky\_way\_color & Color & \ccbox[box]{1.0,1.0,1.0} & Base color of the Milky Way.\\
milky\_way\_intensity & float & 1.0 & Sets the relative brightness with which the milky way is drawn. Typical [1\ldots3]. \\%\midrule
milky\_way\_saturation & float & 1.0 & Sets the color saturation with which the milky way is drawn [0\ldots1]. \\%\midrule
flag\_zodiacal\_light & bool & true & Set to \emph{false} to hide the zodiacal light\\%\midrule
zodiacal\_light\_color & Color & \ccbox[box]{1.0,0.0,1.0} & Base color of the Zodiacal Light.\\
zodiacal\_light\_intensity & float & 1.0 & Sets the relative brightness with which the zodiacal light is drawn. \\%\midrule
max\_mag\_nebula\_name & float & 8.0 & Sets the magnitude of the nebulae whose name is shown. \\%\midrule
flag\_nebula\_hints\_proportional & bool & false & Enables/disables proportional markers for deep-sky objects. \\%\midrule
Expand Down Expand Up @@ -905,8 +908,10 @@ \subsection{\big[viewing\big]}
flag\_constellation\_art & bool & Display constellation art\\%\midrule
flag\_constellation\_boundaries & bool & Display constellation boundaries \\%\midrule
flag\_constellation\_isolate\_selected & bool & If \emph{true}, constellation lines, boundaries and art will be limited to the constellation of the selected star,
if that star is ``on'' one of the constellation lines.\\%\midrule
flag\_constellation\_pick & bool & Set to \emph{true} if you only want to see the line drawing, art and name of the selected constellation star\\\midrule
if that star is ``on'' one of the constellation lines, adding more constellations as you click more \\%\midrule
flag\_constellation\_pick & bool & If flag\_constellation\_isolate\_selected is also true,
set to \emph{true} if you only want to see the line drawing,
art and name of the currently selected constellation\\\midrule
%
flag\_isolated\_trails & bool & Set to \emph{true} if you only want to see the trail line drawn for the selected planet (asteroid, comet, moon)\\%\midrule
number\_isolated\_trails & int & Number of isolated trails for latest selected Solar system bodies [1..5].\\%\midrule
Expand Down
54 changes: 29 additions & 25 deletions guide/ch_interface.tex
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,12 @@ \subsection{The Main Tab}
See section~\ref{sec:ExtraData:ephemerides} if you are interested.

The tab also provides the buttons for saving the current view direction as default
for the next startup, and for saving the program configuration.
Most display settings have to be explicitly stored to make a setting change permanent.
for the next startup, and for saving the program configuration:
most display settings have to be explicitly stored to make a setting change permanent.
If you prefer\newFeature{24.4}, you can activate \button{Immediate Save}.
Then all settings changes will be stored immediately and the program will use them the next time you launch it.
Language and font settings have to be stored explicitly with the buttons next to their settings to protect you from unwanted surprises.
To permanently set this mode, use \button{Save settings} a final time.

\subsection{The Information Tab}
\label{sec:gui:configuration:info}
Expand Down Expand Up @@ -348,9 +352,6 @@ \subsection{The Tools Tab}
\item[Gravity labels] This option makes labels of objects in the
main view align with the nearest horizon. This means that labels
projected onto a dome are always aligned properly.
\item[Select single constellation] When active, clicking on a star
that is member in the constellation lines will make the
constellation stand out. See section~\ref{sec:starlore:singleConstellations} for details.
\item[Dithering] options to allow select better simulation of sky on different hardware.
\item[Auto zoom out returns to initial direction of view] When enabled,
this option changes the behavior of the zoom out key
Expand Down Expand Up @@ -430,8 +431,8 @@ \subsection{The Tools Tab}
you to pre-select a writing system, the other will then allow
selection of a font installed in your system that includes the
characters used in the selected writing system. When you have found
the best font, store your settings on the Main tab (see
section~\ref{sec:gui:configuration:main}) and you may edit
the best font, store your settings here or on the Main tab (see
section~\ref{sec:gui:configuration:main}), and you may edit
\file{config.ini} again to disable the font selection switches.

\paragraph{Screenshots} You can set the directory where screenshots
Expand Down Expand Up @@ -905,28 +906,30 @@ \subsection{The Starlore Tab}
\begin{description}
\item[Use this sky culture as default] Activate this option to load
this sky culture when Stellarium starts.
\item[Show labels] Activate display of constellation labels, like
\guibutton{0.6}{bt_constellation_name.png} or \keys{V}. You can further
\item[Constellations name style] You can
select whether you want to display abbreviated, original or
translated names.
\item[Show lines with thickness\ldots] Activate display of stick
figures, like \guibutton{0.6}{bt_constellation.png} or \keys{C}, and you
can configure constellation line thickness here.
\item[Show asterism lines\ldots] Activate display of asterism stick figures
(like the shortcut \keys{Alt+A}), and you can configure asterism line thickness here.\newFeature{0.16.0}
\item[Show ray helpers\ldots] Activate display of special navigational lines which
connect stars often from different constellations (like the shortcut \keys{Alt+R}),
and you can configure thickness of those lines here.\newFeature{0.17.0}
\item[Show boundaries] Activate display of constellation boundaries,
like \keys{B}. Currently, boundaries have been defined only for
``Modern'' sky cultures.
\item[Use native names for planets] If provided, show the planet names
as used in this sky culture (also shows modern planet name for
reference). %% TODO THIS FEATURE NEEDS SOME REWORK!
\item[Show art in brightness\ldots] Activate display of constellation
\item[Constellation labels] Activate display of constellation labels, like
\guibutton{0.6}{bt_constellation_name.png} or \keys{V}.
\item[Constellation lines] Activate display of stick
figures, like \guibutton{0.6}{bt_constellation.png} or \keys{C}, and you
can configure constellation line thickness in the right spinbox.
\item[Constellation boundaries] Activate display of constellation boundaries,
like \keys{B}. Currently, boundaries have been defined only for
``Modern'' sky cultures.
\item[Art in brightness\ldots] Activate display of constellation
art (if available), like \guibutton{0.6}{bt_constellation_art.png} or
\keys{R}. You can also select the brightness here.
\item[Show asterism labels] Activate display of asterism labels, like \keys{Alt+V}.\newFeature{0.16.0}
\item[Asterism labels] Activate display of asterism labels, like \keys{Alt+V}.\newFeature{0.16.0}
\item[Asterism lines] Activate display of asterism stick figures
(like the shortcut \keys{Alt+A}), and you can configure asterism line thickness as well.\newFeature{0.16.0}
\item[Ray helpers] Activate display of special navigational lines which
connect stars often from different constellations (like the shortcut \keys{Alt+R}),
and you can configure thickness of those lines as well.\newFeature{0.17.0}
\item[Select single constellation/Isolated] See section~\ref{sec:starlore:singleConstellations} for details.
\end{description}

\subsubsection{Select single constellations}
Expand All @@ -935,10 +938,11 @@ \subsubsection{Select single constellations}
Some presenters may want to explain a particular storyline about the
constellations of a sky culture, which includes showing single
constellations or showing a sequence of appearing constellations. To
achieve this, first activate the single constellation mode (see
section~\ref{fig:gui:configuration:tools}). Then, click on a star
achieve this, first activate ``Select single constellation'' mode (see
fig~\ref{fig:gui:view:starlore}). Then, click on a star
which is part of a constellation line set. Click
another star which is part of another constellation to show that one.
another star which is part of another constellation to show that one in addition.
If you really only want to show a single constellation, also add the ``Isolated'' option.

If you explain a sky culture where constellations also have borders
defined, a click anywhere in the constellation area is enough. For
Expand Down
Binary file modified guide/pictures/config_dialog_main_tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion guide/structure.tex
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@
\newcommand{\var}[1]{\texttt{#1}} %% variable name

%% Color boxes for config.ini
\newcommand{\ccbox}[1]{#1\quad\colorbox[rgb]{#1}{\makebox(8,8){}}}
\newcommand{\ccbox}[2][none]{\setlength{\fboxsep}{0mm}\ifthenelse{\equal{#1}{box}}
{#2\quad\fbox{\colorbox[rgb]{#2}{\makebox(10,10){}}}}
{#2\quad\colorbox[rgb]{#2}{\makebox(10,10){}}}
}
%% Color boxes for descriptions
\newcommand{\ccboxdsc}[1]{\colorbox[rgb]{#1}{\makebox(4,4){}}}

Expand Down
2 changes: 2 additions & 0 deletions src/StelMainView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,7 @@ void StelMainView::setFullScreen(bool b)
move(x + screenGeom.x(), y + screenGeom.y());
}
}
StelApp::immediateSave("video/fullscreen", b);
emit fullScreenChanged(b);
}

Expand Down Expand Up @@ -1526,6 +1527,7 @@ void StelMainView::setFlagCursorTimeout(bool b)
cursorTimeoutTimer->stop();
}

StelApp::immediateSave("gui/flag_mouse_cursor_timeout", b);
emit flagCursorTimeoutChanged(b);
}

Expand Down
20 changes: 11 additions & 9 deletions src/StelMainView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class QOpenGLDebugLogger;
class QOpenGLDebugMessage;
#endif
#include "VecMath.hpp"
#include "StelApp.hpp"

class StelGLWidget;
class StelGraphicsScene;
Expand Down Expand Up @@ -157,7 +158,7 @@ public slots:
//! Get whether colors are inverted when saving screenshot
bool getFlagInvertScreenShotColors() const {return flagInvertScreenShotColors;}
//! Set whether colors should be inverted when saving screenshot
void setFlagInvertScreenShotColors(bool b) {flagInvertScreenShotColors=b; emit flagInvertScreenShotColorsChanged(b);}
void setFlagInvertScreenShotColors(bool b) {flagInvertScreenShotColors=b; StelApp::immediateSave("main/invert_screenshots_colors", b); emit flagInvertScreenShotColorsChanged(b);}

//! Get whether date and time should be used for screenshot naming
bool getFlagScreenshotDateFileName() const {return flagScreenshotDateFileName;}
Expand All @@ -168,21 +169,22 @@ public slots:

//! Get whether existing files are overwritten when saving screenshot
bool getFlagOverwriteScreenShots() const {return flagOverwriteScreenshots;}
//! Set whether existing files are overwritten when saving screenshot
//! Set whether existing files are overwritten when saving screenshot.
//! This flag is available for scripting only and initializes to false. There is no config.ini entry.
void setFlagOverwriteScreenShots(bool b) {flagOverwriteScreenshots=b; emit flagOverwriteScreenshotsChanged(b);}

//! Get whether custom size should be used for screenshots
bool getFlagUseCustomScreenshotSize() const {return flagUseCustomScreenshotSize;}
//! Set whether custom size should be used for screenshots
void setFlagUseCustomScreenshotSize(bool b) {flagUseCustomScreenshotSize=b; emit flagUseCustomScreenshotSizeChanged(b);}
void setFlagUseCustomScreenshotSize(bool b) {flagUseCustomScreenshotSize=b; StelApp::immediateSave("main/screenshot_custom_size", b); emit flagUseCustomScreenshotSizeChanged(b);}
//! Get custom screenshot width
int getCustomScreenshotWidth() const {return customScreenshotWidth;}
//! Set custom width for screenshots
void setCustomScreenshotWidth(int width) {customScreenshotWidth=width; emit customScreenshotWidthChanged(width);}
void setCustomScreenshotWidth(int width) {customScreenshotWidth=width; StelApp::immediateSave("main/screenshot_custom_width", width); emit customScreenshotWidthChanged(width);}
//! Get custom screenshot height
int getCustomScreenshotHeight() const {return customScreenshotHeight;}
//! Set custom height for screenshots
void setCustomScreenshotHeight(int height) {customScreenshotHeight=height; emit customScreenshotHeightChanged(height);}
void setCustomScreenshotHeight(int height) {customScreenshotHeight=height; StelApp::immediateSave("main/screenshot_custom_height", height); emit customScreenshotHeightChanged(height);}
//! Get screenshot DPI. This is only an entry in the screenshot image metadata. The raster content is not influenced.
int getScreenshotDpi() const {return screenshotDpi;}
//! Set screenshot DPI. This is only an entry in the screenshot image metadata. The raster content is not influenced.
Expand All @@ -197,23 +199,23 @@ public slots:
//! Get the mouse cursor timeout in seconds
double getCursorTimeout() const {return cursorTimeoutTimer->interval() / 1000.0;}
//! Set the mouse cursor timeout in seconds
void setCursorTimeout(double t) {cursorTimeoutTimer->setInterval(static_cast<int>(t * 1000)); emit cursorTimeoutChanged(t);}
void setCursorTimeout(double t) {cursorTimeoutTimer->setInterval(static_cast<int>(t * 1000)); StelApp::immediateSave("gui/mouse_cursor_timeout", t); emit cursorTimeoutChanged(t);}

//! Set the minimum frames per second. Usually this minimum will be switched to after there are no
//! user events for some seconds to save power. However, if can be useful to set this to a high
//! value to improve playing smoothness in scripts.
//! @param m the new minimum fps setting.
void setMinFps(float m) {minfps=qMin(m, maxfps); emit minFpsChanged(minfps);}
void setMinFps(float m) {minfps=qMin(m, maxfps); StelApp::immediateSave("video/minimum_fps", m); emit minFpsChanged(minfps);}
//! Get the current minimum frames per second.
float getMinFps() const {return minfps;}
//! Set the maximum frames per second.
//! @param m the new maximum fps setting.
void setMaxFps(float m) {maxfps = qMax(m, minfps); emit maxFpsChanged(maxfps);}
void setMaxFps(float m) {maxfps = qMax(m, minfps); StelApp::immediateSave("video/maximum_fps", m); emit maxFpsChanged(maxfps);}
//! Get the current maximum frames per second.
float getMaxFps() const {return maxfps;}
//! Set the minimum time between frames (in milliseconds).
//! @param m the new setting.
void setMinTimeBetweenFrames(int m) {minTimeBetweenFrames = qMax(0, m); emit minTimeBetweenFramesChanged(minTimeBetweenFrames);}
void setMinTimeBetweenFrames(int m) {minTimeBetweenFrames = qMax(0, m); StelApp::immediateSave("video/min_time_between_frames", minTimeBetweenFrames); emit minTimeBetweenFramesChanged(minTimeBetweenFrames);}
//! Get the current minimum time between frames.
int getMinTimeBetweenFrames() const {return minTimeBetweenFrames;}

Expand Down
19 changes: 19 additions & 0 deletions src/core/StelApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@ void StelApp::setFlagOverwriteInfoColor(bool b)
if (flagOverwriteInfoColor!=b)
{
flagOverwriteInfoColor=b;
StelApp::immediateSave("gui/flag_overwrite_info_color", b);
emit flagOverwriteInfoColorChanged(b);
}
}
Expand All @@ -1247,10 +1248,22 @@ void StelApp::setFlagShowDecimalDegrees(bool b)
if (flagShowDecimalDegrees!=b)
{
flagShowDecimalDegrees = b;
StelApp::immediateSave("gui/flag_show_decimal_degrees", b);
emit flagShowDecimalDegreesChanged(b);
}
}

void StelApp::setFlagSouthAzimuthUsage(bool use)
{
if (flagUseAzimuthFromSouth!=use)
{
flagUseAzimuthFromSouth=use;
StelApp::immediateSave("gui/flag_use_azimuth_from_south", use);
emit flagUseAzimuthFromSouthChanged(use);
}
}


void StelApp::setFlagUseFormattingOutput(bool b)
{
if (flagUseFormattingOutput!=b)
Expand Down Expand Up @@ -1304,6 +1317,9 @@ void StelApp::setFlagImmediateSave(bool b)
if (flagImmediateSave!=b)
{
flagImmediateSave = b;
// To not accidentally activate this mode permanently, you must use the "save settings" button to activate!
if (!b)
StelApp::immediateSave("gui/immediate_save_details", false);
emit flagImmediateSaveChanged(b);
}
}
Expand Down Expand Up @@ -1377,6 +1393,7 @@ void StelApp::setDevicePixelsPerPixel(qreal dppp)
void StelApp::setViewportEffect(const QString& name)
{
if (name == getViewportEffect()) return;
StelApp::immediateSave("video/viewport_effect", name);
if (renderBuffer)
{
ensureGLContextCurrent();
Expand Down Expand Up @@ -1439,6 +1456,7 @@ void StelApp::setScreenFontSize(int s)
if (screenFontSize!=s)
{
screenFontSize=s;
StelApp::immediateSave("gui/screen_font_size", s);
emit screenFontSizeChanged(s);
}
}
Expand All @@ -1449,6 +1467,7 @@ void StelApp::setGuiFontSize(int s)
QFont font=QGuiApplication::font();
font.setPixelSize(s);
QGuiApplication::setFont(font);
StelApp::immediateSave("gui/gui_font_size", s);
emit guiFontSizeChanged(s);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/core/StelApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public slots:
//! Set flag for using calculation of azimuth from south towards west (instead north towards east)
bool getFlagSouthAzimuthUsage() const { return flagUseAzimuthFromSouth; }
//! Get flag for using calculation of azimuth from south towards west (instead north towards east)
void setFlagSouthAzimuthUsage(bool use) { flagUseAzimuthFromSouth=use; emit flagUseAzimuthFromSouthChanged(use);}
void setFlagSouthAzimuthUsage(bool use);

//! Set flag for using of formatting output for coordinates
void setFlagUseFormattingOutput(bool b);
Expand All @@ -315,6 +315,8 @@ public slots:
Vec3f getDaylightInfoColor() const;

//! Set flag for storing some settings immediately
//! To not accidentally activate this mode permanently, you must use the "save settings" button to activate!
//! Switching it off is however stored immediately.
void setFlagImmediateSave(bool b);
//! Get flag about storing some settings immediately
bool getFlagImmediateSave() const {return flagImmediateSave;}
Expand Down
Loading
Loading