jfjoch_viewer: Start image number from 1 in the toolbar and image list
This commit is contained in:
@@ -98,8 +98,8 @@ JFJochViewerToolbarImage::JFJochViewerToolbarImage(QWidget *parent) : QToolBar(p
|
||||
void JFJochViewerToolbarImage::updateButtons() {
|
||||
if (image_count_in_dataset > 0) {
|
||||
current_image_edit->setDisabled(false);
|
||||
current_image_edit->setText(QString::number(curr_image));
|
||||
current_image_edit_validator->setRange(0, image_count_in_dataset - 1);
|
||||
current_image_edit->setText(QString::number(curr_image + 1));
|
||||
current_image_edit_validator->setRange(1, image_count_in_dataset);
|
||||
|
||||
left_button->setDisabled(curr_image < jump_value);
|
||||
right_button->setDisabled(curr_image >= image_count_in_dataset - jump_value);
|
||||
@@ -123,7 +123,7 @@ void JFJochViewerToolbarImage::updateButtons() {
|
||||
if (image_count_in_dataset == 0)
|
||||
total_number_label->setText("/ - ");
|
||||
else
|
||||
total_number_label->setText("/" + QString::number(image_count_in_dataset - 1));
|
||||
total_number_label->setText("/" + QString::number(image_count_in_dataset));
|
||||
}
|
||||
|
||||
void JFJochViewerToolbarImage::setImageNumber(int64_t total_images, int64_t current_image) {
|
||||
@@ -173,8 +173,8 @@ void JFJochViewerToolbarImage::editFinalized() {
|
||||
bool ok;
|
||||
int editedValue = current_image_edit->text().toInt(&ok);
|
||||
|
||||
if (ok && editedValue >= 0 && editedValue <= image_count_in_dataset - 1) {
|
||||
emit loadImage(editedValue, sum);
|
||||
if (ok && editedValue >= 1 && editedValue <= image_count_in_dataset) {
|
||||
emit loadImage(editedValue - 1, sum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ void JFJochViewerImageListWindow::datasetLoaded(std::shared_ptr<const JFJochRead
|
||||
if (dataset->max_value.size() > i)
|
||||
max_value = dataset->max_value[i];
|
||||
|
||||
addDataRow(i,
|
||||
addDataRow(i + 1,
|
||||
bkg_estimate,
|
||||
indexing_result,
|
||||
spot_count,
|
||||
@@ -156,5 +156,5 @@ void JFJochViewerImageListWindow::onTableRowDoubleClicked(const QModelIndex &ind
|
||||
|
||||
QModelIndex sourceIndex = proxyModel->mapToSource(index);
|
||||
int imageNumber = tableModel->item(sourceIndex.row(), 0)->data(Qt::DisplayRole).toInt();
|
||||
emit imageSelected(imageNumber, 1);
|
||||
emit imageSelected(imageNumber - 1, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user