summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2014-04-20 00:31:22 +0900
committerMichele Calgaro <[email protected]>2014-04-20 00:31:22 +0900
commitf69bb8df1debfec9d20dd6069f8034263ca31049 (patch)
tree0e112859a6617d2ab003ffd3a6bdf3139d77d3bf
parentc7a9fafe524bdb6549860057d3ecd92f4c931a4d (diff)
downloadtdebase-f69bb8df1debfec9d20dd6069f8034263ca31049.tar.gz
tdebase-f69bb8df1debfec9d20dd6069f8034263ca31049.zip
Added support for handling Meta key as Alt key in konsolePart.
This relates to bug 1026.
-rw-r--r--konsole/konsole/konsole.cpp20
-rw-r--r--konsole/konsole/konsole_part.cpp23
-rw-r--r--konsole/konsole/konsole_part.h9
-rw-r--r--konsole/konsole/session.cpp6
-rw-r--r--konsole/konsole/session.h1
5 files changed, 42 insertions, 17 deletions
diff --git a/konsole/konsole/konsole.cpp b/konsole/konsole/konsole.cpp
index a7d3d7333..26d35602e 100644
--- a/konsole/konsole/konsole.cpp
+++ b/konsole/konsole/konsole.cpp
@@ -2953,21 +2953,21 @@ TQString Konsole::newSession(KSimpleConfig *co, TQString program, const TQStrLis
s->enableFullScripting(b_fullScripting);
// If you add any new signal-slot connection below, think about doing it in konsolePart too
connect( s,TQT_SIGNAL(done(TESession*)),
- this,TQT_SLOT(doneSession(TESession*)) );
- connect( s, TQT_SIGNAL( updateTitle(TESession*) ),
- this, TQT_SLOT( updateTitle(TESession*) ) );
- connect( s, TQT_SIGNAL( notifySessionState(TESession*, int) ),
- this, TQT_SLOT( notifySessionState(TESession*, int)) );
+ this,TQT_SLOT(doneSession(TESession*)));
+ connect( s, TQT_SIGNAL(updateTitle(TESession*)),
+ this, TQT_SLOT(updateTitle(TESession*)));
+ connect( s, TQT_SIGNAL(notifySessionState(TESession*, int)),
+ this, TQT_SLOT(notifySessionState(TESession*, int)));
connect( s, TQT_SIGNAL(disableMasterModeConnections()),
- this, TQT_SLOT(disableMasterModeConnections()) );
+ this, TQT_SLOT(disableMasterModeConnections()));
connect( s, TQT_SIGNAL(enableMasterModeConnections()),
- this, TQT_SLOT(enableMasterModeConnections()) );
+ this, TQT_SLOT(enableMasterModeConnections()));
connect( s, TQT_SIGNAL(renameSession(TESession*,const TQString&)),
- this, TQT_SLOT(slotRenameSession(TESession*, const TQString&)) );
+ this, TQT_SLOT(slotRenameSession(TESession*, const TQString&)));
connect( s->getEmulation(), TQT_SIGNAL(changeColumns(int)),
this, TQT_SLOT(changeColumns(int)) );
connect( s->getEmulation(), TQT_SIGNAL(changeColLin(int,int)),
- this, TQT_SLOT(changeColLin(int,int)) );
+ this, TQT_SLOT(changeColLin(int,int)));
connect( s->getEmulation(), TQT_SIGNAL(ImageSizeChanged(int,int)),
this, TQT_SLOT(notifySize(int,int)));
connect( s, TQT_SIGNAL(zmodemDetected(TESession*)),
@@ -2983,7 +2983,7 @@ TQString Konsole::newSession(KSimpleConfig *co, TQString program, const TQStrLis
connect( s, TQT_SIGNAL(setSessionSchema(TESession*, const TQString &)),
this, TQT_SLOT(slotSetSessionSchema(TESession*, const TQString &)));
connect( s, TQT_SIGNAL(changeTabTextColor(TESession*, int)),
- this,TQT_SLOT(changeTabTextColor(TESession*, int)) );
+ this,TQT_SLOT(changeTabTextColor(TESession*, int)));
s->widget()->setVTFont(defaultFont);// Hack to set font again after newSession
s->setSchemaNo(schmno);
diff --git a/konsole/konsole/konsole_part.cpp b/konsole/konsole/konsole_part.cpp
index f1b2f28d8..87cd2b373 100644
--- a/konsole/konsole/konsole_part.cpp
+++ b/konsole/konsole/konsole_part.cpp
@@ -105,6 +105,7 @@ konsolePart::konsolePart(TQWidget *_parentWidget, const char *widgetName, TQObje
,rootxpm(0)
,blinkingCursor(0)
,showFrame(0)
+,metaAsAlt(0)
,m_useKonsoleSettings(0)
,selectBell(0)
,selectLineSpacing(0)
@@ -431,6 +432,11 @@ void konsolePart::makeGUI()
showFrame->setCheckedState(i18n("Hide Fr&ame"));
showFrame->plug(m_options);
+ // Meta key as Alt key
+ metaAsAlt = new TDEToggleAction(i18n("Me&ta key as Alt key"), 0,
+ this, TQT_SLOT(slotToggleMetaAsAltMode()), settingsActions);
+ metaAsAlt->plug(m_options);
+
// Word Connectors
TDEAction *WordSeps = new TDEAction(i18n("Wor&d Connectors..."), 0, this,
TQT_SLOT(slotWordSeps()), settingsActions);
@@ -505,6 +511,8 @@ void konsolePart::applySettingsToGUI()
selectLineSpacing->setCurrentItem(te->lineSpacing());
if (blinkingCursor)
blinkingCursor->setChecked(te->blinkingCursor());
+ if (metaAsAlt)
+ metaAsAlt->setChecked(b_metaAsAlt);
if (m_schema)
m_schema->setItemChecked(curr_schema,true);
if (selectSetEncoding)
@@ -532,6 +540,8 @@ void konsolePart::applyProperties()
se->widget()->setVTFont( defaultFont );
se->setSchemaNo( curr_schema );
slotSetEncoding();
+
+ se->setMetaAsAltMode(b_metaAsAlt);
}
void konsolePart::setSettingsMenuEnabled( bool enable )
@@ -560,13 +570,13 @@ void konsolePart::readProperties()
config->setDesktopGroup();
b_framevis = config->readBoolEntry("has frame",false);
+ b_metaAsAlt = config->readBoolEntry("metaAsAltMode",false);
b_histEnabled = config->readBoolEntry("historyenabled",true);
n_bell = TQMIN(config->readUnsignedNumEntry("bellmode",TEWidget::BELLSYSTEM),3);
n_keytab=config->readNumEntry("keytab",0); // act. the keytab for this session
n_scroll = TQMIN(config->readUnsignedNumEntry("scrollbar",TEWidget::SCRRIGHT),2);
m_histSize = config->readNumEntry("history",DEFAULT_HISTORY_SIZE);
s_word_seps= config->readEntry("wordseps",":@-./_~");
-
n_encoding = config->readNumEntry("encoding",0);
TQFont tmpFont = TDEGlobalSettings::fixedFont();
@@ -637,6 +647,7 @@ void konsolePart::saveProperties()
config->writeEntry("historyenabled", b_histEnabled);
config->writeEntry("keytab",n_keytab);
config->writeEntry("has frame",b_framevis);
+ config->writeEntry("metaAsAltMode",b_metaAsAlt);
config->writeEntry("LineSpacing", te->lineSpacing());
config->writeEntry("schema",s_tdeconfigSchema);
config->writeEntry("scrollbar",n_scroll);
@@ -914,14 +925,18 @@ void konsolePart::slotBlinkingCursor()
te->setBlinkingCursor(blinkingCursor->isChecked());
}
+void konsolePart::slotToggleMetaAsAltMode()
+{
+ b_metaAsAlt ^= true;
+ if (!se) return;
+ se->setMetaAsAltMode(b_metaAsAlt);
+}
+
void konsolePart::slotUseKonsoleSettings()
{
b_useKonsoleSettings = m_useKonsoleSettings->isChecked();
-
setSettingsMenuEnabled( !b_useKonsoleSettings );
-
readProperties();
-
applySettingsToGUI();
}
diff --git a/konsole/konsole/konsole_part.h b/konsole/konsole/konsole_part.h
index 1fd2ac95f..766e4e5d5 100644
--- a/konsole/konsole/konsole_part.h
+++ b/konsole/konsole/konsole_part.h
@@ -118,6 +118,7 @@ signals:
void slotSelectBell();
void slotSelectLineSpacing();
void slotBlinkingCursor();
+ void slotToggleMetaAsAltMode();
void slotUseKonsoleSettings();
void slotWordSeps();
void slotSetEncoding();
@@ -136,9 +137,9 @@ signals:
void setSchema(ColorSchema* s);
void updateKeytabMenu();
- bool doOpenStream( const TQString& );
- bool doWriteStream( const TQByteArray& );
- bool doCloseStream();
+ bool doOpenStream( const TQString& );
+ bool doWriteStream( const TQByteArray& );
+ bool doCloseStream();
TQWidget* parentWidget;
TEWidget* te;
@@ -151,6 +152,7 @@ signals:
TDEToggleAction* blinkingCursor;
TDEToggleAction* showFrame;
+ TDEToggleAction* metaAsAlt;
TDEToggleAction* m_useKonsoleSettings;
TDESelectAction* selectBell;
@@ -174,6 +176,7 @@ signals:
TQString s_word_seps; // characters that are considered part of a word
bool b_framevis:1;
+ bool b_metaAsAlt:1;
bool b_histEnabled:1;
bool b_useKonsoleSettings:1;
bool b_autoDestroy:1;
diff --git a/konsole/konsole/session.cpp b/konsole/konsole/session.cpp
index 8ecf469af..a6103da4f 100644
--- a/konsole/konsole/session.cpp
+++ b/konsole/konsole/session.cpp
@@ -464,6 +464,12 @@ void TESession::setFontNo(int fn)
font_no = fn;
}
+void TESession::setMetaAsAltMode(bool mode)
+{
+ if (em)
+ em->setMetaKeyMode(mode);
+}
+
void TESession::setTitle(const TQString& _title)
{
title = _title;
diff --git a/konsole/konsole/session.h b/konsole/konsole/session.h
index d15b8b5bd..bfcafdf47 100644
--- a/konsole/konsole/session.h
+++ b/konsole/konsole/session.h
@@ -123,6 +123,7 @@ public:
void setSize(TQSize size);
void setFont(const TQString &font);
TQString font();
+ void setMetaAsAltMode(bool mode);
public slots: