mirror of
https://github.com/KDE/konsole.git
synced 2025-12-23 23:38:08 -05:00
Make Insert-to-paste a run-time rather than compile-time option.
Shift-Insert does paste always. svn path=/trunk/kdebase/konsole/; revision=18936
This commit is contained in:
@@ -39,6 +39,7 @@ public:
|
||||
|
||||
void setScrollbarLocation(int loc);
|
||||
void setScroll(int cursor, int lines);
|
||||
void setInsertToPaste(bool on);
|
||||
|
||||
public:
|
||||
|
||||
@@ -148,6 +149,8 @@ private:
|
||||
BOOL blinking; // hide text in paintEvent
|
||||
BOOL hasBlinker; // has characters to blink
|
||||
QTimer* blinkT; // active when hasBlinker
|
||||
|
||||
bool ins_to_paste; // Insert key causes paste
|
||||
};
|
||||
|
||||
#endif // TE_WIDGET_H
|
||||
|
||||
@@ -106,6 +106,7 @@ private:
|
||||
bool b_menuvis;
|
||||
bool b_framevis;
|
||||
bool b_bshack;
|
||||
bool b_inspaste;
|
||||
int n_font;
|
||||
int n_scroll;
|
||||
QString s_schema;
|
||||
|
||||
@@ -167,6 +167,7 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
|
||||
font_h = 1;
|
||||
font_a = 1;
|
||||
word_selection_mode = FALSE;
|
||||
ins_to_paste = FALSE;
|
||||
|
||||
setMouseMarks(TRUE);
|
||||
setVTFont( QFont("fixed") );
|
||||
@@ -771,11 +772,15 @@ bool TEWidget::eventFilter( QObject *, QEvent *e )
|
||||
case ShiftButton|(Key_Down << 8) :
|
||||
scrollbar->setValue(scrollbar->value()+1);
|
||||
break;
|
||||
#if 0
|
||||
case (Key_Insert << 8) : // Some progs use this.
|
||||
case ShiftButton|(Key_Insert << 8) :
|
||||
emitSelection();
|
||||
break;
|
||||
#endif
|
||||
case (Key_Insert << 8) : // Some progs use this.
|
||||
if ( ins_to_paste ) {
|
||||
emitSelection();
|
||||
break;
|
||||
}
|
||||
// FALLTHROUGH
|
||||
default :
|
||||
emit keyPressedSignal(ke); // expose
|
||||
break;
|
||||
@@ -798,6 +803,11 @@ bool TEWidget::eventFilter( QObject *, QEvent *e )
|
||||
return FALSE; // standard event processing
|
||||
}
|
||||
|
||||
void TEWidget::setInsertToPaste(bool on)
|
||||
{
|
||||
ins_to_paste = on;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* */
|
||||
/* Font */
|
||||
|
||||
@@ -152,6 +152,7 @@ TEDemo::TEDemo(QStrList & _args, int login_shell) : KTMainWindow(), args(_args)
|
||||
te->setFrameStyle( b_framevis
|
||||
? QFrame::WinPanel | QFrame::Sunken
|
||||
: QFrame::NoFrame );
|
||||
te->setInsertToPaste( b_inspaste );
|
||||
te->setScrollbarLocation(n_scroll);
|
||||
|
||||
// construct initial session ///////////////////////////////////////////////
|
||||
@@ -360,6 +361,8 @@ void TEDemo::makeMenu()
|
||||
m_options->insertSeparator();
|
||||
m_options->insertItem( i18n("BS sends &DEL"), 4 );
|
||||
m_options->setItemChecked(4,b_bshack);
|
||||
m_options->insertItem( i18n("&Insert pastes"), 5 );
|
||||
m_options->setItemChecked(5,b_inspaste);
|
||||
m_options->insertSeparator();
|
||||
m_options->insertItem( i18n("&Font"), m_font);
|
||||
m_options->insertItem( i18n("&Size"), m_size);
|
||||
@@ -412,6 +415,7 @@ void TEDemo::saveProperties(KConfig* config)
|
||||
config->writeEntry("menubar visible",b_menuvis);
|
||||
config->writeEntry("has frame",b_framevis);
|
||||
config->writeEntry("BS hack",b_bshack);
|
||||
config->writeEntry("insert paste",b_inspaste);
|
||||
config->writeEntry("font",n_font);
|
||||
config->writeEntry("schema",s_schema);
|
||||
config->writeEntry("scrollbar",n_scroll);
|
||||
@@ -430,6 +434,7 @@ void TEDemo::readProperties(KConfig* config)
|
||||
b_menuvis = config->readBoolEntry("menubar visible",TRUE);
|
||||
b_framevis = config->readBoolEntry("has frame",TRUE);
|
||||
b_bshack = config->readBoolEntry("BS hack",TRUE);
|
||||
b_inspaste = config->readBoolEntry("insert paste",FALSE);
|
||||
n_font = MIN(config->readUnsignedNumEntry("font",3),7);
|
||||
n_scroll = MIN(config->readUnsignedNumEntry("scrollbar",SCRRIGHT),2);
|
||||
s_schema = config->readEntry("schema","");
|
||||
@@ -567,6 +572,10 @@ void TEDemo::opt_menu_activated(int item)
|
||||
else
|
||||
((VT102Emulation*)se->getEmulation())->resetMode(MODE_BsHack);
|
||||
break;
|
||||
case 5: b_inspaste = !b_inspaste;
|
||||
m_options->setItemChecked(5,b_inspaste);
|
||||
te->setInsertToPaste( b_inspaste );
|
||||
break;
|
||||
case 8: saveProperties(kapp->getConfig());
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user