Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KStars
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Education
KStars
Commits
a8eb4030
Commit
a8eb4030
authored
Jan 10, 2013
by
Samikshan Bairagya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Open KConfigDialog for WI settings, currently with only one page for "Light Pollution Settings".
parent
a50e54ec
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
103 additions
and
38 deletions
+103
-38
kstars/kstars.cpp
kstars/kstars.cpp
+5
-27
kstars/kstars.h
kstars/kstars.h
+8
-2
kstars/kstars.kcfg
kstars/kstars.kcfg
+26
-0
kstars/kstarsactions.cpp
kstars/kstarsactions.cpp
+43
-4
kstars/kstarsinit.cpp
kstars/kstarsinit.cpp
+1
-1
kstars/tools/whatsinteresting/obsconditions.cpp
kstars/tools/whatsinteresting/obsconditions.cpp
+9
-0
kstars/tools/whatsinteresting/obsconditions.h
kstars/tools/whatsinteresting/obsconditions.h
+5
-0
kstars/tools/whatsinteresting/wiview.cpp
kstars/tools/whatsinteresting/wiview.cpp
+2
-3
kstars/tools/whatsinteresting/wiview.h
kstars/tools/whatsinteresting/wiview.h
+4
-1
No files found.
kstars/kstars.cpp
View file @
a8eb4030
...
...
@@ -59,9 +59,9 @@ KStars::KStars( bool doSplash, bool clockrun, const QString &startdate )
:
KXmlGuiWindow
(),
kstarsData
(
0
),
skymap
(
0
),
TimeStep
(
0
),
colorActionMenu
(
0
),
fovActionMenu
(
0
),
findDialog
(
0
),
imgExportDialog
(
0
),
obsList
(
0
),
execute
(
0
),
avt
(
0
),
wut
(
0
),
wi
(
0
),
wi
Wiz
(
0
),
wiDock
(
0
),
skycal
(
0
),
sb
(
0
),
pv
(
0
),
jmt
(
0
),
mpt
(
0
),
fm
(
0
),
astrocalc
(
0
),
printingWizard
(
0
),
ekosmenu
(
0
),
DialogIsObsolete
(
false
),
StartClockRunning
(
clockrun
),
avt
(
0
),
wut
(
0
),
wi
(
0
),
wi
ObsConditions
(
0
),
wiWiz
(
0
),
wiDock
(
0
),
skycal
(
0
),
sb
(
0
),
pv
(
0
),
jmt
(
0
),
mpt
(
0
),
fm
(
0
),
astrocalc
(
0
),
printingWizard
(
0
),
ekosmenu
(
0
),
DialogIsObsolete
(
false
),
StartClockRunning
(
clockrun
),
StartDateString
(
startdate
)
{
new
KstarsAdaptor
(
this
);
...
...
@@ -327,31 +327,9 @@ void KStars::selectPreviousFov()
map
()
->
update
();
}
void
KStars
::
showWI
Wizard
()
void
KStars
::
showWI
SettingsUI
()
{
wiDock
->
setVisible
(
false
);
wiWiz
->
restart
();
wiWiz
->
setVisible
(
true
);
}
void
KStars
::
showWI
(
ObsConditions
*
obs
)
{
if
(
!
wi
)
{
wi
=
new
WIView
(
0
,
obs
);
wiDock
=
new
QDockWidget
(
this
);
wiDock
->
setObjectName
(
"What's Interesting"
);
wiDock
->
setAllowedAreas
(
Qt
::
RightDockWidgetArea
);
wiDock
->
setWidget
(
wi
->
getWIBaseView
());
wiDock
->
setMinimumWidth
(
wi
->
getWIBaseView
()
->
width
());
addDockWidget
(
Qt
::
RightDockWidgetArea
,
wiDock
);
wiDock
->
setVisible
(
true
);
}
else
{
wi
->
updateModels
(
obs
);
wiDock
->
setVisible
(
true
);
}
slotWISettings
();
}
void
KStars
::
updateTime
(
const
bool
automaticDSTchange
)
{
...
...
kstars/kstars.h
View file @
a8eb4030
...
...
@@ -46,6 +46,7 @@ class AltVsTime;
class
WUTDialog
;
class
WIView
;
class
WIUserSettings
;
class
WILPSettings
;
class
ObsConditions
;
class
AstroCalc
;
class
SkyCalendar
;
...
...
@@ -170,7 +171,7 @@ public:
void
selectPreviousFov
();
void
showWI
Wizard
();
void
showWI
SettingsUI
();
void
showWI
(
ObsConditions
*
obs
);
...
...
@@ -507,8 +508,11 @@ private slots:
/** action slot: open What's up tonight dialog */
void
slotWUT
();
/** action slot: open What's Interesting settings window */
void
slotWISettings
();
/** action slot: open What's Interesting window */
void
slot
WI
(
);
void
slot
ShowWIView
(
int
status
);
/** action slot: open Sky Calendar tool */
void
slotCalendar
();
...
...
@@ -655,6 +659,8 @@ private:
AltVsTime
*
avt
;
WUTDialog
*
wut
;
WIView
*
wi
;
WILPSettings
*
wiLPSettings
;
ObsConditions
*
wiObsConditions
;
WIUserSettings
*
wiWiz
;
QDockWidget
*
wiDock
;
SkyCalendar
*
skycal
;
...
...
kstars/kstars.kcfg
View file @
a8eb4030
...
...
@@ -1180,6 +1180,32 @@
<default>
10.0
</default>
</entry>
</group>
<group
name=
"WISettings"
>
<entry
name=
"BortleClass"
type=
"UInt"
>
<label>
Bortle dark-sky rating
</label>
<default>
4
</default>
</entry>
<entry
name=
"TelescopeCheck"
type=
"Bool"
>
<label>
Availability of telescope
</label>
<default>
false
</default>
</entry>
<entry
name=
"BinocularsCheck"
type=
"Bool"
>
<label>
Availability of binoculars
</label>
<default>
false
</default>
</entry>
<entry
name=
"NoEquipCheck"
type=
"Bool"
>
<label>
Availability of both telescope and binoculars
</label>
<default>
false
</default>
</entry>
<entry
name=
"Aperture"
type=
"Double"
>
<label>
Aperture of available equipment
</label>
<default>
30.0
</default>
</entry>
<entry
name=
"TelescopeType"
type=
"String"
>
<label>
Type of telescope: Reflector/Refractor
</label>
<default>
Reflector
</default>
</entry>
</group>
<group
name=
"Ekos"
>
<entry
name=
"TelescopeDriver"
type=
"String"
>
<label>
Default telescope driver
</label>
...
...
kstars/kstarsactions.cpp
View file @
a8eb4030
...
...
@@ -77,6 +77,7 @@
#include "tools/wutdialog.h"
#include "tools/whatsinteresting/wiview.h"
#include "tools/whatsinteresting/wiusersettings.h"
#include "tools/whatsinteresting/wilpsettings.h"
#include "tools/skycalendar.h"
#include "tools/scriptbuilder.h"
#include "tools/planetviewer.h"
...
...
@@ -279,10 +280,48 @@ void KStars::slotWUT() {
wut
->
show
();
}
void
KStars
::
slotWI
()
{
if
(
!
wiWiz
)
wiWiz
=
new
WIUserSettings
(
this
);
if
(
wiDock
&&
wiDock
->
isVisible
()
)
return
;
wiWiz
->
show
();
void
KStars
::
slotWISettings
()
{
if
(
KConfigDialog
::
showDialog
(
"wisettings"
))
return
;
KConfigDialog
*
dialog
=
new
KConfigDialog
(
this
,
"wisettings"
,
Options
::
self
());
connect
(
dialog
,
SIGNAL
(
settingsChanged
(
const
QString
&
)),
this
,
SLOT
(
slotApplyConfigChanges
()));
connect
(
dialog
,
SIGNAL
(
finished
(
int
)),
this
,
SLOT
(
slotShowWIView
(
int
)));
wiLPSettings
=
new
WILPSettings
(
this
);
dialog
->
addPage
(
wiLPSettings
,
i18n
(
"What's Interesting Settings"
));
dialog
->
show
();
}
void
KStars
::
slotShowWIView
(
int
status
)
{
if
(
status
==
0
)
return
;
//Cancelled
//Update observing conditions for What's Interesting
kDebug
()
<<
"Bortle class: "
<<
Options
::
bortleClass
();
if
(
!
wiObsConditions
)
wiObsConditions
=
new
ObsConditions
(
Options
::
bortleClass
(),
30.0
,
ObsConditions
::
Telescope
,
ObsConditions
::
Reflector
);
else
wiObsConditions
->
setObsConditions
(
Options
::
bortleClass
(),
30.0
,
ObsConditions
::
Telescope
,
ObsConditions
::
Reflector
);
if
(
!
wi
)
{
wi
=
new
WIView
(
0
,
wiObsConditions
);
wiDock
=
new
QDockWidget
(
this
);
wiDock
->
setObjectName
(
"What's Interesting"
);
wiDock
->
setAllowedAreas
(
Qt
::
RightDockWidgetArea
);
wiDock
->
setWidget
(
wi
->
getWIBaseView
());
wiDock
->
setMinimumWidth
(
wi
->
getWIBaseView
()
->
width
());
addDockWidget
(
Qt
::
RightDockWidgetArea
,
wiDock
);
wiDock
->
setVisible
(
true
);
}
else
{
wi
->
updateModels
(
wiObsConditions
);
}
}
void
KStars
::
slotCalendar
()
{
...
...
kstars/kstarsinit.cpp
View file @
a8eb4030
...
...
@@ -375,7 +375,7 @@ void KStars::initActions() {
actionCollection
()
->
addAction
(
"whats_up_tonight"
,
this
,
SLOT
(
slotWUT
()
)
)
<<
i18n
(
"What's up Tonight"
)
<<
KShortcut
(
Qt
::
CTRL
+
Qt
::
Key_U
);
actionCollection
()
->
addAction
(
"whats_interesting"
,
this
,
SLOT
(
slotWI
()
)
)
actionCollection
()
->
addAction
(
"whats_interesting"
,
this
,
SLOT
(
slotWI
Settings
()
)
)
<<
i18n
(
"What's Interesting..."
)
<<
KShortcut
(
Qt
::
CTRL
+
Qt
::
Key_W
);
actionCollection
()
->
addAction
(
"skycalendar"
,
this
,
SLOT
(
slotCalendar
()
)
)
...
...
kstars/tools/whatsinteresting/obsconditions.cpp
View file @
a8eb4030
...
...
@@ -95,3 +95,12 @@ bool ObsConditions::isVisible(GeoLocation *geo, dms *lst, SkyObject *so)
return
(
sp
.
alt
().
Degrees
()
>
6.0
&&
so
->
mag
()
<
getTrueMagLim
());
}
void
ObsConditions
::
setObsConditions
(
int
bortle
,
double
aperture
,
ObsConditions
::
Equipment
equip
,
ObsConditions
::
TelescopeType
telType
)
{
m_BortleClass
=
bortle
;
setLimMagnitude
();
m_Aperture
=
30.0
;
m_Equip
=
Telescope
;
m_TelType
=
Reflector
;
}
kstars/tools/whatsinteresting/obsconditions.h
View file @
a8eb4030
...
...
@@ -72,6 +72,11 @@ public:
*/
void
setLimMagnitude
();
/**
* \brief Set new observing conditions.
*/
void
setObsConditions
(
int
bortle
,
double
aperture
,
Equipment
equip
,
TelescopeType
telType
);
/**
* \brief Get optimum magnification under current observing conditions.
* \return Get optimum magnification under current observing conditions
...
...
kstars/tools/whatsinteresting/wiview.cpp
View file @
a8eb4030
...
...
@@ -28,7 +28,7 @@
WIView
::
WIView
(
QWidget
*
parent
,
ObsConditions
*
obs
)
:
QWidget
(
parent
),
m_Obs
(
obs
)
{
m_ModManager
=
new
ModelManager
(
o
bs
);
m_ModManager
=
new
ModelManager
(
m_O
bs
);
m_BaseView
=
new
QDeclarativeView
();
...
...
@@ -91,7 +91,6 @@ void WIView::onSoListItemClicked(int type, QString typeName, int index)
void
WIView
::
loadDetailsView
(
SkyObjItem
*
soitem
,
int
index
)
{
m_CurSoItem
=
soitem
;
m_CurIndex
=
index
;
...
...
@@ -171,5 +170,5 @@ void WIView::onDetailsButtonClicked()
void
WIView
::
onSettingsIconClicked
()
{
KStars
*
kstars
=
KStars
::
Instance
();
kstars
->
showWI
Wizard
();
kstars
->
showWI
SettingsUI
();
}
kstars/tools/whatsinteresting/wiview.h
View file @
a8eb4030
...
...
@@ -56,7 +56,10 @@ public:
*/
void
loadDetailsView
(
SkyObjItem
*
soitem
,
int
index
);
inline
void
updateModels
(
ObsConditions
*
obs
)
{
m_ModManager
->
updateModels
(
obs
);
}
/**
* \brief Updates sky-object list models
*/
inline
void
updateModels
(
ObsConditions
*
obs
)
{
m_Obs
=
obs
;
m_ModManager
->
updateModels
(
m_Obs
);
}
inline
QDeclarativeView
*
getWIBaseView
()
const
{
return
m_BaseView
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment