|
|
@ -48,21 +48,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include <kinstance.h>
|
|
|
|
#include <kinstance.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <klocale.h>
|
|
|
|
#include <tdelocale.h>
|
|
|
|
#include <kaction.h>
|
|
|
|
#include <tdeaction.h>
|
|
|
|
#include <kstdaction.h>
|
|
|
|
#include <kstdaction.h>
|
|
|
|
#include <kpopupmenu.h>
|
|
|
|
#include <tdepopupmenu.h>
|
|
|
|
#include <kiconloader.h>
|
|
|
|
#include <kiconloader.h>
|
|
|
|
#include <kmessagebox.h>
|
|
|
|
#include <tdemessagebox.h>
|
|
|
|
#include <kprinter.h>
|
|
|
|
#include <kprinter.h>
|
|
|
|
#include <ktar.h>
|
|
|
|
#include <ktar.h>
|
|
|
|
#include <kzip.h>
|
|
|
|
#include <kzip.h>
|
|
|
|
#include <ktempfile.h>
|
|
|
|
#include <tdetempfile.h>
|
|
|
|
#include <kconfig.h>
|
|
|
|
#include <tdeconfig.h>
|
|
|
|
#include <kurlrequester.h>
|
|
|
|
#include <kurlrequester.h>
|
|
|
|
#include <kcommand.h>
|
|
|
|
#include <kcommand.h>
|
|
|
|
#include <ktoolbar.h>
|
|
|
|
#include <tdetoolbar.h>
|
|
|
|
#include <kfiledialog.h>
|
|
|
|
#include <tdefiledialog.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <tqregexp.h>
|
|
|
|
#include <tqregexp.h>
|
|
|
|
#include <tqtextcodec.h>
|
|
|
|
#include <tqtextcodec.h>
|
|
|
@ -121,43 +121,43 @@ KXMLEditorPart::KXMLEditorPart( bool fReadWrite, KXEDocument* pDocument, TQWidge
|
|
|
|
// edit actions
|
|
|
|
// edit actions
|
|
|
|
m_pActEditFind = KStdAction::find( this, SLOT(slotEditFind()), actionCollection());
|
|
|
|
m_pActEditFind = KStdAction::find( this, SLOT(slotEditFind()), actionCollection());
|
|
|
|
m_pActEditFindNext = KStdAction::findNext( this, SLOT(slotEditFindNext()), actionCollection());
|
|
|
|
m_pActEditFindNext = KStdAction::findNext( this, SLOT(slotEditFindNext()), actionCollection());
|
|
|
|
m_pActEditDeselect = new KAction( i18n("D&eselect Node"), CTRL+Key_E, this,
|
|
|
|
m_pActEditDeselect = new TDEAction( i18n("D&eselect Node"), CTRL+Key_E, this,
|
|
|
|
SLOT(slotEditDeselect()), actionCollection(), "deselect" );
|
|
|
|
SLOT(slotEditDeselect()), actionCollection(), "deselect" );
|
|
|
|
|
|
|
|
|
|
|
|
// view actions
|
|
|
|
// view actions
|
|
|
|
m_pActViewNodeUp = new KAction( i18n("To &Parent Node"), "up", 0, this,
|
|
|
|
m_pActViewNodeUp = new TDEAction( i18n("To &Parent Node"), "up", 0, this,
|
|
|
|
SLOT(slotViewNodeUp()), actionCollection(), "treeitem_up" );
|
|
|
|
SLOT(slotViewNodeUp()), actionCollection(), "treeitem_up" );
|
|
|
|
|
|
|
|
|
|
|
|
m_pActViewExpNode = new KToolBarPopupAction( i18n("&Expand Node"), "expand_node", CTRL+Key_Plus, this,
|
|
|
|
m_pActViewExpNode = new TDEToolBarPopupAction( i18n("&Expand Node"), "expand_node", CTRL+Key_Plus, this,
|
|
|
|
SLOT(slotViewExpNode()), actionCollection(), "treeitem_expand" );
|
|
|
|
SLOT(slotViewExpNode()), actionCollection(), "treeitem_expand" );
|
|
|
|
KPopupMenu * pMenuExpNode = m_pActViewExpNode->popupMenu();
|
|
|
|
TDEPopupMenu * pMenuExpNode = m_pActViewExpNode->popupMenu();
|
|
|
|
connect( pMenuExpNode, SIGNAL(activated(int)), this, SLOT(slotViewExpNode(int)) );
|
|
|
|
connect( pMenuExpNode, SIGNAL(activated(int)), this, SLOT(slotViewExpNode(int)) );
|
|
|
|
for ( uint i = 1; i <= 8; i++ )
|
|
|
|
for ( uint i = 1; i <= 8; i++ )
|
|
|
|
pMenuExpNode->insertItem( i18n("Expand To Level %1").arg(i), i-1 );
|
|
|
|
pMenuExpNode->insertItem( i18n("Expand To Level %1").arg(i), i-1 );
|
|
|
|
|
|
|
|
|
|
|
|
m_pActViewColNode = new KToolBarPopupAction( i18n("&Collapse Node"), "collapse_node", CTRL+Key_Minus, this,
|
|
|
|
m_pActViewColNode = new TDEToolBarPopupAction( i18n("&Collapse Node"), "collapse_node", CTRL+Key_Minus, this,
|
|
|
|
SLOT(slotViewColNode()), actionCollection(), "treeitem_collapse" );
|
|
|
|
SLOT(slotViewColNode()), actionCollection(), "treeitem_collapse" );
|
|
|
|
KPopupMenu * pMenuColNode = m_pActViewColNode->popupMenu();
|
|
|
|
TDEPopupMenu * pMenuColNode = m_pActViewColNode->popupMenu();
|
|
|
|
connect( pMenuColNode, SIGNAL(activated(int)), this, SLOT(slotViewColNode(int)) );
|
|
|
|
connect( pMenuColNode, SIGNAL(activated(int)), this, SLOT(slotViewColNode(int)) );
|
|
|
|
for ( uint i = 0; i <= 7; i++ )
|
|
|
|
for ( uint i = 0; i <= 7; i++ )
|
|
|
|
pMenuColNode->insertItem( i18n("Collapse To Level %1").arg(i), i );
|
|
|
|
pMenuColNode->insertItem( i18n("Collapse To Level %1").arg(i), i );
|
|
|
|
|
|
|
|
|
|
|
|
// bookmark actions
|
|
|
|
// bookmark actions
|
|
|
|
m_pActBookmarksToggle = new KAction( i18n("&Toggle Bookmark"), "bookmark_add", CTRL+Key_B, this,
|
|
|
|
m_pActBookmarksToggle = new TDEAction( i18n("&Toggle Bookmark"), "bookmark_add", CTRL+Key_B, this,
|
|
|
|
SLOT(slotBookmarksToggle()), actionCollection(), "bookmark_toggle" );
|
|
|
|
SLOT(slotBookmarksToggle()), actionCollection(), "bookmark_toggle" );
|
|
|
|
m_pActBookmarksPrev = new KAction( i18n("&Previous Bookmark"), "bookmark_prev", SHIFT+Key_F5, this,
|
|
|
|
m_pActBookmarksPrev = new TDEAction( i18n("&Previous Bookmark"), "bookmark_prev", SHIFT+Key_F5, this,
|
|
|
|
SLOT(slotBookmarksPrev()), actionCollection(), "bookmark_prev" );
|
|
|
|
SLOT(slotBookmarksPrev()), actionCollection(), "bookmark_prev" );
|
|
|
|
m_pActBookmarksNext = new KAction( i18n("&Next Bookmark"), "bookmark_next", Key_F5, this,
|
|
|
|
m_pActBookmarksNext = new TDEAction( i18n("&Next Bookmark"), "bookmark_next", Key_F5, this,
|
|
|
|
SLOT(slotBookmarksNext()), actionCollection(), "bookmark_next" );
|
|
|
|
SLOT(slotBookmarksNext()), actionCollection(), "bookmark_next" );
|
|
|
|
|
|
|
|
|
|
|
|
// settings actions
|
|
|
|
// settings actions
|
|
|
|
new KAction( i18n("&Configure KXMLEditor..."), "configure", 0, this,
|
|
|
|
new TDEAction( i18n("&Configure KXMLEditor..."), "configure", 0, this,
|
|
|
|
SLOT (slotConfigure()), actionCollection(), "configure" );
|
|
|
|
SLOT (slotConfigure()), actionCollection(), "configure" );
|
|
|
|
|
|
|
|
|
|
|
|
// path toolbar
|
|
|
|
// path toolbar
|
|
|
|
m_pActPathCombo = new KXmlEditorComboAction( i18n("Path Bar"), 0, this,
|
|
|
|
m_pActPathCombo = new KXmlEditorComboAction( i18n("Path Bar"), 0, this,
|
|
|
|
SLOT(slotPathSelected(const TQString &)), actionCollection(), "path_combo" );
|
|
|
|
SLOT(slotPathSelected(const TQString &)), actionCollection(), "path_combo" );
|
|
|
|
new KAction( i18n("Clear Path Bar"), BarIcon("locationbar_erase", 16), 0, this,
|
|
|
|
new TDEAction( i18n("Clear Path Bar"), BarIcon("locationbar_erase", 16), 0, this,
|
|
|
|
SLOT(slotPathClear()), actionCollection(), "path_clear" );
|
|
|
|
SLOT(slotPathClear()), actionCollection(), "path_clear" );
|
|
|
|
TQLabel *m_locationLabel = new ToolbarLabel( i18n("Path: ") );
|
|
|
|
TQLabel *m_locationLabel = new ToolbarLabel( i18n("Path: ") );
|
|
|
|
new KWidgetAction( m_locationLabel, i18n("Path: "), 0, this, 0, actionCollection(), "path_label" );
|
|
|
|
new KWidgetAction( m_locationLabel, i18n("Path: "), 0, this, 0, actionCollection(), "path_label" );
|
|
|
@ -182,11 +182,11 @@ KXMLEditorPart::KXMLEditorPart( bool fReadWrite, KXEDocument* pDocument, TQWidge
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// document specific actions here
|
|
|
|
// document specific actions here
|
|
|
|
m_pActVersionEncoding = new KAction( i18n("&Version && Encoding..."), 0, 0, this, SLOT(slotActVersionEncoding()), actionCollection(), "xml_ins_spec_procins" );
|
|
|
|
m_pActVersionEncoding = new TDEAction( i18n("&Version && Encoding..."), 0, 0, this, SLOT(slotActVersionEncoding()), actionCollection(), "xml_ins_spec_procins" );
|
|
|
|
m_pActAttachSchema = new KAction(i18n("Attach Schema..."),0,0,this,SLOT(slotActAttachSchema()), actionCollection(), "xml_attach_schema");
|
|
|
|
m_pActAttachSchema = new TDEAction(i18n("Attach Schema..."),0,0,this,SLOT(slotActAttachSchema()), actionCollection(), "xml_attach_schema");
|
|
|
|
m_pActDetachSchema = new KAction(i18n("Detach Schema"),0,0,this,SLOT(slotActDetachSchema()), actionCollection(), "xml_detach_schema");
|
|
|
|
m_pActDetachSchema = new TDEAction(i18n("Detach Schema"),0,0,this,SLOT(slotActDetachSchema()), actionCollection(), "xml_detach_schema");
|
|
|
|
m_pActAttachStylesheet = new KAction(i18n("Attach Stylesheet..."),0,0,this,SLOT(slotActAttachStylesheet()), actionCollection(), "xml_attach_stylesheet");
|
|
|
|
m_pActAttachStylesheet = new TDEAction(i18n("Attach Stylesheet..."),0,0,this,SLOT(slotActAttachStylesheet()), actionCollection(), "xml_attach_stylesheet");
|
|
|
|
m_pActDetachStylesheet = new KAction(i18n("Detach Stylesheet"),0,0,this,SLOT(slotActDetachStylesheet()), actionCollection(), "xml_detach_stylesheet");
|
|
|
|
m_pActDetachStylesheet = new TDEAction(i18n("Detach Stylesheet"),0,0,this,SLOT(slotActDetachStylesheet()), actionCollection(), "xml_detach_stylesheet");
|
|
|
|
|
|
|
|
|
|
|
|
KStdAction::print( this, SLOT(slotActPrint()), actionCollection(), "print" );
|
|
|
|
KStdAction::print( this, SLOT(slotActPrint()), actionCollection(), "print" );
|
|
|
|
|
|
|
|
|
|
|
@ -206,25 +206,25 @@ KXMLEditorPart::KXMLEditorPart( bool fReadWrite, KXEDocument* pDocument, TQWidge
|
|
|
|
m_pActEditPaste = KStdAction::paste( this, SLOT(slotEditPaste()), actionCollection());
|
|
|
|
m_pActEditPaste = KStdAction::paste( this, SLOT(slotEditPaste()), actionCollection());
|
|
|
|
|
|
|
|
|
|
|
|
// Move node Up & Down
|
|
|
|
// Move node Up & Down
|
|
|
|
m_pActXmlMoveNodeUp = new KAction( i18n("&Move Up"), "xml_move_item_up", CTRL+Key_U, this, SLOT(slotXmlMoveNodeUp()), actionCollection(), "xml_move_item_up" );
|
|
|
|
m_pActXmlMoveNodeUp = new TDEAction( i18n("&Move Up"), "xml_move_item_up", CTRL+Key_U, this, SLOT(slotXmlMoveNodeUp()), actionCollection(), "xml_move_item_up" );
|
|
|
|
m_pActXmlMoveNodeDown = new KAction( i18n("Move &Down"), "xml_move_item_down", CTRL+Key_D, this, SLOT(slotXmlMoveNodeDown()), actionCollection(), "xml_move_item_down" );
|
|
|
|
m_pActXmlMoveNodeDown = new TDEAction( i18n("Move &Down"), "xml_move_item_down", CTRL+Key_D, this, SLOT(slotXmlMoveNodeDown()), actionCollection(), "xml_move_item_down" );
|
|
|
|
|
|
|
|
|
|
|
|
// Insert actions
|
|
|
|
// Insert actions
|
|
|
|
m_pActXmlElementInsert = new KAction( i18n("&Element..."), "xml_insert_element", CTRL+SHIFT+Key_E, this, SLOT(slotXmlElementInsert()), actionCollection(), "xml_ins_element" );
|
|
|
|
m_pActXmlElementInsert = new TDEAction( i18n("&Element..."), "xml_insert_element", CTRL+SHIFT+Key_E, this, SLOT(slotXmlElementInsert()), actionCollection(), "xml_ins_element" );
|
|
|
|
m_pActXmlAttributesAdd = new KAction( i18n("&Attribute..."), "xml_insert_attribute", CTRL+SHIFT+Key_A, this, SLOT(slotXmlAttributesAdd()), actionCollection(), "xml_add_attribute" );
|
|
|
|
m_pActXmlAttributesAdd = new TDEAction( i18n("&Attribute..."), "xml_insert_attribute", CTRL+SHIFT+Key_A, this, SLOT(slotXmlAttributesAdd()), actionCollection(), "xml_add_attribute" );
|
|
|
|
m_pActInsertText = new KAction( i18n("&Text..."), "xml_text", CTRL+SHIFT+Key_T, this, SLOT(slotActInsertText()), actionCollection(), "insert_text" );
|
|
|
|
m_pActInsertText = new TDEAction( i18n("&Text..."), "xml_text", CTRL+SHIFT+Key_T, this, SLOT(slotActInsertText()), actionCollection(), "insert_text" );
|
|
|
|
m_pActInsertCDATA = new KAction( i18n("C&DATA..."), "xml_cdata", CTRL+SHIFT+Key_D, this, SLOT(slotActInsertCDATA()), actionCollection(), "insert_cdata" );
|
|
|
|
m_pActInsertCDATA = new TDEAction( i18n("C&DATA..."), "xml_cdata", CTRL+SHIFT+Key_D, this, SLOT(slotActInsertCDATA()), actionCollection(), "insert_cdata" );
|
|
|
|
m_pActInsertComment = new KAction( i18n("&Comment..."), "xml_comment", CTRL+SHIFT+Key_C, this, SLOT(slotActInsertComment()), actionCollection(), "insert_comment" );
|
|
|
|
m_pActInsertComment = new TDEAction( i18n("&Comment..."), "xml_comment", CTRL+SHIFT+Key_C, this, SLOT(slotActInsertComment()), actionCollection(), "insert_comment" );
|
|
|
|
m_pActXmlProcInstrInsert = new KAction( i18n("&Processing Instruction..."), "xml_insert_procins", CTRL+SHIFT+Key_P, this, SLOT(slotXmlProcInstrInsert()), actionCollection(), "xml_ins_procins" );
|
|
|
|
m_pActXmlProcInstrInsert = new TDEAction( i18n("&Processing Instruction..."), "xml_insert_procins", CTRL+SHIFT+Key_P, this, SLOT(slotXmlProcInstrInsert()), actionCollection(), "xml_ins_procins" );
|
|
|
|
|
|
|
|
|
|
|
|
// Edit node properties
|
|
|
|
// Edit node properties
|
|
|
|
m_pActProperties = new KAction(i18n("&Properties..."),"edit",0,this,SLOT(slotActProperties()),actionCollection(),"edit_properties");
|
|
|
|
m_pActProperties = new TDEAction(i18n("&Properties..."),"edit",0,this,SLOT(slotActProperties()),actionCollection(),"edit_properties");
|
|
|
|
m_pActEditRawXml = new KAction(i18n("Edit &raw XML..."), 0, 0, this, SLOT(slotActEditRawXml()),actionCollection(),"edit_as_raw_xml");
|
|
|
|
m_pActEditRawXml = new TDEAction(i18n("Edit &raw XML..."), 0, 0, this, SLOT(slotActEditRawXml()),actionCollection(),"edit_as_raw_xml");
|
|
|
|
|
|
|
|
|
|
|
|
// delete actions
|
|
|
|
// delete actions
|
|
|
|
m_pActXmlAttributeDel = new KAction( i18n("&Delete"), "editdelete", 0, this, SLOT(slotXmlAttributeDel()), actionCollection(), "xml_del_attribute" );
|
|
|
|
m_pActXmlAttributeDel = new TDEAction( i18n("&Delete"), "editdelete", 0, this, SLOT(slotXmlAttributeDel()), actionCollection(), "xml_del_attribute" );
|
|
|
|
m_pActXmlAttributesDel = new KAction( i18n("Delete all Attributes..."), 0, 0, this, SLOT(slotXmlAttributesDel()), actionCollection(), "xml_del_attributes" );
|
|
|
|
m_pActXmlAttributesDel = new TDEAction( i18n("Delete all Attributes..."), 0, 0, this, SLOT(slotXmlAttributesDel()), actionCollection(), "xml_del_attributes" );
|
|
|
|
m_pActDelete = new KAction(i18n("&Delete"),"editdelete",0,this,SLOT(slotActDelete()),actionCollection(),"edit_delete");
|
|
|
|
m_pActDelete = new TDEAction(i18n("&Delete"),"editdelete",0,this,SLOT(slotActDelete()),actionCollection(),"edit_delete");
|
|
|
|
|
|
|
|
|
|
|
|
setXMLFile( "kxmleditorpartEditUI.rc", true );
|
|
|
|
setXMLFile( "kxmleditorpartEditUI.rc", true );
|
|
|
|
|
|
|
|
|
|
|
@ -276,7 +276,7 @@ KXMLEditorPart::KXMLEditorPart( bool fReadWrite, KXEDocument* pDocument, TQWidge
|
|
|
|
m_pViewProcInstr->setReadOnly( true );
|
|
|
|
m_pViewProcInstr->setReadOnly( true );
|
|
|
|
m_pViewProcInstr->setWordWrap( TQTextEdit::NoWrap );
|
|
|
|
m_pViewProcInstr->setWordWrap( TQTextEdit::NoWrap );
|
|
|
|
|
|
|
|
|
|
|
|
connect( this, SIGNAL(started(KIO::Job*)), this, SLOT(started()) );
|
|
|
|
connect( this, SIGNAL(started(TDEIO::Job*)), this, SLOT(started()) );
|
|
|
|
connect( this, SIGNAL(completed()), this, SLOT(completed()) );
|
|
|
|
connect( this, SIGNAL(completed()), this, SLOT(completed()) );
|
|
|
|
connect( this, SIGNAL(canceled(const TQString &)), this, SLOT(canceled()) );
|
|
|
|
connect( this, SIGNAL(canceled(const TQString &)), this, SLOT(canceled()) );
|
|
|
|
|
|
|
|
|
|
|
@ -343,7 +343,7 @@ KXMLEditorPart::KXMLEditorPart( bool fReadWrite, KXEDocument* pDocument, TQWidge
|
|
|
|
KXMLEditorPart::~KXMLEditorPart()
|
|
|
|
KXMLEditorPart::~KXMLEditorPart()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// saving splitter configuration
|
|
|
|
// saving splitter configuration
|
|
|
|
KConfig *pConfig = instance()->config();
|
|
|
|
TDEConfig *pConfig = instance()->config();
|
|
|
|
pConfig->writeEntry( CONFIG_MAIN_SPLITTER_SIZES, pSplitter->sizes() );
|
|
|
|
pConfig->writeEntry( CONFIG_MAIN_SPLITTER_SIZES, pSplitter->sizes() );
|
|
|
|
|
|
|
|
|
|
|
|
if (m_pDCOPIface)
|
|
|
|
if (m_pDCOPIface)
|
|
|
@ -407,7 +407,7 @@ void KXMLEditorPart::setModified( bool bModified )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// get a handle on our Save action and make sure it is valid
|
|
|
|
// get a handle on our Save action and make sure it is valid
|
|
|
|
KAction *pActFileSave = actionCollection()->action(KStdAction::stdName(KStdAction::Save));
|
|
|
|
TDEAction *pActFileSave = actionCollection()->action(KStdAction::stdName(KStdAction::Save));
|
|
|
|
if(!pActFileSave)
|
|
|
|
if(!pActFileSave)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
@ -1719,13 +1719,13 @@ void KXMLEditorPart::slotContextMenuRequested( const TQString & szMenuName, cons
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( ! pContainer->inherits("KPopupMenu") )
|
|
|
|
if ( ! pContainer->inherits("TDEPopupMenu") )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
kdError() << "KXMLEditor " << k_funcinfo << " Wrong container widget" << endl;
|
|
|
|
kdError() << "KXMLEditor " << k_funcinfo << " Wrong container widget" << endl;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KPopupMenu * pMenu = static_cast <KPopupMenu*> (pContainer);
|
|
|
|
TDEPopupMenu * pMenu = static_cast <TDEPopupMenu*> (pContainer);
|
|
|
|
pMenu->popup( pos );
|
|
|
|
pMenu->popup( pos );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|