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
481d535b
Commit
481d535b
authored
Aug 17, 2012
by
Samikshan Bairagya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolved problem regarding "multiple views" of WI interface.
parent
8a5451ca
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
70 additions
and
29 deletions
+70
-29
kstars/kstars.cpp
kstars/kstars.cpp
+20
-10
kstars/kstars.h
kstars/kstars.h
+6
-2
kstars/kstarsactions.cpp
kstars/kstarsactions.cpp
+5
-2
kstars/tools/whatsinteresting/modelmanager.cpp
kstars/tools/whatsinteresting/modelmanager.cpp
+16
-2
kstars/tools/whatsinteresting/modelmanager.h
kstars/tools/whatsinteresting/modelmanager.h
+2
-1
kstars/tools/whatsinteresting/skyobjlistmodel.cpp
kstars/tools/whatsinteresting/skyobjlistmodel.cpp
+5
-0
kstars/tools/whatsinteresting/skyobjlistmodel.h
kstars/tools/whatsinteresting/skyobjlistmodel.h
+1
-0
kstars/tools/whatsinteresting/wiusersettings.cpp
kstars/tools/whatsinteresting/wiusersettings.cpp
+3
-3
kstars/tools/whatsinteresting/wiusersettings.h
kstars/tools/whatsinteresting/wiusersettings.h
+1
-0
kstars/tools/whatsinteresting/wiview.cpp
kstars/tools/whatsinteresting/wiview.cpp
+6
-9
kstars/tools/whatsinteresting/wiview.h
kstars/tools/whatsinteresting/wiview.h
+5
-0
No files found.
kstars/kstars.cpp
View file @
481d535b
...
...
@@ -39,6 +39,7 @@
#include "dialogs/exportimagedialog.h"
#include "observinglist.h"
#include "oal/execute.h"
#include "whatsinteresting/wiview.h"
#include "kstarsadaptor.h"
...
...
@@ -56,8 +57,8 @@ 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
),
skycal
(
0
),
sb
(
0
),
pv
(
0
),
jmt
(
0
),
fm
(
0
),
astrocalc
(
0
),
printingWizard
(
0
),
indimenu
(
0
),
indidriver
(
0
),
avt
(
0
),
wut
(
0
),
wi
(
0
),
wiWiz
(
0
),
wiDock
(
0
),
skycal
(
0
),
sb
(
0
),
pv
(
0
),
jmt
(
0
),
fm
(
0
),
astrocalc
(
0
),
printingWizard
(
0
),
indimenu
(
0
),
indidriver
(
0
),
indiseq
(
0
),
ekosmenu
(
0
),
DialogIsObsolete
(
false
),
StartClockRunning
(
clockrun
),
StartDateString
(
startdate
)
{
...
...
@@ -304,15 +305,24 @@ void KStars::selectPreviousFov()
map
()
->
update
();
}
void
KStars
::
s
etWIView
(
QDeclarativeView
*
wiView
)
void
KStars
::
s
howWI
(
ObsConditions
*
obs
)
{
QDockWidget
*
wiDock
=
new
QDockWidget
(
this
);
wiDock
->
setObjectName
(
"What's Interesting"
);
wiDock
->
setAllowedAreas
(
Qt
::
RightDockWidgetArea
);
wiDock
->
setWidget
(
wiView
);
wiDock
->
setFixedWidth
(
wiView
->
width
());
wiDock
->
addAction
(
wiDock
->
toggleViewAction
());
addDockWidget
(
Qt
::
RightDockWidgetArea
,
wiDock
);
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
->
setFixedWidth
(
wi
->
getWIBaseView
()
->
width
());
addDockWidget
(
Qt
::
RightDockWidgetArea
,
wiDock
);
wiDock
->
setVisible
(
true
);
}
else
{
wi
->
updateModels
(
obs
);
wiDock
->
setVisible
(
true
);
}
}
void
KStars
::
updateTime
(
const
bool
automaticDSTchange
)
{
...
...
kstars/kstars.h
View file @
481d535b
...
...
@@ -44,7 +44,9 @@ class INDIDriver;
class
imagesequence
;
class
AltVsTime
;
class
WUTDialog
;
class
WIView
;
class
WIUserSettings
;
class
ObsConditions
;
class
AstroCalc
;
class
SkyCalendar
;
class
ScriptBuilder
;
...
...
@@ -173,7 +175,7 @@ public:
void
selectPreviousFov
();
void
s
etWIView
(
QDeclarativeView
*
wiBaseView
);
void
s
howWI
(
ObsConditions
*
obs
);
public
Q_SLOTS
:
/**DBUS interface function.
...
...
@@ -655,7 +657,9 @@ private:
Execute
*
execute
;
AltVsTime
*
avt
;
WUTDialog
*
wut
;
WIUserSettings
*
wi
;
WIView
*
wi
;
WIUserSettings
*
wiWiz
;
QDockWidget
*
wiDock
;
SkyCalendar
*
skycal
;
ScriptBuilder
*
sb
;
PlanetViewer
*
pv
;
...
...
kstars/kstarsactions.cpp
View file @
481d535b
...
...
@@ -27,6 +27,7 @@
#include <QDir>
#include <QTextStream>
#include <QDialog>
#include <QDockWidget>
#include <kdebug.h>
#include <kaction.h>
...
...
@@ -74,6 +75,7 @@
#include "tools/astrocalc.h"
#include "tools/altvstime.h"
#include "tools/wutdialog.h"
#include "tools/whatsinteresting/wiview.h"
#include "tools/whatsinteresting/wiusersettings.h"
#include "tools/skycalendar.h"
#include "tools/scriptbuilder.h"
...
...
@@ -277,8 +279,9 @@ void KStars::slotWUT() {
}
void
KStars
::
slotWI
()
{
if
(
!
wi
)
wi
=
new
WIUserSettings
(
this
);
wi
->
show
();
if
(
!
wiWiz
)
wiWiz
=
new
WIUserSettings
(
this
);
if
(
wiDock
&&
wiDock
->
isVisible
()
)
return
;
wiWiz
->
show
();
}
void
KStars
::
slotCalendar
()
{
...
...
kstars/tools/whatsinteresting/modelmanager.cpp
View file @
481d535b
...
...
@@ -36,7 +36,7 @@ ModelManager::ModelManager(ObsConditions *obs)
initobjects
[
"Constellation"
]
=
QList
<
SkyObject
*>
();
initobjects
[
"Cluster"
]
=
QList
<
SkyObject
*>
();
initobjects
[
"Nebula"
]
=
QList
<
SkyObject
*>
();
updateModels
();
updateModels
(
obs
);
}
ModelManager
::~
ModelManager
()
...
...
@@ -49,8 +49,12 @@ ModelManager::~ModelManager()
delete
nebModel
;
}
void
ModelManager
::
updateModels
()
void
ModelManager
::
updateModels
(
ObsConditions
*
obs
)
{
obsconditions
=
obs
;
initobjects
.
clear
();
resetModels
();
KStarsData
*
data
=
KStarsData
::
Instance
();
KSFileReader
fileReader
;
...
...
@@ -144,6 +148,16 @@ void ModelManager::updateModels()
}
}
void
ModelManager
::
resetModels
()
{
planetsModel
->
resetModel
();
starsModel
->
resetModel
();
conModel
->
resetModel
();
galModel
->
resetModel
();
clustModel
->
resetModel
();
nebModel
->
resetModel
();
}
SkyObjListModel
*
ModelManager
::
returnModel
(
int
type
)
{
switch
(
type
)
...
...
kstars/tools/whatsinteresting/modelmanager.h
View file @
481d535b
...
...
@@ -24,7 +24,8 @@ class ModelManager
public:
ModelManager
(
ObsConditions
*
obs
);
~
ModelManager
();
void
updateModels
();
void
updateModels
(
ObsConditions
*
obs
);
void
resetModels
();
SkyObjListModel
*
returnModel
(
int
type
);
...
...
kstars/tools/whatsinteresting/skyobjlistmodel.cpp
View file @
481d535b
...
...
@@ -53,3 +53,8 @@ SkyObjItem* SkyObjListModel::getSkyObjItem(int index)
{
return
soItemList
[
index
];
}
void
SkyObjListModel
::
resetModel
()
{
soItemList
.
clear
();
}
kstars/tools/whatsinteresting/skyobjlistmodel.h
View file @
481d535b
...
...
@@ -32,6 +32,7 @@ public:
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
;
QList
<
SkyObjItem
*>
getSkyObjItems
();
SkyObjItem
*
getSkyObjItem
(
int
index
);
void
resetModel
();
private:
QList
<
SkyObjItem
*>
soItemList
;
...
...
kstars/tools/whatsinteresting/wiusersettings.cpp
View file @
481d535b
...
...
@@ -19,6 +19,7 @@
#include "wiusersettings.h"
#include "wiview.h"
#include "obsconditions.h"
#include "kstars.h"
#include "kdebug.h"
WIUserSettings
::
WIUserSettings
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QWizard
(
parent
,
flags
)
...
...
@@ -42,11 +43,10 @@ void WIUserSettings::slotFinished(int)
?
(
binocularsCheck
->
isChecked
()
?
ObsConditions
::
Both
:
ObsConditions
::
Telescope
)
:
(
binocularsCheck
->
isChecked
()
?
ObsConditions
::
Binoculars
:
ObsConditions
::
None
));
type
=
(
equipmentType
->
currentText
()
==
"Reflector"
)
?
ObsConditions
::
Reflector
:
ObsConditions
::
Refractor
;
kDebug
()
<<
bortleClass
->
value
()
<<
eq
<<
aperture
->
value
()
<<
type
;
WIView
*
wi
=
new
WIView
(
0
,
new
ObsConditions
(
bortleClass
->
value
(),
aperture
->
value
(),
eq
,
type
));
KStars
*
kstars
=
KStars
::
Instance
()
;
kstars
->
showWI
(
new
ObsConditions
(
bortleClass
->
value
(),
aperture
->
value
(),
eq
,
type
));
}
void
WIUserSettings
::
slotTelescopeCheck
(
bool
on
)
...
...
kstars/tools/whatsinteresting/wiusersettings.h
View file @
481d535b
...
...
@@ -39,6 +39,7 @@ private:
void
makeConnections
();
ObsConditions
::
Equipment
eq
;
ObsConditions
::
EquipmentType
type
;
WIView
*
m_WI
;
};
#endif
kstars/tools/whatsinteresting/wiview.cpp
View file @
481d535b
...
...
@@ -28,15 +28,13 @@ WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent)
m
=
new
ModelManager
(
obs
);
KStars
*
kstars
=
KStars
::
Instance
();
QDeclarativeView
*
baseView
=
new
QDeclarativeView
();
m_BaseView
=
new
QDeclarativeView
();
ctxt
=
b
aseView
->
rootContext
();
ctxt
=
m_B
aseView
->
rootContext
();
b
aseView
->
setSource
(
KStandardDirs
::
locate
(
"appdata"
,
"tools/whatsinteresting/qml/wiview.qml"
));
m_B
aseView
->
setSource
(
KStandardDirs
::
locate
(
"appdata"
,
"tools/whatsinteresting/qml/wiview.qml"
));
m_BaseObj
=
dynamic_cast
<
QObject
*>
(
b
aseView
->
rootObject
());
m_BaseObj
=
dynamic_cast
<
QObject
*>
(
m_B
aseView
->
rootObject
());
//soTypeTextObj = m_BaseObj->findChild<QObject *>("soTypeTextObj");
...
...
@@ -59,9 +57,8 @@ WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent)
m_DetailsButtonObj
=
m_BaseObj
->
findChild
<
QObject
*>
(
"detailsButtonObj"
);
connect
(
m_DetailsButtonObj
,
SIGNAL
(
detailsButtonClicked
()),
this
,
SLOT
(
onDetailsButtonClicked
()));
baseView
->
setResizeMode
(
QDeclarativeView
::
SizeRootObjectToView
);
baseView
->
show
();
kstars
->
setWIView
(
baseView
);
m_BaseView
->
setResizeMode
(
QDeclarativeView
::
SizeRootObjectToView
);
m_BaseView
->
show
();
}
WIView
::~
WIView
()
...
...
kstars/tools/whatsinteresting/wiview.h
View file @
481d535b
...
...
@@ -57,6 +57,10 @@ public:
*/
void
loadDetailsView
(
SkyObjItem
*
soitem
,
int
index
);
inline
void
updateModels
(
ObsConditions
*
obs
)
{
m
->
updateModels
(
obs
);
}
inline
QDeclarativeView
*
getWIBaseView
()
const
{
return
m_BaseView
;
}
public
slots
:
/**
...
...
@@ -99,6 +103,7 @@ private:
QObject
*
m_BaseObj
,
*
m_ViewsRowObj
,
*
m_SoListObj
,
*
m_DetailsViewObj
,
*
m_NextObj
,
*
m_PrevObj
,
*
m_SlewButtonObj
,
*
m_DetailsButtonObj
;
QDeclarativeContext
*
ctxt
;
QDeclarativeView
*
m_BaseView
;
ModelManager
*
m
;
SkyObjItem
*
m_CurSoItem
;
///Current sky-object item.
int
m_CurIndex
;
///Index of current sky-object item in details-view.
...
...
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