Commit e6636490 authored by Wilco Greven's avatar Wilco Greven

Added the actions I'd like to implement first.

svn path=/trunk/kdegraphics/kpdf/; revision=177766
parent 2958797b
......@@ -65,15 +65,22 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
KStdAction::findNext(this, SLOT(findNext()),
actionCollection(), "find_next");
m_fitWidth = new KToggleAction(i18n("Fit Width"), 0,
this, SLOT(fitWidthToggled()),
actionCollection(), "fit_width");
KStdAction::prior(this, SLOT(displayPreviousPage()),
actionCollection(), "previous_page");
KStdAction::next (this, SLOT(displayNextPage()),
actionCollection(), "next_page" );
m_fitToWidth = new KToggleAction(i18n("Fit To Page &Width"), 0,
this, SLOT(slotFitToWidthToggled()),
actionCollection(), "fit_to_width");
KStdAction::zoomIn (this, SLOT(zoomIn()),
actionCollection(), "zoom_in");
KStdAction::zoomOut (this, SLOT(zoomOut()),
actionCollection(), "zoom_out");
KStdAction::back (this, SLOT(back()),
actionCollection(), "back");
KStdAction::forward (this, SLOT(forward()),
actionCollection(), "forward");
KStdAction::prior (this, SLOT(displayPreviousPage()),
actionCollection(), "previous_page");
KStdAction::next (this, SLOT(displayNextPage()),
actionCollection(), "next_page" );
// set our XML-UI resource file
setXMLFile("kpdf_part.rc");
......@@ -383,9 +390,9 @@ Part::executeAction(LinkAction* action)
}
void
Part::fitWidthToggled()
Part::slotFitToWidthToggled()
{
m_zoomMode = m_fitWidth->isChecked() ? FitWidth : FixedFactor;
m_zoomMode = m_fitToWidth->isChecked() ? FitWidth : FixedFactor;
displayPage(m_currentPage);
}
......
......@@ -74,6 +74,10 @@ namespace KPDF
protected slots:
void find() { /* stub */ };
void findNext() { /* stub */ };
void zoomIn() { /* stub */ };
void zoomOut() { /* stub */ };
void back() { /* stub */ };
void forward() { /* stub */ };
void displayNextPage();
void displayPreviousPage();
......@@ -87,7 +91,7 @@ namespace KPDF
PDFDoc* m_doc;
XOutputDev* m_outputDev;
KToggleAction* m_fitWidth;
KToggleAction* m_fitToWidth;
int m_currentPage;
......@@ -95,7 +99,7 @@ namespace KPDF
float m_zoomFactor;
private slots:
void fitWidthToggled();
void slotFitToWidthToggled();
};
class BrowserExtension : public KParts::BrowserExtension
......
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kpdf_part" version="3">
<kpartgui name="kpdf_part" version="4">
<MenuBar>
<Menu name="edit"><text>&amp;Edit</text>
<Action name="find"/>
<Action name="find_next"/>
</Menu>
<Menu name="view"><text>&amp;View</text>
<Action name="fit_width"/>
<Action name="fit_to_width"/>
<Separator/>
<Action name="zoom_in"/>
<Action name="zoom_out"/>
</Menu>
<Menu name="go"><text>&amp;Go</text>
<Action name="back"/>
<Action name="forward"/>
<Separator/>
<Action name="previous_page"/>
<Action name="next_page"/>
</Menu>
......
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