Merge lp:~peppujols/stellarium/printsky into lp:stellarium

Proposed by Pep Pujols
Status: Rejected
Rejected by: Alexander Wolf
Proposed branch: lp:~peppujols/stellarium/printsky
Merge into: lp:stellarium
Diff against target: 2295 lines (+1771/-65)
17 files modified
CMakeLists.txt (+1/-0)
plugins/CMakeLists.txt (+3/-1)
plugins/PrintSky/CMakeLists.txt (+11/-0)
plugins/PrintSky/src/CMakeLists.txt (+69/-0)
plugins/PrintSky/src/PrintSky.cpp (+155/-0)
plugins/PrintSky/src/PrintSky.hpp (+79/-0)
plugins/PrintSky/src/gui/PrintSkyDialog.cpp (+611/-0)
plugins/PrintSky/src/gui/PrintSkyDialog.hpp (+98/-0)
plugins/PrintSky/src/gui/StelDialogPrintSky.cpp (+134/-0)
plugins/PrintSky/src/gui/StelDialogPrintSky.hpp (+52/-0)
plugins/PrintSky/src/gui/printskyDialog.ui (+350/-0)
po/stellarium/POTFILES.in (+3/-0)
po/stellarium/stellarium.pot (+190/-64)
src/CMakeLists.txt (+6/-0)
src/StelMainGraphicsView.cpp (+4/-0)
src/StelMainGraphicsView.hpp (+4/-0)
src/core/modules/StarMgr.cpp (+1/-0)
To merge this branch: bzr merge lp:~peppujols/stellarium/printsky
Reviewer Review Type Date Requested Status
Fabien Chéreau Disapprove
Alexander Wolf Needs Information
Bogdan Marinov Needs Fixing
Matthew Gates Pending
Review via email: mp+62014@code.launchpad.net

This proposal supersedes a proposal from 2011-01-07.

To post a comment you must log in.
Revision history for this message
Matthew Gates (matthew-porpoisehead) wrote : Posted in a previous version of this proposal

I found a couple of without looking into the code:

1. The preview window shows badly corrupted fonts. I think the font size is too big and/or the line spacing is not big enough. See http://i.imgur.com/ccR7I.png

2. The configuration dialog form design is not so good. Spacers and a tab level layout should be used to make the form re-sizable. I would also prefer the colouration to be the same as the other configuration dialogs (this is probably just a matter of copying the stylesheet from the Satellite or Occural plugin).

Matthew

review: Needs Fixing
Revision history for this message
Bogdan Marinov (daggerstab) wrote : Posted in a previous version of this proposal

I agree that it needs some fixing.

Matthew, Pep, did you see the experimental build of Stellarium I've uploaded here?
https://launchpad.net/stellarium/+download
One of the two new plug-ins included in it is a _fixed_ version of Print Sky.

I can provide a patch with my changes. The main problem: it seems that the absolute coordinates used assume a resolution of 300 DPI (dots per inch). If the printer uses a higher resolution, the text appears too small and/or with wrong line spacing. My patch also includes some improvements to the interface.

review: Needs Fixing
Revision history for this message
treaves (treaves) wrote : Posted in a previous version of this proposal

There are several of unused method arguments. For places where you can not change the signature, please use the Q_UNUSED macro.

I'll look over it more when I get home from work; all I had time for was a simple compile check, and that's what showed the above feedback.

Revision history for this message
Bogdan Marinov (daggerstab) wrote : Posted in a previous version of this proposal

I've uploaded a branch with the changes I made to the plug-in when I added it to the experimental build and I've proposed it for merging into Pep Pujols' original branch.
https://code.launchpad.net/~daggerstab/stellarium/printsky

I have also uploaded to Scribd a sample of what the output from my version looks like:
http://www.scribd.com/doc/41205546/PrintSky-Output-Version-Exp02

Revision history for this message
Bogdan Marinov (daggerstab) wrote : Posted in a previous version of this proposal

Just a comment - as the feature freeze is in effect, this should be merged only AFTER the release of 0.10.6 this weekend.

Skimming the code, I've noticed several unresolved merge conflicts, with Bazaar conflict markup in the source files.

Pep, if you set Bazaar to use the same e-mail address as the one you use in Launchpad, Launchpad will put a link to your profile page when it lists the revisions that you have committed. (See "Unmerged revisions" bellow: the author is listed as "Propietario", and there is no link.)

I'll build the plug-in and look deeper into the code later.

Revision history for this message
Pep Pujols (peppujols) wrote : Posted in a previous version of this proposal

> Just a comment - as the feature freeze is in effect, this should be merged only AFTER the release of 0.10.6 this weekend.
>

Ok. No problem.

> Skimming the code, I've noticed several unresolved merge conflicts, with Bazaar conflict markup in the source files.
>

Yes, I should first pull and merge the trunk to my branch (resolving
conflicts) before push my branch to propose to merge?

> Pep, if you set Bazaar to use the same e-mail address as the one you use in Launchpad, Launchpad will put a link to your profile page when it lists the revisions that you have committed. (See "Unmerged revisions" bellow: the author is listed as "Propietario", and there is no link.)

Oh, yeah, I installed the bzr on a new PC and I forget to define my
credentials and EMail. I do it. In the future the new revisions will be
correct.

> I'll build the plug-in and look deeper into the code later.

Thanks.

Pep.

Revision history for this message
Bogdan Marinov (daggerstab) wrote : Posted in a previous version of this proposal

I'll pass this time. There are several issues with the code, some caused by the fact that it has been merged from Timothy Reaves' private branch (for example, the package name, etc.). I can fix them when merging it in the trunk.

What I really want to know is what Fabien thinks about the changes in the core code (in StarMgr) - whether this is the right way to extract such data and if there is a way to make it less intrusive.

review: Abstain
Revision history for this message
treaves (treaves) wrote : Posted in a previous version of this proposal

Oops. Forgot the package name. :)

I name them based on the branch so that I can tell which one I have open in the IDE. I wonder if bazaar support macros like some SCM, so that it could be set on branch / checkout.

Revision history for this message
Pep Pujols (peppujols) wrote : Posted in a previous version of this proposal

Ok.

Pep Pujols.

> Review: Abstain
> I'll pass this time. There are several issues with the code, some caused by the fact that it has been merged from Timothy Reaves' private branch (for example, the package name, etc.). I can fix them when merging it in the trunk.
>
> What I really want to know is what Fabien thinks about the changes in the core code (in StarMgr) - whether this is the right way to extract such data and if there is a way to make it less intrusive.

Revision history for this message
Fabien Chéreau (xalioth) wrote : Posted in a previous version of this proposal

Hi, thanks Bogdan for pinging me again and again.. Pep I'm really sorry for not reviewing the code before..

