StelDialog.hpp   StelDialog.hpp 
skipping to change at line 17 skipping to change at line 17
* 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 _STELDIALOG_HPP_ #ifndef _STELDIALOG_HPP_
#define _STELDIALOG_HPP_ #define _STELDIALOG_HPP_
#include <QObject> #include <QObject>
//! @class StelDialog //! @class StelDialog
//! Base class for all the GUI windows in stellarium //! Base class for all the GUI windows in Stellarium.
//!
//! Windows in Stellarium are actually basic QWidgets that have to be wrapp
ed in
//! a QGraphicsProxyWidget (CustomProxy) to be displayed by StelMainGraphic
sView
//! (which is derived from QGraphicsView). See the Qt documentation for det
ails.
//!
//! The base widget needs to be populated with controls in the implementati
on
//! of the createDialogContent() function. This can be done either manually
, or
//! by using a .ui file. See the Qt documentation on using Qt Designer .ui
files
//! for details.
//!
//! The createDialogContent() function itself is called automatically the f
irst
//! time setVisible() is called with "true".
//!
//! Moving a window is done by dragging its title bar, defined in the BarFr
ame
//! class. Every derived window class needs a BarFrame object - it
//! has to be either included in a .ui file, or manually instantiated in
//! createDialogContent().
class StelDialog : public QObject class StelDialog : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
StelDialog(QObject* parent=NULL); StelDialog(QObject* parent=NULL);
virtual ~StelDialog(); virtual ~StelDialog();
bool visible() const; bool visible() const;
public slots: public slots:
//! Retranslate the content of the dialog //! Retranslate the content of the dialog.
void languageChanged(); //! Needs to be connected to StelApp::languageChanged().
//! At the very least, if the window is
//! <a href="http://doc.qt.nokia.com/stable/designer-using-a-ui-file
.html">
//! based on a Qt Designer file (.ui)</a>, the implementation needs
to call
//! the generated class' retranslateUi() method, like this:
//! \code
//! if (dialog)
//! ui->retranslateUi(dialog);
//! \endcode
virtual void retranslate() = 0;
//! On the first call with "true" populates the window contents.
void setVisible(bool); void setVisible(bool);
//! Closes the window (the window widget is not deleted, just not vi sible).
void close(); void close();
signals: signals:
void visibleChanged(bool); void visibleChanged(bool);
protected: protected:
//! Initialize the dialog widgets and connect the signals/slots //! Initialize the dialog widgets and connect the signals/slots.
virtual void createDialogContent()=0; virtual void createDialogContent()=0;
//! The main dialog //! The main dialog
QWidget* dialog; QWidget* dialog;
class CustomProxy* proxy; class CustomProxy* proxy;
}; };
#endif // _STELDIALOG_HPP_ #endif // _STELDIALOG_HPP_
 End of changes. 5 change blocks. 
5 lines changed or deleted 43 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/