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
a46a0365
Commit
a46a0365
authored
Aug 05, 2014
by
Jasem Mutlaq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial go at migrating whatisinteresting to Qt5
parent
62cf5aee
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
65 deletions
+55
-65
kstars/CMakeLists.txt
kstars/CMakeLists.txt
+14
-14
kstars/kstarsactions.cpp
kstars/kstarsactions.cpp
+13
-19
kstars/kstarsinit.cpp
kstars/kstarsinit.cpp
+0
-2
kstars/tools/whatsinteresting/wiview.cpp
kstars/tools/whatsinteresting/wiview.cpp
+20
-23
kstars/tools/whatsinteresting/wiview.h
kstars/tools/whatsinteresting/wiview.h
+8
-7
No files found.
kstars/CMakeLists.txt
View file @
a46a0365
add_subdirectory
(
data
)
add_subdirectory
(
icons
)
add_subdirectory
(
htmesh
)
#TODO Port to KF5
#add_subdirectory( tools/whatsinteresting/qml)
add_subdirectory
(
tools/whatsinteresting/qml
)
Find_package
(
ZLIB REQUIRED
)
Find_package
(
Threads REQUIRED
)
...
...
@@ -153,16 +152,16 @@ set(libkstarstools_SRCS
tools/scriptfunction.cpp
tools/skycalendar.cpp
tools/wutdialog.cpp
#FIXME Port to KF5
# tools/whatsinteresting/skyobjlistmodel.cpp
# tools/whatsinteresting/wiview.cpp
# tools/whatsinteresting/modelmanager.cpp
# tools/whatsinteresting/skyobjitem.cpp
# tools/whatsinteresting/wilpsettings.cpp
# tools/whatsinteresting/wiequipsettings.cpp
# tools/whatsinteresting/obsconditions.cpp
# tools/whatsinteresting/skyobjdescription.cpp
tools/whatsinteresting/skyobjlistmodel.cpp
tools/whatsinteresting/wiview.cpp
tools/whatsinteresting/modelmanager.cpp
tools/whatsinteresting/skyobjitem.cpp
tools/whatsinteresting/wilpsettings.cpp
tools/whatsinteresting/wiequipsettings.cpp
tools/whatsinteresting/obsconditions.cpp
tools/whatsinteresting/skyobjdescription.cpp
tools/flagmanager.cpp
#FIXME Port to KF5
# tools/moonphasetool.cpp
tools/starhopper.cpp
tools/eyepiecefield.cpp
...
...
@@ -226,9 +225,8 @@ qt5_wrap_ui(libkstarstools_SRCS
tools/skycalendar.ui
tools/wutdialog.ui
tools/flagmanager.ui
#FIXME needs porting
# tools/whatsinteresting/wilpsettings.ui
# tools/whatsinteresting/wiequipsettings.ui
tools/whatsinteresting/wilpsettings.ui
tools/whatsinteresting/wiequipsettings.ui
)
...
...
@@ -492,6 +490,8 @@ target_link_libraries(KStarsLib
Qt5::Sql
Qt5::Svg
Qt5::Multimedia
Qt5::Qml
Qt5::Quick
${
ZLIB_LIBRARIES
}
)
...
...
kstars/kstarsactions.cpp
View file @
a46a0365
...
...
@@ -30,7 +30,8 @@
#include <QDockWidget>
#include <QPointer>
#include <QInputDialog>
#include <QQuickWindow>
#include <QQuickView>
#include <QDebug>
#include <QAction>
#include <QFileDialog>
...
...
@@ -39,17 +40,15 @@
#include <QProcess>
#include <QIcon>
#include <QTemporaryFile>
#include <QStandardPaths>
#include <QInputDialog>
#include <KActionCollection>
#include <KActionMenu>
#include <KToggleAction>
#include <KMessageBox>
#include <ktip.h>
#include <QStandardPaths>
#include <kconfigdialog.h>
#include <kinputdialog.h>
#include <KTipDialog>
#include <KConfigDialog>
#include <kns3/downloaddialog.h>
...
...
@@ -80,10 +79,9 @@
#include "tools/astrocalc.h"
#include "tools/altvstime.h"
#include "tools/wutdialog.h"
//FIXME Port to KF5
//#include "tools/whatsinteresting/wiview.h"
//#include "tools/whatsinteresting/wilpsettings.h"
//#include "tools/whatsinteresting/wiequipsettings.h"
#include "tools/whatsinteresting/wiview.h"
#include "tools/whatsinteresting/wilpsettings.h"
#include "tools/whatsinteresting/wiequipsettings.h"
#include "tools/skycalendar.h"
#include "tools/scriptbuilder.h"
#include "tools/planetviewer.h"
...
...
@@ -297,8 +295,6 @@ void KStars::slotWUT() {
void
KStars
::
slotWISettings
()
{
/*FIXME Port to KF5
*
if
(
wi
&&
!
wiDock
->
isVisible
())
{
slotShowWIView
(
1
);
...
...
@@ -321,13 +317,11 @@ void KStars::slotWISettings()
dialog
->
addPage
(
wiLPSettings
,
xi18n
(
"Light Pollution Settings"
));
dialog
->
addPage
(
wiEquipSettings
,
xi18n
(
"Equipment Settings - Equipment Type and Parameters"
));
dialog
->
show
();
*/
}
void
KStars
::
slotShowWIView
(
int
status
)
{
#if 0
//FIXME Port to KF5
if
(
status
==
0
)
return
;
//Cancelled
int
bortle
=
Options
::
bortleClass
();
...
...
@@ -360,8 +354,9 @@ void KStars::slotShowWIView(int status)
wiDock
=
new
QDockWidget
(
this
);
wiDock
->
setObjectName
(
"What's Interesting"
);
wiDock
->
setAllowedAreas
(
Qt
::
RightDockWidgetArea
);
wiDock->setWidget(wi->getWIBaseView());
wiDock->setMinimumWidth(wi->getWIBaseView()->width());
QWidget
*
container
=
QWidget
::
createWindowContainer
(
wi
->
getWIBaseView
());
wiDock
->
setWidget
(
container
);
wiDock
->
setMinimumWidth
(
container
->
width
());
addDockWidget
(
Qt
::
RightDockWidgetArea
,
wiDock
);
wiDock
->
setVisible
(
true
);
}
...
...
@@ -370,7 +365,6 @@ void KStars::slotShowWIView(int status)
wi
->
updateModels
(
wiObsConditions
);
wiDock
->
setVisible
(
true
);
}
#endif
}
void
KStars
::
slotCalendar
()
{
...
...
kstars/kstarsinit.cpp
View file @
a46a0365
...
...
@@ -381,11 +381,9 @@ void KStars::initActions() {
actionCollection
()
->
addAction
(
"whats_up_tonight"
,
this
,
SLOT
(
slotWUT
()
)
)
<<
xi18n
(
"What's up Tonight"
)
<<
QKeySequence
(
Qt
::
CTRL
+
Qt
::
Key_U
);
/* FIXME Enable once port to KF5 is complete for whats_interesting
actionCollection
()
->
addAction
(
"whats_interesting"
,
this
,
SLOT
(
slotWISettings
()
)
)
<<
xi18n
(
"What's Interesting..."
)
<<
QKeySequence
(
Qt
::
CTRL
+
Qt
::
Key_W
);
*/
actionCollection
()
->
addAction
(
"skycalendar"
,
this
,
SLOT
(
slotCalendar
()
)
)
<<
xi18n
(
"Sky Calendar"
);
...
...
kstars/tools/whatsinteresting/wiview.cpp
View file @
a46a0365
...
...
@@ -16,63 +16,60 @@
***************************************************************************/
//FIXME Needs porting to KF5
//#include "QDeclarativeView"
#include
"QGraphicsObject"
#include <QtQuick/QQuickView>
#include <QtQuick/QQuickItem>
#include <QStandardPaths>
#include
<QGraphicsObject>
#include "wiview.h"
#include "skymap.h"
#include "dialogs/detaildialog.h"
#include "QStandardPaths"
#include "kdeclarative.h"
WIView
::
WIView
(
QWidget
*
parent
,
ObsConditions
*
obs
)
:
QWidget
(
parent
),
m_Obs
(
obs
),
m_CurCategorySelected
(
-
1
)
{
m_ModManager
=
new
ModelManager
(
m_Obs
);
m_BaseView
=
new
Q
Declarative
View
();
m_BaseView
=
new
Q
Quick
View
();
///To use i18n() instead of qsTr() in qml/wiview.qml for translation
KDeclarative
kd
;
kd
.
setDeclarativeEngine
(
m_BaseView
->
engine
());
kd
.
initialize
();
kd
.
setupBindings
();
//
KDeclarative kd;
//
kd.setDeclarativeEngine(m_BaseView->engine());
//
kd.initialize();
//
kd.setupBindings();
m_Ctxt
=
m_BaseView
->
rootContext
();
m_BaseView
->
setSource
(
QStandardPaths
::
locate
(
QStandardPaths
::
DataLocation
,
"tools/whatsinteresting/qml/wiview.qml"
));
m_BaseObj
=
dynamic_cast
<
QObject
*>
(
m_BaseView
->
rootObject
()
);
m_BaseObj
=
m_BaseView
->
rootObject
(
);
//soTypeTextObj = m_BaseObj->findChild<QObject *>("soTypeTextObj");
m_ViewsRowObj
=
m_BaseObj
->
findChild
<
Q
Object
*>
(
"viewsRowObj"
);
m_ViewsRowObj
=
m_BaseObj
->
findChild
<
Q
QuickItem
*>
(
QString
(
"viewsRowObj"
)
);
connect
(
m_ViewsRowObj
,
SIGNAL
(
categorySelected
(
int
)),
this
,
SLOT
(
onCategorySelected
(
int
)));
m_SoListObj
=
m_BaseObj
->
findChild
<
Q
Object
*>
(
"soListObj"
);
m_SoListObj
=
m_BaseObj
->
findChild
<
Q
QuickItem
*>
(
"soListObj"
);
connect
(
m_SoListObj
,
SIGNAL
(
soListItemClicked
(
int
,
QString
,
int
)),
this
,
SLOT
(
onSoListItemClicked
(
int
,
QString
,
int
)));
m_DetailsViewObj
=
m_BaseObj
->
findChild
<
Q
Object
*>
(
"detailsViewObj"
);
m_DetailsViewObj
=
m_BaseObj
->
findChild
<
Q
QuickItem
*>
(
"detailsViewObj"
);
m_NextObj
=
m_BaseObj
->
findChild
<
Q
Object
*>
(
"nextObj"
);
m_NextObj
=
m_BaseObj
->
findChild
<
Q
QuickItem
*>
(
"nextObj"
);
connect
(
m_NextObj
,
SIGNAL
(
nextObjClicked
()),
this
,
SLOT
(
onNextObjClicked
()));
m_PrevObj
=
m_BaseObj
->
findChild
<
Q
Object
*>
(
"prevObj"
);
m_PrevObj
=
m_BaseObj
->
findChild
<
Q
QuickItem
*>
(
"prevObj"
);
connect
(
m_PrevObj
,
SIGNAL
(
prevObjClicked
()),
this
,
SLOT
(
onPrevObjClicked
()));
m_SlewButtonObj
=
m_BaseObj
->
findChild
<
Q
Object
*>
(
"slewButtonObj"
);
m_SlewButtonObj
=
m_BaseObj
->
findChild
<
Q
QuickItem
*>
(
"slewButtonObj"
);
connect
(
m_SlewButtonObj
,
SIGNAL
(
slewButtonClicked
()),
this
,
SLOT
(
onSlewButtonClicked
()));
m_DetailsButtonObj
=
m_BaseObj
->
findChild
<
Q
Object
*>
(
"detailsButtonObj"
);
m_DetailsButtonObj
=
m_BaseObj
->
findChild
<
Q
QuickItem
*>
(
"detailsButtonObj"
);
connect
(
m_DetailsButtonObj
,
SIGNAL
(
detailsButtonClicked
()),
this
,
SLOT
(
onDetailsButtonClicked
()));
QObject
*
settingsIconObj
=
m_BaseObj
->
findChild
<
Q
Object
*>
(
"settingsIconObj"
);
QObject
*
settingsIconObj
=
m_BaseObj
->
findChild
<
Q
QuickItem
*>
(
"settingsIconObj"
);
connect
(
settingsIconObj
,
SIGNAL
(
settingsIconClicked
()),
this
,
SLOT
(
onSettingsIconClicked
()));
QObject
*
reloadIconObj
=
m_BaseObj
->
findChild
<
Q
Object
*>
(
"reloadIconObj"
);
QObject
*
reloadIconObj
=
m_BaseObj
->
findChild
<
Q
QuickItem
*>
(
"reloadIconObj"
);
connect
(
reloadIconObj
,
SIGNAL
(
reloadIconClicked
()),
this
,
SLOT
(
onReloadIconClicked
()));
m_BaseView
->
setResizeMode
(
Q
Declarative
View
::
SizeRootObjectToView
);
m_BaseView
->
setResizeMode
(
Q
Quick
View
::
SizeRootObjectToView
);
m_BaseView
->
show
();
}
...
...
kstars/tools/whatsinteresting/wiview.h
View file @
a46a0365
...
...
@@ -18,9 +18,10 @@
#ifndef WIVIEW_H
#define WIVIEW_H
class
QDeclarativeView
;
class
QQuickView
;
class
QQuickItem
;
#include <Q
tDeclarative/QDeclarative
Context>
#include <Q
Qml
Context>
#include "skyobject.h"
#include "modelmanager.h"
#include "skyobjlistmodel.h"
...
...
@@ -29,7 +30,7 @@ class QDeclarativeView;
/**
* \class WIView
* \brief Manages the QML user interface for What's Interesting.
* WIView is used to display the QML UI using a Q
Declarative
View.
* WIView is used to display the QML UI using a Q
Quick
View.
* It acts on all signals emitted by the UI and manages the data
* sent to the UI for display.
* \author Samikshan Bairagya
...
...
@@ -61,7 +62,7 @@ public:
*/
void
updateModels
(
ObsConditions
*
obs
);
inline
Q
Declarative
View
*
getWIBaseView
()
const
{
return
m_BaseView
;
}
inline
Q
Quick
View
*
getWIBaseView
()
const
{
return
m_BaseView
;
}
public
slots
:
...
...
@@ -112,10 +113,10 @@ public slots:
void
onReloadIconClicked
();
private:
Q
Object
*
m_BaseObj
,
*
m_ViewsRowObj
,
*
m_SoListObj
,
*
m_DetailsViewObj
,
Q
QuickItem
*
m_BaseObj
,
*
m_ViewsRowObj
,
*
m_SoListObj
,
*
m_DetailsViewObj
,
*
m_NextObj
,
*
m_PrevObj
,
*
m_SlewButtonObj
,
*
m_DetailsButtonObj
;
Q
Declarative
Context
*
m_Ctxt
;
Q
Declarative
View
*
m_BaseView
;
Q
Qml
Context
*
m_Ctxt
;
Q
Quick
View
*
m_BaseView
;
ObsConditions
*
m_Obs
;
ModelManager
*
m_ModManager
;
SkyObjItem
*
m_CurSoItem
;
///Current sky-object item.
...
...
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