Compare commits
2 Commits
974d482d5b
...
8b8759facb
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b8759facb | |||
| 468862ad35 |
@@ -337,7 +337,7 @@ void BatchProcessing::newMessageCli(const QString &message, bool error)
|
|||||||
if(error)
|
if(error)
|
||||||
qWarning() << message;
|
qWarning() << message;
|
||||||
else
|
else
|
||||||
qDebug() << message;
|
qInfo() << message;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJSValue BatchProcessing::getString(const QString &label, const QString &text)
|
QJSValue BatchProcessing::getString(const QString &label, const QString &text)
|
||||||
|
|||||||
@@ -447,7 +447,7 @@ DatabaseTreeView::DatabaseTreeView(Database *database, QWidget *parent) : QWidge
|
|||||||
,_database(database)
|
,_database(database)
|
||||||
{
|
{
|
||||||
QVBoxLayout *vlayout = new QVBoxLayout(this);
|
QVBoxLayout *vlayout = new QVBoxLayout(this);
|
||||||
QHBoxLayout *hlayout = new QHBoxLayout(this);
|
QHBoxLayout *hlayout = new QHBoxLayout;
|
||||||
|
|
||||||
_model = new DatabaseTree(database, this);
|
_model = new DatabaseTree(database, this);
|
||||||
_treeView = new QTreeView(this);
|
_treeView = new QTreeView(this);
|
||||||
@@ -473,7 +473,7 @@ DatabaseTreeView::DatabaseTreeView(Database *database, QWidget *parent) : QWidge
|
|||||||
connect(_filters, &QComboBox::currentIndexChanged, this, &DatabaseTreeView::filterChanged);
|
connect(_filters, &QComboBox::currentIndexChanged, this, &DatabaseTreeView::filterChanged);
|
||||||
filterChanged(_filters->currentIndex());
|
filterChanged(_filters->currentIndex());
|
||||||
|
|
||||||
QStackedWidget *stackedWidget = new QStackedWidget;
|
QStackedWidget *stackedWidget = new QStackedWidget(this);
|
||||||
stackedWidget->addWidget(_treeView);
|
stackedWidget->addWidget(_treeView);
|
||||||
stackedWidget->addWidget(_tableView);
|
stackedWidget->addWidget(_tableView);
|
||||||
|
|
||||||
|
|||||||
+21
-17
@@ -1,19 +1,20 @@
|
|||||||
#include "databaseview.h"
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QSettings>
|
|
||||||
#include <QDialogButtonBox>
|
|
||||||
#include <QHeaderView>
|
|
||||||
#include <QSqlError>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QMenu>
|
|
||||||
#include <QContextMenuEvent>
|
|
||||||
#include <QRegularExpression>
|
|
||||||
#include <QGuiApplication>
|
|
||||||
#include <QClipboard>
|
|
||||||
#include <QMimeData>
|
|
||||||
#include <iostream>
|
|
||||||
#include "batchprocessing.h"
|
#include "batchprocessing.h"
|
||||||
|
#include "databaseview.h"
|
||||||
|
#include <QClipboard>
|
||||||
|
#include <QContextMenuEvent>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QHeaderView>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QMimeData>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
#include <QSettings>
|
||||||
|
#include <QSqlError>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
const QStringList DEFAULT_COLUMNS = {"EXPTIME", "OBJECT", "RA", "DEC"};
|
const QStringList DEFAULT_COLUMNS = {"EXPTIME", "OBJECT", "RA", "DEC"};
|
||||||
|
|
||||||
@@ -248,7 +249,7 @@ void FITSFileModel::prepareQuery()
|
|||||||
{
|
{
|
||||||
setHeaderData(i++, Qt::Horizontal, column);
|
setHeaderData(i++, Qt::Horizontal, column);
|
||||||
}
|
}
|
||||||
std::cout << sql.toStdString() << std::endl;
|
qDebug() << "DB SQL" << sql;
|
||||||
if(lastError().type() != QSqlError::NoError)
|
if(lastError().type() != QSqlError::NoError)
|
||||||
qDebug() << "Database error" << lastError();
|
qDebug() << "Database error" << lastError();
|
||||||
|
|
||||||
@@ -318,9 +319,12 @@ DataBaseView::DataBaseView(Database *database, QWidget *parent) : QWidget(parent
|
|||||||
m_model = new FITSFileModel(m_database, this);
|
m_model = new FITSFileModel(m_database, this);
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
m_tableView->setModel(m_model);
|
|
||||||
m_model->setColumns(settings.value("databaseview/selectedColumns", DEFAULT_COLUMNS).toStringList());
|
m_model->setColumns(settings.value("databaseview/selectedColumns", DEFAULT_COLUMNS).toStringList());
|
||||||
|
m_tableView->setModel(m_model);
|
||||||
|
QTimer::singleShot(200, [this](){
|
||||||
|
QSettings settings;
|
||||||
m_tableView->horizontalHeader()->restoreState(settings.value("databaseview/header").toByteArray());
|
m_tableView->horizontalHeader()->restoreState(settings.value("databaseview/header").toByteArray());
|
||||||
|
});
|
||||||
|
|
||||||
QHBoxLayout *hlayout = new QHBoxLayout();
|
QHBoxLayout *hlayout = new QHBoxLayout();
|
||||||
layout->addLayout(hlayout);
|
layout->addLayout(hlayout);
|
||||||
|
|||||||
+20
-2
@@ -1,15 +1,28 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QSurfaceFormat>
|
|
||||||
#include <QTranslator>
|
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QSurfaceFormat>
|
||||||
|
#include <QTranslator>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "../thumbnailer/genthumbnail.h"
|
#include "../thumbnailer/genthumbnail.h"
|
||||||
#ifdef Q_OS_WIN64
|
#ifdef Q_OS_WIN64
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool DEBUG_LOG = false;
|
||||||
|
|
||||||
|
QtMessageHandler defaultHandler = nullptr;
|
||||||
|
|
||||||
|
void messageHandler(QtMsgType type, const QMessageLogContext &ctx, const QString &message)
|
||||||
|
{
|
||||||
|
if(defaultHandler)
|
||||||
|
{
|
||||||
|
if(DEBUG_LOG || type != QtMsgType::QtDebugMsg)
|
||||||
|
defaultHandler(type, ctx, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
@@ -29,6 +42,7 @@ int main(int argc, char *argv[])
|
|||||||
freopen("CONOUT$", "w", stderr);
|
freopen("CONOUT$", "w", stderr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
defaultHandler = qInstallMessageHandler(messageHandler);
|
||||||
|
|
||||||
QCommandLineParser cmd;
|
QCommandLineParser cmd;
|
||||||
cmd.addOption({"gl", "Use desktop OpenGL. This is default on x86 and MacOS platform."});
|
cmd.addOption({"gl", "Use desktop OpenGL. This is default on x86 and MacOS platform."});
|
||||||
@@ -40,6 +54,7 @@ int main(int argc, char *argv[])
|
|||||||
cmd.addOption({"scriptarg", "String that will be passed to script as variable \"scriparg\"", "arg"});
|
cmd.addOption({"scriptarg", "String that will be passed to script as variable \"scriparg\"", "arg"});
|
||||||
cmd.addOption({"outdir", "Output dir for script (default: CWD)", "dir", "."});
|
cmd.addOption({"outdir", "Output dir for script (default: CWD)", "dir", "."});
|
||||||
cmd.addOption({"noexit", "Do not exit application when script finish"});
|
cmd.addOption({"noexit", "Do not exit application when script finish"});
|
||||||
|
cmd.addOption({"debug", "Print debug info"});
|
||||||
cmd.addHelpOption();
|
cmd.addHelpOption();
|
||||||
QStringList cmdArgs;
|
QStringList cmdArgs;
|
||||||
for(int i = 0; i < argc; i++)
|
for(int i = 0; i < argc; i++)
|
||||||
@@ -51,6 +66,9 @@ int main(int argc, char *argv[])
|
|||||||
if(cmd.isSet("gles"))
|
if(cmd.isSet("gles"))
|
||||||
useGLES = true;
|
useGLES = true;
|
||||||
|
|
||||||
|
if(cmd.isSet("debug"))
|
||||||
|
DEBUG_LOG = true;
|
||||||
|
|
||||||
if(cmd.isSet("thumb"))
|
if(cmd.isSet("thumb"))
|
||||||
{
|
{
|
||||||
QCoreApplication app(argc, argv);
|
QCoreApplication app(argc, argv);
|
||||||
|
|||||||
@@ -576,6 +576,8 @@ void MainWindow::loadFile(const QString &path)
|
|||||||
if(!path.isEmpty())
|
if(!path.isEmpty())
|
||||||
{
|
{
|
||||||
QFileInfo info(path);
|
QFileInfo info(path);
|
||||||
|
if(info.exists() && info.isReadable())
|
||||||
|
{
|
||||||
m_ringList->setFile(info.canonicalFilePath());
|
m_ringList->setFile(info.canonicalFilePath());
|
||||||
updateWindowTitle();
|
updateWindowTitle();
|
||||||
if(info.isDir())
|
if(info.isDir())
|
||||||
@@ -587,6 +589,11 @@ void MainWindow::loadFile(const QString &path)
|
|||||||
if(settings.value("settings/bestfit", false).toBool())
|
if(settings.value("settings/bestfit", false).toBool())
|
||||||
m_image->bestFit();
|
m_image->bestFit();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qWarning() << "File doesn't exist or is not readable";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::loadFiles(const QStringList &paths)
|
void MainWindow::loadFiles(const QStringList &paths)
|
||||||
|
|||||||
Reference in New Issue
Block a user