TelescopeDialog.hpp   TelescopeDialog.hpp 
/* /*
* Stellarium Telescope Control Plug-in * Stellarium Telescope Control Plug-in
* *
* Copyright (C) 2009-2010 Bogdan Marinov (this file) * Copyright (C) 2009-2011 Bogdan Marinov (this file)
* *
* 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.
* *
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef _TELESCOPEDIALOG_HPP_ #ifndef _TELESCOPEDIALOG_HPP_
#define _TELESCOPEDIALOG_HPP_ #define _TELESCOPEDIALOG_HPP_
#include <QObject> #include <QObject>
#include <QHash> #include <QHash>
#include <QIntValidator> #include <QIntValidator>
#include <QModelIndex> #include <QModelIndex>
#include <QStandardItemModel> #include <QStandardItemModel>
//#include "StelDialog.hpp" #include "StelDialog.hpp"
#include "StelDialogTelescopeControl.hpp"
#include "TelescopeControlGlobals.hpp" #include "TelescopeControlGlobals.hpp"
#include "TelescopeConfigurationDialog.hpp" #include "TelescopeConfigurationDialog.hpp"
using namespace TelescopeControlGlobals; using namespace TelescopeControlGlobals;
class Ui_telescopeDialogForm; class Ui_telescopeDialogForm;
class TelescopeConfigurationDialog; class TelescopeConfigurationDialog;
class TelescopeControl; class TelescopeControl;
class TelescopeDialog : public StelDialogTelescopeControl class TelescopeDialog : public StelDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
TelescopeDialog(); TelescopeDialog();
virtual ~TelescopeDialog(); virtual ~TelescopeDialog();
void updateStyle(); void updateStyle();
public slots: public slots:
void languageChanged(); void retranslate();
protected: protected:
//! Initialize the dialog widgets and connect the signals/slots //! Initialize the dialog widgets and connect the signals/slots
virtual void createDialogContent(); virtual void createDialogContent();
Ui_telescopeDialogForm* ui; Ui_telescopeDialogForm* ui;
private: private:
enum TelescopeStatus {
StatusNA = 0,
StatusStarting,
StatusConnecting,
StatusConnected,
StatusDisconnected,
StatusStopped,
StatusCount
};
//! Update the text and the tooltip of the ChangeStatus button //! Update the text and the tooltip of the ChangeStatus button
void updateStatusButtonForSlot(int slot); void updateStatusButtonForSlot(int slot);
void setStatusButtonToStart(); void setStatusButtonToStart();
void setStatusButtonToStop(); void setStatusButtonToStop();
void setStatusButtonToConnect(); void setStatusButtonToConnect();
void setStatusButtonToDisconnect(); void setStatusButtonToDisconnect();
void setAboutText();
void setHeaderNames();
void updateWarningTexts();
QString getTypeLabel(ConnectionType type);
void addModelRow(int slotNumber, ConnectionType type, TelescopeStatu
s status, const QString& name);
void updateModelRow(int rowNumber, ConnectionType type, TelescopeSta
tus status, const QString& name);
private slots: private slots:
void buttonChangeStatusPressed(void); void buttonChangeStatusPressed(void);
void buttonConfigurePressed(void); void buttonConfigurePressed(void);
void buttonAddPressed(void); void buttonAddPressed(void);
void buttonRemovePressed(void); void buttonRemovePressed(void);
void checkBoxUseExecutablesToggled(bool); void checkBoxUseExecutablesToggled(bool);
void buttonBrowseServerDirectoryPressed(void); void buttonBrowseServerDirectoryPressed(void);
//! Slot for receiving information from TelescopeConfigurationDialog //! Slot for receiving information from TelescopeConfigurationDialog
void saveChanges(QString name, ConnectionType type); void saveChanges(QString name, ConnectionType type);
//! Slot for receiving information from TelescopeConfigurationDialog //! Slot for receiving information from TelescopeConfigurationDialog
void discardChanges(void); void discardChanges(void);
void toggleReticles(int);
void toggleLabels(int);
void toggleCircles(int);
void selectTelecope(const QModelIndex &); void selectTelecope(const QModelIndex &);
void configureTelescope(const QModelIndex &); void configureTelescope(const QModelIndex &);
//! Update the list of telescopes with their current states //! Update the list of telescopes with their current states
void updateTelescopeStates(void); void updateTelescopeStates(void);
private: private:
enum TelescopeStatus {
StatusNA = 0,
StatusStarting,
StatusConnecting,
StatusConnected,
StatusDisconnected,
StatusStopped,
StatusCount
};
//! @enum ModelColumns This enum defines the number and the order of the columns in the table that lists active telescopes //! @enum ModelColumns This enum defines the number and the order of the columns in the table that lists active telescopes
enum ModelColumns { enum ModelColumns {
ColumnSlot = 0, //!< slot number column ColumnSlot = 0, //!< slot number column
//ColumnStartup, //!< startup checkbox column //ColumnStartup, //!< startup checkbox column
ColumnStatus, //!< telescope status column ColumnStatus, //!< telescope status column
ColumnType, //!< telescope type column ColumnType, //!< telescope type column
ColumnName, //!< telescope name column ColumnName, //!< telescope name column
ColumnCount //!< total number of columns ColumnCount //!< total number of columns
}; };
QHash<int, QString> statusString; QHash<int, QString> statusString;
TelescopeConfigurationDialog configurationDialog; TelescopeConfigurationDialog configurationDialog;
QStandardItemModel * telescopeListModel; QStandardItemModel * telescopeListModel;
TelescopeControl * telescopeManager; TelescopeControl * telescopeManager;
int telescopeStatus[SLOT_NUMBER_LIMIT]; TelescopeStatus telescopeStatus[SLOT_NUMBER_LIMIT];
ConnectionType telescopeType[SLOT_NUMBER_LIMIT]; ConnectionType telescopeType[SLOT_NUMBER_LIMIT];
int telescopeCount; int telescopeCount;
int configuredSlot; int configuredSlot;
bool configuredTelescopeIsNew; bool configuredTelescopeIsNew;
}; };
#endif // _TELESCOPEDIALOG_ #endif // _TELESCOPEDIALOG_
 End of changes. 10 change blocks. 
20 lines changed or deleted 26 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/