SatellitesDialog.hpp   SatellitesDialog.hpp 
/* /*
* Stellarium Satellites Plug-in GUI * Stellarium Satellites Plug-in GUI
* *
* Copyright (C) 2010 Matthew Gates * Copyright (C) 2010 Matthew Gates
* Copyright (C) 2015 Nick Fedoseev (Iridium flares)
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 26 skipping to change at line 27
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _SATELLITESDIALOG_HPP_ #ifndef _SATELLITESDIALOG_HPP_
#define _SATELLITESDIALOG_HPP_ #define _SATELLITESDIALOG_HPP_
#include <QObject> #include <QObject>
#include <QModelIndex> #include <QModelIndex>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include "StelDialog.hpp" #include "StelDialog.hpp"
#include "Satellites.hpp" #include "Satellites.hpp"
class Ui_satellitesDialog; class Ui_satellitesDialog;
class QCheckBox; class QCheckBox;
class QListWidgetItem; class QListWidgetItem;
class QSortFilterProxyModel; class QSortFilterProxyModel;
class QStandardItemModel; class QStandardItemModel;
class QTimer; class QTimer;
class SatellitesImportDialog; class SatellitesImportDialog;
class SatellitesListFilterModel; class SatellitesListFilterModel;
//! Main configuration window of the %Satellites plugin. //! Main configuration window of the %Satellites plugin.
//! @todo Save sources list on check/uncheck. //! @todo Save sources list on check/uncheck.
//! @ingroup satellites
class SatellitesDialog : public StelDialog class SatellitesDialog : public StelDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
//! Defines the number and the order of the columns in the Iridium F
lares table
//! @enum IridiumFlaresColumns
enum IridiumFlaresColumns {
IridiumFlaresDate, //! date and time of Iridium flare
IridiumFlaresMagnitude, //! magnitude of the flare
IridiumFlaresAltitude, //! altitude of the flare
IridiumFlaresAzimuth, //! azimuth of the flare
IridiumFlaresSatellite, //! satellite name
IridiumFlaresCount //! total number of columns
};
SatellitesDialog(); SatellitesDialog();
~SatellitesDialog(); ~SatellitesDialog();
protected: protected:
//! Initialize the dialog widgets and connect the signals/slots //! Initialize the dialog widgets and connect the signals/slots
void createDialogContent(); void createDialogContent();
public slots: public slots:
void retranslate(); void retranslate();
skipping to change at line 96 skipping to change at line 111
void addSatellites(const TleDataList& newSatellites); void addSatellites(const TleDataList& newSatellites);
void removeSatellites(); void removeSatellites();
//! Apply the "Displayed" and "Orbit" boxes to the selected satellit e(s). //! Apply the "Displayed" and "Orbit" boxes to the selected satellit e(s).
void setFlags(); void setFlags();
//! Find out if a group is added or toggled in the group selector. //! Find out if a group is added or toggled in the group selector.
void handleGroupChanges(QListWidgetItem* item); void handleGroupChanges(QListWidgetItem* item);
//! Display, select and start tracking the double clicked satellite. //! Display, select and start tracking the double clicked satellite.
void trackSatellite(const QModelIndex & index); void trackSatellite(const QModelIndex & index);
void setOrbitParams(void); void setOrbitParams(void);
void updateTLEs(void); void updateTLEs(void);
void repaintSourceList(void);
void predictIridiumFlares();
void selectCurrentIridiumFlare(const QModelIndex &modelIndex);
private: private:
//! @todo find out if this is really necessary... --BM //! @todo find out if this is really necessary... --BM
void enableSatelliteDataForm(bool enabled); void enableSatelliteDataForm(bool enabled);
void populateAboutPage(); void populateAboutPage();
//! Update the Settings tab with values from the plug-in. //! Update the Settings tab with values from the plug-in.
//! Calls updateCountdown(). Connected to Satellites::settingsChange d(). //! Calls updateCountdown(). Connected to Satellites::settingsChange d().
void updateSettingsPage(); void updateSettingsPage();
//! Populates the satellite groups filtering menu on the %Satellites tab. //! Populates the satellite groups filtering menu on the %Satellites tab.
//! Preserves the current item, if it's still in the new list. //! Preserves the current item, if it's still in the new list.
skipping to change at line 119 skipping to change at line 136
void populateSourcesList(); void populateSourcesList();
//! Add the special "New group..." editable item to the group select or. //! Add the special "New group..." editable item to the group select or.
//! Unlike the other items, which can only be checked/unchecked, thi s one //! Unlike the other items, which can only be checked/unchecked, thi s one
//! can be edited. Saving the edit will add a new group with the spe cified //! can be edited. Saving the edit will add a new group with the spe cified
//! name. //! name.
//! Called by updateSatelliteData() and handleGroupChanges(). //! Called by updateSatelliteData() and handleGroupChanges().
void addSpecialGroupItem(); void addSpecialGroupItem();
//! Applies the changes in the group selector to the selected satell ites. //! Applies the changes in the group selector to the selected satell ites.
void setGroups(); void setGroups();
//! Update header names for Iridium flares table
void setIridiumFlaresHeaderNames();
//! Init header and list of Iridium flares
void initListIridiumFlares();
Ui_satellitesDialog* ui; Ui_satellitesDialog* ui;
bool satelliteModified; bool satelliteModified;
QTimer* updateTimer; QTimer* updateTimer;
SatellitesImportDialog* importWindow; SatellitesImportDialog* importWindow;
SatellitesListFilterModel* filterModel; SatellitesListFilterModel* filterModel;
//! Makes sure that newly added source lines are as checkable as the rest. //! Makes sure that newly added source lines are as checkable as the rest.
Qt::ItemDataRole checkStateRole; Qt::ItemDataRole checkStateRole;
}; };
// Reimplements the QTreeWidgetItem class to fix the sorting bug
class SatPIFTreeWidgetItem : public QTreeWidgetItem
{
public:
SatPIFTreeWidgetItem(QTreeWidget* parent)
: QTreeWidgetItem(parent)
{
}
private:
bool operator < (const QTreeWidgetItem &other) const
{
int column = treeWidget()->sortColumn();
if (column == SatellitesDialog::IridiumFlaresMagnitude)
{
return text(column).toFloat() < other.text(column).t
oFloat();
}
else
{
return text(column).toLower() < other.text(column).t
oLower();
}
}
};
#endif // _SATELLITESDIALOG_HPP_ #endif // _SATELLITESDIALOG_HPP_
 End of changes. 7 change blocks. 
1 lines changed or deleted 52 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/