Commit d3a61715 authored by Robert Knight's avatar Robert Knight
Browse files

Correct capitalization of LineFont file name. Move default.keytab header to...

Correct capitalization of LineFont file name.  Move default.keytab header to /old as it is no longer used.  Remove MakeDefaults as it is no longer used.  Start of code to escape key binding output for use in key binding editor.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=676647
parent 323b5b76
......@@ -5,7 +5,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Linux)
endif (CMAKE_SYSTEM_NAME MATCHES Linux)
configure_file (config-konsole.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-konsole.h )
OPTION(KONSOLE_GENERATE_LINEFONT "Konsole: regenerate linefont file" OFF)
OPTION(KONSOLE_GENERATE_LINEFONT "Konsole: regenerate LineFont file" OFF)
########### next target ###############
......@@ -23,7 +23,7 @@ target_link_libraries(fontembedder ${KDE4_KIO_LIBS} )
#qt4_add_dbus_adaptor( sessionadaptors_SRCS org.kde.konsole.SessionScripting.xml Session.h Session )
if(KONSOLE_GENERATE_LINEFONT)
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/linefont.h COMMAND ${CMAKE_CURRENT_BINARY_DIR}/fontembedder ARGS ${CMAKE_SOURCE_DIR}/linefont.src DEPENDS ${CMAKE_SOURCE_DIR}/linefont.src )
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/LineFont.h COMMAND ${CMAKE_CURRENT_BINARY_DIR}/fontembedder ARGS ${CMAKE_SOURCE_DIR}/LineFont.src DEPENDS ${CMAKE_SOURCE_DIR}/LineFont.src )
endif(KONSOLE_GENERATE_LINEFONT)
########### next target ###############
......
......@@ -621,6 +621,43 @@ bool KeyboardTranslator::Entry::matches(int keyCode , Qt::KeyboardModifier modif
return true;
}
QByteArray KeyboardTranslator::Entry::escapedText() const
{
QByteArray result(_text);
for ( int i = 0 ; i < result.count()-1 ; i++ )
{
char ch = result[i];
char replacement = 0;
switch ( ch )
{
case 27 : replacement = 'E'; break;
case 8 : replacement = 'b'; break;
case 12 : replacement = 'f'; break;
case 9 : replacement = 't'; break;
case 13 : replacement = 'r'; break;
case 10 : replacement = 'n'; break;
default:
if ( !QChar(ch).isPrint() )
replacement = 'x';
}
qDebug() << "a" << ch << "b";
if ( replacement == 'x' )
{
result.replace(i,1,'\\'+QByteArray(ch,1).toHex());
} else if ( replacement != 0 )
{
result.remove(i,1);
result.insert(i,'\\');
result.insert(i+1,replacement);
}
}
return result;
}
QByteArray KeyboardTranslator::Entry::unescape(const QByteArray& input) const
{
QByteArray result(input);
......@@ -717,7 +754,7 @@ void KeyboardTranslator::Entry::insertState( QString& item , int state ) const
QString KeyboardTranslator::Entry::resultToString() const
{
if ( !_text.isEmpty() )
return _text;
return escapedText();
else if ( _command == ScrollPageUpCommand )
return "ScrollPageUp";
else if ( _command == ScrollPageDownCommand )
......
......@@ -128,6 +128,14 @@ public:
/** Sets the character sequence associated with this entry */
void setText(const QByteArray& text);
/**
* Returns the character sequence associated with this entry,
* with any non-printable characters replaced with escape sequences.
*
* eg. \E for Escape, \t for tab, \n for new line.
*/
QByteArray escapedText() const;
/** Returns the character code ( from the Qt::Key enum ) associated with this entry */
int keyCode() const;
/** Sets the character code associated with this entry */
......
# [MakeDefaults] Quote default configuration files
# TODO. We should convert both schema and sessions
# to the method demonstrated for keytrans.
../tests/quote ../other/README.default.Keytab > default.keytab.h
......@@ -420,7 +420,7 @@ enum LineEncode
BotR = (1<<23)
};
#include "linefont.h"
#include "LineFont.h"
static void drawLineChar(QPainter& paint, int x, int y, int w, int h, uchar code)
{
......
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