So here are some stuff I saw (I didn't look in detail at the GUI code; but it's OK you're responsible for it):

1- You canot do that!
-PROJECT(Stellarium)
+PROJECT(Printsky)
and that:
- #SET(CMAKE_OSX_ARCHITECTURES "x86_64")
+ SET(CMAKE_OSX_ARCHITECTURES "x86_64")

2- Do you really need all the #pragma mark xxxx ?

3- You will need to merge from trunk (there are some minor conflicts). I know it's my fault because it tool me too long to review this code :(

4- The changes in StarMgr are not needed I think. All you need is to compute the radius for various stars magnitudes. You should only use the StelSkyDrawer::computeRCMag method for each magnitude steps (and maybe suppress the steps if the radius is too small/big).

In theory you could do everything without touching at the core's code, except the CMakefiles to declare your plugin.

Fabien

review: Needs Fixing
Revision history for this message
Pep Pujols (peppujols) wrote : Posted in a previous version of this proposal

Hi.

> So here are some stuff I saw (I didn't look in detail at the GUI code; but it's OK you're responsible for it):
>
> 1- You canot do that!
> -PROJECT(Stellarium)
> +PROJECT(Printsky)
> and that:
> - #SET(CMAKE_OSX_ARCHITECTURES "x86_64")
> + SET(CMAKE_OSX_ARCHITECTURES "x86_64")
>

Yes, sorry.

> 2- Do you really need all the #pragma mark xxxx ?

No, I removed this code.

> 3- You will need to merge from trunk (there are some minor conflicts). I know it's my fault because it tool me too long to review this code :(

Done.

> 4- The changes in StarMgr are not needed I think. All you need is to compute the radius for various stars magnitudes. You should only use the StelSkyDrawer::computeRCMag method for each magnitude steps (and maybe suppress the steps if the radius is too small/big).
>
>
> In theory you could do everything without touching at the core's code, except the CMakefiles to declare your plugin.
>

Ok. I removed the method from StarMgr and I have placed it in my
pluguin, with simplified code.

I resubmited to proposal to merge again.

Regards.

Pep.

Revision history for this message
Alexander Wolf (alexwolf) wrote :

I like it plugin, but I found some troubles with GUI style.

Plus I have one small patch for getPluginInfo() method:
        info.id = "PrintSky";
        info.displayedName = q_("Print Sky");
        info.authors = "Pep Pujols";
        info.contact = "<email address hidden>";
        info.description = q_("Provides an system printing sky");

lp:~peppujols/stellarium/printsky updated
4718. By Pep Pujols

More simplified method getListMagnitudeRadius. Small patch to plugin info definition.

Revision history for this message
Pep Pujols (peppujols) wrote :

> I like it plugin, but I found some troubles with GUI style.
>

What troubles?

> Plus I have one small patch for getPluginInfo() method:
> info.id = "PrintSky";
> info.displayedName = q_("Print Sky");
> info.authors = "Pep Pujols";
> info.contact = "<email address hidden>";
> info.description = q_("Provides an system printing sky");
>

Done.

Thanks.

Pep.

Revision history for this message
Alexander Wolf (alexwolf) wrote :

Headers of windows as example - it style is wrong as other windows

Revision history for this message
Bogdan Marinov (daggerstab) wrote :

There have been some changes to the stylesheets. In "printskyDialog.ui", please change the name of the "BarFrame"(the bar at the top of the window) from "LocationBar" to "TitleBar". The rest will be fixed when resolving the merge conflicts.

lp:~peppujols/stellarium/printsky updated
4719. By Pep Pujols

Fixed style dialog wrong

4720. By Pep Pujols

Merged from trunk

4721. By Pep Pujols

Merged from trunk (atmosphere refraction)

Revision history for this message
Bogdan Marinov (daggerstab) wrote :

I was going to merge this into the trunk today, but then noticed that both of the files that contain the main class, PrintSky.hpp and PrintSky.cpp, are missing the GNU GPL header - the comment section in the beginning that indicates the license.
http://www.gnu.org/licenses/old-licenses/gpl-2.0.html#SEC4

Pep Pujols, could you please fix this? It needs to be done by the author of the code, to make clear that you are releasing them under this license.

review: Needs Fixing
Revision history for this message
Pep Pujols (peppujols) wrote :

Fixed!

Pep.

> Review: Needs Fixing
> I was going to merge this into the trunk today, but then noticed that both of the files that contain the main class, PrintSky.hpp and PrintSky.cpp, are missing the GNU GPL header - the comment section in the beginning that indicates the license.
> http://www.gnu.org/licenses/old-licenses/gpl-2.0.html#SEC4
>
> Pep Pujols, could you please fix this? It needs to be done by the author of the code, to make clear that you are releasing them under this license.

Revision history for this message
Fabien Chéreau (xalioth) wrote :

There are still conflicts in CMakeLists.txt. Please get rid of them!
Fab

review: Needs Fixing
lp:~peppujols/stellarium/printsky updated
4722. By Pep Pujols

Added GNU GPL header to the main class.

Revision history for this message
Pep Pujols (peppujols) wrote :

Hi.

Fixed.

Pep.

> Review: Needs Fixing
> There are still conflicts in CMakeLists.txt. Please get rid of them!
> Fab

Revision history for this message
Alexander Wolf (alexwolf) wrote :

If Matthew approved this plugin I can merge it and make some work for it localization and resolve two conflicts with my plugins.

review: Approve
lp:~peppujols/stellarium/printsky updated
4723. By Pep Pujols

Merge from code refactoring

Revision history for this message
Alexander Wolf (alexwolf) wrote :

OK. This plugin just work but I have one question: why you just make screenshot and table with S/T/R for SS bodies? Do you can improved this plugin like really calculation ephemerides for SS bodies, generate contour sky map, etc.?

Also I have one note - formatting of elements on page is different on different systems.

review: Needs Information
Revision history for this message
Pep Pujols (peppujols) wrote :

> Review: Needs Information
>
> OK. This plugin just work but I have one question: why you just make screenshot and table with S/T/R for SS bodies? Do you can improved this plugin like really calculation ephemerides for SS bodies, generate contour sky map, etc.?

The screenshot and table is the simpliest and quickly way to have a
report with this field information. I don't understand your
suggestion...really calculation ephemerides: I calcule the ephemerides
(rising, transit, setting, etc...)...other ephemerides? generate contour
sky map, etc..? You suggest to build the screen dinamically? Can you
specify a little more please?

> Also I have one note - formatting of elements on page is different on different systems.

I don't know that. What means? There is documentation about that?

Thanks.

Pep.

Revision history for this message
Alexander Wolf (alexwolf) wrote :

Sorry for the delay in response. You can see view of stellarium report from Linux and Mac here: http://astro.uni-altai.ru/~aw/stellarium/sr-linux.pdf and http://astro.uni-altai.ru/~aw/stellarium/sr-mac.pdf On Windows this report also look not like Mac or Linux report.

Revision history for this message
Pep Pujols (peppujols) wrote :

Hi.

> Sorry for the delay in response. You can see view of stellarium report from Linux and Mac here: http://astro.uni-altai.ru/~aw/stellarium/sr-linux.pdf and http://astro.uni-altai.ru/~aw/stellarium/sr-mac.pdf On Windows this report also look not like Mac or Linux report.

I see. But if I used standard QT code, the look on the three systems
should be the same isn't it?...how can I be sure that the code works
fine? I can make changes but i I can't test the look on the three
systems...only Windows and in Windows look fine.

Pep.

Revision history for this message
Fabien Chéreau (xalioth) wrote :

Will need to be re-worked as it's now 3 years old !

review: Disapprove

Unmerged revisions

4723. By Pep Pujols

Merge from code refactoring

4722. By Pep Pujols

Added GNU GPL header to the main class.

4721. By Pep Pujols

Merged from trunk (atmosphere refraction)

4720. By Pep Pujols

Merged from trunk

4719. By Pep Pujols

Fixed style dialog wrong

4718. By Pep Pujols

More simplified method getListMagnitudeRadius. Small patch to plugin info definition.

4717. By Pep Pujols

Merged from trunk

4716. By Pep Pujols

Fixed some points: Invalid defines, removed pragma marks, reallocation owner metod from StarMgr to PrintSkyDialog

4715. By Pep Pujols

Merge Trunk

4714. By Pep Pujols

Merged in trunk, and corrected ISO C++ bug

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2012-01-24 15:14:41 +0000
3+++ CMakeLists.txt 2012-02-17 15:04:18 +0000
4@@ -147,6 +147,7 @@
5 SET(USE_PLUGIN_VIRGO 0 CACHE BOOL "Define whether the VirGO plugin should be created.")
6 SET(USE_PLUGIN_SOLARSYSTEMEDITOR 1 CACHE BOOL "Define whether the Solar System Editor should be built.")
7 SET(USE_PLUGIN_SUPERNOVAE 1 CACHE BOOL "Define whether the Historical Supernova plugin should be created.")
8+SET(USE_PLUGIN_PRINTSKY 1 CACHE BOOL "Define wheter the PrintSky plugin should be created.")
9 SET(USE_PLUGIN_QUASARS 1 CACHE BOOL "Define whether the Quasars plugin should be created.")
10 SET(USE_PLUGIN_PULSARS 1 CACHE BOOL "Define whether the Pulsars plugin should be created.")
11
12
13=== modified file 'plugins/CMakeLists.txt'
14--- plugins/CMakeLists.txt 2012-01-24 15:14:41 +0000
15+++ plugins/CMakeLists.txt 2012-02-17 15:04:18 +0000
16@@ -53,4 +53,6 @@
17 SET(VIRGO_PROJECT_PATH "../extmodules/VirGO/" CACHE PATH "The location of the VirGO plugin main directory i.e. the one containing the top level CMakeLists.txt")
18 ADD_SUBDIRECTORY( ${VIRGO_PROJECT_PATH} VirGO )
19 ENDIF()
20-
21+IF (USE_PLUGIN_PRINTSKY)
22+ ADD_SUBDIRECTORY( PrintSky )
23+ENDIF()
24
25=== added directory 'plugins/PrintSky'
26=== added file 'plugins/PrintSky/CMakeLists.txt'
27--- plugins/PrintSky/CMakeLists.txt 1970-01-01 00:00:00 +0000
28+++ plugins/PrintSky/CMakeLists.txt 2012-02-17 15:04:18 +0000
29@@ -0,0 +1,11 @@
30+# This is the cmake config file for the PrintSky plugin
31+SET(PRINTSKY_VERSION "0.1.0")
32+
33+ADD_SUBDIRECTORY( src )
34+
35+IF(APPLE)
36+ SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/Library/Application\ Support/Stellarium)
37+ElSE(APPLE)
38+ SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/.stellarium)
39+ENDIF(APPLE)
40+INSTALL(FILES DESTINATION "modules/PrintSky")
41
42=== added directory 'plugins/PrintSky/src'
43=== added file 'plugins/PrintSky/src/CMakeLists.txt'
44--- plugins/PrintSky/src/CMakeLists.txt 1970-01-01 00:00:00 +0000
45+++ plugins/PrintSky/src/CMakeLists.txt 2012-02-17 15:04:18 +0000
46@@ -0,0 +1,69 @@
47+INCLUDE_DIRECTORIES(
48+ .
49+ gui
50+ ${CMAKE_BINARY_DIR}/plugins/PrintSky/src
51+)
52+LINK_DIRECTORIES(${BUILD_DIR}/src)
53+
54+SET(PrintSky_SRCS
55+ PrintSky.hpp
56+ PrintSky.cpp
57+ gui/PrintSkyDialog.hpp
58+ gui/PrintSkyDialog.cpp
59+ gui/StelDialogPrintSky.hpp
60+ gui/StelDialogPrintSky.cpp
61+ )
62+
63+################# compiles resources files ############
64+#SET(PrintSky_RES ../PrintSky.qrc)
65+#QT4_ADD_RESOURCES(PrintSky_RES_CXX ${PrintSky_RES})
66+
67+################# compiles .ui files ############
68+SET(PrintSky_UIS
69+ gui/printskyDialog.ui
70+)
71+QT4_WRAP_UI(PrintSky_UIS_H ${PrintSky_UIS})
72+
73+# Add here all the files which require moc compilation
74+# that is, all the headers with SIGNAL/SLOTS/PLUGIN_INTERFACE etc..
75+SET(PrintSky_MOC_HDRS
76+ PrintSky.hpp
77+ gui/PrintSkyDialog.hpp
78+ gui/StelDialogPrintSky.hpp
79+ )
80+
81+# After this call, PrintSky_MOC_SRCS = moc_PrintSky.cxx
82+QT4_WRAP_CPP(PrintSky_MOC_SRCS ${PrintSky_MOC_HDRS})
83+
84+SET(extLinkerOption ${QT_LIBRARIES} ${FreeType2_LIBRARIES} ${JPEG_LIBRARIES} ${PNG_LIBRARIES} ${OPENGL_LIBRARIES} ${ICONV_LIBRARIES} ${INTL_LIBRARIES})
85+
86+############### For building the dynamic library ######################
87+IF(BUILD_DYNAMIC_PLUGINS)
88+ ADD_LIBRARY(PrintSky MODULE ${PrintSky_SRCS} ${PrintSky_MOC_SRCS} ${PrintSky_UIS_H})
89+ IF(APPLE)
90+ FIND_LIBRARY(OPENGL_LIBRARY OpenGL)
91+ MARK_AS_ADVANCED(OPENGL_LIBRARY)
92+ SET_TARGET_PROPERTIES(PrintSky PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" SUFFIX ".dylib")
93+ ENDIF(APPLE)
94+
95+ IF(WIN32)
96+ SET_TARGET_PROPERTIES(PrintSky PROPERTIES LINK_FLAGS "-enable-runtime-pseudo-reloc -Wl,--allow-multiple-definition" )
97+ SET(StelMain stelMain)
98+ ELSE(WIN32)
99+ SET(StelMain )
100+ ENDIF(WIN32)
101+
102+ TARGET_LINK_LIBRARIES(PrintSky ${StelMain} ${extLinkerOption})
103+ INSTALL(TARGETS PrintSky DESTINATION "modules/${PACKAGE}")
104+ENDIF()
105+
106+############### For building the static library ######################
107+IF(BUILD_STATIC_PLUGINS)
108+ ADD_LIBRARY(PrintSky-static STATIC ${PrintSky_SRCS} ${PrintSky_MOC_SRCS} ${PrintSky_UIS_H})
109+ # The library target "PrintSky-static" has a default OUTPUT_NAME of "PrintSky-static", so change it.
110+ SET_TARGET_PROPERTIES(PrintSky-static PROPERTIES OUTPUT_NAME "PrintSky")
111+ TARGET_LINK_LIBRARIES(PrintSky-static ${extLinkerOption})
112+ SET_TARGET_PROPERTIES(PrintSky-static PROPERTIES COMPILE_FLAGS "-fPIC -DQT_STATICPLUGIN")
113+ ADD_DEPENDENCIES(AllStaticPlugins PrintSky-static)
114+ENDIF()
115+
116
117=== added file 'plugins/PrintSky/src/PrintSky.cpp'
118--- plugins/PrintSky/src/PrintSky.cpp 1970-01-01 00:00:00 +0000
119+++ plugins/PrintSky/src/PrintSky.cpp 2012-02-17 15:04:18 +0000
120@@ -0,0 +1,155 @@
121+/*
122+ * Copyright (C) 2010 Pep Pujols
123+ *
124+ * This program is free software; you can redistribute it and/or
125+ * modify it under the terms of the GNU General Public License
126+ * as published by the Free Software Foundation; either version 2
127+ * of the License, or (at your option) any later version.
128+ *
129+ * This program is distributed in the hope that it will be useful,
130+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
131+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
132+ * GNU General Public License for more details.
133+ *
134+ * You should have received a copy of the GNU General Public License
135+ * along with this program; if not, write to the Free Software
136+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
137+ */
138+
139+#include <QDebug>
140+#include <QKeyEvent>
141+#include "StelProjector.hpp"
142+#include "StelPainter.hpp"
143+#include "StelApp.hpp"
144+#include "StelCore.hpp"
145+#include "StelFileMgr.hpp"
146+#include "StelLocaleMgr.hpp"
147+#include "StelModuleMgr.hpp"
148+#include "StelGui.hpp"
149+#include "StelGuiItems.hpp"
150+#include "StelIniParser.hpp"
151+#include "StelVertexArray.hpp"
152+#include "PrintSky.hpp"
153+#include <QAction>
154+#include "StelMainGraphicsView.hpp"
155+#include <QGLWidget>
156+
157+//! This method is the one called automatically by the StelModuleMgr just
158+//! after loading the dynamic library
159+StelModule* PrintSkyStelPluginInterface::getStelModule() const
160+{
161+ return new PrintSky();
162+}
163+
164+StelPluginInfo PrintSkyStelPluginInterface::getPluginInfo() const
165+{
166+ StelPluginInfo info;
167+ info.id = "PrintSky";
168+ info.displayedName = N_("Print Sky");
169+ info.authors = "Pep Pujols";
170+ info.contact = "maslarocaxica@gmail.com";
171+ info.description = N_("Provides a system printing sky");
172+ return info;
173+}
174+
175+Q_EXPORT_PLUGIN2(PrintSky, PrintSkyStelPluginInterface)
176+
177+PrintSky::PrintSky()
178+{
179+ setObjectName("PrintSky");
180+ useInvertColors=scaleToFit=false;
181+ printData=true;
182+}
183+
184+PrintSky::~PrintSky()
185+{
186+ delete printskyDialog;
187+ printskyDialog = NULL;
188+}
189+
190+void PrintSky::init()
191+{
192+ printskyDialog = new PrintSkyDialog();
193+
194+ // create action for enable/disable & hook up signals
195+ StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
196+ Q_ASSERT(gui);
197+
198+ gui->addGuiActions("actionInit_Printing_Sky", N_("Printing Sky"), "Ctrl+P", N_("Plugin Key Bindings"), true, false);
199+ gui->getGuiActions("actionInit_Printing_Sky")->setChecked(true);
200+ connect(gui->getGuiActions("actionInit_Printing_Sky"), SIGNAL(triggered()), this, SLOT(initPrintingSky()));
201+
202+ try
203+ {
204+ //Make sure that "/modules/PrintSky" exists
205+ StelFileMgr::makeSureDirExistsAndIsWritable(StelFileMgr::getUserDir() + "/modules/PrintSky/");
206+
207+ StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable);
208+ QString printskyIniPath = StelFileMgr::findFile("modules/PrintSky/", flags) + "printsky.ini";
209+
210+ QSettings settings(printskyIniPath, QSettings::IniFormat);
211+ useInvertColors = settings.value("use_invert_colors", 0.0).toBool();
212+ scaleToFit=settings.value("use_scale_to_fit", true).toBool();
213+ orientation=settings.value("orientation", "Portrait").toString();
214+ printData=settings.value("print_data", true).toBool();
215+ printSSEphemerides=settings.value("print_SS_ephemerides", true).toBool();
216+ }
217+ catch (std::runtime_error& e)
218+ {
219+ qWarning() << "WARNING: unable to locate printsky.ini file or create a default one for PrintSky plugin: " << e.what();
220+ }
221+}
222+
223+void PrintSky::update(double deltaTime)
224+{
225+}
226+
227+//! Draw any parts on the screen which are for our module
228+void PrintSky::draw(StelCore* core)
229+{
230+}
231+
232+//! Determine which "layer" the plagin's drawing will happen on.
233+double PrintSky::getCallOrder(StelModuleActionName actionName) const
234+{
235+ return 0;
236+}
237+
238+void PrintSky::handleKeys(QKeyEvent* event)
239+{
240+ event->setAccepted(false);
241+}
242+
243+void PrintSky::handleMouseClicks(class QMouseEvent* event)
244+{
245+ event->setAccepted(false);
246+
247+}
248+
249+bool PrintSky::handleMouseMoves(int x, int y, Qt::MouseButtons b)
250+{
251+ return false;
252+}
253+
254+//! Show dialog printing enabling preview and print buttons
255+void PrintSky::initPrintingSky()
256+{
257+ printskyDialog->setVisible(true);
258+ printskyDialog->enableOutputOptions(true);
259+}
260+
261+void PrintSky::setStelStyle(const QString& section)
262+{
263+ printskyDialog->updateStyle();
264+}
265+
266+bool PrintSky::configureGui(bool show)
267+{
268+ if (show)
269+ {
270+ printskyDialog->setVisible(true);
271+ printskyDialog->enableOutputOptions(false);
272+ }
273+
274+ return true;
275+}
276
277=== added file 'plugins/PrintSky/src/PrintSky.hpp'
278--- plugins/PrintSky/src/PrintSky.hpp 1970-01-01 00:00:00 +0000
279+++ plugins/PrintSky/src/PrintSky.hpp 2012-02-17 15:04:18 +0000
280@@ -0,0 +1,79 @@
281+/*
282+ * Copyright (C) 2010 Pep Pujols
283+ *
284+ * This program is free software; you can redistribute it and/or
285+ * modify it under the terms of the GNU General Public License
286+ * as published by the Free Software Foundation; either version 2
287+ * of the License, or (at your option) any later version.
288+ *
289+ * This program is distributed in the hope that it will be useful,
290+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
291+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
292+ * GNU General Public License for more details.
293+ *
294+ * You should have received a copy of the GNU General Public License
295+ * along with this program; if not, write to the Free Software
296+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
297+ */
298+
299+#ifndef PrintSky_H
300+#define PrintSky_H
301+
302+#include "StelModule.hpp"
303+#include <QPrinter>
304+#include <QPrintPreviewWidget>
305+#include <QPrintPreviewDialog>
306+#include "StelStyle.hpp"
307+#include "PrintSkyDialog.hpp"
308+
309+//class PrintSky
310+class PrintSky : public StelModule
311+{
312+ Q_OBJECT
313+public:
314+ PrintSky();
315+ virtual ~PrintSky();
316+
317+
318+ ///////////////////////////////////////////////////////////////////////////
319+ // Methods defined in the StelModule class
320+ virtual void init();
321+ virtual bool configureGui(bool show=true);
322+ virtual void update(double deltaTime);
323+ virtual void draw(StelCore* core);
324+ virtual double getCallOrder(StelModuleActionName actionName) const;
325+ virtual void handleKeys(class QKeyEvent* event);
326+ virtual void handleMouseClicks(class QMouseEvent* event);
327+ virtual bool handleMouseMoves(int x, int y, Qt::MouseButtons b);
328+ virtual void setStelStyle(const QString& style);
329+
330+public slots:
331+
332+ //! Show dialog printing enabling preview and print buttons
333+ void initPrintingSky();
334+
335+private slots:
336+
337+private:
338+ //Printing options
339+ bool useInvertColors, scaleToFit, printData, printSSEphemerides;
340+ QString orientation;
341+
342+ PrintSkyDialog *printskyDialog;
343+};
344+
345+#include "fixx11h.h"
346+#include <QObject>
347+#include "StelPluginInterface.hpp"
348+
349+//! This class is used by Qt to manage a plug-in interface
350+class PrintSkyStelPluginInterface : public QObject, public StelPluginInterface
351+{
352+ Q_OBJECT
353+ Q_INTERFACES(StelPluginInterface)
354+public:
355+ virtual StelModule* getStelModule() const;
356+ virtual StelPluginInfo getPluginInfo() const;
357+ };
358+
359+#endif // PrintSky_H
360
361=== added directory 'plugins/PrintSky/src/gui'
362=== added file 'plugins/PrintSky/src/gui/PrintSkyDialog.cpp'
363--- plugins/PrintSky/src/gui/PrintSkyDialog.cpp 1970-01-01 00:00:00 +0000
364+++ plugins/PrintSky/src/gui/PrintSkyDialog.cpp 2012-02-17 15:04:18 +0000
365@@ -0,0 +1,611 @@
366+/*
367+ * Copyright (C) 2010 Pep Pujols
368+ *
369+ * This program is free software; you can redistribute it and/or
370+ * modify it under the terms of the GNU General Public License
371+ * as published by the Free Software Foundation; either version 2
372+ * of the License, or (at your option) any later version.
373+ *
374+ * This program is distributed in the hope that it will be useful,
375+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
376+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
377+ * GNU General Public License for more details.
378+ *
379+ * You should have received a copy of the GNU General Public License
380+ * along with this program; if not, write to the Free Software
381+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
382+ */
383+
384+#include "PrintSkyDialog.hpp"
385+#include "ui_printskyDialog.h"
386+#include "PrintSky.hpp"
387+#include <QAction>
388+#include <QGLWidget>
389+#include <QPrintDialog>
390+#include <QTimer>
391+#include <QGraphicsWidget>
392+
393+#include "StelApp.hpp"
394+#include "StelGui.hpp"
395+#include "StelFileMgr.hpp"
396+#include "StelModuleMgr.hpp"
397+#include "StelMainGraphicsView.hpp"
398+#include "StelTranslator.hpp"
399+#include "StelCore.hpp"
400+#include "StelLocaleMgr.hpp"
401+#include "StelMovementMgr.hpp"
402+#include "StelSkyDrawer.hpp"
403+#include "StarMgr.hpp"
404+#include "SolarSystem.hpp"
405+#include "Planet.hpp"
406+
407+#include <QDataWidgetMapper>
408+#include <QDebug>
409+#include <QFrame>
410+#include <QSettings>
411+
412+
413+PrintSkyDialog::PrintSkyDialog()
414+{
415+ ui = new Ui_printskyDialogForm;
416+}
417+
418+PrintSkyDialog::~PrintSkyDialog()
419+{
420+ //These exist only if the window has been shown once:
421+ if (dialog)
422+ {
423+ }
424+
425+ delete ui;
426+ ui = NULL;
427+
428+}
429+
430+/* ********************************************************************* */
431+void PrintSkyDialog::languageChanged()
432+{
433+ if (dialog) {
434+ ui->retranslateUi(dialog);
435+ }
436+}
437+
438+void PrintSkyDialog::updateStyle()
439+{
440+ if(dialog) {
441+ gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
442+ Q_ASSERT(gui);
443+ QString style(gui->getStelStyle().htmlStyleSheet);
444+ dialog->setStyleSheet(style);
445+ }
446+}
447+
448+void PrintSkyDialog::styleChanged()
449+{
450+ // Nothing for now
451+}
452+
453+/* ********************************************************************* */
454+void PrintSkyDialog::closeWindow()
455+{
456+ setVisible(false);
457+ StelMainGraphicsView::getInstance().scene()->setActiveWindow(0);
458+}
459+
460+
461+/* ********************************************************************* */
462+void PrintSkyDialog::invertColorsStateChanged(int state)
463+{
464+ bool shouldInvert = (state == Qt::Checked);
465+
466+ try
467+ {
468+ StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable);
469+ QString printskyIniPath = StelFileMgr::findFile("modules/PrintSky/", flags) + "printsky.ini";
470+ QSettings settings(printskyIniPath, QSettings::IniFormat);
471+ bool useInvertColors = settings.value("use_invert_colors", 0.0).toBool();
472+ if (state != useInvertColors)
473+ {
474+ settings.setValue("use_invert_colors", shouldInvert);
475+ emit(invertColorsChanged(shouldInvert));
476+ }
477+ }
478+ catch (std::runtime_error& e)
479+ {
480+ qWarning() << "WARNING: unable to locate printsky.ini file or create a default one for PrintSky plugin: " << e.what();
481+ }
482+
483+}
484+
485+/* ********************************************************************* */
486+void PrintSkyDialog::scaleToFitStateChanged(int state)
487+{
488+ bool shouldScale = (state == Qt::Checked);
489+
490+ try
491+ {
492+ StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable);
493+ QString printskyIniPath = StelFileMgr::findFile("modules/PrintSky/", flags) + "printsky.ini";
494+ QSettings settings(printskyIniPath, QSettings::IniFormat);
495+ bool useScaleToFit = settings.value("use_scale_to_fit", 0.0).toBool();
496+ if (state != useScaleToFit)
497+ {
498+ settings.setValue("use_scale_to_fit", shouldScale);
499+ emit(scaleToFitChanged(shouldScale));
500+ }
501+ }
502+ catch (std::runtime_error& e)
503+ {
504+ qWarning() << "WARNING: unable to locate printsky.ini file or create a default one for PrintSky plugin: " << e.what();
505+ }
506+
507+}
508+
509+/* ********************************************************************* */
510+void PrintSkyDialog::orientationStateChanged(bool state)
511+{
512+ QString newOrientation=(ui->orientationPortraitRadioButton->isChecked()? "Portrait": "Landscape");
513+
514+ try
515+ {
516+ StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable);
517+ QString printskyIniPath = StelFileMgr::findFile("modules/PrintSky/", flags) + "printsky.ini";
518+ QSettings settings(printskyIniPath, QSettings::IniFormat);
519+ QString currentOrientation = settings.value("orientation", "Portrait").toString();
520+ if (newOrientation != currentOrientation)
521+ {
522+ settings.setValue("orientation", newOrientation);
523+ emit(orientationChanged(true));
524+ }
525+ }
526+ catch (std::runtime_error& e)
527+ {
528+ qWarning() << "WARNING: unable to locate printsky.ini file or create a default one for PrintSky plugin: " << e.what();
529+ }
530+
531+}
532+
533+/* ********************************************************************* */
534+void PrintSkyDialog::printDataStateChanged(int state)
535+{
536+ bool shouldPrint = (state == Qt::Checked);
537+
538+ try
539+ {
540+ StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable);
541+ QString printskyIniPath = StelFileMgr::findFile("modules/PrintSky/", flags) + "printsky.ini";
542+ QSettings settings(printskyIniPath, QSettings::IniFormat);
543+ bool printData = settings.value("print_data", 0.0).toBool();
544+ if (state != printData)
545+ {
546+ settings.setValue("print_data", shouldPrint);
547+ emit(printDataChanged(shouldPrint));
548+ }
549+ }
550+ catch (std::runtime_error& e)
551+ {
552+ qWarning() << "WARNING: unable to locate printsky.ini file or create a default one for PrintSky plugin: " << e.what();
553+ }
554+
555+}
556+
557+/* ********************************************************************* */
558+void PrintSkyDialog::printSSEphemeridesStateChanged(int state)
559+{
560+ bool shouldPrint = (state == Qt::Checked);
561+
562+ try
563+ {
564+ StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable);
565+ QString printskyIniPath = StelFileMgr::findFile("modules/PrintSky/", flags) + "printsky.ini";
566+ QSettings settings(printskyIniPath, QSettings::IniFormat);
567+ bool printSSEphemerides = settings.value("print_SS_ephemerides", 0.0).toBool();
568+ if (state != printSSEphemerides)
569+ {
570+ settings.setValue("print_SS_ephemerides", shouldPrint);
571+ emit(printSSEphemeridesChanged(shouldPrint));
572+ }
573+ }
574+ catch (std::runtime_error& e)
575+ {
576+ qWarning() << "WARNING: unable to locate printsky.ini file or create a default one for PrintSky plugin: " << e.what();
577+ }
578+
579+}
580+
581+
582+/* ********************************************************************* */
583+void PrintSkyDialog::createDialogContent()
584+{
585+
586+ ui->setupUi(dialog);
587+
588+ //Now the rest of the actions.
589+ connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
590+ connect(ui->invertColorsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(invertColorsStateChanged(int)));
591+ connect(ui->scaleToFitCheckBox, SIGNAL(stateChanged(int)), this, SLOT(scaleToFitStateChanged(int)));
592+ connect(ui->previewSkyPushButton, SIGNAL(clicked()), this, SLOT(previewSky()));
593+ connect(ui->printSkyPushButton, SIGNAL(clicked()), this, SLOT(printSky()));
594+ connect(ui->orientationPortraitRadioButton, SIGNAL(toggled(bool)), this, SLOT(orientationStateChanged(bool)));
595+ connect(ui->printDataCheckBox, SIGNAL(stateChanged(int)), this, SLOT(printDataStateChanged(int)));
596+ connect(ui->printSSEphemeridesCheckBox, SIGNAL(stateChanged(int)), this, SLOT(printSSEphemeridesStateChanged(int)));
597+
598+ // set the initial state
599+ try
600+ {
601+ StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable);
602+ QString printskyIniPath = StelFileMgr::findFile("modules/PrintSky/", flags) + "printsky.ini";
603+ QSettings settings(printskyIniPath, QSettings::IniFormat);
604+ bool useInvertColors = settings.value("use_invert_colors", false).toBool();
605+ if (useInvertColors)
606+ {
607+ ui->invertColorsCheckBox->setCheckState(Qt::Checked);
608+ }
609+ bool useScaleToFit = settings.value("use_scale_to_fit", true).toBool();
610+ if (useScaleToFit)
611+ {
612+ ui->scaleToFitCheckBox->setCheckState(Qt::Checked);
613+ }
614+ QString orientation=settings.value("orientation", "Portrait").toString();
615+ if (orientation=="Portrait")
616+ ui->orientationPortraitRadioButton->setChecked(true);
617+ if (orientation=="Landscape")
618+ ui->orientationLandscapeRadioButton->setChecked(true);
619+ bool printData = settings.value("print_data", true).toBool();
620+ if (printData)
621+ {
622+ ui->printDataCheckBox->setCheckState(Qt::Checked);
623+ }
624+ bool printSSEphemerides = settings.value("print_SS_ephemerides", true).toBool();
625+ if (printSSEphemerides)
626+ {
627+ ui->printSSEphemeridesCheckBox->setCheckState(Qt::Checked);
628+ }
629+
630+ }
631+ catch (std::runtime_error& e)
632+ {
633+ qWarning() << "WARNING: unable to locate printsky.ini file or create a default one for PrintSky plugin: " << e.what();
634+ }
635+
636+
637+ //Initialize the style
638+ updateStyle();
639+}
640+
641+//! Print report on a preview window
642+void PrintSkyDialog::previewSky()
643+{
644+ currentVisibilityGui = gui->getVisible();
645+ gui->setVisible(false);
646+ dialog->setVisible(false);
647+
648+ outputOption = true;
649+
650+ QTimer::singleShot(50, this, SLOT(executePrinterOutputOption()));
651+}
652+
653+//! Draw contents report
654+void PrintSkyDialog::printDataSky(QPrinter * printer)
655+{
656+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
657+
658+ QPainter painter(printer);
659+
660+ QGLWidget* glQGLWidget=(QGLWidget *) StelMainGraphicsView::getInstance().getStelQGLWidget();
661+ Q_ASSERT(glQGLWidget);
662+
663+
664+ QImage img=glQGLWidget->grabFrameBuffer();
665+
666+ int imageYPos=(printDataOption? 400: 0);
667+
668+ QSize sizeReal=printer->pageRect().size();
669+ sizeReal.setHeight(sizeReal.height()-imageYPos);
670+
671+ if (scaleToFitOption)
672+ img=img.scaled(sizeReal, Qt::KeepAspectRatio, Qt::SmoothTransformation);
673+
674+ if (invertColorsOption)
675+ img.invertPixels();
676+
677+ int imageXPos=(printer->pageRect().width()-img.width())/2;
678+
679+ painter.drawImage(imageXPos, 0, img);
680+
681+ StelCore* core = StelApp::getInstance().getCore();
682+ StelLocation locationData=core->getCurrentLocation();
683+ double jd = core->getJDay();
684+
685+ int fontsize = (int)printer->pageRect().width()/60;
686+ font.setPixelSize(fontsize);
687+ painter.setFont(font);
688+ int lineSpacing=fontsize+5;
689+
690+ //qDebug() << "PrintSky: printer debugging information:";
691+ //qDebug() << "Current printer resolution:" << printer->resolution();
692+ //qDebug() << "Supported printer resolutions:" << printer->supportedResolutions();
693+ //qDebug() << "Page size (size index, 0-30)" << printer->paperSize();
694+ //For the paper size index, see http://doc.qt.nokia.com/qprinter.html#PaperSize-enum
695+ //qDebug() << "Pixel Size:" << font.pixelSize();
696+ //qDebug() << "Paper Rect: "<< printer->paperRect();
697+ //qDebug() << "Page Rect: "<< printer->pageRect();
698+
699+ if (printDataOption)
700+ {
701+ int posY=img.height()+lineSpacing;
702+
703+ QRect surfaceData(printer->pageRect().left(), posY, printer->pageRect().width(), printer->pageRect().height()-posY);
704+
705+ painter.drawText(surfaceData.adjusted(0, 0, 0, -(surfaceData.height()-lineSpacing)), Qt::AlignCenter, q_("CHART INFORMATION"));
706+
707+ QString printLatitude=StelUtils::radToDmsStr((std::fabs(locationData.latitude)/180.)*M_PI);
708+ QString printLongitude=StelUtils::radToDmsStr((std::fabs(locationData.longitude)/180.)*M_PI);
709+
710+ QString location = QString("%1: %2,\t%3,\t%4;\t%5\t%6\t%7%8")
711+ .arg(q_("Location"))
712+ .arg(locationData.name)
713+ .arg(q_(locationData.country))
714+ .arg(q_(locationData.planetName))
715+ .arg(locationData.latitude<0 ? QString("%1S").arg(printLatitude) : QString("%1N").arg(printLatitude))
716+ .arg(locationData.longitude<0 ? QString("%1W").arg(printLongitude) : QString("%1E").arg(printLongitude))
717+ .arg(locationData.altitude)
718+ .arg(q_("m"));
719+ painter.drawText(surfaceData.adjusted(50, lineSpacing, 0, 0), Qt::AlignLeft, location);
720+
721+ StelLocaleMgr lmgr = StelApp::getInstance().getLocaleMgr();
722+ QString datetime = QString("%1: %2 %3 (UTC%4%5)")
723+ .arg(q_("Local time"))
724+ .arg(lmgr.getPrintableDateLocal(jd))
725+ .arg(lmgr.getPrintableTimeLocal(jd))
726+ .arg(lmgr.getGMTShift(jd)>=0? '+':'-')
727+ .arg(lmgr.getGMTShift(jd));
728+
729+ painter.drawText(surfaceData.adjusted(50, (lineSpacing)*2, 0, 0), Qt::AlignLeft, datetime);
730+
731+ QString str;
732+ QTextStream wos(&str);
733+ wos << q_("FOV: ") << qSetRealNumberPrecision(3) << core->getMovementMgr()->getCurrentFov() << QChar(0x00B0);
734+ painter.drawText(surfaceData.adjusted(50, (lineSpacing)*3, 0, 0), Qt::AlignLeft, *wos.string());
735+
736+ painter.drawText(surfaceData.adjusted(surfaceData.width()-(15*fontsize), 0, 0, 0), Qt::AlignLeft, q_("Magnitude"));
737+
738+ QList< QPair<float,float> > listPairsMagnitudesRadius=getListMagnitudeRadius(core);
739+
740+ int xPos=-(12*fontsize), yPos=lineSpacing+10;
741+ for (int icount=1; icount<=listPairsMagnitudesRadius.count(); ++icount)
742+ {
743+ painter.drawText(surfaceData.adjusted(surfaceData.width()+xPos, yPos, 0, 0), Qt::AlignLeft, QString("%1").arg(listPairsMagnitudesRadius.at(icount-1).first));
744+ painter.setBrush(Qt::SolidPattern);
745+ painter.drawEllipse(QPoint(surfaceData.left() + surfaceData.width() + xPos - 40, surfaceData.top() + yPos + (fontsize/2)),
746+ (int) std::ceil(listPairsMagnitudesRadius.at(icount - 1).second),
747+ (int) std::ceil(listPairsMagnitudesRadius.at(icount - 1).second));
748+ yPos+=lineSpacing;
749+ if (yPos+lineSpacing>=surfaceData.height())
750+ {
751+ xPos+=200;
752+ yPos=lineSpacing+10;
753+ }
754+ }
755+ }
756+
757+ // Print solar system ephemerides
758+ if (printSSEphemeridesOption)
759+ {
760+
761+ SolarSystem* ssmgr = GETSTELMODULE(SolarSystem);
762+
763+ double geographicLongitude=-locationData.longitude*M_PI/180.;
764+ double geographicLatitude=locationData.latitude*M_PI/180.;
765+
766+ PlanetP pHome=ssmgr->searchByEnglishName(locationData.planetName);
767+ double standardSideralTime=pHome->getSiderealTime(((int) jd)+0.5)*M_PI/180.;
768+
769+ QStringList allBodiesNames=ssmgr->getAllPlanetEnglishNames();
770+ allBodiesNames.sort();
771+ bool doHeader=true;
772+ int yPos;
773+ bool oddLine=false;
774+ for (int iBodyName=1; iBodyName<=allBodiesNames.count(); ++iBodyName)
775+ {
776+ QString englishName=allBodiesNames.at(iBodyName-1);
777+ PlanetP p=ssmgr->searchByEnglishName(englishName);
778+ double dec, ra;
779+ StelUtils::rectToSphe(&ra,&dec, p->getEquinoxEquatorialPos(core));
780+ double standardAltitude=-0.5667;
781+ if (englishName=="Sun")
782+ standardAltitude=-0.8333;
783+ if (englishName=="Moon")
784+ standardAltitude=0.125;
785+ standardAltitude*=M_PI/180.;
786+
787+ double cosH=(std::sin(standardAltitude)-(std::sin(geographicLatitude)*std::sin(dec)))/(std::cos(geographicLatitude)*std::cos(dec));
788+
789+ if (englishName!=locationData.planetName && cosH>=-1. && cosH<=1.)
790+ {
791+
792+ if (doHeader)
793+ {
794+
795+ yPos=50;
796+ printer->newPage();
797+ painter.drawText(0, 0, printer->paperRect().width(), yPos, Qt::AlignCenter, q_("SOLAR SYSTEM EPHEMERIDES"));
798+
799+ int ratioWidth=300.*(double) fontsize/45.;
800+ int xPos=printer->pageRect().left()-ratioWidth;;
801+ yPos+=(lineSpacing)*2;
802+
803+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, q_("Name"));
804+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, q_("RA"));
805+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, q_("Dec"));
806+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, q_("Rising"));
807+ painter.drawText(QRect(xPos, yPos-fontsize-lineSpacing/4, ratioWidth*3, fontsize), Qt::AlignCenter, q_("Local Time"));
808+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, q_("Transit"));
809+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, q_("Setting"));
810+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, q_("Dist.(AU)"));
811+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, q_("Ap.Mag."));
812+ yPos+=(lineSpacing)*1.25;
813+ doHeader=false;
814+ }
815+
816+
817+ double angleH=std::acos(cosH);
818+ double transit=((ra+geographicLongitude-standardSideralTime)/(2*M_PI));
819+ if (transit>1.)
820+ transit-=1.;
821+ if (transit<0)
822+ transit+=1.;
823+
824+ double rising=transit-angleH/(2*M_PI);
825+ if (rising>1.)
826+ rising-=1.;
827+ if (rising<0.)
828+ rising+=1.;
829+
830+ double setting=transit+angleH/(2*M_PI);
831+ if (setting>1.)
832+ setting-=1.;
833+ if (setting<0.)
834+ setting+=1.;
835+
836+ int shift=StelApp::getInstance().getLocaleMgr().getGMTShift(jd);
837+
838+ int ratioWidth=300.*(double) fontsize/45.;
839+ int xPos=printer->pageRect().left()-ratioWidth;
840+
841+ oddLine=!oddLine;
842+
843+
844+ painter.setPen(Qt::NoPen);
845+ painter.setBrush(oddLine? Qt::white: Qt::lightGray);
846+ painter.drawRect(QRect(xPos+ratioWidth, yPos, ratioWidth*8, fontsize+lineSpacing));
847+ painter.setPen(Qt::SolidLine);
848+
849+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignLeft, QString(" %1").arg(q_(englishName)));
850+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignRight, QString("%1").arg(StelUtils::radToHmsStr(ra)));
851+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignRight, QString("%1").arg(StelUtils::radToDmsStr(dec)));
852+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, QString("%1").arg(printableTime(rising, shift)));
853+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, QString("%1").arg(printableTime(transit, shift)));
854+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignCenter, QString("%1").arg(printableTime(setting, shift)));
855+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignRight, QString("%1").arg(p->getDistance(), 0, 'f', 5));
856+ painter.drawText(QRect(xPos+=ratioWidth, yPos, ratioWidth, fontsize), Qt::AlignRight, QString("%1 ").arg(p->getVMagnitude(core), 0, 'f', 3));
857+
858+ yPos+=lineSpacing;
859+ if (yPos+((lineSpacing)*3)>=printer->pageRect().top()+printer->pageRect().height())
860+ doHeader=true;
861+ }
862+ }
863+ }
864+ QApplication::restoreOverrideCursor();
865+}
866+
867+//! Print report direct to printer
868+void PrintSkyDialog::printSky()
869+{
870+ currentVisibilityGui=gui->getVisible();
871+ gui->setVisible(false);
872+ dialog->setVisible(false);
873+
874+ outputOption=false;
875+
876+ QTimer::singleShot(50, this, SLOT(executePrinterOutputOption()));
877+
878+}
879+
880+//! Read the printer parameters and run the output option selected (Print/Preview)
881+void PrintSkyDialog::executePrinterOutputOption()
882+{
883+ //Options for printing image.
884+ invertColorsOption=false;
885+ scaleToFitOption=true;
886+ orientationOption="Portrait";
887+ printDataOption=true;
888+ printSSEphemeridesOption=true;
889+
890+ try
891+ {
892+ StelFileMgr::Flags flags = (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable);
893+ QString printskyIniPath = StelFileMgr::findFile("modules/PrintSky/", flags) + "printsky.ini";
894+ QSettings settings(printskyIniPath, QSettings::IniFormat);
895+ invertColorsOption=settings.value("use_invert_colors", false).toBool();
896+ scaleToFitOption=settings.value("use_scale_to_fit", true).toBool();
897+ orientationOption=settings.value("orientation", "Portrait").toString();
898+ printDataOption=settings.value("print_data", true).toBool();
899+ printSSEphemeridesOption=settings.value("print_SS_ephemerides", true).toBool();
900+ }
901+ catch (std::runtime_error& e)
902+ {
903+ qWarning() << "WARNING: unable to locate printsky.ini file or create a default one for PrintSky plugin: " << e.what();
904+ }
905+
906+
907+ //QPrinter printer(QPrinter::HighResolution);
908+ QPrinter printer(QPrinter::ScreenResolution);
909+ printer.setResolution(300);
910+ printer.setDocName("STELLARIUM REPORT");
911+ printer.setOrientation((orientationOption=="Portrait"? QPrinter::Portrait: QPrinter::Landscape));
912+
913+ if (outputOption)
914+ {
915+ //QPrintPreviewDialog oPrintPreviewDialog(&printer, &StelMainGraphicsView::getInstance());
916+ QPrintPreviewDialog oPrintPreviewDialog(&printer);
917+ connect(&oPrintPreviewDialog, SIGNAL(paintRequested(QPrinter *)), this, SLOT(printDataSky(QPrinter *)));
918+ oPrintPreviewDialog.exec();
919+ }
920+ else
921+ {
922+ //QPrintDialog dialogPrinter(&printer, &StelMainGraphicsView::getInstance());
923+ QPrintDialog dialogPrinter(&printer);
924+ if (dialogPrinter.exec() == QDialog::Accepted)
925+ printDataSky(&printer);
926+ }
927+
928+ gui->setVisible(currentVisibilityGui);
929+ ((QGraphicsWidget*)StelMainGraphicsView::getInstance().getStelAppGraphicsWidget())->setFocus(Qt::OtherFocusReason);
930+}
931+
932+
933+
934+void PrintSkyDialog::enableOutputOptions(bool enable)
935+{
936+ ui->buttonsFrame->setVisible(enable);
937+}
938+
939+
940+QString PrintSkyDialog::printableTime(double time, int shift)
941+{
942+ time*=24.;
943+ time+=shift;
944+ if (time>=24.)
945+ time-=24.;
946+ if (time<0)
947+ time+=24.;
948+ int hour=(int) time;
949+ time-=hour;
950+ time*=60;
951+ int minute=(int) time;
952+ return(QString("%1:%2").arg(hour, 2, 10, QChar('0')).arg(minute, 2, 10, QChar('0')));
953+}
954+
955+//! Get relations between magnitude stars and draw radius
956+QList< QPair<float, float> > PrintSkyDialog::getListMagnitudeRadius(StelCore *core)
957+{
958+ QList< QPair<float, float> > listPairsMagnitudesRadius;
959+ StelSkyDrawer* skyDrawer = core->getSkyDrawer();
960+
961+
962+ float rcmag_table[1];
963+ for (int mag=-30; mag<100; ++mag)
964+ {
965+ skyDrawer->computeRCMag(mag,rcmag_table);
966+ if (rcmag_table[0]>0. && rcmag_table[0]<13.)
967+ {
968+ QPair<float, float> pairMagnitudeRadius;
969+ pairMagnitudeRadius.first=mag;
970+ pairMagnitudeRadius.second=rcmag_table[0];
971+ listPairsMagnitudesRadius << pairMagnitudeRadius;
972+ }
973+ }
974+
975+ return(listPairsMagnitudesRadius);
976+}
977
978=== added file 'plugins/PrintSky/src/gui/PrintSkyDialog.hpp'
979--- plugins/PrintSky/src/gui/PrintSkyDialog.hpp 1970-01-01 00:00:00 +0000
980+++ plugins/PrintSky/src/gui/PrintSkyDialog.hpp 2012-02-17 15:04:18 +0000
981@@ -0,0 +1,98 @@
982+/*
983+ * Copyright (C) 2010 Pep Pujols
984+ *
985+ * This program is free software; you can redistribute it and/or
986+ * modify it under the terms of the GNU General Public License
987+ * as published by the Free Software Foundation; either version 2
988+ * of the License, or (at your option) any later version.
989+ *
990+ * This program is distributed in the hope that it will be useful,
991+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
992+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
993+ * GNU General Public License for more details.
994+ *
995+ * You should have received a copy of the GNU General Public License
996+ * along with this program; if not, write to the Free Software
997+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
998+ */
999+
1000+#ifndef _PRINTSKYDIALOG_HPP_
1001+#define _PRINTSKYDIALOG_HPP_
1002+
1003+#include <QObject>
1004+#include "StelDialogPrintSky.hpp"
1005+#include "StelStyle.hpp"
1006+#include <QPrinter>
1007+#include <QPrintPreviewWidget>
1008+#include <QPrintPreviewDialog>
1009+#include "StelGui.hpp"
1010+
1011+class Ui_printskyDialogForm;
1012+
1013+
1014+class PrintSkyDialog : public StelDialogPrintSky
1015+{
1016+ Q_OBJECT
1017+
1018+public:
1019+ PrintSkyDialog();
1020+ virtual ~PrintSkyDialog();
1021+ void languageChanged();
1022+ void updateStyle();
1023+
1024+ //! Notify that the application style changed
1025+ void styleChanged();
1026+ void enableOutputOptions(bool enable);
1027+
1028+public slots:
1029+ void closeWindow();
1030+
1031+ //! Print report on a preview window
1032+ void previewSky();
1033+ //! Read the printer parameters and run the output option selected (Print/Preview)
1034+ void executePrinterOutputOption();
1035+ //! Print report direct to printer
1036+ void printSky();
1037+
1038+signals:
1039+ void invertColorsChanged(bool state);
1040+ void scaleToFitChanged(bool state);
1041+ void orientationChanged(bool state);
1042+ void printDataChanged(bool state);
1043+ void printSSEphemeridesChanged(bool state);
1044+
1045+protected:
1046+ //! Initialize the dialog widgets and connect the signals/slots
1047+ virtual void createDialogContent();
1048+ Ui_printskyDialogForm* ui;
1049+
1050+private slots:
1051+ void invertColorsStateChanged(int state);
1052+ //! Draw contents report
1053+ //! @param printer the paint device to paint on a print
1054+ void printDataSky(QPrinter * printer);
1055+ void scaleToFitStateChanged(int state);
1056+ void orientationStateChanged(bool state);
1057+ void printDataStateChanged(int state);
1058+ void printSSEphemeridesStateChanged(int state);
1059+
1060+private:
1061+ QFont font;
1062+ //Gui
1063+ StelGui* gui;
1064+ bool currentVisibilityGui;
1065+
1066+ //! Printing options
1067+ bool outputOption;
1068+ bool invertColorsOption;
1069+ bool scaleToFitOption;
1070+ QString orientationOption;
1071+ bool printDataOption;
1072+ bool printSSEphemeridesOption;
1073+ QString printableTime(double time, int shift);
1074+ QList< QPair<float, float> > getListMagnitudeRadius(StelCore *core);
1075+
1076+
1077+};
1078+
1079+#endif // _OCULARDIALOG_HPP_
1080
1081=== added file 'plugins/PrintSky/src/gui/StelDialogPrintSky.cpp'
1082--- plugins/PrintSky/src/gui/StelDialogPrintSky.cpp 1970-01-01 00:00:00 +0000
1083+++ plugins/PrintSky/src/gui/StelDialogPrintSky.cpp 2012-02-17 15:04:18 +0000
1084@@ -0,0 +1,134 @@
1085+/*
1086+ * Stellarium
1087+ * Copyright (C) 2008 Fabien Chereau
1088+ *
1089+ * This program is free software; you can redistribute it and/or
1090+ * modify it under the terms of the GNU General Public License
1091+ * as published by the Free Software Foundation; either version 2
1092+ * of the License, or (at your option) any later version.
1093+ *
1094+ * This program is distributed in the hope that it will be useful,
1095+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1096+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1097+ * GNU General Public License for more details.
1098+ *
1099+ * You should have received a copy of the GNU General Public License
1100+ * along with this program; if not, write to the Free Software
1101+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1102+*/
1103+
1104+
1105+#include "StelDialogPrintSky.hpp"
1106+#include "StelMainGraphicsView.hpp"
1107+#include "StelMainWindow.hpp"
1108+
1109+#include <QDebug>
1110+#include <QDialog>
1111+#include <QGraphicsProxyWidget>
1112+#include <QStyleOptionGraphicsItem>
1113+
1114+class CustomProxy : public QGraphicsProxyWidget
1115+{
1116+ public:
1117+ CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0) : QGraphicsProxyWidget(parent, wFlags)
1118+ {
1119+ setFocusPolicy(Qt::StrongFocus);
1120+ }
1121+ //! Reimplement this method to add windows decorations. Currently there are invisible 2 px decorations
1122+ void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
1123+ {
1124+/* QStyleOptionTitleBar bar;
1125+ initStyleOption(&bar);
1126+ bar.subControls = QStyle::SC_TitleBarCloseButton;
1127+ qWarning() << style()->subControlRect(QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarCloseButton);
1128+ QGraphicsProxyWidget::paintWindowFrame(painter, option, widget);*/
1129+ }
1130+ protected:
1131+
1132+ virtual bool event(QEvent* event)
1133+ {
1134+ if (event->type()==QEvent::WindowDeactivate)
1135+ {
1136+ widget()->setWindowOpacity(0.4);
1137+ }
1138+ if (event->type()==QEvent::WindowActivate)
1139+ {
1140+ widget()->setWindowOpacity(0.9);
1141+ }
1142+ return QGraphicsProxyWidget::event(event);
1143+ }
1144+};
1145+
1146+StelDialogPrintSky::StelDialogPrintSky() : dialog(NULL)
1147+{
1148+}
1149+
1150+StelDialogPrintSky::~StelDialogPrintSky()
1151+{
1152+}
1153+
1154+
1155+void StelDialogPrintSky::close()
1156+{
1157+ setVisible(false);
1158+ StelMainGraphicsView::getInstance().scene()->setActiveWindow(0);
1159+ ((QGraphicsWidget*)StelMainGraphicsView::getInstance().getStelAppGraphicsWidget())->setFocus(Qt::OtherFocusReason);
1160+}
1161+
1162+void StelDialogPrintSky::setVisible(bool v)
1163+{
1164+ if (v)
1165+ {
1166+
1167+ QSize screenSize = StelMainWindow::getInstance().size();
1168+ if (dialog)
1169+ {
1170+ dialog->show();
1171+ StelMainGraphicsView::getInstance().scene()->setActiveWindow(proxy);
1172+ // If the main window has been resized, it is possible the dialog
1173+ // will be off screen. Check for this and move it to a visible
1174+ // position if necessary
1175+ QPointF newPos = proxy->pos();
1176+ if (newPos.x()>=screenSize.width())
1177+ newPos.setX(screenSize.width() - dialog->size().width());
1178+ if (newPos.y()>=screenSize.height())
1179+ newPos.setY(screenSize.height() - dialog->size().height());
1180+ if (newPos != dialog->pos())
1181+ proxy->setPos(newPos);
1182+
1183+ proxy->setFocus();
1184+ return;
1185+ }
1186+ dialog = new QDialog(NULL);
1187+ connect(dialog, SIGNAL(rejected()), this, SLOT(close()));
1188+ createDialogContent();
1189+
1190+ proxy = new CustomProxy(NULL, Qt::Tool);
1191+ proxy->setWidget(dialog);
1192+ QRectF bound = proxy->boundingRect();
1193+
1194+ // centre with dialog according to current window size.
1195+ proxy->setPos((int)((screenSize.width()-bound.width())/2), (int)((screenSize.height()-bound.height())/2));
1196+ StelMainGraphicsView::getInstance().scene()->addItem(proxy);
1197+ proxy->setWindowFrameMargins(2,0,2,2);
1198+
1199+ // The caching is buggy on all plateforms with Qt 4.5.2
1200+
1201+#if QT_VERSION==0x040502
1202+ proxy->setCacheMode(QGraphicsItem::NoCache);
1203+#else
1204+ proxy->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
1205+#endif
1206+
1207+ proxy->setZValue(100);
1208+ StelMainGraphicsView::getInstance().scene()->setActiveWindow(proxy);
1209+ proxy->setFocus();
1210+ }
1211+ else
1212+ {
1213+ dialog->hide();
1214+ emit visibleChanged(false);
1215+ //proxy->clearFocus();
1216+ StelMainGraphicsView::getInstance().scene()->setActiveWindow(0);
1217+ }
1218+}
1219
1220=== added file 'plugins/PrintSky/src/gui/StelDialogPrintSky.hpp'
1221--- plugins/PrintSky/src/gui/StelDialogPrintSky.hpp 1970-01-01 00:00:00 +0000
1222+++ plugins/PrintSky/src/gui/StelDialogPrintSky.hpp 2012-02-17 15:04:18 +0000
1223@@ -0,0 +1,52 @@
1224+/*
1225+ * Stellarium
1226+ * Copyright (C) 2008 Fabien Chereau
1227+ *
1228+ * This program is free software; you can redistribute it and/or
1229+ * modify it under the terms of the GNU General Public License
1230+ * as published by the Free Software Foundation; either version 2
1231+ * of the License, or (at your option) any later version.
1232+ *
1233+ * This program is distributed in the hope that it will be useful,
1234+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1235+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1236+ * GNU General Public License for more details.
1237+ *
1238+ * You should have received a copy of the GNU General Public License
1239+ * along with this program; if not, write to the Free Software
1240+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1241+*/
1242+
1243+#ifndef _STELDIALOGPRINTSKY_HPP_
1244+#define _STELDIALOGPRINTSKY_HPP_
1245+
1246+#include <QObject>
1247+
1248+//! @class StelDialog
1249+//! A local copy of StelDialog, the base class for all the GUI windows in Stellarium, included to allow the plug-in to be
1250+//! loaded dynamically on Windows. (An "Invalid access to memory location" error is thrown otherwise.)
1251+class StelDialogPrintSky : public QObject
1252+{
1253+ Q_OBJECT
1254+public:
1255+ StelDialogPrintSky();
1256+ virtual ~StelDialogPrintSky();
1257+ //! Retranslate the content of the dialog
1258+ virtual void languageChanged()=0;
1259+
1260+public slots:
1261+ void setVisible(bool);
1262+ void close();
1263+signals:
1264+ void visibleChanged(bool);
1265+
1266+protected:
1267+ //! Initialize the dialog widgets and connect the signals/slots
1268+ virtual void createDialogContent()=0;
1269+
1270+ //! The main dialog
1271+ QWidget* dialog;
1272+ class CustomProxy* proxy;
1273+};
1274+
1275+#endif // _STELDIALOGPRINTSKY_HPP_
1276
1277=== added file 'plugins/PrintSky/src/gui/printskyDialog.ui'
1278--- plugins/PrintSky/src/gui/printskyDialog.ui 1970-01-01 00:00:00 +0000
1279+++ plugins/PrintSky/src/gui/printskyDialog.ui 2012-02-17 15:04:18 +0000
1280@@ -0,0 +1,350 @@
1281+<?xml version="1.0" encoding="UTF-8"?>
1282+<ui version="4.0">
1283+ <class>printskyDialogForm</class>
1284+ <widget class="QWidget" name="printskyDialogForm">
1285+ <property name="geometry">
1286+ <rect>
1287+ <x>0</x>
1288+ <y>0</y>
1289+ <width>500</width>
1290+ <height>300</height>
1291+ </rect>
1292+ </property>
1293+ <property name="sizePolicy">
1294+ <sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
1295+ <horstretch>0</horstretch>
1296+ <verstretch>0</verstretch>
1297+ </sizepolicy>
1298+ </property>
1299+ <property name="minimumSize">
1300+ <size>
1301+ <width>300</width>
1302+ <height>300</height>
1303+ </size>
1304+ </property>
1305+ <layout class="QVBoxLayout" name="verticalLayout_2">
1306+ <property name="spacing">
1307+ <number>0</number>
1308+ </property>
1309+ <property name="margin">
1310+ <number>0</number>
1311+ </property>
1312+ <item>
1313+ <widget class="BarFrame" name="TitleBar">
1314+ <property name="sizePolicy">
1315+ <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
1316+ <horstretch>0</horstretch>
1317+ <verstretch>0</verstretch>
1318+ </sizepolicy>
1319+ </property>
1320+ <property name="maximumSize">
1321+ <size>
1322+ <width>16777215</width>
1323+ <height>25</height>
1324+ </size>
1325+ </property>
1326+ <property name="frameShape">
1327+ <enum>QFrame::StyledPanel</enum>
1328+ </property>
1329+ <property name="frameShadow">
1330+ <enum>QFrame::Raised</enum>
1331+ </property>
1332+ <layout class="QHBoxLayout" name="horizontalLayout_7">
1333+ <property name="spacing">
1334+ <number>6</number>
1335+ </property>
1336+ <property name="leftMargin">
1337+ <number>0</number>
1338+ </property>
1339+ <property name="topMargin">
1340+ <number>0</number>
1341+ </property>
1342+ <property name="rightMargin">
1343+ <number>4</number>
1344+ </property>
1345+ <property name="bottomMargin">
1346+ <number>0</number>
1347+ </property>
1348+ <item>
1349+ <spacer name="spacer_2">
1350+ <property name="orientation">
1351+ <enum>Qt::Horizontal</enum>
1352+ </property>
1353+ <property name="sizeHint" stdset="0">
1354+ <size>
1355+ <width>40</width>
1356+ <height>20</height>
1357+ </size>
1358+ </property>
1359+ </spacer>
1360+ </item>
1361+ <item>
1362+ <widget class="QLabel" name="stelWindowTitle">
1363+ <property name="text">
1364+ <string>Print sky</string>
1365+ </property>
1366+ </widget>
1367+ </item>
1368+ <item>
1369+ <spacer name="spacer">
1370+ <property name="orientation">
1371+ <enum>Qt::Horizontal</enum>
1372+ </property>
1373+ <property name="sizeHint" stdset="0">
1374+ <size>
1375+ <width>40</width>
1376+ <height>20</height>
1377+ </size>
1378+ </property>
1379+ </spacer>
1380+ </item>
1381+ <item>
1382+ <widget class="QPushButton" name="closeStelWindow">
1383+ <property name="minimumSize">
1384+ <size>
1385+ <width>16</width>
1386+ <height>16</height>
1387+ </size>
1388+ </property>
1389+ <property name="maximumSize">
1390+ <size>
1391+ <width>16</width>
1392+ <height>16</height>
1393+ </size>
1394+ </property>
1395+ <property name="focusPolicy">
1396+ <enum>Qt::NoFocus</enum>
1397+ </property>
1398+ <property name="text">
1399+ <string/>
1400+ </property>
1401+ </widget>
1402+ </item>
1403+ </layout>
1404+ </widget>
1405+ </item>
1406+ <item>
1407+ <widget class="QFrame" name="Contents">
1408+ <property name="sizePolicy">
1409+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
1410+ <horstretch>0</horstretch>
1411+ <verstretch>0</verstretch>
1412+ </sizepolicy>
1413+ </property>
1414+ <property name="frameShape">
1415+ <enum>QFrame::StyledPanel</enum>
1416+ </property>
1417+ <property name="frameShadow">
1418+ <enum>QFrame::Raised</enum>
1419+ </property>
1420+ <layout class="QVBoxLayout" name="verticalLayout_4">
1421+ <property name="spacing">
1422+ <number>0</number>
1423+ </property>
1424+ <property name="margin">
1425+ <number>0</number>
1426+ </property>
1427+ <item>
1428+ <widget class="QTabWidget" name="Tabs">
1429+ <property name="currentIndex">
1430+ <number>0</number>
1431+ </property>
1432+ <widget class="QWidget" name="General">
1433+ <attribute name="title">
1434+ <string>General</string>
1435+ </attribute>
1436+ <layout class="QVBoxLayout" name="verticalLayout_3">
1437+ <property name="spacing">
1438+ <number>0</number>
1439+ </property>
1440+ <property name="margin">
1441+ <number>0</number>
1442+ </property>
1443+ <item>
1444+ <widget class="QGroupBox" name="groupBox">
1445+ <property name="title">
1446+ <string>Options</string>
1447+ </property>
1448+ <layout class="QGridLayout" name="gridLayout_2">
1449+ <property name="margin">
1450+ <number>0</number>
1451+ </property>
1452+ <item row="0" column="0" colspan="2">
1453+ <layout class="QVBoxLayout" name="verticalLayout">
1454+ <item>
1455+ <widget class="QCheckBox" name="invertColorsCheckBox">
1456+ <property name="text">
1457+ <string>Invert colors</string>
1458+ </property>
1459+ </widget>
1460+ </item>
1461+ <item>
1462+ <widget class="QCheckBox" name="scaleToFitCheckBox">
1463+ <property name="text">
1464+ <string>Scale to fit</string>
1465+ </property>
1466+ </widget>
1467+ </item>
1468+ <item>
1469+ <widget class="QCheckBox" name="printDataCheckBox">
1470+ <property name="text">
1471+ <string>Print scene information</string>
1472+ </property>
1473+ </widget>
1474+ </item>
1475+ <item>
1476+ <widget class="QCheckBox" name="printSSEphemeridesCheckBox">
1477+ <property name="text">
1478+ <string>Print Solar System ephemerides</string>
1479+ </property>
1480+ </widget>
1481+ </item>
1482+ </layout>
1483+ </item>
1484+ <item row="0" column="2">
1485+ <widget class="QGroupBox" name="orientationGroupBox">
1486+ <property name="title">
1487+ <string>Orientation</string>
1488+ </property>
1489+ <layout class="QVBoxLayout" name="verticalLayout_5">
1490+ <property name="margin">
1491+ <number>0</number>
1492+ </property>
1493+ <item>
1494+ <widget class="QRadioButton" name="orientationPortraitRadioButton">
1495+ <property name="text">
1496+ <string>Portrait</string>
1497+ </property>
1498+ <property name="checked">
1499+ <bool>true</bool>
1500+ </property>
1501+ </widget>
1502+ </item>
1503+ <item>
1504+ <widget class="QRadioButton" name="orientationLandscapeRadioButton">
1505+ <property name="text">
1506+ <string>Landscape</string>
1507+ </property>
1508+ </widget>
1509+ </item>
1510+ </layout>
1511+ </widget>
1512+ </item>
1513+ <item row="1" column="0" colspan="3">
1514+ <widget class="QFrame" name="buttonsFrame">
1515+ <layout class="QHBoxLayout" name="horizontalLayout">
1516+ <item>
1517+ <widget class="QPushButton" name="previewSkyPushButton">
1518+ <property name="text">
1519+ <string>Preview</string>
1520+ </property>
1521+ </widget>
1522+ </item>
1523+ <item>
1524+ <widget class="QPushButton" name="printSkyPushButton">
1525+ <property name="text">
1526+ <string>Print</string>
1527+ </property>
1528+ </widget>
1529+ </item>
1530+ </layout>
1531+ </widget>
1532+ </item>
1533+ </layout>
1534+ </widget>
1535+ </item>
1536+ <item>
1537+ <spacer name="verticalSpacer">
1538+ <property name="orientation">
1539+ <enum>Qt::Vertical</enum>
1540+ </property>
1541+ <property name="sizeHint" stdset="0">
1542+ <size>
1543+ <width>20</width>
1544+ <height>40</height>
1545+ </size>
1546+ </property>
1547+ </spacer>
1548+ </item>
1549+ </layout>
1550+ </widget>
1551+ <widget class="QWidget" name="About">
1552+ <attribute name="title">
1553+ <string>About</string>
1554+ </attribute>
1555+ <layout class="QGridLayout" name="gridLayout">
1556+ <item row="1" column="0">
1557+ <widget class="QLabel" name="labelAbout">
1558+ <property name="text">
1559+ <string>This plugin allows the user to preview and print the current screen and some aditional data as the current location, the screen time adding the GMT difference, and also a relation radius magnitude as a field reference.
1560+
1561+In a optional second page you can get some Solar System ephemerides.
1562+
1563+Use Ctrl+P to open the print window.</string>
1564+ </property>
1565+ <property name="textFormat">
1566+ <enum>Qt::AutoText</enum>
1567+ </property>
1568+ <property name="alignment">
1569+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
1570+ </property>
1571+ <property name="wordWrap">
1572+ <bool>true</bool>
1573+ </property>
1574+ </widget>
1575+ </item>
1576+ <item row="2" column="0">
1577+ <spacer name="verticalSpacer_2">
1578+ <property name="orientation">
1579+ <enum>Qt::Vertical</enum>
1580+ </property>
1581+ <property name="sizeHint" stdset="0">
1582+ <size>
1583+ <width>20</width>
1584+ <height>40</height>
1585+ </size>
1586+ </property>
1587+ </spacer>
1588+ </item>
1589+ <item row="0" column="0">
1590+ <widget class="QLabel" name="label">
1591+ <property name="text">
1592+ <string>Author: &lt;a href=&quot;mailto:maslarocaxica@gmail.com&quot;&gt;Pep Pujols&lt;/a&gt; (with fixes by Bogdan Marinov)</string>
1593+ </property>
1594+ <property name="openExternalLinks">
1595+ <bool>true</bool>
1596+ </property>
1597+ </widget>
1598+ </item>
1599+ </layout>
1600+ </widget>
1601+ </widget>
1602+ </item>
1603+ </layout>
1604+ </widget>
1605+ </item>
1606+ </layout>
1607+ </widget>
1608+ <customwidgets>
1609+ <customwidget>
1610+ <class>BarFrame</class>
1611+ <extends>QFrame</extends>
1612+ <header>Dialog.hpp</header>
1613+ <container>1</container>
1614+ </customwidget>
1615+ </customwidgets>
1616+ <tabstops>
1617+ <tabstop>Tabs</tabstop>
1618+ <tabstop>invertColorsCheckBox</tabstop>
1619+ <tabstop>scaleToFitCheckBox</tabstop>
1620+ <tabstop>printDataCheckBox</tabstop>
1621+ <tabstop>printSSEphemeridesCheckBox</tabstop>
1622+ <tabstop>orientationPortraitRadioButton</tabstop>
1623+ <tabstop>orientationLandscapeRadioButton</tabstop>
1624+ <tabstop>previewSkyPushButton</tabstop>
1625+ <tabstop>printSkyPushButton</tabstop>
1626+ <tabstop>labelAbout</tabstop>
1627+ </tabstops>
1628+ <resources/>
1629+ <connections/>
1630+</ui>
1631
1632=== modified file 'po/stellarium/POTFILES.in'
1633--- po/stellarium/POTFILES.in 2012-01-24 15:14:41 +0000
1634+++ po/stellarium/POTFILES.in 2012-02-17 15:04:18 +0000
1635@@ -76,3 +76,6 @@
1636 plugins/Quasars/src/Quasar.cpp
1637 plugins/Pulsars/src/Pulsars.cpp
1638 plugins/Pulsars/src/Pulsar.cpp
1639+plugins/PrintSky/src/PrintSky.cpp
1640+plugins/PrintSky/src/gui/PrintSkyDialog.cpp
1641+plugins/PrintSky/src/ui_printskyDialog.h
1642
1643=== modified file 'po/stellarium/stellarium.pot'
1644--- po/stellarium/stellarium.pot 2012-02-13 05:33:48 +0000
1645+++ po/stellarium/stellarium.pot 2012-02-17 15:04:18 +0000
1646@@ -8,10 +8,11 @@
1647 msgstr ""
1648 "Project-Id-Version: PACKAGE VERSION\n"
1649 "Report-Msgid-Bugs-To: \n"
1650-"POT-Creation-Date: 2012-02-13 12:32+0700\n"
1651+"POT-Creation-Date: 2012-02-15 19:54+0700\n"
1652 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1653 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1654 "Language-Team: LANGUAGE <LL@li.org>\n"
1655+"Language: \n"
1656 "MIME-Version: 1.0\n"
1657 "Content-Type: text/plain; charset=UTF-8\n"
1658 "Content-Transfer-Encoding: 8bit\n"
1659@@ -297,68 +298,68 @@
1660 msgid "Az/Alt: %1/%2"
1661 msgstr ""
1662
1663-#: src/gui/ConfigurationDialog.cpp:313 src/gui/ConfigurationDialog.cpp:315
1664+#: src/gui/ConfigurationDialog.cpp:314 src/gui/ConfigurationDialog.cpp:316
1665 msgid "Select screenshot directory"
1666 msgstr ""
1667
1668-#: src/gui/ConfigurationDialog.cpp:488
1669+#: src/gui/ConfigurationDialog.cpp:489
1670 #, qt-format
1671 msgid "Startup FOV: %1%2"
1672 msgstr ""
1673
1674-#: src/gui/ConfigurationDialog.cpp:496
1675+#: src/gui/ConfigurationDialog.cpp:497
1676 #, qt-format
1677 msgid "Startup direction of view Az/Alt: %1/%2"
1678 msgstr ""
1679
1680-#: src/gui/ConfigurationDialog.cpp:535
1681-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:254
1682+#: src/gui/ConfigurationDialog.cpp:536
1683+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:255
1684 msgid "Authors"
1685 msgstr ""
1686
1687-#: src/gui/ConfigurationDialog.cpp:539 src/gui/ViewDialog.cpp:397
1688+#: src/gui/ConfigurationDialog.cpp:540 src/gui/ViewDialog.cpp:397
1689 msgid "Contact"
1690 msgstr ""
1691
1692-#: src/gui/ConfigurationDialog.cpp:617
1693+#: src/gui/ConfigurationDialog.cpp:618
1694 msgid "Author"
1695 msgstr ""
1696
1697-#: src/gui/ConfigurationDialog.cpp:621
1698+#: src/gui/ConfigurationDialog.cpp:622
1699 msgid "License"
1700 msgstr ""
1701
1702-#: src/gui/ConfigurationDialog.cpp:650
1703+#: src/gui/ConfigurationDialog.cpp:651
1704 msgid "Running script: "
1705 msgstr ""
1706
1707-#: src/gui/ConfigurationDialog.cpp:657
1708+#: src/gui/ConfigurationDialog.cpp:658
1709 msgid "Running script: [none]"
1710 msgstr ""
1711
1712-#: src/gui/ConfigurationDialog.cpp:727
1713+#: src/gui/ConfigurationDialog.cpp:728
1714 msgid ""
1715 "Finished downloading new star catalogs!\n"
1716 "Restart Stellarium to display them."
1717 msgstr ""
1718
1719-#: src/gui/ConfigurationDialog.cpp:731
1720+#: src/gui/ConfigurationDialog.cpp:732
1721 msgid "All available star catalogs have been installed."
1722 msgstr ""
1723
1724-#: src/gui/ConfigurationDialog.cpp:736
1725+#: src/gui/ConfigurationDialog.cpp:737
1726 #, qt-format
1727 msgid "Get catalog %1 of %2"
1728 msgstr ""
1729
1730-#: src/gui/ConfigurationDialog.cpp:743
1731+#: src/gui/ConfigurationDialog.cpp:744
1732 #, qt-format
1733 msgid ""
1734 "Downloading %1...\n"
1735 "(You can close this window.)"
1736 msgstr ""
1737
1738-#: src/gui/ConfigurationDialog.cpp:750
1739+#: src/gui/ConfigurationDialog.cpp:751
1740 #, qt-format
1741 msgid ""
1742 "Download size: %1MB\n"
1743@@ -366,18 +367,18 @@
1744 "Magnitude range: %3 - %4"
1745 msgstr ""
1746
1747-#: src/gui/ConfigurationDialog.cpp:793 src/gui/ConfigurationDialog.cpp:829
1748+#: src/gui/ConfigurationDialog.cpp:794 src/gui/ConfigurationDialog.cpp:830
1749 #, qt-format
1750 msgid ""
1751 "Error downloading %1:\n"
1752 "%2"
1753 msgstr ""
1754
1755-#: src/gui/ConfigurationDialog.cpp:881
1756+#: src/gui/ConfigurationDialog.cpp:882
1757 msgid "Verifying file integrity..."
1758 msgstr ""
1759
1760-#: src/gui/ConfigurationDialog.cpp:885
1761+#: src/gui/ConfigurationDialog.cpp:886
1762 #, qt-format
1763 msgid ""
1764 "Error downloading %1:\n"
1765@@ -454,6 +455,7 @@
1766 #: plugins/CompassMarks/src/CompassMarks.cpp:124
1767 #: plugins/Oculars/src/Oculars.cpp:1188
1768 #: plugins/Satellites/src/Satellites.cpp:128
1769+#: plugins/PrintSky/src/PrintSky.cpp:78
1770 msgid "Plugin Key Bindings"
1771 msgstr ""
1772
1773@@ -944,7 +946,7 @@
1774 msgid "You can remove it manually by deleting the following directory: %1"
1775 msgstr ""
1776
1777-#: src/main.cpp:336
1778+#: src/main.cpp:333
1779 msgid "This system does not support OpenGL."
1780 msgstr ""
1781
1782@@ -2441,6 +2443,7 @@
1783 #: plugins/TelescopeControl/src/ui_telescopeDialog.h:423
1784 #: plugins/TimeZoneConfiguration/src/ui_timeZoneConfigurationWindow.h:408
1785 #: plugins/SolarSystemEditor/src/ui_solarSystemManagerWindow.h:313
1786+#: plugins/PrintSky/src/ui_printskyDialog.h:287
1787 msgid "About"
1788 msgstr ""
1789
1790@@ -2454,6 +2457,7 @@
1791
1792 #: src/ui_locationDialogGui.h:387
1793 #: plugins/TextUserInterface/src/TextUserInterface.cpp:133
1794+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:345
1795 msgid "Location"
1796 msgstr ""
1797
1798@@ -2644,6 +2648,7 @@
1799 #: src/ui_viewDialog.h:1142 src/ui_viewDialog.h:1144
1800 #: src/ui_configurationDialog.h:855 src/ui_configurationDialog.h:866
1801 #: plugins/TelescopeControl/src/ui_telescopeDialog.h:421
1802+#: plugins/PrintSky/src/ui_printskyDialog.h:270
1803 msgid "Options"
1804 msgstr ""
1805
1806@@ -2661,6 +2666,7 @@
1807
1808 #: src/ui_viewDialog.h:1080
1809 #: plugins/TextUserInterface/src/TextUserInterface.cpp:394
1810+#: plugins/PrintSky/src/ui_printskyDialog.h:277
1811 msgid "Landscape"
1812 msgstr ""
1813
1814@@ -3042,6 +3048,7 @@
1815 msgstr ""
1816
1817 #: src/ui_configurationDialog.h:841
1818+#: plugins/PrintSky/src/ui_printskyDialog.h:271
1819 msgid "Invert colors"
1820 msgstr ""
1821
1822@@ -3499,6 +3506,7 @@
1823
1824 #: plugins/Oculars/src/ui_ocularDialog.h:873
1825 #: plugins/TextUserInterface/src/TextUserInterface.cpp:213
1826+#: plugins/PrintSky/src/ui_printskyDialog.h:280
1827 msgid "General"
1828 msgstr ""
1829
1830@@ -3673,44 +3681,44 @@
1831 msgid "%1 MHz (%2%3 kHz)"
1832 msgstr ""
1833
1834-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:252
1835+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:253
1836 msgid "Stellarium Satellites Plugin"
1837 msgstr ""
1838
1839-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:253
1840+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:254
1841 msgid "Version"
1842 msgstr ""
1843
1844-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:257
1845+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:258
1846 msgid ""
1847 "The Satellites plugin predicts the positions of artificial satellites in "
1848 "Earth orbit."
1849 msgstr ""
1850
1851-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:259
1852+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:260
1853 msgid "Notes for users"
1854 msgstr ""
1855
1856-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:260
1857+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:261
1858 msgid ""
1859 "Satellites and their orbits are only shown when the observer is on Earth."
1860 msgstr ""
1861
1862-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:261
1863+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:262
1864 msgid ""
1865 "Predicted positions are only good for a fairly short time (on the order of "
1866 "days, weeks or perhaps a month into the past and future). Expect high "
1867 "weirdness when looking at dates outside this range."
1868 msgstr ""
1869
1870-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:262
1871+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:263
1872 msgid ""
1873 "Orbital elements go out of date pretty quickly (over mere weeks, sometimes "
1874 "days). To get useful data out, you need to update the TLE data regularly."
1875 msgstr ""
1876
1877 #. TRANSLATORS: The translated names of the button and the tab are filled in automatically. You can check the original names in Stellarium. File names are not translated.
1878-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:264
1879+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:265
1880 #, qt-format
1881 msgid ""
1882 "Clicking the \"%1\" button in the \"%2\" tab of this dialog will revert to "
1883@@ -3718,25 +3726,25 @@
1884 "found in the user data directory, under \"modules/Satellites/\"."
1885 msgstr ""
1886
1887-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:270
1888+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:271
1889 msgid ""
1890 "The Satellites plugin is still under development. Some features are "
1891 "incomplete, missing or buggy."
1892 msgstr ""
1893
1894 #. TRANSLATORS: Title of a section in the About tab of the Satellites window
1895-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:274
1896+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:275
1897 msgid "TLE data updates"
1898 msgstr ""
1899
1900-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:275
1901+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:276
1902 msgid ""
1903 "The Satellites plugin can automatically download TLE data from Internet "
1904 "sources, and by default the plugin will do this if the existing data is more "
1905 "than 72 hours old. "
1906 msgstr ""
1907
1908-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:276
1909+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:277
1910 #, qt-format
1911 msgid ""
1912 "If you disable Internet updates, you may update from a file on your "
1913@@ -3744,136 +3752,136 @@
1914 "(see %1 for an example)."
1915 msgstr ""
1916
1917-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:277
1918+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:278
1919 msgid ""
1920 "<b>Note:</b> if the name of a satellite in update data has anything in "
1921 "square brackets at the end, it will be removed before the data is used."
1922 msgstr ""
1923
1924-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:280
1925+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:281
1926 msgid "Adding new satellites"
1927 msgstr ""
1928
1929-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:281
1930+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:282
1931 #, qt-format
1932 msgid ""
1933 "At the moment you must manually edit the %1 file to add new satellites to "
1934 "the database. Making this easier is still on the TODO list..."
1935 msgstr ""
1936
1937-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:283
1938+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:284
1939 msgid "Technical notes"
1940 msgstr ""
1941
1942-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:284
1943+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:285
1944 msgid ""
1945 "Positions are calculated using the SGP4 & SDP4 methods, using NORAD TLE data "
1946 "as the input. "
1947 msgstr ""
1948
1949-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:285
1950+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:286
1951 msgid ""
1952 "The orbital calculation code is written by Jose Luis Canales according to "
1953 "the revised Spacetrack Report #3 (including Spacetrack Report #6). "
1954 msgstr ""
1955
1956 #. TRANSLATORS: The numbers contain the opening and closing tag of an HTML link
1957-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:287
1958+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:288
1959 #, qt-format
1960 msgid "See %1this document%2 for details."
1961 msgstr ""
1962
1963-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:289
1964+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:290
1965 msgid "Links"
1966 msgstr ""
1967
1968-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:290
1969+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:291
1970 msgid ""
1971 "Support is provided via the Launchpad website. Be sure to put \"Satellites "
1972 "plugin\" in the subject when posting."
1973 msgstr ""
1974
1975 #. TRANSLATORS: The numbers contain the opening and closing tag of an HTML link
1976-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:293
1977+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:294
1978 #, qt-format
1979 msgid "If you have a question, you can %1get an answer here%2"
1980 msgstr ""
1981
1982 #. TRANSLATORS: The numbers contain the opening and closing tag of an HTML link
1983-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:295
1984+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:296
1985 #, qt-format
1986 msgid "Bug reports can be made %1here%2."
1987 msgstr ""
1988
1989 #. TRANSLATORS: The numbers contain the opening and closing tag of an HTML link
1990-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:297
1991+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:298
1992 msgid ""
1993 "If you would like to make a feature request, you can create a bug report, "
1994 "and set the severity to \"wishlist\"."
1995 msgstr ""
1996
1997-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:315
1998+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:316
1999 msgid "Internet updates disabled"
2000 msgstr ""
2001
2002-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:317
2003-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:349
2004+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:318
2005+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:350
2006 msgid "Updating now..."
2007 msgstr ""
2008
2009-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:319
2010+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:320
2011 msgid "Next update: < 1 minute"
2012 msgstr ""
2013
2014-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:321
2015+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:322
2016 #, qt-format
2017 msgid "Next update: %1 minutes"
2018 msgstr ""
2019
2020-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:323
2021+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:324
2022 #, qt-format
2023 msgid "Next update: %1 hours"
2024 msgstr ""
2025
2026-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:338
2027+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:339
2028 #: plugins/Satellites/src/ui_satellitesDialog.h:647
2029 msgid "Update now"
2030 msgstr ""
2031
2032-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:340
2033+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:341
2034 msgid "Update from files"
2035 msgstr ""
2036
2037-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:352
2038+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:353
2039 msgid "Update error"
2040 msgstr ""
2041
2042-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:359
2043+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:360
2044 #, qt-format
2045 msgid "Updated %1/%2 satellite(s); %3 missing"
2046 msgstr ""
2047
2048-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:416
2049+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:417
2050 msgid "[new source]"
2051 msgstr ""
2052
2053-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:457
2054+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:458
2055 msgid "[all newly added]"
2056 msgstr ""
2057
2058-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:458
2059+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:459
2060 msgid "[all not displayed]"
2061 msgstr ""
2062
2063-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:459
2064+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:460
2065 msgid "[all displayed]"
2066 msgstr ""
2067
2068-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:460
2069+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:461
2070 msgid "[all]"
2071 msgstr ""
2072
2073-#: plugins/Satellites/src/gui/SatellitesDialog.cpp:572
2074+#: plugins/Satellites/src/gui/SatellitesDialog.cpp:573
2075 msgid "Select TLE Update File"
2076 msgstr ""
2077
2078@@ -4134,7 +4142,7 @@
2079
2080 #: plugins/TelescopeControl/src/gui/TelescopeDialog.cpp:239
2081 #: plugins/TimeZoneConfiguration/src/gui/TimeZoneConfigurationWindow.cpp:105
2082-#: plugins/SolarSystemEditor/src/gui/SolarSystemManagerWindow.cpp:96
2083+#: plugins/SolarSystemEditor/src/gui/SolarSystemManagerWindow.cpp:97
2084 #, qt-format
2085 msgid "Version %1"
2086 msgstr ""
2087@@ -4153,6 +4161,7 @@
2088 msgstr ""
2089
2090 #: plugins/TelescopeControl/src/gui/TelescopeDialog.cpp:269
2091+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:433
2092 msgid "Name"
2093 msgstr ""
2094
2095@@ -4908,12 +4917,12 @@
2096 msgstr ""
2097
2098 #. TRANSLATORS: Appears as the text of hyperlinks linking to websites. :)
2099-#: plugins/SolarSystemEditor/src/gui/SolarSystemManagerWindow.cpp:87
2100+#: plugins/SolarSystemEditor/src/gui/SolarSystemManagerWindow.cpp:88
2101 msgid "website"
2102 msgstr ""
2103
2104 #. TRANSLATORS: IAU = International Astronomical Union
2105-#: plugins/SolarSystemEditor/src/gui/SolarSystemManagerWindow.cpp:91
2106+#: plugins/SolarSystemEditor/src/gui/SolarSystemManagerWindow.cpp:92
2107 #, qt-format
2108 msgid ""
2109 "You can import comet and asteroid data formatted in the export formats of "
2110@@ -4922,7 +4931,7 @@
2111 "Planet and Comet Ephemeris Service (MPES)."
2112 msgstr ""
2113
2114-#: plugins/SolarSystemEditor/src/gui/SolarSystemManagerWindow.cpp:95
2115+#: plugins/SolarSystemEditor/src/gui/SolarSystemManagerWindow.cpp:96
2116 msgid "Solar System Editor plug-in"
2117 msgstr ""
2118
2119@@ -5223,3 +5232,120 @@
2120 #: plugins/Pulsars/src/Pulsar.cpp:280
2121 msgid "extragalactic (in MC) pulsar"
2122 msgstr ""
2123+
2124+#: plugins/PrintSky/src/PrintSky.cpp:48
2125+msgid "Print Sky"
2126+msgstr ""
2127+
2128+#: plugins/PrintSky/src/PrintSky.cpp:51
2129+msgid "Provides a system printing sky"
2130+msgstr ""
2131+
2132+#: plugins/PrintSky/src/PrintSky.cpp:78
2133+msgid "Printing Sky"
2134+msgstr ""
2135+
2136+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:339
2137+msgid "CHART INFORMATION"
2138+msgstr ""
2139+
2140+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:352
2141+msgid "m"
2142+msgstr ""
2143+
2144+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:355
2145+msgid "Local time"
2146+msgstr ""
2147+
2148+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:363
2149+msgid "FOV: "
2150+msgstr ""
2151+
2152+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:366
2153+msgid "Magnitude"
2154+msgstr ""
2155+
2156+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:427
2157+msgid "SOLAR SYSTEM EPHEMERIDES"
2158+msgstr ""
2159+
2160+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:434
2161+msgid "RA"
2162+msgstr ""
2163+
2164+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:435
2165+msgid "Dec"
2166+msgstr ""
2167+
2168+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:436
2169+msgid "Rising"
2170+msgstr ""
2171+
2172+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:437
2173+msgid "Local Time"
2174+msgstr ""
2175+
2176+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:438
2177+msgid "Transit"
2178+msgstr ""
2179+
2180+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:439
2181+msgid "Setting"
2182+msgstr ""
2183+
2184+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:440
2185+msgid "Dist.(AU)"
2186+msgstr ""
2187+
2188+#: plugins/PrintSky/src/gui/PrintSkyDialog.cpp:441
2189+msgid "Ap.Mag."
2190+msgstr ""
2191+
2192+#: plugins/PrintSky/src/ui_printskyDialog.h:268
2193+msgid "Print sky"
2194+msgstr ""
2195+
2196+#: plugins/PrintSky/src/ui_printskyDialog.h:272
2197+msgid "Scale to fit"
2198+msgstr ""
2199+
2200+#: plugins/PrintSky/src/ui_printskyDialog.h:273
2201+msgid "Print scene information"
2202+msgstr ""
2203+
2204+#: plugins/PrintSky/src/ui_printskyDialog.h:274
2205+msgid "Print Solar System ephemerides"
2206+msgstr ""
2207+
2208+#: plugins/PrintSky/src/ui_printskyDialog.h:275
2209+msgid "Orientation"
2210+msgstr ""
2211+
2212+#: plugins/PrintSky/src/ui_printskyDialog.h:276
2213+msgid "Portrait"
2214+msgstr ""
2215+
2216+#: plugins/PrintSky/src/ui_printskyDialog.h:278
2217+msgid "Preview"
2218+msgstr ""
2219+
2220+#: plugins/PrintSky/src/ui_printskyDialog.h:279
2221+msgid "Print"
2222+msgstr ""
2223+
2224+#: plugins/PrintSky/src/ui_printskyDialog.h:281
2225+msgid ""
2226+"This plugin allows the user to preview and print the current screen and some "
2227+"aditional data as the current location, the screen time adding the GMT "
2228+"difference, and also a relation radius magnitude as a field reference.\n"
2229+"\n"
2230+"In a optional second page you can get some Solar System ephemerides.\n"
2231+"\n"
2232+"Use Ctrl+P to open the print window."
2233+msgstr ""
2234+
2235+#: plugins/PrintSky/src/ui_printskyDialog.h:286
2236+msgid ""
2237+"Author: <a href=\"mailto:maslarocaxica@gmail.com\">Pep Pujols</a> (with "
2238+"fixes by Bogdan Marinov)"
2239+msgstr ""
2240
2241=== modified file 'src/CMakeLists.txt'
2242--- src/CMakeLists.txt 2012-01-24 15:14:41 +0000
2243+++ src/CMakeLists.txt 2012-02-17 15:04:18 +0000
2244@@ -596,6 +596,12 @@
2245 SET(STELLARIUM_STATIC_PLUGINS_LIBRARIES ${STELLARIUM_STATIC_PLUGINS_LIBRARIES} ${CMAKE_BINARY_DIR}/plugins/VirGO/src/${CMAKE_CFG_INTDIR}/libVirGO.a ${CFITSIO_LIBRARIES})
2246 ADD_DEFINITIONS(-DUSE_STATIC_PLUGIN_VIRGO)
2247 ENDIF()
2248+
2249+ IF (USE_PLUGIN_PRINTSKY)
2250+ SET(STELLARIUM_STATIC_PLUGINS_LIBRARIES ${STELLARIUM_STATIC_PLUGINS_LIBRARIES} "${CMAKE_BINARY_DIR}/plugins/PrintSky/src/${CMAKE_CFG_INTDIR}/libPrintSky.a")
2251+ ADD_DEFINITIONS(-DUSE_STATIC_PLUGIN_PRINTSKY)
2252+ ENDIF()
2253+
2254 ENDIF()
2255
2256
2257
2258=== modified file 'src/StelMainGraphicsView.cpp'
2259--- src/StelMainGraphicsView.cpp 2012-01-24 15:14:41 +0000
2260+++ src/StelMainGraphicsView.cpp 2012-02-17 15:04:18 +0000
2261@@ -105,6 +105,10 @@
2262 Q_IMPORT_PLUGIN(Supernovae)
2263 #endif
2264
2265+#ifdef USE_STATIC_PLUGIN_PRINTSKY
2266+Q_IMPORT_PLUGIN(PrintSky)
2267+#endif
2268+
2269 #ifdef USE_STATIC_PLUGIN_QUASARS
2270 Q_IMPORT_PLUGIN(Quasars)
2271 #endif
2272
2273=== modified file 'src/StelMainGraphicsView.hpp'
2274--- src/StelMainGraphicsView.hpp 2012-01-11 10:50:37 +0000
2275+++ src/StelMainGraphicsView.hpp 2012-02-17 15:04:18 +0000
2276@@ -65,6 +65,10 @@
2277 StelScriptMgr& getScriptMgr() {return *scriptMgr;}
2278 #endif
2279
2280+ //! Return the QGLWidget encapsulating the Stellarium main sky view.
2281+ //! Use its layout if you want to rendering OpenGL Graphics.
2282+ StelQGLWidget* getStelQGLWidget() {return glWidget;}
2283+
2284 public slots:
2285
2286 ///////////////////////////////////////////////////////////////////////////
2287
2288=== modified file 'src/core/modules/StarMgr.cpp'
2289--- src/core/modules/StarMgr.cpp 2012-02-15 18:11:27 +0000
2290+++ src/core/modules/StarMgr.cpp 2012-02-17 15:04:18 +0000
2291@@ -969,3 +969,4 @@
2292 setFlagSciNames(skyCultureDir.startsWith("western"));
2293 updateI18n();
2294 }
2295+