~adamreichold/qpdfview/trunk

« back to all changes in this revision

Viewing changes to sources/mainwindow.cpp

  • Committer: Adam Reichold
  • Date: 2014-01-03 14:30:43 UTC
  • Revision ID: adam.reichold@t-online.com-20140103143043-fxhzeobfhs9a5ojc
Move handling of document view settings back into document view itself since embeddability is not a concern anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
 
182
182
    if(newTab->open(filePath))
183
183
    {
184
 
        newTab->setContinousMode(s_settings->documentView().continuousMode());
185
 
        newTab->setLayoutMode(s_settings->documentView().layoutMode());
186
 
        newTab->setScaleMode(s_settings->documentView().scaleMode());
187
 
        newTab->setScaleFactor(s_settings->documentView().scaleFactor());
188
 
        newTab->setRotation(s_settings->documentView().rotation());
189
 
        newTab->setInvertColors(s_settings->documentView().invertColors());
190
 
        newTab->setHighlightAll(s_settings->documentView().highlightAll());
191
 
 
192
184
        const QFileInfo fileInfo(filePath);
193
185
 
194
186
        s_settings->mainWindow().setOpenPath(fileInfo.absolutePath());
211
203
 
212
204
        connect(newTab, SIGNAL(canJumpChanged(bool,bool)), SLOT(on_currentTab_canJumpChanged(bool,bool)));
213
205
 
214
 
        connect(newTab, SIGNAL(continousModeChanged(bool)), SLOT(on_currentTab_continuousModeChanged(bool)));
 
206
        connect(newTab, SIGNAL(continuousModeChanged(bool)), SLOT(on_currentTab_continuousModeChanged(bool)));
215
207
        connect(newTab, SIGNAL(layoutModeChanged(LayoutMode)), SLOT(on_currentTab_layoutModeChanged(LayoutMode)));
216
208
        connect(newTab, SIGNAL(scaleModeChanged(ScaleMode)), SLOT(on_currentTab_scaleModeChanged(ScaleMode)));
217
209
        connect(newTab, SIGNAL(scaleFactorChanged(qreal)), SLOT(on_currentTab_scaleFactorChanged(qreal)));
218
 
        connect(newTab, SIGNAL(rotationChanged(Rotation)), SLOT(on_currentTab_rotationChanged(Rotation)));
219
210
 
220
211
        connect(newTab, SIGNAL(linkClicked(QString,int)), SLOT(on_currentTab_linkClicked(QString,int)));
221
212
 
378
369
 
379
370
        on_currentTab_canJumpChanged(currentTab()->canJumpBackward(), currentTab()->canJumpForward());
380
371
 
381
 
        on_currentTab_continuousModeChanged(currentTab()->continousMode());
 
372
        on_currentTab_continuousModeChanged(currentTab()->continuousMode());
382
373
        on_currentTab_layoutModeChanged(currentTab()->layoutMode());
383
374
        on_currentTab_scaleModeChanged(currentTab()->scaleMode());
384
375
        on_currentTab_scaleFactorChanged(currentTab()->scaleFactor());
385
 
        on_currentTab_rotationChanged(currentTab()->rotation());
386
376
 
387
377
        on_currentTab_invertColorsChanged(currentTab()->invertColors());
388
378
        on_currentTab_highlightAllChanged(currentTab()->highlightAll());
703
693
    if(senderIsCurrentTab())
704
694
    {
705
695
        m_continuousModeAction->setChecked(continuousMode);
706
 
 
707
 
        s_settings->documentView().setContinuousMode(continuousMode);
708
696
    }
709
697
}
710
698
 
715
703
        m_twoPagesModeAction->setChecked(layoutMode == TwoPagesMode);
716
704
        m_twoPagesWithCoverPageModeAction->setChecked(layoutMode == TwoPagesWithCoverPageMode);
717
705
        m_multiplePagesModeAction->setChecked(layoutMode == MultiplePagesMode);
718
 
 
719
 
        s_settings->documentView().setLayoutMode(layoutMode);
720
706
    }
721
707
}
722
708
 
752
738
            m_zoomOutAction->setEnabled(true);
753
739
            break;
754
740
        }
755
 
 
756
 
        s_settings->documentView().setScaleMode(scaleMode);
757
741
    }
758
742
}
759
743
 
769
753
            m_zoomInAction->setDisabled(qFuzzyCompare(scaleFactor, Defaults::DocumentView::maximumScaleFactor()));
770
754
            m_zoomOutAction->setDisabled(qFuzzyCompare(scaleFactor, Defaults::DocumentView::minimumScaleFactor()));
771
755
        }
772
 
 
773
 
        s_settings->documentView().setScaleFactor(scaleFactor);
774
 
    }
775
 
}
776
 
 
777
 
void MainWindow::on_currentTab_rotationChanged(Rotation rotation)
778
 
{
779
 
    if(senderIsCurrentTab())
780
 
    {
781
 
        s_settings->documentView().setRotation(rotation);
782
756
    }
783
757
}
784
758
 
792
766
    if(senderIsCurrentTab())
793
767
    {
794
768
        m_invertColorsAction->setChecked(invertColors);
795
 
 
796
 
        s_settings->documentView().setInvertColors(invertColors);
797
769
    }
798
770
}
799
771
 
802
774
    if(senderIsCurrentTab())
803
775
    {
804
776
        m_highlightAllCheckBox->setChecked(highlightAll);
805
 
 
806
 
        s_settings->documentView().setHighlightAll(highlightAll);
807
777
    }
808
778
}
809
779
 
1166
1136
 
1167
1137
void MainWindow::on_continuousMode_triggered(bool checked)
1168
1138
{
1169
 
    currentTab()->setContinousMode(checked);
 
1139
    currentTab()->setContinuousMode(checked);
1170
1140
}
1171
1141
 
1172
1142
void MainWindow::on_twoPagesMode_triggered(bool checked)
1616
1586
    }
1617
1587
}
1618
1588
 
1619
 
void MainWindow::on_database_tabRestored(const QString& filePath, bool continousMode, LayoutMode layoutMode, ScaleMode scaleMode, qreal scaleFactor, Rotation rotation, int currentPage)
 
1589
void MainWindow::on_database_tabRestored(const QString& filePath, bool continuousMode, LayoutMode layoutMode, ScaleMode scaleMode, qreal scaleFactor, Rotation rotation, int currentPage)
1620
1590
{
1621
1591
    if(openInNewTab(filePath))
1622
1592
    {
1623
 
        currentTab()->setContinousMode(continousMode);
 
1593
        currentTab()->setContinuousMode(continuousMode);
1624
1594
        currentTab()->setLayoutMode(layoutMode);
1625
1595
 
1626
1596
        currentTab()->setScaleMode(scaleMode);