LogBookDialog.cpp   SessionsDialog.cpp 
/* /*
* Copyright (C) 2009 Timothy Reaves * Copyright (C) 2010 Timothy Reaves
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#include "LogBookDialog.hpp" #include "SessionsDialog.hpp"
#include "LogBookCommon.hpp"
#include "FieldConcatModel.hpp" #include "FieldConcatModel.hpp"
#include "LogBook.hpp"
#include "LogBookCommon.hpp"
#include "ObservationsDialog.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelGui.hpp"
#include "StelMainGraphicsView.hpp" #include "StelMainGraphicsView.hpp"
#include "ui_LogBookDialog.h" #include "StelModuleMgr.hpp"
#include "StelStyle.hpp"
#include "ui_SessionsDialog.h"
#include <QDateTime> #include <QDateTime>
#include <QDebug> #include <QDebug>
#include <QModelIndex> #include <QModelIndex>
#include <QSqlDatabase> #include <QSqlDatabase>
#include <QSqlError> #include <QSqlError>
#include <QSqlField> #include <QSqlField>
#include <QSqlRecord> #include <QSqlRecord>
#include <QSqlRelation> #include <QSqlRelation>
#include <QSqlRelationalTableModel> #include <QSqlRelationalTableModel>
#include <QSqlTableModel> #include <QSqlTableModel>
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Creation & Destruction #pragma mark Creation & Destruction
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
LogBookDialog::LogBookDialog(QMap<QString, QSqlTableModel *> theTableModels ) SessionsDialog::SessionsDialog(QMap<QString, QSqlTableModel *> theTableMode ls)
{ {
ui = new Ui_LogBookDialogForm; ui = new Ui_SessionsDialog;
tableModels = theTableModels; tableModels = theTableModels;
} }
LogBookDialog::~LogBookDialog() SessionsDialog::~SessionsDialog()
{ {
delete ui; delete ui;
ui = NULL; ui = NULL;
} }
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark StelModule Methods #pragma mark StelModule Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void LogBookDialog::languageChanged() void SessionsDialog::languageChanged()
{ {
if (dialog) { if (dialog) {
ui->retranslateUi(dialog); ui->retranslateUi(dialog);
} }
} }
void LogBookDialog::styleChanged() void SessionsDialog::styleChanged()
{ {
// Nothing for now // Nothing for now
} }
void SessionsDialog::updateStyle()
{
if(dialog) {
StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance()
.getGui());
Q_ASSERT(gui);
const StelStyle pluginStyle = GETSTELMODULE(LogBook)->getMod
uleStyleSheet(gui->getStelStyle());
dialog->setStyleSheet(pluginStyle.qtStyleSheet);
ui->commentsTextEdit->document()->setDefaultStyleSheet(QStri
ng(pluginStyle.htmlStyleSheet));
ui->weatherTextEdit->document()->setDefaultStyleSheet(QStrin
g(pluginStyle.htmlStyleSheet));
}
}
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Slot Methods #pragma mark Slot Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void LogBookDialog::accessoriesTextChanged() void SessionsDialog::commentsTextChanged()
{
QSqlRecord record = currentSessionRecord();
if (!record.isEmpty() && record.value("accessories").toString() != u
i->accessoriesTextEdit->toPlainText()) {
record.setValue("accessories", ui->accessoriesTextEdit->toPl
ainText());
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->sessionsListView->setCurrentIndex(tableModels[OBSERVATIONS]->ind
ex(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::barlowChanged(const QString &newValue)
{ {
QSqlRecord record = currentSessionRecord(); QSqlRecord record = currentSessionRecord();
int newIndex = fieldModels[BARLOWS]->idForDisplayString(newValue);
if (!record.isEmpty() && record.value("barlow_id").toInt() != newInd
ex) {
record.setValue("barlow_id", newIndex);
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]-
>index(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::closeWindow()
{
setVisible(false);
StelMainGraphicsView::getInstance().scene()->setActiveWindow(0);
}
void LogBookDialog::commentsTextChanged() if (!record.isEmpty() && record.value("comments").toString() != ui->
{ commentsTextEdit->toPlainText()) {
QSqlRecord record = currentSessionRecord(); record.setValue("comments", ui->commentsTextEdit->toPlainTex
t());
if (!record.isEmpty() && record.value("comments").toString() != ui->
sessionNotesTextEdit->toPlainText()) {
record.setValue("comments", ui->sessionNotesTextEdit->toPlai
nText());
tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record); tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record);
if (!tableModels[SESSIONS]->submit()) { if (!tableModels[SESSIONS]->submit()) {
qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError(); qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError();
} }
ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]- >index(lastSessionRowNumberSelected, 1));
} }
ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1));
} }
void LogBookDialog::deleteSelectedObservation() void SessionsDialog::deleteSelectedSession()
{
QModelIndex selection = ui->observationsListView->currentIndex();
if (selection.row() != -1 && observationsModel->rowCount() > 1) {
observationsModel->removeRows(selection.row(), 1);
ui->observationsListView->setCurrentIndex(observationsModel-
>index(0, 1));
}
}
void LogBookDialog::deleteSelectedSession()
{ {
QModelIndex selection = ui->sessionsListView->currentIndex(); QModelIndex selection = ui->sessionsListView->currentIndex();
if (selection.row() != -1 && tableModels[SESSIONS]->rowCount() > 1) { if (selection.row() != -1 && tableModels[SESSIONS]->rowCount() > 1) {
tableModels[SESSIONS]->removeRows(selection.row(), 1); tableModels[SESSIONS]->removeRows(selection.row(), 1);
ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]- >index(0, 1)); ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]- >index(0, 1));
} }
} }
void LogBookDialog::filterChanged(const QString &newValue) void SessionsDialog::insertNewSession()
{
QSqlRecord record = currentSessionRecord();
int newIndex = fieldModels[FILTERS]->idForDisplayString(newValue);
if (!record.isEmpty() && record.value("filter_id").toInt() != newInd
ex) {
record.setValue("filter_id", newIndex);
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]-
>index(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::imagerChanged(const QString &newValue)
{
QSqlRecord record = currentSessionRecord();
int newIndex = fieldModels[IMAGERS]->idForDisplayString(newValue);
if (!record.isEmpty() && record.value("imager_id").toInt() != newInd
ex) {
record.setValue("imager_id", newIndex);
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]-
>index(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::insertNewObservation()
{
QSqlField field1("observer_id", QVariant::Int);
QSqlField field2("session_id", QVariant::Int);
QSqlField field3("target_id", QVariant::Int);
QSqlField field4("begin", QVariant::String);
QSqlField field5("end", QVariant::String);
QSqlField field6("optics_id", QVariant::Int);
field1.setValue(QVariant(1));
field2.setValue(QVariant(1));
field3.setValue(QVariant(1));
QDateTime dateTime = QDateTime::currentDateTime();
field4.setValue(QVariant(dateTime.toString("yyyy/MM/dd HH:mm")));
dateTime = dateTime.addSecs(600);
field5.setValue(QVariant(dateTime.toString("yyyy/MM/dd HH:mm")));
field6.setValue(QVariant(1));
QSqlRecord newRecord = QSqlRecord();
newRecord.append(field1);
newRecord.append(field2);
newRecord.append(field3);
newRecord.append(field4);
newRecord.append(field5);
newRecord.append(field6);
if (observationsModel->insertRecord(-1, newRecord)) {
ui->observationsListView->setCurrentIndex(observationsModel-
>index(observationsModel->rowCount() - 1, 1));
} else {
qWarning() << "LogBook: could not insert new observation. T
he error is: " << observationsModel->lastError();
}
}
void LogBookDialog::insertNewSession()
{ {
QSqlField field1("begin", QVariant::String); QSqlField field1("begin", QVariant::String);
QSqlField field2("end", QVariant::String); QSqlField field2("end", QVariant::String);
QSqlField field3("site_id", QVariant::Int); QSqlField field3("site_id", QVariant::Int);
QSqlField field4("observer_id", QVariant::Int); QSqlField field4("observer_id", QVariant::Int);
QDateTime dateTime = QDateTime::currentDateTime(); QDateTime dateTime = QDateTime::currentDateTime();
field1.setValue(QVariant(dateTime.toString("yyyy/MM/dd HH:mm"))); field1.setValue(QVariant(dateTime.toString("yyyy/MM/dd HH:mm")));
dateTime = dateTime.addSecs(60*60); dateTime = dateTime.addSecs(60*60);
field2.setValue(QVariant(dateTime.toString("yyyy/MM/dd HH:mm"))); field2.setValue(QVariant(dateTime.toString("yyyy/MM/dd HH:mm")));
// field3.setValue(QVariant(1)); field3.setValue(QVariant(1));
// field4.setValue(QVariant(1));
QSqlRecord newRecord = QSqlRecord(); QSqlRecord newRecord = QSqlRecord();
newRecord.append(field1); newRecord.append(field1);
newRecord.append(field2); newRecord.append(field2);
// newRecord.append(field3); newRecord.append(field3);
// newRecord.append(field4);
if (tableModels[SESSIONS]->insertRecord(-1, newRecord)) { if (sessionsModel->insertRecord(-1, newRecord)) {
ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]- ui->sessionsListView->setCurrentIndex(sessionsModel->index(s
>index(tableModels[SESSIONS]->rowCount() - 1, 1)); essionsModel->rowCount() - 1, 1));
} else { } else {
qWarning() << "LogBook: could not insert new session. The e qWarning() << "LogBook: could not insert new session. The e
rror is: " << tableModels[SESSIONS]->lastError(); rror is: " << sessionsModel->lastError();
}
}
void LogBookDialog::limitingMagnitudeChanged(const QString &newValue)
{
QSqlRecord record = currentSessionRecord();
if (!record.isEmpty() && record.value("limiting_magnitude").toString
() != newValue) {
record.setValue("limiting_magnitude", newValue);
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]-
>index(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::notesTextChanged()
{
QSqlRecord record = currentSessionRecord();
if (!record.isEmpty() && record.value("notes").toString() != ui->acc
essoriesTextEdit->toPlainText()) {
record.setValue("notes", ui->accessoriesTextEdit->toPlainTex
t());
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->sessionsListView->setCurrentIndex(tableModels[OBSERVATIONS]->ind
ex(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::ocularChanged(const QString &newValue)
{
QSqlRecord record = currentSessionRecord();
int newIndex = fieldModels[OCULARS]->idForDisplayString(newValue);
if (!record.isEmpty() && record.value("ocular_id").toInt() != newInd
ex) {
record.setValue("ocular_id", newIndex);
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]-
>index(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::observationBeginDateTimeChanged(const QDateTime &dateti
me)
{
QSqlRecord record = currentSessionRecord();
if (!record.isEmpty() && record.value("begin") != datetime.toString(
"yyyy/MM/dd HH:mm")) {
record.setValue("begin", datetime.toString("yyyy/MM/dd HH:mm
"));
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]-
>index(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::observationEndDateTimeChanged(const QDateTime &datetime
)
{
QSqlRecord record = currentSessionRecord();
if (!record.isEmpty() && record.value("end") != datetime.toString("y
yyy/MM/dd HH:mm")) {
record.setValue("end", datetime.toString("yyyy/MM/dd HH:mm")
);
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
} }
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]- >index(lastObservationRowNumberSelected, 1));
} }
void LogBookDialog::observationObserverChanged(const QString &newValue) void SessionsDialog::beginDateTimeChanged(const QDateTime &datetime)
{
QSqlRecord record = currentSessionRecord();
int newIndex = fieldModels[QString(OBSERVATIONS) + QString(OBSERVERS
)]->idForDisplayString(newValue);
if (!record.isEmpty() && record.value("observer_id").toInt() != newI
ndex) {
record.setValue("observer_id", newIndex);
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]-
>index(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::observationSelected(const QModelIndex &index)
{
if (index.row() != -1) {
lastObservationRowNumberSelected = index.row();
//Switch the to observation tab
ui->tabWidget->setCurrentIndex(1);
ui->observationTabWidget->setCurrentIndex(0);
populateFormWithObservationIndex(index);
}
}
void LogBookDialog::opticChanged(const QString &newValue)
{
QSqlRecord record = currentSessionRecord();
int newIndex = fieldModels[OPTICS]->idForDisplayString(newValue);
if (!record.isEmpty() && record.value("optics_id").toInt() != newInd
ex) {
record.setValue("optics_id", newIndex);
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]-
>index(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::seeingChanged(const QString &newValue)
{
QSqlRecord record = currentSessionRecord();
if (!record.isEmpty() && record.value("seeing").toString() != newVal
ue) {
record.setValue("seeing", newValue);
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]-
>index(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::sessionBeginDateTimeChanged(const QDateTime &datetime)
{ {
QSqlRecord record = currentSessionRecord(); QSqlRecord record = currentSessionRecord();
if (!record.isEmpty() && record.value("begin") != datetime.toString( "yyyy/MM/dd HH:mm")) { if (!record.isEmpty() && record.value("begin") != datetime.toString( "yyyy/MM/dd HH:mm")) {
record.setValue("begin", datetime.toString("yyyy/MM/dd HH:mm ")); record.setValue("begin", datetime.toString("yyyy/MM/dd HH:mm "));
tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record); tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record);
if (!tableModels[SESSIONS]->submit()) { if (!tableModels[SESSIONS]->submit()) {
qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError(); qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError();
} }
} }
ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1)); ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1));
} }
void LogBookDialog::sessionEndDateTimeChanged(const QDateTime &datetime) void SessionsDialog::endDateTimeChanged(const QDateTime &datetime)
{ {
QSqlRecord record = currentSessionRecord(); QSqlRecord record = currentSessionRecord();
if (!record.isEmpty() && record.value("end") != datetime.toString("y yyy/MM/dd HH:mm")) { if (!record.isEmpty() && record.value("end") != datetime.toString("y yyy/MM/dd HH:mm")) {
record.setValue("end", datetime.toString("yyyy/MM/dd HH:mm") ); record.setValue("end", datetime.toString("yyyy/MM/dd HH:mm") );
tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record); tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record);
if (!tableModels[SESSIONS]->submit()) { if (!tableModels[SESSIONS]->submit()) {
qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError(); qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError();
} }
} }
ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1)); ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1));
} }
void LogBookDialog::sessionObserverChanged(const QString &newValue) void SessionsDialog::observationWindowClosed(StelDialogLogBook* theDialog)
{
disconnect(theDialog, SIGNAL(dialogClosed(StelDialogLogBook *)), thi
s, SLOT(observationWindowClosed(StelDialogLogBook *)));
delete theDialog;
}
void SessionsDialog::observerChanged(const QString &newValue)
{ {
QSqlRecord record = currentSessionRecord(); QSqlRecord record = currentSessionRecord();
int newIndex = fieldModels[QString(SESSIONS) + QString(OBSERVERS)]-> idForDisplayString(newValue); int newIndex = fieldModels[QString(OBSERVERS)]->idForDisplayString(n ewValue);
if (!record.isEmpty() && record.value("observer_id").toInt() != newI ndex) { if (!record.isEmpty() && record.value("observer_id").toInt() != newI ndex) {
record.setValue("observer_id", newIndex); record.setValue("observer_id", newIndex);
tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record); tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record);
if (!tableModels[SESSIONS]->submit()) { if (!tableModels[SESSIONS]->submit()) {
qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError(); qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError();
} }
} }
ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1)); ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1));
} }
void LogBookDialog::sessionSelected(const QModelIndex &index) void SessionsDialog::openObservations()
{
int sessionID = currentSessionRecord().value("session_id").toInt();
ObservationsDialog* observationsDialog = new ObservationsDialog(tabl
eModels, sessionID);
connect(observationsDialog, SIGNAL(dialogClosed(StelDialogLogBook *)
), this, SLOT(observationWindowClosed(StelDialogLogBook *)));
observationsDialog->updateStyle();
observationsDialog->setVisible(true);
}
void SessionsDialog::sessionSelected(const QModelIndex &index)
{ {
if (index.row() != -1) { if (index.row() != -1) {
lastSessionRowNumberSelected = index.row(); lastSessionRowNumberSelected = index.row();
//Switch the to session tab
ui->tabWidget->setCurrentIndex(0);
populateFormWithSessionIndex(index); populateFormWithSessionIndex(index);
} }
} }
void LogBookDialog::siteChanged(const QString &newValue) void SessionsDialog::siteChanged(const QString &newValue)
{ {
QSqlRecord record = currentSessionRecord(); QSqlRecord record = currentSessionRecord();
int newIndex = fieldModels[SITES]->idForDisplayString(newValue); int newIndex = fieldModels[SITES]->idForDisplayString(newValue);
if (!record.isEmpty() && record.value("site_id").toInt() != newIndex ) { if (!record.isEmpty() && record.value("site_id").toInt() != newIndex ) {
record.setValue("site_id", newIndex); record.setValue("site_id", newIndex);
tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record); tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record);
if (!tableModels[SESSIONS]->submit()) { if (!tableModels[SESSIONS]->submit()) {
qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError(); qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError();
} }
} }
ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1)); ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1));
} }
void LogBookDialog::targetChanged(const QString &newValue) void SessionsDialog::weatherTextChanged()
{
QSqlRecord record = currentSessionRecord();
int newIndex = fieldModels[TARGETS]->idForDisplayString(newValue);
if (!record.isEmpty() && record.value("target_id").toInt() != newInd
ex) {
record.setValue("target_id", newIndex);
tableModels[OBSERVATIONS]->setRecord(lastObservationRowNumbe
rSelected, record);
if (!tableModels[OBSERVATIONS]->submit()) {
qWarning() << "LogBook: could not update observation
. Error is: " << tableModels[OBSERVATIONS]->lastError();
}
}
ui->observationsListView->setCurrentIndex(tableModels[OBSERVATIONS]-
>index(lastObservationRowNumberSelected, 1));
}
void LogBookDialog::weatherTextChanged()
{ {
QSqlRecord record = currentSessionRecord(); QSqlRecord record = currentSessionRecord();
if (!record.isEmpty() && record.value("weather").toString() != ui->w eatherTextEdit->toPlainText()) { if (!record.isEmpty() && record.value("weather").toString() != ui->w eatherTextEdit->toPlainText()) {
record.setValue("weather", ui->weatherTextEdit->toPlainText( )); record.setValue("weather", ui->weatherTextEdit->toPlainText( ));
tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record); tableModels[SESSIONS]->setRecord(lastSessionRowNumberSelecte d, record);
if (!tableModels[SESSIONS]->submit()) { if (!tableModels[SESSIONS]->submit()) {
qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError(); qWarning() << "LogBook: could not update session. E rror is: " << tableModels[SESSIONS]->lastError();
} }
} }
ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1)); ui->sessionsListView->setCurrentIndex(tableModels[SESSIONS]->index(l astSessionRowNumberSelected, 1));
} }
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Protected Methods #pragma mark Protected Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void LogBookDialog::createDialogContent() void SessionsDialog::createDialogContent()
{ {
ui->setupUi(dialog); ui->setupUi(dialog);
// All of the table models // All of the table models
setupModels(); setupModels();
setupConnections(); setupConnections();
ui->sessionsListView->setCurrentIndex(fieldModels[SESSIONS]->index(0 , 1)); ui->sessionsListView->setCurrentIndex(fieldModels[SESSIONS]->index(0 , 1));
}
QSqlRecord LogBookDialog::currentObservationRecord() //Initialize the style
{ updateStyle();
if (lastObservationRowNumberSelected == -1) {
return QSqlRecord();
} else {
return tableModels[OBSERVATIONS]->record(lastObservationRowN
umberSelected);
}
} }
QSqlRecord LogBookDialog::currentSessionRecord() QSqlRecord SessionsDialog::currentSessionRecord()
{ {
if (lastSessionRowNumberSelected == -1) { if (lastSessionRowNumberSelected == -1) {
return QSqlRecord(); return QSqlRecord();
} else { } else {
return tableModels[SESSIONS]->record(lastSessionRowNumberSel ected); return tableModels[SESSIONS]->record(lastSessionRowNumberSel ected);
} }
} }
void LogBookDialog::populateFormWithObservationIndex(const QModelIndex &ind void SessionsDialog::populateFormWithSessionIndex(const QModelIndex &index)
ex)
{
if (index.row() != -1) {
teardownConnections();
//We first need to handle the new session
QSqlRecord record = tableModels[OBSERVATIONS]->record(index.
row());
ui->observationBeginDateTimeEdit->setDateTime(QDateTime::fro
mString(record.value("begin").toString(), "yyyy/MM/dd HH:mm"));
ui->observationEndDateTimeEdit->setDateTime(QDateTime::fromS
tring(record.value("end").toString(), "yyyy/MM/dd HH:mm"));
ui->accessoriesTextEdit->setPlainText(record.value("accessor
ies").toString());
ui->observationNotesTextEdit->setPlainText(record.value("not
es").toString());
QModelIndexList list1
= tableModels[OBSERVERS]->match(tableModels[OBSERVERS]->inde
x(0, 0), Qt::DisplayRole, record.value("observer_id"));
QSqlRecord typeRecord1 = tableModels[OBSERVERS]->record(list
1[0].row());
ui->observationObserverComboBox->setCurrentIndex(ui->session
ObserverComboBox
->findText(fieldModels[QString(SESSION
S) + QString(OBSERVERS)]->displayStringForRecord(typeRecord1)));
list1 = tableModels[OPTICS]->match(tableModels[OPTICS]->inde
x(0, 0), Qt::DisplayRole, record.value("optics_id"));
typeRecord1 = tableModels[OPTICS]->record(list1[0].row());
ui->opticComboBox->setCurrentIndex(ui->opticComboBox->findTe
xt(fieldModels[OPTICS]->displayStringForRecord(typeRecord1)));
list1 = tableModels[OCULARS]->match(tableModels[OCULARS]->in
dex(0, 0), Qt::DisplayRole, record.value("ocular_id"));
typeRecord1 = tableModels[OCULARS]->record(list1[0].row());
ui->ocularComboBox->setCurrentIndex(ui->ocularComboBox->find
Text(fieldModels[OCULARS]->displayStringForRecord(typeRecord1)));
list1 = tableModels[BARLOWS]->match(tableModels[BARLOWS]->in
dex(0, 0), Qt::DisplayRole, record.value("barlow_id"));
typeRecord1 = tableModels[BARLOWS]->record(list1[0].row());
ui->barlowComboBox->setCurrentIndex(ui->barlowComboBox->find
Text(fieldModels[BARLOWS]->displayStringForRecord(typeRecord1)));
list1 = tableModels[FILTERS]->match(tableModels[FILTERS]->in
dex(0, 0), Qt::DisplayRole, record.value("filter_id"));
typeRecord1 = tableModels[FILTERS]->record(list1[0].row());
ui->filterComboBox->setCurrentIndex(ui->filterComboBox->find
Text(fieldModels[FILTERS]->displayStringForRecord(typeRecord1)));
list1 = tableModels[TARGETS]->match(tableModels[TARGETS]->in
dex(0, 0), Qt::DisplayRole, record.value("target_id"));
typeRecord1 = tableModels[TARGETS]->record(list1[0].row());
ui->targetComboBox->setCurrentIndex(ui->targetComboBox->find
Text(fieldModels[TARGETS]->displayStringForRecord(typeRecord1)));
list1 = tableModels[IMAGERS]->match(tableModels[IMAGERS]->in
dex(0, 0), Qt::DisplayRole, record.value("imager_id"));
typeRecord1 = tableModels[IMAGERS]->record(list1[0].row());
ui->imagerComboBox->setCurrentIndex(ui->imagerComboBox->find
Text(fieldModels[IMAGERS]->displayStringForRecord(typeRecord1)));
ui->limitingMagComboBox->setCurrentIndex(ui->limitingMagComb
oBox->findText(record.value("limiting_magnitude").toString()));
ui->seeingComboBox->setCurrentIndex(ui->seeingComboBox->find
Text(record.value("seeing").toString()));
setupConnections();
}
}
void LogBookDialog::populateFormWithSessionIndex(const QModelIndex &index)
{ {
if (index.row() != -1) { if (index.row() != -1) {
teardownConnections(); teardownConnections();
//We first need to handle the new session //We first need to handle the new session
QSqlRecord record = tableModels[SESSIONS]->record(index.row( )); QSqlRecord record = tableModels[SESSIONS]->record(index.row( ));
ui->beginSessionDateTimeEdit->setDateTime(QDateTime::fromStr ui->beginDateTimeEdit->setDateTime(QDateTime::fromString(rec
ing(record.value("begin").toString(), "yyyy/MM/dd HH:mm")); ord.value("begin").toString(), "yyyy/MM/dd HH:mm"));
ui->endSessionDateTimeEdit->setDateTime(QDateTime::fromStrin ui->endDateTimeEdit->setDateTime(QDateTime::fromString(recor
g(record.value("end").toString(), "yyyy/MM/dd HH:mm")); d.value("end").toString(), "yyyy/MM/dd HH:mm"));
ui->weatherTextEdit->setPlainText(record.value("weather").to String()); ui->weatherTextEdit->setPlainText(record.value("weather").to String());
ui->sessionNotesTextEdit->setPlainText(record.value("comment s").toString()); ui->commentsTextEdit->setPlainText(record.value("comments"). toString());
QModelIndexList list1 QModelIndexList list1
= tableModels[OBSERVERS]->match(tableModels[OBSERVERS]->inde x(0, 0), Qt::DisplayRole, record.value("observer_id")); = tableModels[OBSERVERS]->match(tableModels[OBSERVER S]->index(0, 0), Qt::DisplayRole, record.value("observer_id"));
QSqlRecord typeRecord1 = tableModels[OBSERVERS]->record(list 1[0].row()); QSqlRecord typeRecord1 = tableModels[OBSERVERS]->record(list 1[0].row());
ui->sessionObserverComboBox ui->observerComboBox
->setCurrentIndex(ui->sessionObserverComboBox ->setCurrentIndex(ui->observerComboBox
->findText(fieldModels[QSt ->findText(fieldMo
ring(SESSIONS) + QString(OBSERVERS)]->displayStringForRecord(typeRecord1))) dels[QString(OBSERVERS)]->displayStringForRecord(typeRecord1)));
;
list1 = tableModels[SITES]->match(tableModels[SITES]->index( 0, 0), Qt::DisplayRole, record.value("site_id")); list1 = tableModels[SITES]->match(tableModels[SITES]->index( 0, 0), Qt::DisplayRole, record.value("site_id"));
typeRecord1 = tableModels[SITES]->record(list1[0].row()); typeRecord1 = tableModels[SITES]->record(list1[0].row());
ui->siteComboBox->setCurrentIndex(ui->siteComboBox->findText (typeRecord1.value("name").toString())); ui->siteComboBox->setCurrentIndex(ui->siteComboBox->findText (typeRecord1.value("name").toString()));
setupConnections(); setupConnections();
// We want the observations change to trigger
// First, we re-filter the model
observationsListModel->setFilter(QString("session_id = %1").
arg(record.value("session_id").toInt()));
lastObservationRowNumberSelected = 1;
// Now select the first one, which causes it to populate
ui->observationsListView->setCurrentIndex(observationsListMo
del->index(lastObservationRowNumberSelected, 1));
} }
} }
void LogBookDialog::setupConnections() void SessionsDialog::setupConnections()
{ {
connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ; connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close())) ;
connect(ui->addSessionPushButton, SIGNAL(clicked()), this, SLOT(inse connect(ui->addSessionButton, SIGNAL(clicked()), this, SLOT(insertNe
rtNewSession())); wSession()));
connect(ui->sessionsListView->selectionModel() , SIGNAL(currentRowCh connect(ui->openSessionButton, SIGNAL(clicked()), this, SLOT(openObs
anged(QModelIndex, QModelIndex)), ervations()));
this, SLOT(sessionSelected(QModelIndex))); connect(ui->sessionsListView->selectionModel() , SIGNAL(currentRowCh
connect(ui->observationsListView->selectionModel() , SIGNAL(currentR anged(QModelIndex, QModelIndex)), this,
owChanged(QModelIndex, QModelIndex)), SLOT(sessionSelected(QModelIndex)));
this, SLOT(observationSelected(QModelIndex)));
connect(ui->beginDateTimeEdit, SIGNAL(dateTimeChanged(const QDateTim
connect(ui->beginSessionDateTimeEdit, SIGNAL(dateTimeChanged(const Q e&)), this, SLOT(beginDateTimeChanged(const QDateTime&)));
DateTime&)), connect(ui->endDateTimeEdit, SIGNAL(dateTimeChanged(const QDateTime&
this, SLOT(sessionBeginDateTimeChanged(const QDateTi )), this, SLOT(endDateTimeChanged(const QDateTime&)));
me&))); connect(ui->observerComboBox, SIGNAL(currentIndexChanged(const QStri
connect(ui->endSessionDateTimeEdit, SIGNAL(dateTimeChanged(const QDa ng&)), this, SLOT(observerChanged(const QString&)));
teTime&)), this, SLOT(sessionEndDateTimeChanged(const QDateTime&)));
connect(ui->sessionObserverComboBox, SIGNAL(currentIndexChanged(cons
t QString&)), this, SLOT(sessionObserverChanged(const QString&)));
connect(ui->siteComboBox, SIGNAL(currentIndexChanged(const QString&) ), this, SLOT(siteChanged(const QString&))); connect(ui->siteComboBox, SIGNAL(currentIndexChanged(const QString&) ), this, SLOT(siteChanged(const QString&)));
connect(ui->weatherTextEdit, SIGNAL(editingFinished()), this, SLOT(w eatherTextChanged())); connect(ui->weatherTextEdit, SIGNAL(editingFinished()), this, SLOT(w eatherTextChanged()));
connect(ui->sessionNotesTextEdit, SIGNAL(editingFinished()), this, S connect(ui->commentsTextEdit, SIGNAL(editingFinished()), this, SLOT(
LOT(commentsTextChanged())); commentsTextChanged()));
}
connect(ui->observationObserverComboBox, SIGNAL(currentIndexChanged( void SessionsDialog::setupModels()
const QString&)), {
this, SLOT(observationObserverChanged(const QString& QSqlDatabase db = QSqlDatabase::database("LogBook");
))); // We want the relational table model so we can join the target name
connect(ui->opticComboBox, SIGNAL(currentIndexChanged(const QString& with the date in the display string
)), this, SLOT(opticChanged(const QString&))); sessionsModel = new QSqlRelationalTableModel(this, db);
connect(ui->ocularComboBox, SIGNAL(currentIndexChanged(const QString sessionsModel->setTable(SESSIONS);
&)), this, SLOT(ocularChanged(const QString&))); sessionsModel->setObjectName("Sessions Table Model");
connect(ui->barlowComboBox, SIGNAL(currentIndexChanged(const QString sessionsModel->setRelation(3, QSqlRelation(SITES, "site_id", "name")
&)), this, SLOT(barlowChanged(const QString&))); );
connect(ui->filterComboBox, SIGNAL(currentIndexChanged(const QString sessionsModel->setEditStrategy(QSqlTableModel::OnFieldChange);
&)), this, SLOT(filterChanged(const QString&))); sessionsModel->select();
connect(ui->targetComboBox, SIGNAL(currentIndexChanged(const QString
&)), this, SLOT(targetChanged(const QString&))); fieldModels[QString(OBSERVERS)] = new FieldConcatModel(tableModels[O
connect(ui->limitingMagComboBox, SIGNAL(currentIndexChanged(const QS BSERVERS], QStringList() << "surname" << "name", ", " , this);
tring&)), this, SLOT(limitingMagnitudeChanged(const QString&))); fieldModels[SESSIONS] = new FieldConcatModel(sessionsModel, QStringL
connect(ui->seeingComboBox, SIGNAL(currentIndexChanged(const QString ist() << "name" << "begin", " on " , this);
&)), this, SLOT(seeingChanged(const QString&)));
connect(ui->imagerComboBox, SIGNAL(currentIndexChanged(const QString
&)), this, SLOT(imagerChanged(const QString&)));
connect(ui->observationBeginDateTimeEdit, SIGNAL(dateTimeChanged(con
st QDateTime&)),
this, SLOT(observationBeginDateTimeChanged(const QDa
teTime&)));
connect(ui->observationEndDateTimeEdit, SIGNAL(dateTimeChanged(const
QDateTime&)),
this, SLOT(observationEndDateTimeChanged(const QDate
Time&)));
connect(ui->accessoriesTextEdit, SIGNAL(editingFinished()), this, SL
OT(accessoriesTextChanged()));
connect(ui->observationNotesTextEdit, SIGNAL(editingFinished()), thi
s, SLOT(notesTextChanged()));
}
void LogBookDialog::setupModels()
{
fieldModels[QString(SESSIONS) + QString(OBSERVERS)]
= new FieldConcatModel(tableModels[OBSERVERS], QStringList()
<< "surname" << "name", ", " , this);
fieldModels[QString(OBSERVATIONS) + QString(OBSERVERS)]
= new FieldConcatModel(tableModels[OBSERVERS], QStringList()
<< "surname" << "name", ", " , this);
fieldModels[OPTICS] = new FieldConcatModel(tableModels[OPTICS], QStr
ingList() << "model" << "vendor", " | " , this);
fieldModels[OCULARS] = new FieldConcatModel(tableModels[OCULARS], QS
tringList() << "model" << "vendor", " | " , this);
fieldModels[BARLOWS] = new FieldConcatModel(tableModels[BARLOWS], QS
tringList() << "model" << "vendor", " | " , this);
fieldModels[FILTERS] = new FieldConcatModel(tableModels[FILTERS], QS
tringList() << "type" << "vendor", " | " , this);
fieldModels[TARGETS] = new FieldConcatModel(tableModels[TARGETS], QS
tringList() << "name" << "alias", " | " , this);
fieldModels[IMAGERS] = new FieldConcatModel(tableModels[IMAGERS], QS
tringList() << "model" << "vendor", " | " , this);
fieldModels[SESSIONS] = new FieldConcatModel(tableModels[SESSIONS],
QStringList() << "begin" << "end", " to " , this);
ui->siteComboBox->setModel(tableModels[SITES]); ui->siteComboBox->setModel(tableModels[SITES]);
ui->siteComboBox->setModelColumn(1); ui->siteComboBox->setModelColumn(1);
ui->sessionObserverComboBox->setModel(fieldModels[QString(SESSIONS) ui->observerComboBox->setModel(fieldModels[QString(OBSERVERS)]);
+ QString(OBSERVERS)]); ui->observerComboBox->setModelColumn(1);
ui->sessionObserverComboBox->setModelColumn(1);
ui->observationObserverComboBox->setModel(fieldModels[QString(OBSERV
ATIONS) + QString(OBSERVERS)]);
ui->observationObserverComboBox->setModelColumn(1);
ui->opticComboBox->setModel(fieldModels[OPTICS]);
ui->opticComboBox->setModelColumn(1);
ui->ocularComboBox->setModel(fieldModels[OCULARS]);
ui->ocularComboBox->setModelColumn(1);
ui->barlowComboBox->setModel(fieldModels[BARLOWS]);
ui->barlowComboBox->setModelColumn(1);
ui->filterComboBox->setModel(fieldModels[FILTERS]);
ui->filterComboBox->setModelColumn(1);
ui->targetComboBox->setModel(fieldModels[TARGETS]);
ui->targetComboBox->setModelColumn(1);
ui->imagerComboBox->setModel(fieldModels[IMAGERS]);
ui->imagerComboBox->setModelColumn(1);
ui->sessionsListView->setModel(fieldModels[SESSIONS]); ui->sessionsListView->setModel(fieldModels[SESSIONS]);
ui->sessionsListView->setModelColumn(1); ui->sessionsListView->setModelColumn(1);
QSqlDatabase db = QSqlDatabase::database("LogBook");
observationsModel = new QSqlRelationalTableModel(this, db);
observationsModel->setTable(OBSERVATIONS);
observationsModel->setRelation(3, QSqlRelation(TARGETS, "target_id",
"name"));
observationsListModel = new FieldConcatModel(observationsModel, QStr
ingList() << "name" << "begin", " at " , this);
ui->observationsListView->setModel(observationsListModel);
ui->observationsListView->setModelColumn(1);
} }
void LogBookDialog::teardownConnections() void SessionsDialog::teardownConnections()
{ {
disconnect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close( ))); disconnect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close( )));
disconnect(ui->addSessionPushButton, SIGNAL(clicked()), this, SLOT(i disconnect(ui->addSessionButton, SIGNAL(clicked()), this, SLOT(inser
nsertNewSession())); tNewSession()));
disconnect(ui->sessionsListView->selectionModel() , SIGNAL(currentRo disconnect(ui->openSessionButton, SIGNAL(clicked()), this, SLOT(open
wChanged(QModelIndex, QModelIndex)), Observations()));
this, SLOT(sessionSelected(QModelIndex))); disconnect(ui->sessionsListView->selectionModel() , SIGNAL(currentRo
disconnect(ui->observationsListView->selectionModel() , SIGNAL(curre wChanged(QModelIndex, QModelIndex)), this,
ntRowChanged(QModelIndex, QModelIndex)), SLOT(sessionSelected(QModelIndex)));
this, SLOT(observationSelected(QModelIndex)));
disconnect(ui->beginDateTimeEdit, SIGNAL(dateTimeChanged(const QDate
disconnect(ui->beginSessionDateTimeEdit, SIGNAL(dateTimeChanged(cons Time&)), this, SLOT(beginDateTimeChanged(const QDateTime&)));
t QDateTime&)), disconnect(ui->endDateTimeEdit, SIGNAL(dateTimeChanged(const QDateTi
this, SLOT(sessionBeginDateTimeChanged(const QDat me&)), this, SLOT(endDateTimeChanged(const QDateTime&)));
eTime&))); disconnect(ui->observerComboBox, SIGNAL(currentIndexChanged(const QS
disconnect(ui->endSessionDateTimeEdit, SIGNAL(dateTimeChanged(const tring&)), this, SLOT(observerChanged(const QString&)));
QDateTime&)), this, SLOT(sessionEndDateTimeChanged(const QDateTime&)));
disconnect(ui->sessionObserverComboBox, SIGNAL(currentIndexChanged(c
onst QString&)), this, SLOT(sessionObserverChanged(const QString&)));
disconnect(ui->siteComboBox, SIGNAL(currentIndexChanged(const QStrin g&)), this, SLOT(siteChanged(const QString&))); disconnect(ui->siteComboBox, SIGNAL(currentIndexChanged(const QStrin g&)), this, SLOT(siteChanged(const QString&)));
disconnect(ui->weatherTextEdit, SIGNAL(editingFinished()), this, SLO T(weatherTextChanged())); disconnect(ui->weatherTextEdit, SIGNAL(editingFinished()), this, SLO T(weatherTextChanged()));
disconnect(ui->sessionNotesTextEdit, SIGNAL(editingFinished()), this disconnect(ui->commentsTextEdit, SIGNAL(editingFinished()), this, SL
, SLOT(commentsTextChanged())); OT(commentsTextChanged()));
disconnect(ui->observationObserverComboBox, SIGNAL(currentIndexChang
ed(const QString&)),
this, SLOT(observationObserverChanged(const QStri
ng&)));
disconnect(ui->opticComboBox, SIGNAL(currentIndexChanged(const QStri
ng&)), this, SLOT(opticChanged(const QString&)));
disconnect(ui->ocularComboBox, SIGNAL(currentIndexChanged(const QStr
ing&)), this, SLOT(ocularChanged(const QString&)));
disconnect(ui->barlowComboBox, SIGNAL(currentIndexChanged(const QStr
ing&)), this, SLOT(barlowChanged(const QString&)));
disconnect(ui->filterComboBox, SIGNAL(currentIndexChanged(const QStr
ing&)), this, SLOT(filterChanged(const QString&)));
disconnect(ui->targetComboBox, SIGNAL(currentIndexChanged(const QStr
ing&)), this, SLOT(targetChanged(const QString&)));
disconnect(ui->limitingMagComboBox, SIGNAL(currentIndexChanged(const
QString&)), this, SLOT(limitingMagnitudeChanged(const QString&)));
disconnect(ui->seeingComboBox, SIGNAL(currentIndexChanged(const QStr
ing&)), this, SLOT(seeingChanged(const QString&)));
disconnect(ui->imagerComboBox, SIGNAL(currentIndexChanged(const QStr
ing&)), this, SLOT(imagerChanged(const QString&)));
disconnect(ui->observationBeginDateTimeEdit, SIGNAL(dateTimeChanged(
const QDateTime&)),
this, SLOT(observationBeginDateTimeChanged(const
QDateTime&)));
disconnect(ui->observationEndDateTimeEdit, SIGNAL(dateTimeChanged(co
nst QDateTime&)),
this, SLOT(observationEndDateTimeChanged(const QD
ateTime&)));
disconnect(ui->accessoriesTextEdit, SIGNAL(editingFinished()), this,
SLOT(accessoriesTextChanged()));
disconnect(ui->observationNotesTextEdit, SIGNAL(editingFinished()),
this, SLOT(notesTextChanged()));
} }
 End of changes. 52 change blocks. 
611 lines changed or deleted 141 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/