StoredViewDialog.cpp   StoredViewDialog.cpp 
skipping to change at line 23 skipping to change at line 23
* 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 "StoredViewDialog.hpp" #include "StoredViewDialog.hpp"
#include "StoredViewDialog_p.hpp" #include "StoredViewDialog_p.hpp"
#include "Scenery3dMgr.hpp" #include "Scenery3d.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
StoredViewDialog::StoredViewDialog(QObject *parent) : StelDialog("Scenery3d Views", parent), mgr(NULL), viewModel(NULL) StoredViewDialog::StoredViewDialog(QObject *parent) : StelDialog("Scenery3d Views", parent), mgr(Q_NULLPTR), viewModel(Q_NULLPTR)
{ {
ui = new Ui_storedViewDialogForm; ui = new Ui_storedViewDialogForm;
} }
StoredViewDialog::~StoredViewDialog() StoredViewDialog::~StoredViewDialog()
{ {
delete ui; delete ui;
} }
void StoredViewDialog::retranslate() void StoredViewDialog::retranslate()
skipping to change at line 52 skipping to change at line 52
if(dialog) if(dialog)
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
} }
void StoredViewDialog::createDialogContent() void StoredViewDialog::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
connect(ui->closeStelWindow, &QPushButton::clicked, this, &StelDialo g::close); connect(ui->closeStelWindow, &QPushButton::clicked, this, &StelDialo g::close);
connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMove dTo(QPoint))); connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMove dTo(QPoint)));
mgr = GETSTELMODULE(Scenery3dMgr); mgr = GETSTELMODULE(Scenery3d);
Q_ASSERT(mgr); Q_ASSERT(mgr);
connect(ui->pushButtonAddView, &QPushButton::clicked, this, &StoredV iewDialog::addUserView); connect(ui->pushButtonAddView, &QPushButton::clicked, this, &StoredV iewDialog::addUserView);
connect(ui->pushButtonLoadView, &QPushButton::clicked, this, &Stored ViewDialog::loadView); connect(ui->pushButtonLoadView, &QPushButton::clicked, this, &Stored ViewDialog::loadView);
//also allow doubleclick to load view //also allow doubleclick to load view
connect(ui->listView, &QListView::doubleClicked, this, &StoredViewDi alog::loadView); connect(ui->listView, &QListView::doubleClicked, this, &StoredViewDi alog::loadView);
connect(ui->pushButtonDeleteView, &QPushButton::clicked, this, &Stor edViewDialog::deleteView); connect(ui->pushButtonDeleteView, &QPushButton::clicked, this, &Stor edViewDialog::deleteView);
connect(ui->lineEditTitle, &QLineEdit::editingFinished, this, &Store dViewDialog::updateCurrentView); connect(ui->lineEditTitle, &QLineEdit::editingFinished, this, &Store dViewDialog::updateCurrentView);
connect(ui->textEditDescription, &CustomTextEdit::editingFinished, t his, &StoredViewDialog::updateCurrentView); connect(ui->textEditDescription, &CustomTextEdit::editingFinished, t his, &StoredViewDialog::updateCurrentView);
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( )); StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui( ));
Q_ASSERT(gui); Q_ASSERT(gui);
ui->textEditDescription->document()->setDefaultStyleSheet(QString(gu i->getStelStyle().htmlStyleSheet)); ui->textEditDescription->document()->setDefaultStyleSheet(QString(gu i->getStelStyle().htmlStyleSheet));
//we use a sorta MVC system here //we use a sorta MVC system here
viewModel = new StoredViewModel(ui->listView); viewModel = new StoredViewModel(ui->listView);
ui->listView->setModel(viewModel); ui->listView->setModel(viewModel);
connect(ui->listView->selectionModel(), &QItemSelectionModel::curren tChanged, this, &StoredViewDialog::updateViewSelection); connect(ui->listView->selectionModel(), &QItemSelectionModel::curren tChanged, this, &StoredViewDialog::updateViewSelection);
connect(mgr, &Scenery3dMgr::currentSceneChanged, viewModel, &StoredV iewModel::setScene); connect(mgr, &Scenery3d::currentSceneChanged, viewModel, &StoredView Model::setScene);
connect(viewModel, &QAbstractItemModel::modelReset, this, &StoredVie wDialog::resetViewSelection); connect(viewModel, &QAbstractItemModel::modelReset, this, &StoredVie wDialog::resetViewSelection);
viewModel->setScene(mgr->getCurrentScene()); viewModel->setScene(mgr->getCurrentScene());
} }
void StoredViewDialog::updateCurrentView() void StoredViewDialog::updateCurrentView()
{ {
int idx = ui->listView->selectionModel()->currentIndex().row(); int idx = ui->listView->selectionModel()->currentIndex().row();
if(idx>=0) if(idx>=0)
{ {
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 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/