|
|
|
@ -159,8 +159,8 @@ KateView::KateView( KateDocument *doc, TQWidget *parent, const char * name )
|
|
|
|
|
|
|
|
|
|
slotHlChanged();
|
|
|
|
|
/*test texthint
|
|
|
|
|
connect(this,TQT_SIGNAL(needTextHint(int, int, TQString &)),
|
|
|
|
|
this,TQT_SLOT(slotNeedTextHint(int, int, TQString &)));
|
|
|
|
|
connect(this,TQ_SIGNAL(needTextHint(int, int, TQString &)),
|
|
|
|
|
this,TQ_SLOT(slotNeedTextHint(int, int, TQString &)));
|
|
|
|
|
enableTextHints(1000);
|
|
|
|
|
test texthint*/
|
|
|
|
|
}
|
|
|
|
@ -186,22 +186,22 @@ KateView::~KateView()
|
|
|
|
|
|
|
|
|
|
void KateView::setupConnections()
|
|
|
|
|
{
|
|
|
|
|
connect( m_doc, TQT_SIGNAL(undoChanged()),
|
|
|
|
|
this, TQT_SLOT(slotNewUndo()) );
|
|
|
|
|
connect( m_doc, TQT_SIGNAL(hlChanged()),
|
|
|
|
|
this, TQT_SLOT(slotHlChanged()) );
|
|
|
|
|
connect( m_doc, TQT_SIGNAL(canceled(const TQString&)),
|
|
|
|
|
this, TQT_SLOT(slotSaveCanceled(const TQString&)) );
|
|
|
|
|
connect( m_viewInternal, TQT_SIGNAL(dropEventPass(TQDropEvent*)),
|
|
|
|
|
this, TQT_SIGNAL(dropEventPass(TQDropEvent*)) );
|
|
|
|
|
connect(this,TQT_SIGNAL(cursorPositionChanged()),this,TQT_SLOT(slotStatusMsg()));
|
|
|
|
|
connect(this,TQT_SIGNAL(newStatus()),this,TQT_SLOT(slotStatusMsg()));
|
|
|
|
|
connect(m_doc, TQT_SIGNAL(undoChanged()), this, TQT_SLOT(slotStatusMsg()));
|
|
|
|
|
connect( m_doc, TQ_SIGNAL(undoChanged()),
|
|
|
|
|
this, TQ_SLOT(slotNewUndo()) );
|
|
|
|
|
connect( m_doc, TQ_SIGNAL(hlChanged()),
|
|
|
|
|
this, TQ_SLOT(slotHlChanged()) );
|
|
|
|
|
connect( m_doc, TQ_SIGNAL(canceled(const TQString&)),
|
|
|
|
|
this, TQ_SLOT(slotSaveCanceled(const TQString&)) );
|
|
|
|
|
connect( m_viewInternal, TQ_SIGNAL(dropEventPass(TQDropEvent*)),
|
|
|
|
|
this, TQ_SIGNAL(dropEventPass(TQDropEvent*)) );
|
|
|
|
|
connect(this,TQ_SIGNAL(cursorPositionChanged()),this,TQ_SLOT(slotStatusMsg()));
|
|
|
|
|
connect(this,TQ_SIGNAL(newStatus()),this,TQ_SLOT(slotStatusMsg()));
|
|
|
|
|
connect(m_doc, TQ_SIGNAL(undoChanged()), this, TQ_SLOT(slotStatusMsg()));
|
|
|
|
|
|
|
|
|
|
if ( m_doc->browserView() )
|
|
|
|
|
{
|
|
|
|
|
connect( this, TQT_SIGNAL(dropEventPass(TQDropEvent*)),
|
|
|
|
|
this, TQT_SLOT(slotDropEventPass(TQDropEvent*)) );
|
|
|
|
|
connect( this, TQ_SIGNAL(dropEventPass(TQDropEvent*)),
|
|
|
|
|
this, TQ_SLOT(slotDropEventPass(TQDropEvent*)) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -212,84 +212,84 @@ void KateView::setupActions()
|
|
|
|
|
|
|
|
|
|
m_toggleWriteLock = 0;
|
|
|
|
|
|
|
|
|
|
m_cut = a=KStdAction::cut(this, TQT_SLOT(cut()), ac);
|
|
|
|
|
m_cut = a=KStdAction::cut(this, TQ_SLOT(cut()), ac);
|
|
|
|
|
a->setWhatsThis(i18n("Cut the selected text and move it to the clipboard"));
|
|
|
|
|
|
|
|
|
|
m_paste = a=KStdAction::pasteText(this, TQT_SLOT(paste()), ac);
|
|
|
|
|
m_paste = a=KStdAction::pasteText(this, TQ_SLOT(paste()), ac);
|
|
|
|
|
a->setWhatsThis(i18n("Paste previously copied or cut clipboard contents"));
|
|
|
|
|
|
|
|
|
|
m_copy = a=KStdAction::copy(this, TQT_SLOT(copy()), ac);
|
|
|
|
|
m_copy = a=KStdAction::copy(this, TQ_SLOT(copy()), ac);
|
|
|
|
|
a->setWhatsThis(i18n( "Use this command to copy the currently selected text to the system clipboard."));
|
|
|
|
|
|
|
|
|
|
m_copyHTML = a = new TDEAction(i18n("Copy as &HTML"), "edit-copy", 0, this, TQT_SLOT(copyHTML()), ac, "edit_copy_html");
|
|
|
|
|
m_copyHTML = a = new TDEAction(i18n("Copy as &HTML"), "edit-copy", 0, this, TQ_SLOT(copyHTML()), ac, "edit_copy_html");
|
|
|
|
|
a->setWhatsThis(i18n( "Use this command to copy the currently selected text as HTML to the system clipboard."));
|
|
|
|
|
|
|
|
|
|
if (!m_doc->readOnly())
|
|
|
|
|
{
|
|
|
|
|
a=KStdAction::save(this, TQT_SLOT(save()), ac);
|
|
|
|
|
a=KStdAction::save(this, TQ_SLOT(save()), ac);
|
|
|
|
|
a->setWhatsThis(i18n("Save the current document"));
|
|
|
|
|
|
|
|
|
|
a=m_editUndo = KStdAction::undo(m_doc, TQT_SLOT(undo()), ac);
|
|
|
|
|
a=m_editUndo = KStdAction::undo(m_doc, TQ_SLOT(undo()), ac);
|
|
|
|
|
a->setWhatsThis(i18n("Revert the most recent editing actions"));
|
|
|
|
|
|
|
|
|
|
a=m_editRedo = KStdAction::redo(m_doc, TQT_SLOT(redo()), ac);
|
|
|
|
|
a=m_editRedo = KStdAction::redo(m_doc, TQ_SLOT(redo()), ac);
|
|
|
|
|
a->setWhatsThis(i18n("Revert the most recent undo operation"));
|
|
|
|
|
|
|
|
|
|
(new TDEAction(i18n("&Word Wrap Document"), "", 0, this, TQT_SLOT(applyWordWrap()), ac, "tools_apply_wordwrap"))->setWhatsThis(
|
|
|
|
|
(new TDEAction(i18n("&Word Wrap Document"), "", 0, this, TQ_SLOT(applyWordWrap()), ac, "tools_apply_wordwrap"))->setWhatsThis(
|
|
|
|
|
i18n("Use this command to wrap all lines of the current document which are longer than the width of the"
|
|
|
|
|
" current view, to fit into this view.<br><br> This is a static word wrap, meaning it is not updated"
|
|
|
|
|
" when the view is resized."));
|
|
|
|
|
|
|
|
|
|
// setup Tools menu
|
|
|
|
|
a=new TDEAction(i18n("&Indent"), "format-indent-more", TQt::CTRL+TQt::Key_I, this, TQT_SLOT(indent()), ac, "tools_indent");
|
|
|
|
|
a=new TDEAction(i18n("&Indent"), "format-indent-more", TQt::CTRL+TQt::Key_I, this, TQ_SLOT(indent()), ac, "tools_indent");
|
|
|
|
|
a->setWhatsThis(i18n("Use this to indent a selected block of text.<br><br>"
|
|
|
|
|
"You can configure whether tabs should be honored and used or replaced with spaces, in the configuration dialog."));
|
|
|
|
|
a=new TDEAction(i18n("&Unindent"), "format-indent-less", TQt::CTRL+TQt::SHIFT+TQt::Key_I, this, TQT_SLOT(unIndent()), ac, "tools_unindent");
|
|
|
|
|
a=new TDEAction(i18n("&Unindent"), "format-indent-less", TQt::CTRL+TQt::SHIFT+TQt::Key_I, this, TQ_SLOT(unIndent()), ac, "tools_unindent");
|
|
|
|
|
a->setWhatsThis(i18n("Use this to unindent a selected block of text."));
|
|
|
|
|
|
|
|
|
|
a=new TDEAction(i18n("&Clean Indentation"), 0, this, TQT_SLOT(cleanIndent()), ac, "tools_cleanIndent");
|
|
|
|
|
a=new TDEAction(i18n("&Clean Indentation"), 0, this, TQ_SLOT(cleanIndent()), ac, "tools_cleanIndent");
|
|
|
|
|
a->setWhatsThis(i18n("Use this to clean the indentation of a selected block of text (only tabs/only spaces)<br><br>"
|
|
|
|
|
"You can configure whether tabs should be honored and used or replaced with spaces, in the configuration dialog."));
|
|
|
|
|
|
|
|
|
|
a=new TDEAction(i18n("&Align"), 0, this, TQT_SLOT(align()), ac, "tools_align");
|
|
|
|
|
a=new TDEAction(i18n("&Align"), 0, this, TQ_SLOT(align()), ac, "tools_align");
|
|
|
|
|
a->setWhatsThis(i18n("Use this to align the current line or block of text to its proper indent level."));
|
|
|
|
|
|
|
|
|
|
a=new TDEAction(i18n("C&omment"), CTRL+TQt::Key_D, this, TQT_SLOT(comment()),
|
|
|
|
|
a=new TDEAction(i18n("C&omment"), CTRL+TQt::Key_D, this, TQ_SLOT(comment()),
|
|
|
|
|
ac, "tools_comment");
|
|
|
|
|
a->setWhatsThis(i18n("This command comments out the current line or a selected block of text.<BR><BR>"
|
|
|
|
|
"The characters for single/multiple line comments are defined within the language's highlighting."));
|
|
|
|
|
|
|
|
|
|
a=new TDEAction(i18n("Unco&mment"), CTRL+SHIFT+TQt::Key_D, this, TQT_SLOT(uncomment()),
|
|
|
|
|
a=new TDEAction(i18n("Unco&mment"), CTRL+SHIFT+TQt::Key_D, this, TQ_SLOT(uncomment()),
|
|
|
|
|
ac, "tools_uncomment");
|
|
|
|
|
a->setWhatsThis(i18n("This command removes comments from the current line or a selected block of text.<BR><BR>"
|
|
|
|
|
"The characters for single/multiple line comments are defined within the language's highlighting."));
|
|
|
|
|
a = m_toggleWriteLock = new TDEToggleAction(
|
|
|
|
|
i18n("&Read Only Mode"), 0, 0,
|
|
|
|
|
this, TQT_SLOT( toggleWriteLock() ),
|
|
|
|
|
this, TQ_SLOT( toggleWriteLock() ),
|
|
|
|
|
ac, "tools_toggle_write_lock" );
|
|
|
|
|
a->setWhatsThis( i18n("Lock/unlock the document for writing") );
|
|
|
|
|
|
|
|
|
|
a = new TDEAction( i18n("Uppercase"), CTRL + TQt::Key_U, this,
|
|
|
|
|
TQT_SLOT(uppercase()), ac, "tools_uppercase" );
|
|
|
|
|
TQ_SLOT(uppercase()), ac, "tools_uppercase" );
|
|
|
|
|
a->setWhatsThis( i18n("Convert the selection to uppercase, or the character to the "
|
|
|
|
|
"right of the cursor if no text is selected.") );
|
|
|
|
|
|
|
|
|
|
a = new TDEAction( i18n("Lowercase"), CTRL + SHIFT + TQt::Key_U, this,
|
|
|
|
|
TQT_SLOT(lowercase()), ac, "tools_lowercase" );
|
|
|
|
|
TQ_SLOT(lowercase()), ac, "tools_lowercase" );
|
|
|
|
|
a->setWhatsThis( i18n("Convert the selection to lowercase, or the character to the "
|
|
|
|
|
"right of the cursor if no text is selected.") );
|
|
|
|
|
|
|
|
|
|
a = new TDEAction( i18n("Capitalize"), CTRL + ALT + TQt::Key_U, this,
|
|
|
|
|
TQT_SLOT(capitalize()), ac, "tools_capitalize" );
|
|
|
|
|
TQ_SLOT(capitalize()), ac, "tools_capitalize" );
|
|
|
|
|
a->setWhatsThis( i18n("Capitalize the selection, or the word under the "
|
|
|
|
|
"cursor if no text is selected.") );
|
|
|
|
|
|
|
|
|
|
a = new TDEAction( i18n("Delete Line"), 0, this,
|
|
|
|
|
TQT_SLOT( killLine() ), ac, "tools_delete_line");
|
|
|
|
|
TQ_SLOT( killLine() ), ac, "tools_delete_line");
|
|
|
|
|
a->setWhatsThis(i18n("Use this to delete the current line."));
|
|
|
|
|
|
|
|
|
|
a = new TDEAction( i18n("Join Lines"), CTRL + TQt::Key_J, this,
|
|
|
|
|
TQT_SLOT( joinLines() ), ac, "tools_join_lines" );
|
|
|
|
|
TQ_SLOT( joinLines() ), ac, "tools_join_lines" );
|
|
|
|
|
a->setWhatsThis(i18n("Use this to join lines together."));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -300,19 +300,19 @@ void KateView::setupActions()
|
|
|
|
|
m_editRedo = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
a=KStdAction::print( m_doc, TQT_SLOT(print()), ac );
|
|
|
|
|
a=KStdAction::print( m_doc, TQ_SLOT(print()), ac );
|
|
|
|
|
a->setWhatsThis(i18n("Print the current document."));
|
|
|
|
|
|
|
|
|
|
a=new TDEAction(i18n("Reloa&d"), "reload", TDEStdAccel::reload(), this, TQT_SLOT(reloadFile()), ac, "file_reload");
|
|
|
|
|
a=new TDEAction(i18n("Reloa&d"), "reload", TDEStdAccel::reload(), this, TQ_SLOT(reloadFile()), ac, "file_reload");
|
|
|
|
|
a->setWhatsThis(i18n("Reload the current document from disk."));
|
|
|
|
|
|
|
|
|
|
a=KStdAction::saveAs(this, TQT_SLOT(saveAs()), ac);
|
|
|
|
|
a=KStdAction::saveAs(this, TQ_SLOT(saveAs()), ac);
|
|
|
|
|
a->setWhatsThis(i18n("Save the current document to disk, with a name of your choice."));
|
|
|
|
|
|
|
|
|
|
a=KStdAction::gotoLine(this, TQT_SLOT(gotoLine()), ac);
|
|
|
|
|
a=KStdAction::gotoLine(this, TQ_SLOT(gotoLine()), ac);
|
|
|
|
|
a->setWhatsThis(i18n("This command opens a dialog and lets you choose a line that you want the cursor to move to."));
|
|
|
|
|
|
|
|
|
|
a=new TDEAction(i18n("&Configure Editor..."), 0, m_doc, TQT_SLOT(configDialog()),ac, "set_confdlg");
|
|
|
|
|
a=new TDEAction(i18n("&Configure Editor..."), 0, m_doc, TQ_SLOT(configDialog()),ac, "set_confdlg");
|
|
|
|
|
a->setWhatsThis(i18n("Configure various aspects of this editor."));
|
|
|
|
|
|
|
|
|
|
KateViewHighlightAction *menu = new KateViewHighlightAction (i18n("&Highlighting"), ac, "set_highlight");
|
|
|
|
@ -329,45 +329,45 @@ void KateView::setupActions()
|
|
|
|
|
new KateViewIndentationAction (m_doc, i18n("&Indentation"),ac,"tools_indentation");
|
|
|
|
|
|
|
|
|
|
// html export
|
|
|
|
|
a = new TDEAction(i18n("E&xport as HTML..."), 0, 0, this, TQT_SLOT(exportAsHTML()), ac, "file_export_html");
|
|
|
|
|
a = new TDEAction(i18n("E&xport as HTML..."), 0, 0, this, TQ_SLOT(exportAsHTML()), ac, "file_export_html");
|
|
|
|
|
a->setWhatsThis(i18n("This command allows you to export the current document"
|
|
|
|
|
" with all highlighting information into a HTML document."));
|
|
|
|
|
|
|
|
|
|
m_selectAll = a=KStdAction::selectAll(this, TQT_SLOT(selectAll()), ac);
|
|
|
|
|
m_selectAll = a=KStdAction::selectAll(this, TQ_SLOT(selectAll()), ac);
|
|
|
|
|
a->setWhatsThis(i18n("Select the entire text of the current document."));
|
|
|
|
|
|
|
|
|
|
m_deSelect = a=KStdAction::deselect(this, TQT_SLOT(clearSelection()), ac);
|
|
|
|
|
m_deSelect = a=KStdAction::deselect(this, TQ_SLOT(clearSelection()), ac);
|
|
|
|
|
a->setWhatsThis(i18n("If you have selected something within the current document, this will no longer be selected."));
|
|
|
|
|
|
|
|
|
|
a=new TDEAction(i18n("Enlarge Font"), "zoom-in", 0, m_viewInternal, TQT_SLOT(slotIncFontSizes()), ac, "incFontSizes");
|
|
|
|
|
a=new TDEAction(i18n("Enlarge Font"), "zoom-in", 0, m_viewInternal, TQ_SLOT(slotIncFontSizes()), ac, "incFontSizes");
|
|
|
|
|
a->setWhatsThis(i18n("This increases the display font size."));
|
|
|
|
|
|
|
|
|
|
a=new TDEAction(i18n("Shrink Font"), "zoom-out", 0, m_viewInternal, TQT_SLOT(slotDecFontSizes()), ac, "decFontSizes");
|
|
|
|
|
a=new TDEAction(i18n("Shrink Font"), "zoom-out", 0, m_viewInternal, TQ_SLOT(slotDecFontSizes()), ac, "decFontSizes");
|
|
|
|
|
a->setWhatsThis(i18n("This decreases the display font size."));
|
|
|
|
|
|
|
|
|
|
a= m_toggleBlockSelection = new TDEToggleAction(
|
|
|
|
|
i18n("Bl&ock Selection Mode"), CTRL + SHIFT + Key_B,
|
|
|
|
|
this, TQT_SLOT(toggleBlockSelectionMode()),
|
|
|
|
|
this, TQ_SLOT(toggleBlockSelectionMode()),
|
|
|
|
|
ac, "set_verticalSelect");
|
|
|
|
|
a->setWhatsThis(i18n("This command allows switching between the normal (line based) selection mode and the block selection mode."));
|
|
|
|
|
|
|
|
|
|
a= m_toggleInsert = new TDEToggleAction(
|
|
|
|
|
i18n("Overwr&ite Mode"), Key_Insert,
|
|
|
|
|
this, TQT_SLOT(toggleInsert()),
|
|
|
|
|
this, TQ_SLOT(toggleInsert()),
|
|
|
|
|
ac, "set_insert" );
|
|
|
|
|
a->setWhatsThis(i18n("Choose whether you want the text you type to be inserted or to overwrite existing text."));
|
|
|
|
|
|
|
|
|
|
TDEToggleAction *toggleAction;
|
|
|
|
|
a= m_toggleDynWrap = toggleAction = new TDEToggleAction(
|
|
|
|
|
i18n("&Dynamic Word Wrap"), Key_F10,
|
|
|
|
|
this, TQT_SLOT(toggleDynWordWrap()),
|
|
|
|
|
this, TQ_SLOT(toggleDynWordWrap()),
|
|
|
|
|
ac, "view_dynamic_word_wrap" );
|
|
|
|
|
a->setWhatsThis(i18n("If this option is checked, the text lines will be wrapped at the view border on the screen."));
|
|
|
|
|
|
|
|
|
|
a= m_setDynWrapIndicators = new TDESelectAction(i18n("Dynamic Word Wrap Indicators"), 0, ac, "dynamic_word_wrap_indicators");
|
|
|
|
|
a->setWhatsThis(i18n("Choose when the Dynamic Word Wrap Indicators should be displayed"));
|
|
|
|
|
|
|
|
|
|
connect(m_setDynWrapIndicators, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setDynWrapIndicators(int)));
|
|
|
|
|
connect(m_setDynWrapIndicators, TQ_SIGNAL(activated(int)), this, TQ_SLOT(setDynWrapIndicators(int)));
|
|
|
|
|
TQStringList list2;
|
|
|
|
|
list2.append(i18n("&Off"));
|
|
|
|
|
list2.append(i18n("Follow &Line Numbers"));
|
|
|
|
@ -376,14 +376,14 @@ void KateView::setupActions()
|
|
|
|
|
|
|
|
|
|
a= toggleAction=m_toggleFoldingMarkers = new TDEToggleAction(
|
|
|
|
|
i18n("Show Folding &Markers"), Key_F9,
|
|
|
|
|
this, TQT_SLOT(toggleFoldingMarkers()),
|
|
|
|
|
this, TQ_SLOT(toggleFoldingMarkers()),
|
|
|
|
|
ac, "view_folding_markers" );
|
|
|
|
|
a->setWhatsThis(i18n("You can choose if the codefolding marks should be shown, if codefolding is possible."));
|
|
|
|
|
toggleAction->setCheckedState(i18n("Hide Folding &Markers"));
|
|
|
|
|
|
|
|
|
|
a= m_toggleIconBar = toggleAction = new TDEToggleAction(
|
|
|
|
|
i18n("Show &Icon Border"), Key_F6,
|
|
|
|
|
this, TQT_SLOT(toggleIconBorder()),
|
|
|
|
|
this, TQ_SLOT(toggleIconBorder()),
|
|
|
|
|
ac, "view_border");
|
|
|
|
|
a=toggleAction;
|
|
|
|
|
a->setWhatsThis(i18n("Show/hide the icon border.<BR><BR> The icon border shows bookmark symbols, for instance."));
|
|
|
|
@ -391,21 +391,21 @@ void KateView::setupActions()
|
|
|
|
|
|
|
|
|
|
a= toggleAction=m_toggleLineNumbers = new TDEToggleAction(
|
|
|
|
|
i18n("Show &Line Numbers"), Key_F11,
|
|
|
|
|
this, TQT_SLOT(toggleLineNumbersOn()),
|
|
|
|
|
this, TQ_SLOT(toggleLineNumbersOn()),
|
|
|
|
|
ac, "view_line_numbers" );
|
|
|
|
|
a->setWhatsThis(i18n("Show/hide the line numbers on the left hand side of the view."));
|
|
|
|
|
toggleAction->setCheckedState(i18n("Hide &Line Numbers"));
|
|
|
|
|
|
|
|
|
|
a= m_toggleScrollBarMarks = toggleAction = new TDEToggleAction(
|
|
|
|
|
i18n("Show Scroll&bar Marks"), 0,
|
|
|
|
|
this, TQT_SLOT(toggleScrollBarMarks()),
|
|
|
|
|
this, TQ_SLOT(toggleScrollBarMarks()),
|
|
|
|
|
ac, "view_scrollbar_marks");
|
|
|
|
|
a->setWhatsThis(i18n("Show/hide the marks on the vertical scrollbar.<BR><BR>The marks, for instance, show bookmarks."));
|
|
|
|
|
toggleAction->setCheckedState(i18n("Hide Scroll&bar Marks"));
|
|
|
|
|
|
|
|
|
|
a = toggleAction = m_toggleWWMarker = new TDEToggleAction(
|
|
|
|
|
i18n("Show Static &Word Wrap Marker"), 0,
|
|
|
|
|
this, TQT_SLOT( toggleWWMarker() ),
|
|
|
|
|
this, TQ_SLOT( toggleWWMarker() ),
|
|
|
|
|
ac, "view_word_wrap_marker" );
|
|
|
|
|
a->setWhatsThis( i18n(
|
|
|
|
|
"Show/hide the Word Wrap Marker, a vertical line drawn at the word "
|
|
|
|
@ -414,7 +414,7 @@ void KateView::setupActions()
|
|
|
|
|
|
|
|
|
|
a= m_switchCmdLine = new TDEAction(
|
|
|
|
|
i18n("Switch to Command Line"), Key_F7,
|
|
|
|
|
this, TQT_SLOT(switchToCmdLine()),
|
|
|
|
|
this, TQ_SLOT(switchToCmdLine()),
|
|
|
|
|
ac, "switch_to_cmd_line" );
|
|
|
|
|
a->setWhatsThis(i18n("Show/hide the command line on the bottom of the view."));
|
|
|
|
|
|
|
|
|
@ -426,7 +426,7 @@ void KateView::setupActions()
|
|
|
|
|
list.append("&Macintosh");
|
|
|
|
|
m_setEndOfLine->setItems(list);
|
|
|
|
|
m_setEndOfLine->setCurrentItem (m_doc->config()->eol());
|
|
|
|
|
connect(m_setEndOfLine, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setEol(int)));
|
|
|
|
|
connect(m_setEndOfLine, TQ_SIGNAL(activated(int)), this, TQ_SLOT(setEol(int)));
|
|
|
|
|
|
|
|
|
|
// encoding menu
|
|
|
|
|
new KateViewEncodingAction (m_doc, this, i18n("E&ncoding"), ac, "set_encoding");
|
|
|
|
@ -437,7 +437,7 @@ void KateView::setupActions()
|
|
|
|
|
|
|
|
|
|
slotSelectionChanged ();
|
|
|
|
|
|
|
|
|
|
connect (this, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged()));
|
|
|
|
|
connect (this, TQ_SIGNAL(selectionChanged()), this, TQ_SLOT(slotSelectionChanged()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KateView::setupEditActions()
|
|
|
|
@ -447,134 +447,134 @@ void KateView::setupEditActions()
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Move Word Left"), CTRL + Key_Left,
|
|
|
|
|
this,TQT_SLOT(wordLeft()),
|
|
|
|
|
this,TQ_SLOT(wordLeft()),
|
|
|
|
|
ac, "word_left" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select Character Left"), SHIFT + Key_Left,
|
|
|
|
|
this,TQT_SLOT(shiftCursorLeft()),
|
|
|
|
|
this,TQ_SLOT(shiftCursorLeft()),
|
|
|
|
|
ac, "select_char_left" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select Word Left"), SHIFT + CTRL + Key_Left,
|
|
|
|
|
this, TQT_SLOT(shiftWordLeft()),
|
|
|
|
|
this, TQ_SLOT(shiftWordLeft()),
|
|
|
|
|
ac, "select_word_left" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Move Word Right"), CTRL + Key_Right,
|
|
|
|
|
this, TQT_SLOT(wordRight()),
|
|
|
|
|
this, TQ_SLOT(wordRight()),
|
|
|
|
|
ac, "word_right" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select Character Right"), SHIFT + Key_Right,
|
|
|
|
|
this, TQT_SLOT(shiftCursorRight()),
|
|
|
|
|
this, TQ_SLOT(shiftCursorRight()),
|
|
|
|
|
ac, "select_char_right" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select Word Right"), SHIFT + CTRL + Key_Right,
|
|
|
|
|
this,TQT_SLOT(shiftWordRight()),
|
|
|
|
|
this,TQ_SLOT(shiftWordRight()),
|
|
|
|
|
ac, "select_word_right" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Move to Beginning of Line"), Key_Home,
|
|
|
|
|
this, TQT_SLOT(home()),
|
|
|
|
|
this, TQ_SLOT(home()),
|
|
|
|
|
ac, "beginning_of_line" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Move to Beginning of Document"), TDEStdAccel::home(),
|
|
|
|
|
this, TQT_SLOT(top()),
|
|
|
|
|
this, TQ_SLOT(top()),
|
|
|
|
|
ac, "beginning_of_document" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select to Beginning of Line"), SHIFT + Key_Home,
|
|
|
|
|
this, TQT_SLOT(shiftHome()),
|
|
|
|
|
this, TQ_SLOT(shiftHome()),
|
|
|
|
|
ac, "select_beginning_of_line" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select to Beginning of Document"), SHIFT + CTRL + Key_Home,
|
|
|
|
|
this, TQT_SLOT(shiftTop()),
|
|
|
|
|
this, TQ_SLOT(shiftTop()),
|
|
|
|
|
ac, "select_beginning_of_document" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Move to End of Line"), Key_End,
|
|
|
|
|
this, TQT_SLOT(end()),
|
|
|
|
|
this, TQ_SLOT(end()),
|
|
|
|
|
ac, "end_of_line" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Move to End of Document"), TDEStdAccel::end(),
|
|
|
|
|
this, TQT_SLOT(bottom()),
|
|
|
|
|
this, TQ_SLOT(bottom()),
|
|
|
|
|
ac, "end_of_document" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select to End of Line"), SHIFT + Key_End,
|
|
|
|
|
this, TQT_SLOT(shiftEnd()),
|
|
|
|
|
this, TQ_SLOT(shiftEnd()),
|
|
|
|
|
ac, "select_end_of_line" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select to End of Document"), SHIFT + CTRL + Key_End,
|
|
|
|
|
this, TQT_SLOT(shiftBottom()),
|
|
|
|
|
this, TQ_SLOT(shiftBottom()),
|
|
|
|
|
ac, "select_end_of_document" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select to Previous Line"), SHIFT + Key_Up,
|
|
|
|
|
this, TQT_SLOT(shiftUp()),
|
|
|
|
|
this, TQ_SLOT(shiftUp()),
|
|
|
|
|
ac, "select_line_up" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Scroll Line Up"),"", CTRL + Key_Up,
|
|
|
|
|
this, TQT_SLOT(scrollUp()),
|
|
|
|
|
this, TQ_SLOT(scrollUp()),
|
|
|
|
|
ac, "scroll_line_up" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(i18n("Move to Next Line"), Key_Down, this, TQT_SLOT(down()),
|
|
|
|
|
new TDEAction(i18n("Move to Next Line"), Key_Down, this, TQ_SLOT(down()),
|
|
|
|
|
ac, "move_line_down");
|
|
|
|
|
|
|
|
|
|
new TDEAction(i18n("Move to Previous Line"), Key_Up, this, TQT_SLOT(up()),
|
|
|
|
|
new TDEAction(i18n("Move to Previous Line"), Key_Up, this, TQ_SLOT(up()),
|
|
|
|
|
ac, "move_line_up");
|
|
|
|
|
|
|
|
|
|
new TDEAction(i18n("Move Character Right"), Key_Right, this,
|
|
|
|
|
TQT_SLOT(cursorRight()), ac, "move_cursor_right");
|
|
|
|
|
TQ_SLOT(cursorRight()), ac, "move_cursor_right");
|
|
|
|
|
|
|
|
|
|
new TDEAction(i18n("Move Character Left"), Key_Left, this, TQT_SLOT(cursorLeft()),
|
|
|
|
|
new TDEAction(i18n("Move Character Left"), Key_Left, this, TQ_SLOT(cursorLeft()),
|
|
|
|
|
ac, "move_cusor_left");
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select to Next Line"), SHIFT + Key_Down,
|
|
|
|
|
this, TQT_SLOT(shiftDown()),
|
|
|
|
|
this, TQ_SLOT(shiftDown()),
|
|
|
|
|
ac, "select_line_down" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Scroll Line Down"), CTRL + Key_Down,
|
|
|
|
|
this, TQT_SLOT(scrollDown()),
|
|
|
|
|
this, TQ_SLOT(scrollDown()),
|
|
|
|
|
ac, "scroll_line_down" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Scroll Page Up"), TDEStdAccel::prior(),
|
|
|
|
|
this, TQT_SLOT(pageUp()),
|
|
|
|
|
this, TQ_SLOT(pageUp()),
|
|
|
|
|
ac, "scroll_page_up" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select Page Up"), SHIFT + Key_PageUp,
|
|
|
|
|
this, TQT_SLOT(shiftPageUp()),
|
|
|
|
|
this, TQ_SLOT(shiftPageUp()),
|
|
|
|
|
ac, "select_page_up" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Move to Top of View"), CTRL + Key_PageUp,
|
|
|
|
|
this, TQT_SLOT(topOfView()),
|
|
|
|
|
this, TQ_SLOT(topOfView()),
|
|
|
|
|
ac, "move_top_of_view" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select to Top of View"), CTRL + SHIFT + Key_PageUp,
|
|
|
|
|
this, TQT_SLOT(shiftTopOfView()),
|
|
|
|
|
this, TQ_SLOT(shiftTopOfView()),
|
|
|
|
|
ac, "select_top_of_view" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Scroll Page Down"), TDEStdAccel::next(),
|
|
|
|
|
this, TQT_SLOT(pageDown()),
|
|
|
|
|
this, TQ_SLOT(pageDown()),
|
|
|
|
|
ac, "scroll_page_down" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select Page Down"), SHIFT + Key_PageDown,
|
|
|
|
|
this, TQT_SLOT(shiftPageDown()),
|
|
|
|
|
this, TQ_SLOT(shiftPageDown()),
|
|
|
|
|
ac, "select_page_down" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Move to Bottom of View"), CTRL + Key_PageDown,
|
|
|
|
|
this, TQT_SLOT(bottomOfView()),
|
|
|
|
|
this, TQ_SLOT(bottomOfView()),
|
|
|
|
|
ac, "move_bottom_of_view" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select to Bottom of View"), CTRL + SHIFT + Key_PageDown,
|
|
|
|
|
this, TQT_SLOT(shiftBottomOfView()),
|
|
|
|
|
this, TQ_SLOT(shiftBottomOfView()),
|
|
|
|
|
ac, "select_bottom_of_view" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Move to Matching Bracket"), CTRL + Key_6,
|
|
|
|
|
this, TQT_SLOT(toMatchingBracket()),
|
|
|
|
|
this, TQ_SLOT(toMatchingBracket()),
|
|
|
|
|
ac, "to_matching_bracket" );
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Select to Matching Bracket"), SHIFT + CTRL + Key_6,
|
|
|
|
|
this, TQT_SLOT(shiftToMatchingBracket()),
|
|
|
|
|
this, TQ_SLOT(shiftToMatchingBracket()),
|
|
|
|
|
ac, "select_matching_bracket" );
|
|
|
|
|
|
|
|
|
|
// anders: shortcuts doing any changes should not be created in browserextension
|
|
|
|
@ -582,40 +582,40 @@ void KateView::setupEditActions()
|
|
|
|
|
{
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Transpose Characters"), CTRL + Key_T,
|
|
|
|
|
this, TQT_SLOT(transpose()),
|
|
|
|
|
this, TQ_SLOT(transpose()),
|
|
|
|
|
ac, "transpose_char" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Delete Line"), CTRL + Key_K,
|
|
|
|
|
this, TQT_SLOT(killLine()),
|
|
|
|
|
this, TQ_SLOT(killLine()),
|
|
|
|
|
ac, "delete_line" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Delete Word Left"), TDEStdAccel::deleteWordBack(),
|
|
|
|
|
this, TQT_SLOT(deleteWordLeft()),
|
|
|
|
|
this, TQ_SLOT(deleteWordLeft()),
|
|
|
|
|
ac, "delete_word_left" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(
|
|
|
|
|
i18n("Delete Word Right"), TDEStdAccel::deleteWordForward(),
|
|
|
|
|
this, TQT_SLOT(deleteWordRight()),
|
|
|
|
|
this, TQ_SLOT(deleteWordRight()),
|
|
|
|
|
ac, "delete_word_right" );
|
|
|
|
|
|
|
|
|
|
new TDEAction(i18n("Delete Next Character"), Key_Delete,
|
|
|
|
|
this, TQT_SLOT(keyDelete()),
|
|
|
|
|
this, TQ_SLOT(keyDelete()),
|
|
|
|
|
ac, "delete_next_character");
|
|
|
|
|
|
|
|
|
|
TDEAction *a = new TDEAction(i18n("Backspace"), Key_Backspace,
|
|
|
|
|
this, TQT_SLOT(backspace()),
|
|
|
|
|
this, TQ_SLOT(backspace()),
|
|
|
|
|
ac, "backspace");
|
|
|
|
|
TDEShortcut cut = a->shortcut();
|
|
|
|
|
cut.append( KKey( SHIFT + Key_Backspace ) );
|
|
|
|
|
a->setShortcut( cut );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
connect( this, TQT_SIGNAL(gotFocus(Kate::View*)),
|
|
|
|
|
this, TQT_SLOT(slotGotFocus()) );
|
|
|
|
|
connect( this, TQT_SIGNAL(lostFocus(Kate::View*)),
|
|
|
|
|
this, TQT_SLOT(slotLostFocus()) );
|
|
|
|
|
connect( this, TQ_SIGNAL(gotFocus(Kate::View*)),
|
|
|
|
|
this, TQ_SLOT(slotGotFocus()) );
|
|
|
|
|
connect( this, TQ_SIGNAL(lostFocus(Kate::View*)),
|
|
|
|
|
this, TQ_SLOT(slotLostFocus()) );
|
|
|
|
|
|
|
|
|
|
m_editActions->readShortcutSettings( "Katepart Shortcuts" );
|
|
|
|
|
|
|
|
|
@ -631,18 +631,18 @@ void KateView::setupCodeFolding()
|
|
|
|
|
{
|
|
|
|
|
TDEActionCollection *ac=this->actionCollection();
|
|
|
|
|
new TDEAction( i18n("Collapse Toplevel"), CTRL+SHIFT+Key_Minus,
|
|
|
|
|
m_doc->foldingTree(),TQT_SLOT(collapseToplevelNodes()),ac,"folding_toplevel");
|
|
|
|
|
m_doc->foldingTree(),TQ_SLOT(collapseToplevelNodes()),ac,"folding_toplevel");
|
|
|
|
|
new TDEAction( i18n("Expand Toplevel"), CTRL+SHIFT+Key_Plus,
|
|
|
|
|
this,TQT_SLOT(slotExpandToplevel()),ac,"folding_expandtoplevel");
|
|
|
|
|
this,TQ_SLOT(slotExpandToplevel()),ac,"folding_expandtoplevel");
|
|
|
|
|
new TDEAction( i18n("Collapse One Local Level"), CTRL+Key_Minus,
|
|
|
|
|
this,TQT_SLOT(slotCollapseLocal()),ac,"folding_collapselocal");
|
|
|
|
|
this,TQ_SLOT(slotCollapseLocal()),ac,"folding_collapselocal");
|
|
|
|
|
new TDEAction( i18n("Expand One Local Level"), CTRL+Key_Plus,
|
|
|
|
|
this,TQT_SLOT(slotExpandLocal()),ac,"folding_expandlocal");
|
|
|
|
|
this,TQ_SLOT(slotExpandLocal()),ac,"folding_expandlocal");
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUGACCELS
|
|
|
|
|
TDEAccel* debugAccels = new TDEAccel(this,this);
|
|
|
|
|
debugAccels->insert("KATE_DUMP_REGION_TREE",i18n("Show the code folding region tree"),"","Ctrl+Shift+Alt+D",m_doc,TQT_SLOT(dumpRegionTree()));
|
|
|
|
|
debugAccels->insert("KATE_TEMPLATE_TEST",i18n("Basic template code test"),"","Ctrl+Shift+Alt+T",m_doc,TQT_SLOT(testTemplateCode()));
|
|
|
|
|
debugAccels->insert("KATE_DUMP_REGION_TREE",i18n("Show the code folding region tree"),"","Ctrl+Shift+Alt+D",m_doc,TQ_SLOT(dumpRegionTree()));
|
|
|
|
|
debugAccels->insert("KATE_TEMPLATE_TEST",i18n("Basic template code test"),"","Ctrl+Shift+Alt+T",m_doc,TQ_SLOT(testTemplateCode()));
|
|
|
|
|
debugAccels->setEnabled(true);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
@ -669,16 +669,16 @@ void KateView::slotExpandLocal()
|
|
|
|
|
void KateView::setupCodeCompletion()
|
|
|
|
|
{
|
|
|
|
|
m_codeCompletion = new KateCodeCompletion(this);
|
|
|
|
|
connect( m_codeCompletion, TQT_SIGNAL(completionAborted()),
|
|
|
|
|
this, TQT_SIGNAL(completionAborted()));
|
|
|
|
|
connect( m_codeCompletion, TQT_SIGNAL(completionDone()),
|
|
|
|
|
this, TQT_SIGNAL(completionDone()));
|
|
|
|
|
connect( m_codeCompletion, TQT_SIGNAL(argHintHidden()),
|
|
|
|
|
this, TQT_SIGNAL(argHintHidden()));
|
|
|
|
|
connect( m_codeCompletion, TQT_SIGNAL(completionDone(KTextEditor::CompletionEntry)),
|
|
|
|
|
this, TQT_SIGNAL(completionDone(KTextEditor::CompletionEntry)));
|
|
|
|
|
connect( m_codeCompletion, TQT_SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,TQString*)),
|
|
|
|
|
this, TQT_SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,TQString*)));
|
|
|
|
|
connect( m_codeCompletion, TQ_SIGNAL(completionAborted()),
|
|
|
|
|
this, TQ_SIGNAL(completionAborted()));
|
|
|
|
|
connect( m_codeCompletion, TQ_SIGNAL(completionDone()),
|
|
|
|
|
this, TQ_SIGNAL(completionDone()));
|
|
|
|
|
connect( m_codeCompletion, TQ_SIGNAL(argHintHidden()),
|
|
|
|
|
this, TQ_SIGNAL(argHintHidden()));
|
|
|
|
|
connect( m_codeCompletion, TQ_SIGNAL(completionDone(KTextEditor::CompletionEntry)),
|
|
|
|
|
this, TQ_SIGNAL(completionDone(KTextEditor::CompletionEntry)));
|
|
|
|
|
connect( m_codeCompletion, TQ_SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,TQString*)),
|
|
|
|
|
this, TQ_SIGNAL(filterInsertString(KTextEditor::CompletionEntry*,TQString*)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KateView::slotGotFocus()
|
|
|
|
|