All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TerraView.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of TerraView - A Free and Open Source GIS Application.
4 
5  TerraView is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraView is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with TerraLib Code Editor. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@dpi.inpe.br>.
18  */
19 
20 /*!
21  \file terraview/TerraView.cpp
22 
23  \brief The main class of TerraView.
24 */
25 
26 // TerraView
27 #include "AboutDialog.h"
28 #include "TerraView.h"
29 #include "TerraViewConfig.h"
30 
31 // TerraLib
34 
35 // STL
36 #include <memory>
37 
38 // Qt
39 #include <QtGui/QAction>
40 #include <QtGui/QApplication>
41 #include <QtGui/QMenu>
42 
43 TerraView::TerraView(QWidget* parent)
44  : te::qt::af::BaseApplication(parent)
45 {
46 }
47 
49 {
50 }
51 
53 {
55 }
56 
57 void TerraView::init(const std::string& configFile)
58 {
60 
61  //set application icon
62  std::string tvIcon = TVIEW_LOGO_ICON;
63  QPixmap pix(tvIcon.c_str());
64  pix = pix.scaled(16, 16, Qt::KeepAspectRatio, Qt::SmoothTransformation);
65  QIcon icon(pix);
66 
67  this->setWindowIcon(icon);
68 }
69 
71 {
73 
75 
76  QAction* helpAbout = hmenu->addAction(tr("&About..."));
77 
78  helpAbout->setObjectName("Help.About");
79  helpAbout->setIcon(QIcon::fromTheme("help-about-browser"));
80 
81  connect(helpAbout, SIGNAL(triggered()), this, SLOT(showAboutDialog()));
82 }
83 
85 {
86  std::auto_ptr<AboutDialog> dialog(new AboutDialog(this));
87 
88  dialog->exec();
89 }
90 
92 {
93  te::qt::widgets::HelpManager::getInstance().showHelp("terraview/index.html", "dpi.inpe.br.terraview");
94 }
95 
96 
A singleton that contains a pointer to a help manager implementation.
The base API for controllers of TerraLib applications.
static ApplicationController & getInstance()
It gives access to the controller singleton.
void makeDialog()
Definition: TerraView.cpp:70
void onHelpTriggered()
Definition: TerraView.cpp:91
A Qt dialog showing MGis about window.
TerraView(QWidget *parent=0)
Definition: TerraView.cpp:43
void showAboutDialog()
Definition: TerraView.cpp:84
void init()
Definition: TerraView.cpp:52
static HelpManager & getInstance()
It returns a reference to the singleton instance.
The main class of TerraView.
QMenu * getMenu(const QString &id)
Returns a menu registered with key id.