summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/TEWidget.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/TEWidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp
index 98c3cdf..2e3e0f5 100644
--- a/core/apps/embeddedkonsole/TEWidget.cpp
+++ b/core/apps/embeddedkonsole/TEWidget.cpp
@@ -261,97 +261,97 @@ void TEWidget::fontChange(const QFont &)
261 strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") 261 strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646")
262 ? vt100extended 262 ? vt100extended
263 : 263 :
264#endif 264#endif
265 identicalMap; 265 identicalMap;
266 propagateSize(); 266 propagateSize();
267 update(); 267 update();
268} 268}
269 269
270void TEWidget::setVTFont(const QFont& f) 270void TEWidget::setVTFont(const QFont& f)
271{ 271{
272 QFrame::setFont(f); 272 QFrame::setFont(f);
273} 273}
274 274
275QFont TEWidget::getVTFont() { 275QFont TEWidget::getVTFont() {
276 return font(); 276 return font();
277} 277}
278 278
279void TEWidget::setFont(const QFont &) 279void TEWidget::setFont(const QFont &)
280{ 280{
281 // ignore font change request if not coming from konsole itself 281 // ignore font change request if not coming from konsole itself
282} 282}
283 283
284/* ------------------------------------------------------------------------- */ 284/* ------------------------------------------------------------------------- */
285/* */ 285/* */
286/* Constructor / Destructor */ 286/* Constructor / Destructor */
287/* */ 287/* */
288/* ------------------------------------------------------------------------- */ 288/* ------------------------------------------------------------------------- */
289 289
290TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) 290TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name)
291{ 291{
292#ifndef QT_NO_CLIPBOARD 292#ifndef QT_NO_CLIPBOARD
293 cb = QApplication::clipboard(); 293 cb = QApplication::clipboard();
294 QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), 294 QObject::connect( (QObject*)cb, SIGNAL(dataChanged()),
295 this, SLOT(onClearSelection()) ); 295 this, SLOT(onClearSelection()) );
296#endif 296#endif
297 297
298 scrollbar = new QScrollBar(this); 298 scrollbar = new QScrollBar(this);
299 scrollbar->setCursor( arrowCursor ); 299 scrollbar->setCursor( arrowCursor );
300 connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); 300 connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int)));
301 301
302 hScrollbar = new QScrollBar(this); 302 hScrollbar = new QScrollBar(this);
303 hScrollbar->setCursor( arrowCursor ); 303 hScrollbar->setCursor( arrowCursor );
304 hScrollbar->setOrientation(QScrollBar::Horizontal); 304 hScrollbar->setOrientation(QScrollBar::Horizontal);
305 // hScrollbar->setMaximumHeight(16); 305 // hScrollbar->setMaximumHeight(16);
306 306
307 connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int))); 307 connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int)));
308 308
309 Config cfg("Qkonsole"); 309 Config cfg( "Konsole" );
310 cfg.setGroup("ScrollBar"); 310 cfg.setGroup("ScrollBar");
311 switch( cfg.readNumEntry("Position",2)){ 311 switch( cfg.readNumEntry("Position",2)){
312 case 0: 312 case 0:
313 scrollLoc = SCRNONE; 313 scrollLoc = SCRNONE;
314 break; 314 break;
315 case 1: 315 case 1:
316 scrollLoc = SCRLEFT; 316 scrollLoc = SCRLEFT;
317 break; 317 break;
318 case 2: 318 case 2:
319 scrollLoc = SCRRIGHT; 319 scrollLoc = SCRRIGHT;
320 break; 320 break;
321 }; 321 };
322 322
323 useHorzScroll=cfg.readBoolEntry("HorzScroll",0); 323 useHorzScroll=cfg.readBoolEntry("HorzScroll",0);
324 324
325 blinkT = new QTimer(this); 325 blinkT = new QTimer(this);
326 connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent())); 326 connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent()));
327 // blinking = FALSE; 327 // blinking = FALSE;
328 blinking = TRUE; 328 blinking = TRUE;
329 329
330 resizing = FALSE; 330 resizing = FALSE;
331 actSel = 0; 331 actSel = 0;
332 image = 0; 332 image = 0;
333 lines = 1; 333 lines = 1;
334 columns = 1; 334 columns = 1;
335 font_w = 1; 335 font_w = 1;
336 font_h = 1; 336 font_h = 1;
337 font_a = 1; 337 font_a = 1;
338 word_selection_mode = FALSE; 338 word_selection_mode = FALSE;
339 hposition = 0; 339 hposition = 0;
340 vcolumns = 0; 340 vcolumns = 0;
341 useBeep = true; 341 useBeep = true;
342 342
343 setMouseMarks(TRUE); 343 setMouseMarks(TRUE);
344 setVTFont( QFont("fixed") ); 344 setVTFont( QFont("fixed") );
345 setColorTable(base_color_table); // init color table 345 setColorTable(base_color_table); // init color table
346 346
347 qApp->installEventFilter( this ); //FIXME: see below 347 qApp->installEventFilter( this ); //FIXME: see below
348// KCursor::setAutoHideCursor( this, true ); 348// KCursor::setAutoHideCursor( this, true );
349 349
350 // Init DnD //////////////////////////////////////////////////////////////// 350 // Init DnD ////////////////////////////////////////////////////////////////
351 currentSession = NULL; 351 currentSession = NULL;
352// setAcceptDrops(true); // attempt 352// setAcceptDrops(true); // attempt
353// m_drop = new QPopupMenu(this); 353// m_drop = new QPopupMenu(this);
354// m_drop->insertItem( QString("Paste"), 0); 354// m_drop->insertItem( QString("Paste"), 0);
355// m_drop->insertItem( QString("cd"), 1); 355// m_drop->insertItem( QString("cd"), 1);
356// connect(m_drop, SIGNAL(activated(int)), SLOT(drop_menu_activated(int))); 356// connect(m_drop, SIGNAL(activated(int)), SLOT(drop_menu_activated(int)));
357 357
@@ -1182,97 +1182,97 @@ void TEWidget::frameChanged()
1182/* Sound */ 1182/* Sound */
1183/* */ 1183/* */
1184/* ------------------------------------------------------------------------- */ 1184/* ------------------------------------------------------------------------- */
1185 1185
1186void TEWidget::Bell() 1186void TEWidget::Bell()
1187{ 1187{
1188//#ifdef QT_QWS_SL5XXX 1188//#ifdef QT_QWS_SL5XXX
1189//# ifndef QT_NO_COP 1189//# ifndef QT_NO_COP
1190 if(useBeep) 1190 if(useBeep)
1191 QCopEnvelope( "QPE/TaskBar", "soundAlarm()" ); 1191 QCopEnvelope( "QPE/TaskBar", "soundAlarm()" );
1192 1192
1193//# endif 1193//# endif
1194//#else 1194//#else
1195//# ifndef QT_NO_SOUND 1195//# ifndef QT_NO_SOUND
1196// QSound::play(Resource::findSound("alarm")); 1196// QSound::play(Resource::findSound("alarm"));
1197//# endif 1197//# endif
1198//#endif 1198//#endif
1199 1199
1200// QApplication::beep(); 1200// QApplication::beep();
1201} 1201}
1202 1202
1203/* ------------------------------------------------------------------------- */ 1203/* ------------------------------------------------------------------------- */
1204/* */ 1204/* */
1205/* Auxiluary */ 1205/* Auxiluary */
1206/* */ 1206/* */
1207/* ------------------------------------------------------------------------- */ 1207/* ------------------------------------------------------------------------- */
1208 1208
1209void TEWidget::clearImage() 1209void TEWidget::clearImage()
1210// initialize the image 1210// initialize the image
1211// for internal use only 1211// for internal use only
1212{ 1212{
1213 for (int y = 0; y < lines; y++) 1213 for (int y = 0; y < lines; y++)
1214 for (int x = 0; x < columns; x++) 1214 for (int x = 0; x < columns; x++)
1215 { 1215 {
1216 image[loc(x,y)].c = 0xff; //' '; 1216 image[loc(x,y)].c = 0xff; //' ';
1217 image[loc(x,y)].f = 0xff; //DEFAULT_FORE_COLOR; 1217 image[loc(x,y)].f = 0xff; //DEFAULT_FORE_COLOR;
1218 image[loc(x,y)].b = 0xff; //DEFAULT_BACK_COLOR; 1218 image[loc(x,y)].b = 0xff; //DEFAULT_BACK_COLOR;
1219 image[loc(x,y)].r = 0xff; //DEFAULT_RENDITION; 1219 image[loc(x,y)].r = 0xff; //DEFAULT_RENDITION;
1220 } 1220 }
1221} 1221}
1222 1222
1223// Create Image /////////////////////////////////////////////////////// 1223// Create Image ///////////////////////////////////////////////////////
1224 1224
1225void TEWidget::calcGeometry() 1225void TEWidget::calcGeometry()
1226{ 1226{
1227 int showhscrollbar = 1; 1227 int showhscrollbar = 1;
1228 int hwidth = 0; 1228 int hwidth = 0;
1229 int dcolumns; 1229 int dcolumns;
1230 Config cfg("Qkonsole"); 1230 Config cfg( "Konsole" );
1231 cfg.setGroup("ScrollBar"); 1231 cfg.setGroup("ScrollBar");
1232 useHorzScroll=cfg.readBoolEntry("HorzScroll",0); 1232 useHorzScroll=cfg.readBoolEntry("HorzScroll",0);
1233 1233
1234 if(vcolumns == 0) showhscrollbar = 0; 1234 if(vcolumns == 0) showhscrollbar = 0;
1235 if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width(); 1235 if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width();
1236 1236
1237 scrollbar->resize(QApplication::style().scrollBarExtent().width(), 1237 scrollbar->resize(QApplication::style().scrollBarExtent().width(),
1238 contentsRect().height() - hwidth); 1238 contentsRect().height() - hwidth);
1239 1239
1240 switch(scrollLoc) { 1240 switch(scrollLoc) {
1241 case SCRNONE : 1241 case SCRNONE :
1242 columns = ( contentsRect().width() - 2 * rimX ) / font_w; 1242 columns = ( contentsRect().width() - 2 * rimX ) / font_w;
1243 dcolumns = columns; 1243 dcolumns = columns;
1244 if(vcolumns) columns = vcolumns; 1244 if(vcolumns) columns = vcolumns;
1245 blX = (contentsRect().width() - (columns*font_w) ) / 2; 1245 blX = (contentsRect().width() - (columns*font_w) ) / 2;
1246 if(showhscrollbar) 1246 if(showhscrollbar)
1247 blX = -hposition * font_w; 1247 blX = -hposition * font_w;
1248 brX = blX; 1248 brX = blX;
1249 scrollbar->hide(); 1249 scrollbar->hide();
1250 break; 1250 break;
1251 case SCRLEFT : 1251 case SCRLEFT :
1252 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; 1252 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1253 dcolumns = columns; 1253 dcolumns = columns;
1254 if(vcolumns) columns = vcolumns; 1254 if(vcolumns) columns = vcolumns;
1255 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; 1255 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1256 if(showhscrollbar) 1256 if(showhscrollbar)
1257 brX = -hposition * font_w; 1257 brX = -hposition * font_w;
1258 blX = brX + scrollbar->width(); 1258 blX = brX + scrollbar->width();
1259 scrollbar->move(contentsRect().topLeft()); 1259 scrollbar->move(contentsRect().topLeft());
1260 scrollbar->show(); 1260 scrollbar->show();
1261 break; 1261 break;
1262 case SCRRIGHT: 1262 case SCRRIGHT:
1263 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; 1263 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1264 dcolumns = columns; 1264 dcolumns = columns;
1265 if(vcolumns) columns = vcolumns; 1265 if(vcolumns) columns = vcolumns;
1266 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; 1266 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1267 if(showhscrollbar) 1267 if(showhscrollbar)
1268 blX = -hposition * font_w; 1268 blX = -hposition * font_w;
1269 brX = blX; 1269 brX = blX;
1270 scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0)); 1270 scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0));
1271 scrollbar->show(); 1271 scrollbar->show();
1272 break; 1272 break;
1273 } 1273 }
1274 //FIXME: support 'rounding' styles 1274 //FIXME: support 'rounding' styles
1275 lines = ( contentsRect().height() - 2 * rimY ) / font_h; 1275 lines = ( contentsRect().height() - 2 * rimY ) / font_h;
1276 bY = (contentsRect().height() - (lines *font_h)) / 2; 1276 bY = (contentsRect().height() - (lines *font_h)) / 2;
1277 1277
1278 if(showhscrollbar == 1) { 1278 if(showhscrollbar == 1) {