Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index a8ddc99..3c87ad4 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -355,27 +355,39 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
355 | 355 | ||
356 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); | 356 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); |
357 | 357 | ||
358 | scrollMenu->insertItem(tr( "None" )); | 358 | scrollMenu->insertItem(tr( "None" )); |
359 | scrollMenu->insertItem(tr( "Left" )); | 359 | scrollMenu->insertItem(tr( "Left" )); |
360 | scrollMenu->insertItem(tr( "Right" )); | 360 | scrollMenu->insertItem(tr( "Right" )); |
361 | scrollMenu->insertSeparator(4); | ||
362 | scrollMenu->insertItem(tr( "Horizontal" )); | ||
363 | |||
361 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); | 364 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); |
362 | 365 | //scrollMenuSelected(-29); | |
366 | // cfg.setGroup("ScrollBar"); | ||
367 | // if(cfg.readBoolEntry("HorzScroll",0)) { | ||
368 | // if(cfg.readNumEntry("Position",2) == 0) | ||
369 | // te->setScrollbarLocation(1); | ||
370 | // else | ||
371 | // te->setScrollbarLocation(0); | ||
372 | // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); | ||
373 | // te->setWrapAt(120); | ||
374 | // } | ||
363 | // create applications ///////////////////////////////////////////////////// | 375 | // create applications ///////////////////////////////////////////////////// |
364 | setCentralWidget(tab); | 376 | setCentralWidget(tab); |
365 | 377 | ||
366 | // load keymaps //////////////////////////////////////////////////////////// | 378 | // load keymaps //////////////////////////////////////////////////////////// |
367 | KeyTrans::loadAll(); | 379 | KeyTrans::loadAll(); |
368 | for (int i = 0; i < KeyTrans::count(); i++) | 380 | for (int i = 0; i < KeyTrans::count(); i++) |
369 | { KeyTrans* s = KeyTrans::find(i); | 381 | { KeyTrans* s = KeyTrans::find(i); |
370 | assert( s ); | 382 | assert( s ); |
371 | } | 383 | } |
372 | 384 | ||
373 | se_pgm = _pgm; | 385 | se_pgm = _pgm; |
374 | se_args = _args; | 386 | se_args = _args; |
375 | 387 | se_args.prepend("--login"); | |
376 | parseCommandLine(); | 388 | parseCommandLine(); |
377 | // read and apply default values /////////////////////////////////////////// | 389 | // read and apply default values /////////////////////////////////////////// |
378 | resize(321, 321); // Dummy. | 390 | resize(321, 321); // Dummy. |
379 | QSize currentSize = size(); | 391 | QSize currentSize = size(); |
380 | if (currentSize != size()) | 392 | if (currentSize != size()) |
381 | defaultSize = size(); | 393 | defaultSize = size(); |
@@ -505,12 +517,14 @@ QSize Konsole::calcSize(int columns, int lines) { | |||
505 | sets application window to a size based on columns X lines of the te | 517 | sets application window to a size based on columns X lines of the te |
506 | guest widget. Call with (0,0) for setting default size. | 518 | guest widget. Call with (0,0) for setting default size. |
507 | */ | 519 | */ |
508 | 520 | ||
509 | void Konsole::setColLin(int columns, int lines) | 521 | void Konsole::setColLin(int columns, int lines) |
510 | { | 522 | { |
523 | qDebug("konsole::setColLin:: Columns %d", columns); | ||
524 | |||
511 | if ((columns==0) || (lines==0)) | 525 | if ((columns==0) || (lines==0)) |
512 | { | 526 | { |
513 | if (defaultSize.isEmpty()) // not in config file : set default value | 527 | if (defaultSize.isEmpty()) // not in config file : set default value |
514 | { | 528 | { |
515 | defaultSize = calcSize(80,24); | 529 | defaultSize = calcSize(80,24); |
516 | // notifySize(24,80); // set menu items (strange arg order !) | 530 | // notifySize(24,80); // set menu items (strange arg order !) |
@@ -549,12 +563,13 @@ void Konsole::setFont(int fontno) | |||
549 | */ | 563 | */ |
550 | 564 | ||
551 | // --| color selection |------------------------------------------------------- | 565 | // --| color selection |------------------------------------------------------- |
552 | 566 | ||
553 | void Konsole::changeColumns(int columns) | 567 | void Konsole::changeColumns(int columns) |
554 | { | 568 | { |
569 | qDebug("change columns"); | ||
555 | TEWidget* te = getTe(); | 570 | TEWidget* te = getTe(); |
556 | if (te != 0) { | 571 | if (te != 0) { |
557 | setColLin(columns,te->Lines()); | 572 | setColLin(columns,te->Lines()); |
558 | te->update(); | 573 | te->update(); |
559 | } | 574 | } |
560 | } | 575 | } |
@@ -797,14 +812,13 @@ void Konsole::setColor() | |||
797 | int scheme = cfg.readNumEntry("Schema",1); | 812 | int scheme = cfg.readNumEntry("Schema",1); |
798 | if(scheme != 1) colorMenuSelected( -scheme); | 813 | if(scheme != 1) colorMenuSelected( -scheme); |
799 | } | 814 | } |
800 | 815 | ||
801 | void Konsole::scrollMenuSelected(int index) | 816 | void Konsole::scrollMenuSelected(int index) |
802 | { | 817 | { |
803 | // QString temp; | 818 | qDebug( "scrollbar menu %d",index); |
804 | // qDebug( temp.sprintf("scrollbar menu %d",index)); | ||
805 | TEWidget* te = getTe(); | 819 | TEWidget* te = getTe(); |
806 | Config cfg("Konsole"); | 820 | Config cfg("Konsole"); |
807 | cfg.setGroup("ScrollBar"); | 821 | cfg.setGroup("ScrollBar"); |
808 | switch( index){ | 822 | switch( index){ |
809 | case -25: | 823 | case -25: |
810 | te->setScrollbarLocation(0); | 824 | te->setScrollbarLocation(0); |
@@ -815,12 +829,24 @@ void Konsole::scrollMenuSelected(int index) | |||
815 | cfg.writeEntry("Position",1); | 829 | cfg.writeEntry("Position",1); |
816 | break; | 830 | break; |
817 | case -27: | 831 | case -27: |
818 | te->setScrollbarLocation(2); | 832 | te->setScrollbarLocation(2); |
819 | cfg.writeEntry("Position",2); | 833 | cfg.writeEntry("Position",2); |
820 | break; | 834 | break; |
835 | case -29: { | ||
836 | bool b=cfg.readBoolEntry("HorzScroll",0); | ||
837 | cfg.writeEntry("HorzScroll", !b ); | ||
838 | cfg.write(); | ||
839 | if(cfg.readNumEntry("Position",2) == 0) | ||
840 | te->setScrollbarLocation(1); | ||
841 | else | ||
842 | te->setScrollbarLocation(0); | ||
843 | te->setScrollbarLocation( cfg.readNumEntry("Position",2)); | ||
844 | te->setWrapAt(120); | ||
845 | } | ||
846 | break; | ||
821 | }; | 847 | }; |
822 | 848 | ||
823 | } | 849 | } |
824 | 850 | ||
825 | void Konsole::editCommandListMenuSelected(int iD) | 851 | void Konsole::editCommandListMenuSelected(int iD) |
826 | { | 852 | { |