Commit 91e53d61 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Cleared page selection when toggling

when toggling to all pages or first pages after selecting a range of page,
the selected items in the list box was not cleard. Now it clears selection
when toggling to all pages or first page

Patch by  prabhendu v senan

CCMAIL: prabhendu v senan <pvsenan@gmail.com>
parent b621c565
......@@ -53,6 +53,7 @@ KisPDFImportWidget::KisPDFImportWidget(Poppler::Document* pdfDoc, QWidget * pare
connect(boolFirstPage, SIGNAL(toggled(bool)), this, SLOT(selectFirstPage(bool)));
connect(boolSelectionPage, SIGNAL(toggled(bool)), this, SLOT(selectSelectionOfPages(bool)));
connect(listPages, SIGNAL(itemSelectionChanged()), this, SLOT(updateSelectionOfPages()));
}
......@@ -63,6 +64,10 @@ KisPDFImportWidget::~KisPDFImportWidget()
void KisPDFImportWidget::selectAllPages(bool v)
{
if (v) {
if (listPages->selectedItems().count() != 0){
listPages->clearSelection();
boolAllPages->toggle();
}
m_pages.clear();
for (int i = 0; i < m_pdfDoc->numPages(); i++) {
m_pages.push_back(i);
......@@ -73,8 +78,13 @@ void KisPDFImportWidget::selectAllPages(bool v)
void KisPDFImportWidget::selectFirstPage(bool v)
{
if (v) {
if (listPages->selectedItems().count() != 0){
listPages->clearSelection();
boolFirstPage->toggle();
}
m_pages.clear();
m_pages.push_back(0); // The first page is selected
updateMaxCanvasSize();
}
}
void KisPDFImportWidget::selectSelectionOfPages(bool v)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment