LogBook.cpp   LogBook.cpp 
skipping to change at line 22 skipping to change at line 22
* 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 "LogBook.hpp" #include "LogBook.hpp"
#include "LogBookCommon.hpp" #include "LogBookCommon.hpp"
#include "LogBookConfigDialog.hpp" #include "LogBookConfigDialog.hpp"
#include "LogBookDialog.hpp" #include "ObservationsDialog.hpp"
#include "SessionsDialog.hpp"
#include "TargetsDialog.hpp" #include "TargetsDialog.hpp"
#include "stdexcept" #include "stdexcept"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelGui.hpp" #include "StelGui.hpp"
#include "StelGuiItems.hpp" #include "StelGuiItems.hpp"
#include "StelModuleMgr.hpp" #include "StelModuleMgr.hpp"
#include "StelObjectMgr.hpp" #include "StelObjectMgr.hpp"
#include "StelObjectType.hpp" #include "StelObjectType.hpp"
#include "StelProjector.hpp" #include "StelProjector.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "StelStyle.hpp"
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include <QAction> #include <QAction>
#include <QDebug> #include <QDebug>
#include <QDir> #include <QDir>
#include <QList> #include <QList>
#include <QListIterator> #include <QListIterator>
#include <QString> #include <QString>
#include <QSqlDatabase> #include <QSqlDatabase>
#include <QSqlError> #include <QSqlError>
skipping to change at line 102 skipping to change at line 104
#pragma mark Instance Methods #pragma mark Instance Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
LogBook::LogBook() LogBook::LogBook()
{ {
setObjectName("LogBook"); setObjectName("LogBook");
} }
LogBook::~LogBook() LogBook::~LogBook()
{ {
delete configDialog;
delete sessionsDialog;
delete targetsDialog;
} }
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark StelModule Methods #pragma mark StelModule Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
bool LogBook::configureGui(bool) bool LogBook::configureGui(bool)
{ {
return true; return true;
} }
void LogBook::draw(StelCore* core)
{
StelPainter painter(core->getProjection2d());
}
double LogBook::getCallOrder(StelModuleActionName actionName) const double LogBook::getCallOrder(StelModuleActionName actionName) const
{ {
if (actionName==StelModule::ActionDraw) { if (actionName==StelModule::ActionDraw) {
return StelApp::getInstance().getModuleMgr().getModule("Nebu laMgr")->getCallOrder(actionName)+10.; return StelApp::getInstance().getModuleMgr().getModule("Nebu laMgr")->getCallOrder(actionName)+10.;
} }
return 0; return 0;
} }
const StelStyle LogBook::getModuleStyleSheet(const StelStyle& style)
{
StelStyle pluginStyle(style);
if (style.confSectionName == "color") {
pluginStyle.qtStyleSheet.append(normalStyleSheet);
} else {
pluginStyle.qtStyleSheet.append(nightStyleSheet);
}
return pluginStyle;
}
void LogBook::init() void LogBook::init()
{ {
qDebug() << "LogBook plugin - press Command-L to toggle Log Book vie w mode. Press ALT-L for configuration."; qDebug() << "LogBook plugin - press Command-L to toggle Log Book vie w mode. Press ALT-L for configuration.";
initializeDatabase(); initializeDatabase();
mainDialog = new LogBookDialog(tableModels); //Load the module's custom style sheets
QFile styleSheetFile;
styleSheetFile.setFileName(":/logbook/normalStyle.css");
if(styleSheetFile.open(QFile::ReadOnly|QFile::Text)){
normalStyleSheet = styleSheetFile.readAll();
}
styleSheetFile.close();
styleSheetFile.setFileName(":/logbook/nightStyle.css");
if(styleSheetFile.open(QFile::ReadOnly|QFile::Text)){
nightStyleSheet = styleSheetFile.readAll();
}
styleSheetFile.close();
configDialog = new LogBookConfigDialog(tableModels); configDialog = new LogBookConfigDialog(tableModels);
sessionsDialog = new SessionsDialog(tableModels);
targetsDialog = new TargetsDialog(tableModels); targetsDialog = new TargetsDialog(tableModels);
flagShowLogBook = false; flagShowLogBook = false;
initializeActions(); initializeActions();
} }
void LogBook::draw(StelCore* core) void LogBook::setStelStyle(const QString&)
{
StelPainter painter(core->getProjection2d());
}
void LogBook::setStelStyle(const QString& )
{ {
qDebug() << "====> Here.";
configDialog->updateStyle();
sessionsDialog->updateStyle();
targetsDialog->updateStyle();
} }
/* ********************************************************************* */ /* ********************************************************************* */
#if 0 #if 0
#pragma mark - #pragma mark -
#pragma mark Slots Methods #pragma mark Slots Methods
#endif #endif
/* ********************************************************************* */ /* ********************************************************************* */
void LogBook::enableLogBook(bool b) void LogBook::enableLogBook(bool b)
{ {
mainDialog->setVisible(b); sessionsDialog->setVisible(b);
// Toggle the plugin on & off. To toggle on, we want to ensure ther e is a selected object. // Toggle the plugin on & off. To toggle on, we want to ensure ther e is a selected object.
if (!StelApp::getInstance().getStelObjectMgr().getWasSelected()) { if (!StelApp::getInstance().getStelObjectMgr().getWasSelected()) {
qDebug() << "====> Nothing selected."; qDebug() << "====> Nothing selected.";
} else { } else {
QList<StelObjectP> selectedObjects = StelApp::getInstance(). getStelObjectMgr().getSelectedObject(); QList<StelObjectP> selectedObjects = StelApp::getInstance(). getStelObjectMgr().getSelectedObject();
QListIterator<StelObjectP> objectIterator(selectedObjects); QListIterator<StelObjectP> objectIterator(selectedObjects);
while (objectIterator.hasNext()) { while (objectIterator.hasNext()) {
StelObjectP stelObject = objectIterator.next(); StelObjectP stelObject = objectIterator.next();
qDebug() << "====> Name: "<< stelObject->getNameI18n (); qDebug() << "====> Name: "<< stelObject->getNameI18n ();
} }
skipping to change at line 251 skipping to change at line 284
tableModels[FILTERS]->select(); tableModels[FILTERS]->select();
tableModels[IMAGERS] = new QSqlTableModel(this, db); tableModels[IMAGERS] = new QSqlTableModel(this, db);
tableModels[IMAGERS]->setTable(IMAGERS); tableModels[IMAGERS]->setTable(IMAGERS);
tableModels[IMAGERS]->setObjectName("Imagers Table Model"); tableModels[IMAGERS]->setObjectName("Imagers Table Model");
tableModels[IMAGERS]->setEditStrategy(QSqlTableModel::OnFiel dChange); tableModels[IMAGERS]->setEditStrategy(QSqlTableModel::OnFiel dChange);
tableModels[IMAGERS]->select(); tableModels[IMAGERS]->select();
tableModels[OBSERVATIONS] = new QSqlTableModel(this, db); tableModels[OBSERVATIONS] = new QSqlTableModel(this, db);
tableModels[OBSERVATIONS]->setTable(OBSERVATIONS); tableModels[OBSERVATIONS]->setTable(OBSERVATIONS);
tableModels[OBSERVATIONS]->setObjectName("Observers Table Mo del"); tableModels[OBSERVATIONS]->setObjectName("Observations Table Model");
tableModels[OBSERVATIONS]->setEditStrategy(QSqlTableModel::O nFieldChange); tableModels[OBSERVATIONS]->setEditStrategy(QSqlTableModel::O nFieldChange);
tableModels[OBSERVATIONS]->select(); tableModels[OBSERVATIONS]->select();
tableModels[OBSERVERS] = new QSqlTableModel(this, db); tableModels[OBSERVERS] = new QSqlTableModel(this, db);
tableModels[OBSERVERS]->setTable(OBSERVERS); tableModels[OBSERVERS]->setTable(OBSERVERS);
tableModels[OBSERVERS]->setObjectName("Observers Table Model "); tableModels[OBSERVERS]->setObjectName("Observers Table Model ");
tableModels[OBSERVERS]->setEditStrategy(QSqlTableModel::OnFi eldChange); tableModels[OBSERVERS]->setEditStrategy(QSqlTableModel::OnFi eldChange);
tableModels[OBSERVERS]->select(); tableModels[OBSERVERS]->select();
tableModels[OCULARS] = new QSqlTableModel(this, db); tableModels[OCULARS] = new QSqlTableModel(this, db);
 End of changes. 11 change blocks. 
10 lines changed or deleted 43 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/