solved hyperlink problem: kviewshell is informed about page changes

svn path=/trunk/kdegraphics/kdvi/; revision=55751
remotes/origin/kdvi-2.0
Stefan Kebekus 26 years ago
parent f7bd400fb6
commit 13b84a0bb7
  1. 8
      kdvi_multipage.cpp
  2. 13
      kdvi_multipage.h

@ -156,7 +156,7 @@ void KDVIMultiPage::goto_page(int page, int y)
scrollView()->ensureVisible(scrollView()->width()/2, (int)(y/window->zoom()) );
emit previewChanged(true);
emit moved_to_page(page);
emit pageInfo(window->totalPages(), page );
}
@ -367,13 +367,11 @@ void KDVIMultiPage::reload()
killTimer(timer_id);
timer_id = -1;
int currsav = window->curr_page();
window->setFile(m_file);
window->setFile(m_file);
window->gotoPage(currsav);
emit pageInfo(window->totalPages(), window->curr_page() ); // We don't use "currsav" here, because that page may no longer exist. In that case, gotoPage already selected another page.
// @@@ Problem here. When kviewshell received this signal, it
// automatically moves to page one. This is very unfortunate
// indeed, I must say.
emit numberOfPages(window->totalPages());
scrollView()->resizeContents(window->width(), window->height());
emit previewChanged(true);

@ -93,14 +93,15 @@ protected:
signals:
/// emitted to indicate the number of pages in the file
/// Emitted to indicate the number of pages in the file. The
//receiver will set the current page to zero and call the
//gotoPage()-method.
void numberOfPages(int nr);
/// emitted to indicate that KDVIMultiPage has jumped to a different
//page without being asked to by the kviewshell, i.e. because the
//user clicked on a hyperlink.
void moved_to_page(int nr);
/// Emitted to indicate the number of pages in the file and the
//current page. The receiver will not change or update the display,
//nor call the gotoPage()-method.
void pageInfo(int nr, int currpg);
protected slots:

Loading…
Cancel
Save