Add open marked files
This commit is contained in:
@@ -25,3 +25,7 @@ Then to build run standard cmake sequence
|
|||||||
cmake -B build -S .
|
cmake -B build -S .
|
||||||
cmake --build build
|
cmake --build build
|
||||||
./build/tenmon
|
./build/tenmon
|
||||||
|
|
||||||
|
For working plate solving you must have compiled and installed StellarSolver https://github.com/rlancaste/stellarsolver
|
||||||
|
It is important that you compile StellarSolver with Qt6. By default it use Qt5 but when linked with Qt6 program it will
|
||||||
|
crash.
|
||||||
|
|||||||
@@ -218,6 +218,16 @@ void ImageRingList::decrement()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ImageRingList::setMarked()
|
||||||
|
{
|
||||||
|
QStringList files = m_database->getMarkedFiles();
|
||||||
|
std::remove_if(files.begin(), files.end(), [](const QString &file){
|
||||||
|
QFileInfo info(file);
|
||||||
|
return !info.exists() || !info.isReadable();
|
||||||
|
});
|
||||||
|
setFiles(files);
|
||||||
|
}
|
||||||
|
|
||||||
void ImageRingList::setLiveMode(bool live)
|
void ImageRingList::setLiveMode(bool live)
|
||||||
{
|
{
|
||||||
m_liveMode = live;
|
m_liveMode = live;
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ public slots:
|
|||||||
void toggleSlideshow(bool start);
|
void toggleSlideshow(bool start);
|
||||||
void increment();
|
void increment();
|
||||||
void decrement();
|
void decrement();
|
||||||
|
void setMarked();
|
||||||
protected:
|
protected:
|
||||||
void setFiles(const QStringList files, const QString ¤tFile = QString());
|
void setFiles(const QStringList files, const QString ¤tFile = QString());
|
||||||
QList<ImagePtr>::iterator increment(QList<ImagePtr>::iterator iter);
|
QList<ImagePtr>::iterator increment(QList<ImagePtr>::iterator iter);
|
||||||
|
|||||||
+5
-2
@@ -157,7 +157,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
|||||||
QMenu *fileMenu = new QMenu(tr("File"), this);
|
QMenu *fileMenu = new QMenu(tr("File"), this);
|
||||||
fileMenu->addAction(tr("Open"), QKeySequence::Open, this, SLOT(loadFile()));
|
fileMenu->addAction(tr("Open"), QKeySequence::Open, this, SLOT(loadFile()));
|
||||||
fileMenu->addAction(tr("Open directory recursively"), this, &MainWindow::loadDir);
|
fileMenu->addAction(tr("Open directory recursively"), this, &MainWindow::loadDir);
|
||||||
fileMenu->addAction(tr("Save as"), QKeySequence::Save, this, SLOT(saveAs()));
|
QAction *saveAs = fileMenu->addAction(tr("Save as"), QKeySequence::Save, this, SLOT(saveAs()));
|
||||||
fileMenu->addSeparator();
|
fileMenu->addSeparator();
|
||||||
fileMenu->addAction(tr("Copy marked files"), Qt::Key_F5, this, SLOT(copyMarked()));
|
fileMenu->addAction(tr("Copy marked files"), Qt::Key_F5, this, SLOT(copyMarked()));
|
||||||
fileMenu->addAction(tr("Move marked files"), Qt::Key_F6, this, SLOT(moveMarked()));
|
fileMenu->addAction(tr("Move marked files"), Qt::Key_F6, this, SLOT(moveMarked()));
|
||||||
@@ -225,8 +225,11 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
|||||||
selectMenu->addSeparator();
|
selectMenu->addSeparator();
|
||||||
selectMenu->addAction(tr("Mark and next"), Qt::Key_M, this, SLOT(markAndNext()));
|
selectMenu->addAction(tr("Mark and next"), Qt::Key_M, this, SLOT(markAndNext()));
|
||||||
selectMenu->addAction(tr("Unmark and next"), Qt::Key_X, this, SLOT(unmarkAndNext()));
|
selectMenu->addAction(tr("Unmark and next"), Qt::Key_X, this, SLOT(unmarkAndNext()));
|
||||||
selectMenu->addAction(tr("Show marked"), this, &MainWindow::showMarkFilesDialog);
|
selectMenu->addSeparator();
|
||||||
|
selectMenu->addAction(tr("Show marked list"), this, &MainWindow::showMarkFilesDialog);
|
||||||
|
QAction *openMarked = selectMenu->addAction(tr("Open marked"), m_ringList, &ImageRingList::setMarked);
|
||||||
menuBar()->addMenu(selectMenu);
|
menuBar()->addMenu(selectMenu);
|
||||||
|
fileMenu->insertAction(saveAs, openMarked);
|
||||||
|
|
||||||
/*QMenu *analyzeMenu = new QMenu(tr("Analyze"), this);
|
/*QMenu *analyzeMenu = new QMenu(tr("Analyze"), this);
|
||||||
QActionGroup *analyzeGroup = new QActionGroup(this);
|
QActionGroup *analyzeGroup = new QActionGroup(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user