StelDialogLogBook.cpp   StelDialogLogBook.cpp 
skipping to change at line 21 skipping to change at line 21
* 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelDialogLogBook.hpp" #include "StelDialogLogBook.hpp"
#include "StelMainGraphicsView.hpp" #include "StelMainView.hpp"
#include "StelMainWindow.hpp" #include "StelMainWindow.hpp"
#include <QDebug> #include <QDebug>
#include <QDialog> #include <QDialog>
#include <QGraphicsProxyWidget> #include <QGraphicsProxyWidget>
#include <QStyleOptionGraphicsItem> #include <QStyleOptionGraphicsItem>
class CustomProxy : public QGraphicsProxyWidget class CustomProxy : public QGraphicsProxyWidget
{ {
public: public:
skipping to change at line 67 skipping to change at line 67
{ {
} }
StelDialogLogBook::~StelDialogLogBook() StelDialogLogBook::~StelDialogLogBook()
{ {
} }
void StelDialogLogBook::close() void StelDialogLogBook::close()
{ {
setVisible(false); setVisible(false);
StelMainGraphicsView::getInstance().scene()->setActiveWindow(0); StelMainView::getInstance().scene()->setActiveWindow(0);
((QGraphicsWidget*)StelMainGraphicsView::getInstance().getStelAppGra ((QGraphicsWidget*)StelMainView::getInstance().getStelAppGraphicsWid
phicsWidget())->setFocus(Qt::OtherFocusReason); get())->setFocus(Qt::OtherFocusReason);
emit(dialogClosed(this)); emit(dialogClosed(this));
} }
void StelDialogLogBook::setVisible(bool v) void StelDialogLogBook::setVisible(bool v)
{ {
if (v) if (v)
{ {
QSize screenSize = StelMainWindow::getInstance().size(); QSize screenSize = StelMainWindow::getInstance().size();
if (dialog) if (dialog)
{ {
dialog->show(); dialog->show();
StelMainGraphicsView::getInstance().scene()->setActi veWindow(proxy); StelMainView::getInstance().scene()->setActiveWindow (proxy);
// If the main window has been resized, it is possib le the dialog // If the main window has been resized, it is possib le the dialog
// will be off screen. Check for this and move it t o a visible // will be off screen. Check for this and move it t o a visible
// position if necessary // position if necessary
QPointF newPos = proxy->pos(); QPointF newPos = proxy->pos();
if (newPos.x()>=screenSize.width()) if (newPos.x()>=screenSize.width())
newPos.setX(screenSize.width() - dialog->siz e().width()); newPos.setX(screenSize.width() - dialog->siz e().width());
if (newPos.y()>=screenSize.height()) if (newPos.y()>=screenSize.height())
newPos.setY(screenSize.height() - dialog->si ze().height()); newPos.setY(screenSize.height() - dialog->si ze().height());
if (newPos != dialog->pos()) if (newPos != dialog->pos())
proxy->setPos(newPos); proxy->setPos(newPos);
skipping to change at line 105 skipping to change at line 105
dialog = new QDialog(NULL); dialog = new QDialog(NULL);
connect(dialog, SIGNAL(rejected()), this, SLOT(close())); connect(dialog, SIGNAL(rejected()), this, SLOT(close()));
createDialogContent(); createDialogContent();
proxy = new CustomProxy(NULL, Qt::Tool); proxy = new CustomProxy(NULL, Qt::Tool);
proxy->setWidget(dialog); proxy->setWidget(dialog);
QRectF bound = proxy->boundingRect(); QRectF bound = proxy->boundingRect();
// centre with dialog according to current window size. // centre with dialog according to current window size.
proxy->setPos((int)((screenSize.width()-bound.width())/2), ( int)((screenSize.height()-bound.height())/2)); proxy->setPos((int)((screenSize.width()-bound.width())/2), ( int)((screenSize.height()-bound.height())/2));
StelMainGraphicsView::getInstance().scene()->addItem(proxy); StelMainView::getInstance().scene()->addItem(proxy);
proxy->setWindowFrameMargins(2,0,2,2); proxy->setWindowFrameMargins(2,0,2,2);
// The caching is buggy on all plateforms with Qt 4.5.2 // The caching is buggy on all plateforms with Qt 4.5.2
#if QT_VERSION==0x040502 #if QT_VERSION==0x040502
proxy->setCacheMode(QGraphicsItem::NoCache); proxy->setCacheMode(QGraphicsItem::NoCache);
#else #else
proxy->setCacheMode(QGraphicsItem::DeviceCoordinateCache); proxy->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
#endif #endif
proxy->setZValue(100); proxy->setZValue(100);
StelMainGraphicsView::getInstance().scene()->setActiveWindow (proxy); StelMainView::getInstance().scene()->setActiveWindow(proxy);
proxy->setFocus(); proxy->setFocus();
} }
else else
{ {
dialog->hide(); dialog->hide();
emit visibleChanged(false); emit visibleChanged(false);
//proxy->clearFocus(); //proxy->clearFocus();
StelMainGraphicsView::getInstance().scene()->setActiveWindow (0); StelMainView::getInstance().scene()->setActiveWindow(0);
} }
} }
 End of changes. 6 change blocks. 
8 lines changed or deleted 8 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/