00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "katedocumenthelpers.h"
00022 #include "katedocumenthelpers.moc"
00023
00024 #include "katedocument.h"
00025 #include "kateview.h"
00026
00027 #include <kpopupmenu.h>
00028 #include <klocale.h>
00029
00030 KateBrowserExtension::KateBrowserExtension( KateDocument* doc )
00031 : KParts::BrowserExtension( doc, "katepartbrowserextension" ),
00032 m_doc (doc)
00033 {
00034 connect( doc, SIGNAL( selectionChanged() ),
00035 this, SLOT( slotSelectionChanged() ) );
00036 emit enableAction( "print", true );
00037 }
00038
00039 void KateBrowserExtension::copy()
00040 {
00041 if (m_doc->activeView())
00042 m_doc->activeView()->copy();
00043 }
00044
00045 void KateBrowserExtension::print()
00046 {
00047 m_doc->printDialog();
00048 }
00049
00050 void KateBrowserExtension::slotSelectionChanged()
00051 {
00052 if (m_doc->activeView())
00053 emit enableAction( "copy", m_doc->activeView()->hasSelection() );
00054 }
00055
00056