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)
|
||||
qWarning() << message;
|
||||
else
|
||||
qDebug() << message;
|
||||
qInfo() << message;
|
||||
}
|
||||
|
||||
QJSValue BatchProcessing::getString(const QString &label, const QString &text)
|
||||
|
||||
@@ -447,7 +447,7 @@ DatabaseTreeView::DatabaseTreeView(Database *database, QWidget *parent) : QWidge
|
||||
,_database(database)
|
||||
{
|
||||
QVBoxLayout *vlayout = new QVBoxLayout(this);
|
||||
QHBoxLayout *hlayout = new QHBoxLayout(this);
|
||||
QHBoxLayout *hlayout = new QHBoxLayout;
|
||||
|
||||
_model = new DatabaseTree(database, this);
|
||||
_treeView = new QTreeView(this);
|
||||
@@ -473,7 +473,7 @@ DatabaseTreeView::DatabaseTreeView(Database *database, QWidget *parent) : QWidge
|
||||
connect(_filters, &QComboBox::currentIndexChanged, this, &DatabaseTreeView::filterChanged);
|
||||
filterChanged(_filters->currentIndex());
|
||||
|
||||
QStackedWidget *stackedWidget = new QStackedWidget;
|
||||
QStackedWidget *stackedWidget = new QStackedWidget(this);
|
||||
stackedWidget->addWidget(_treeView);
|
||||
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 "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"};
|
||||
|
||||
@@ -248,7 +249,7 @@ void FITSFileModel::prepareQuery()
|
||||
{
|
||||
setHeaderData(i++, Qt::Horizontal, column);
|
||||
}
|
||||
std::cout << sql.toStdString() << std::endl;
|
||||
qDebug() << "DB SQL" << sql;
|
||||
if(lastError().type() != QSqlError::NoError)
|
||||
qDebug() << "Database error" << lastError();
|
||||
|
||||
@@ -318,9 +319,12 @@ DataBaseView::DataBaseView(Database *database, QWidget *parent) : QWidget(parent
|
||||
m_model = new FITSFileModel(m_database, this);
|
||||
|
||||
QSettings settings;
|
||||
m_tableView->setModel(m_model);
|
||||
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());
|
||||
});
|
||||
|
||||
QHBoxLayout *hlayout = new QHBoxLayout();
|
||||
layout->addLayout(hlayout);
|
||||
|
||||
+20
-2
@@ -1,15 +1,28 @@
|
||||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
#include <QSurfaceFormat>
|
||||
#include <QTranslator>
|
||||
#include <QCommandLineParser>
|
||||
#include <QSettings>
|
||||
#include <QSurfaceFormat>
|
||||
#include <QTranslator>
|
||||
#include <stdlib.h>
|
||||
#include "../thumbnailer/genthumbnail.h"
|
||||
#ifdef Q_OS_WIN64
|
||||
#include <windows.h>
|
||||
#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[])
|
||||
{
|
||||
#ifdef __linux__
|
||||
@@ -29,6 +42,7 @@ int main(int argc, char *argv[])
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
}
|
||||
#endif
|
||||
defaultHandler = qInstallMessageHandler(messageHandler);
|
||||
|
||||
QCommandLineParser cmd;
|
||||
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({"outdir", "Output dir for script (default: CWD)", "dir", "."});
|
||||
cmd.addOption({"noexit", "Do not exit application when script finish"});
|
||||
cmd.addOption({"debug", "Print debug info"});
|
||||
cmd.addHelpOption();
|
||||
QStringList cmdArgs;
|
||||
for(int i = 0; i < argc; i++)
|
||||
@@ -51,6 +66,9 @@ int main(int argc, char *argv[])
|
||||
if(cmd.isSet("gles"))
|
||||
useGLES = true;
|
||||
|
||||
if(cmd.isSet("debug"))
|
||||
DEBUG_LOG = true;
|
||||
|
||||
if(cmd.isSet("thumb"))
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
@@ -576,6 +576,8 @@ void MainWindow::loadFile(const QString &path)
|
||||
if(!path.isEmpty())
|
||||
{
|
||||
QFileInfo info(path);
|
||||
if(info.exists() && info.isReadable())
|
||||
{
|
||||
m_ringList->setFile(info.canonicalFilePath());
|
||||
updateWindowTitle();
|
||||
if(info.isDir())
|
||||
@@ -587,6 +589,11 @@ void MainWindow::loadFile(const QString &path)
|
||||
if(settings.value("settings/bestfit", false).toBool())
|
||||
m_image->bestFit();
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "File doesn't exist or is not readable";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::loadFiles(const QStringList &paths)
|
||||
|
||||
Reference in New Issue
Block a user