1 /*
2  * minimapdock.cpp
3  * Copyright 2012, Christoph Schnackenberg <bluechs@gmx.de>
4  *
5  * This file is part of Tiled.
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the Free
9  * Software Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15  * more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include "minimapdock.h"
22 
23 #include "minimap.h"
24 
25 #include <QEvent>
26 
27 using namespace Tiled;
28 
MiniMapDock(QWidget * parent)29 MiniMapDock::MiniMapDock(QWidget *parent)
30     : QDockWidget(parent)
31 {
32     setObjectName(QLatin1String("miniMapDock"));
33 
34     mMiniMap = new MiniMap(this);
35 
36     setWidget(mMiniMap);
37     retranslateUi();
38 }
39 
setMapDocument(MapDocument * map)40 void MiniMapDock::setMapDocument(MapDocument *map)
41 {
42     mMiniMap->setMapDocument(map);
43 }
44 
changeEvent(QEvent * e)45 void MiniMapDock::changeEvent(QEvent *e)
46 {
47     QDockWidget::changeEvent(e);
48     switch (e->type()) {
49     case QEvent::LanguageChange:
50         retranslateUi();
51         break;
52     default:
53         break;
54     }
55 }
56 
retranslateUi()57 void MiniMapDock::retranslateUi()
58 {
59     setWindowTitle(tr("Mini-map"));
60 }
61 
62 #include "moc_minimapdock.cpp"
63