author | llornkcor <llornkcor> | 2002-02-03 18:23:27 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-03 18:23:27 (UTC) |
commit | 09c3eed0c594f4c93157faf5269ef4d975a310ca (patch) (unidiff) | |
tree | 9034282b1376e00baadc4405d1c24c1067d6bcb9 /core/apps/embeddedkonsole/konsole.cpp | |
parent | bbbccc44398fc92dcbb148def8d30f2e78f71aa5 (diff) | |
download | opie-09c3eed0c594f4c93157faf5269ef4d975a310ca.zip opie-09c3eed0c594f4c93157faf5269ef4d975a310ca.tar.gz opie-09c3eed0c594f4c93157faf5269ef4d975a310ca.tar.bz2 |
merged in Marks commandlist edit dialog
Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 274 |
1 files changed, 178 insertions, 96 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 23c12f8..bc5a766 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -51,6 +51,7 @@ | |||
51 | 51 | ||
52 | #include "konsole.h" | 52 | #include "konsole.h" |
53 | #include "keytrans.h" | 53 | #include "keytrans.h" |
54 | #include "commandeditdialog.h" | ||
54 | 55 | ||
55 | class EKNumTabBar : public QTabBar { | 56 | class EKNumTabBar : public QTabBar { |
56 | public: | 57 | public: |
@@ -175,6 +176,26 @@ Konsole::Konsole(const char* name, const char* _pgm, QStrList & _args, int) | |||
175 | init(_pgm,_args); | 176 | init(_pgm,_args); |
176 | } | 177 | } |
177 | 178 | ||
179 | void Konsole::initCommandList() | ||
180 | { | ||
181 | // qDebug("Konsole::initCommandList"); | ||
182 | Config cfg("Konsole"); | ||
183 | cfg.setGroup("Commands"); | ||
184 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); | ||
185 | commonCombo->clear(); | ||
186 | if (cfg.readEntry("Commands Set","FALSE") == "FALSE") { | ||
187 | for (int i = 0; commonCmds[i] != NULL; i++) { | ||
188 | commonCombo->insertItem(commonCmds[i],i); | ||
189 | } | ||
190 | } else { | ||
191 | for (int i = 0; i < 100; i++) { | ||
192 | if (!(cfg.readEntry( QString::number(i),"")).isEmpty()) | ||
193 | commonCombo->insertItem((cfg.readEntry( QString::number(i),""))); | ||
194 | } | ||
195 | } | ||
196 | |||
197 | } | ||
198 | |||
178 | void Konsole::init(const char* _pgm, QStrList & _args) | 199 | void Konsole::init(const char* _pgm, QStrList & _args) |
179 | { | 200 | { |
180 | b_scroll = TRUE; // histon; | 201 | b_scroll = TRUE; // histon; |
@@ -225,14 +246,17 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
225 | configMenu = new QPopupMenu( this); | 246 | configMenu = new QPopupMenu( this); |
226 | colorMenu = new QPopupMenu( this); | 247 | colorMenu = new QPopupMenu( this); |
227 | scrollMenu = new QPopupMenu( this); | 248 | scrollMenu = new QPopupMenu( this); |
249 | editCommandListMenu = new QPopupMenu( this); | ||
250 | |||
251 | configMenu->insertItem("Command List",editCommandListMenu); | ||
228 | 252 | ||
229 | bool listHidden; | 253 | bool listHidden; |
230 | cfg.setGroup("Menubar"); | 254 | cfg.setGroup("Menubar"); |
231 | if( cfg.readEntry("Hidden","FALSE") == "TRUE") { | 255 | if( cfg.readEntry("Hidden","FALSE") == "TRUE") { |
232 | configMenu->insertItem("Show command list"); | 256 | editCommandListMenu->insertItem("Show command list"); |
233 | listHidden=TRUE; | 257 | listHidden=TRUE; |
234 | } else { | 258 | } else { |
235 | configMenu->insertItem("Hide command list"); | 259 | editCommandListMenu->insertItem("Hide command list"); |
236 | listHidden=FALSE; | 260 | listHidden=FALSE; |
237 | } | 261 | } |
238 | 262 | ||
@@ -266,7 +290,7 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
266 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); | 290 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); |
267 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) )); | 291 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) )); |
268 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); | 292 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); |
269 | 293 | connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); | |
270 | menuBar->insertItem( tr("Font"), fontList ); | 294 | menuBar->insertItem( tr("Font"), fontList ); |
271 | menuBar->insertItem( tr("Options"), configMenu ); | 295 | menuBar->insertItem( tr("Options"), configMenu ); |
272 | 296 | ||
@@ -301,21 +325,24 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
301 | 325 | ||
302 | commonCombo = new QComboBox( secondToolBar ); | 326 | commonCombo = new QComboBox( secondToolBar ); |
303 | commonCombo->setMaximumWidth(236); | 327 | commonCombo->setMaximumWidth(236); |
304 | configMenu->insertItem( "Edit Command List"); | 328 | |
329 | editCommandListMenu->insertItem( "Quick Edit"); | ||
305 | if( listHidden) { | 330 | if( listHidden) { |
306 | secondToolBar->hide(); | 331 | secondToolBar->hide(); |
307 | configMenu->setItemEnabled(-20 ,FALSE); | 332 | editCommandListMenu->setItemEnabled(-22 ,FALSE); |
308 | } | 333 | } |
334 | editCommandListMenu->insertItem( "Edit"); | ||
309 | 335 | ||
310 | cfg.setGroup("Commands"); | 336 | cfg.setGroup("Commands"); |
311 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); | 337 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); |
312 | 338 | ||
313 | for (int i = 0; commonCmds[i] != NULL; i++) { | 339 | initCommandList(); |
314 | commonCombo->insertItem( commonCmds[i], i ); | 340 | // for (int i = 0; commonCmds[i] != NULL; i++) { |
315 | tmp = cfg.readEntry( QString::number(i),""); | 341 | // commonCombo->insertItem( commonCmds[i], i ); |
316 | if(tmp != "") | 342 | // tmp = cfg.readEntry( QString::number(i),""); |
317 | commonCombo->changeItem( tmp,i ); | 343 | // if(tmp != "") |
318 | } | 344 | // commonCombo->changeItem( tmp,i ); |
345 | // } | ||
319 | 346 | ||
320 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); | 347 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); |
321 | 348 | ||
@@ -586,8 +613,8 @@ void Konsole::switchSession(QWidget* w) { | |||
586 | /// ------------------------------- some new stuff by L.J. Potter | 613 | /// ------------------------------- some new stuff by L.J. Potter |
587 | void Konsole::colorMenuSelected(int iD) | 614 | void Konsole::colorMenuSelected(int iD) |
588 | { // this is NOT pretty, elegant or anything else besides functional | 615 | { // this is NOT pretty, elegant or anything else besides functional |
589 | // QString temp; | 616 | // QString temp; |
590 | // qDebug( temp.sprintf("%d", iD)); | 617 | // qDebug( temp.sprintf("colormenu %d", iD)); |
591 | TEWidget* te = getTe(); | 618 | TEWidget* te = getTe(); |
592 | Config cfg("Konsole"); | 619 | Config cfg("Konsole"); |
593 | cfg.setGroup("Colors"); | 620 | cfg.setGroup("Colors"); |
@@ -598,89 +625,89 @@ void Konsole::colorMenuSelected(int iD) | |||
598 | const ColorEntry * defaultCt=te->getdefaultColorTable(); | 625 | const ColorEntry * defaultCt=te->getdefaultColorTable(); |
599 | /////////// fore back | 626 | /////////// fore back |
600 | int i; | 627 | int i; |
601 | if(iD==-8) { // default default | 628 | if(iD==-9) { // default default |
602 | for (i = 0; i < TABLE_COLORS; i++) { | 629 | for (i = 0; i < TABLE_COLORS; i++) { |
603 | m_table[i].color = defaultCt[i].color; | 630 | m_table[i].color = defaultCt[i].color; |
604 | if(i==1 || i == 11) | 631 | if(i==1 || i == 11) |
605 | m_table[i].transparent=1; | 632 | m_table[i].transparent=1; |
606 | cfg.writeEntry("Schema","8"); | 633 | cfg.writeEntry("Schema","98"); |
607 | colorMenu->setItemChecked(-8,TRUE); | 634 | colorMenu->setItemChecked(-9,TRUE); |
608 | } | 635 | } |
609 | } else { | 636 | } else { |
610 | if(iD==-5) { // green black | 637 | if(iD==-6) { // green black |
611 | foreground.setRgb(0x18,255,0x18); | 638 | foreground.setRgb(0x18,255,0x18); |
612 | background.setRgb(0x00,0x00,0x00); | 639 | background.setRgb(0x00,0x00,0x00); |
613 | cfg.writeEntry("Schema","5"); | 640 | cfg.writeEntry("Schema","6"); |
614 | colorMenu->setItemChecked(-5,TRUE); | 641 | colorMenu->setItemChecked(-6,TRUE); |
615 | } | 642 | } |
616 | if(iD==-6) { // black white | 643 | if(iD==-7) { // black white |
617 | foreground.setRgb(0x00,0x00,0x00); | 644 | foreground.setRgb(0x00,0x00,0x00); |
618 | background.setRgb(0xFF,0xFF,0xFF); | 645 | background.setRgb(0xFF,0xFF,0xFF); |
619 | cfg.writeEntry("Schema","6"); | 646 | cfg.writeEntry("Schema","7"); |
620 | colorMenu->setItemChecked(-6,TRUE); | 647 | colorMenu->setItemChecked(-7,TRUE); |
621 | } | 648 | } |
622 | if(iD==-7) { // white black | 649 | if(iD==-8) { // white black |
623 | foreground.setRgb(0xFF,0xFF,0xFF); | 650 | foreground.setRgb(0xFF,0xFF,0xFF); |
624 | background.setRgb(0x00,0x00,0x00); | 651 | background.setRgb(0x00,0x00,0x00); |
625 | cfg.writeEntry("Schema","7"); | 652 | cfg.writeEntry("Schema","8"); |
626 | colorMenu->setItemChecked(-7,TRUE); | 653 | colorMenu->setItemChecked(-8,TRUE); |
627 | } | 654 | } |
628 | if(iD==-9) {// Black, Red | 655 | if(iD==-10) {// Black, Red |
629 | foreground.setRgb(0x00,0x00,0x00); | 656 | foreground.setRgb(0x00,0x00,0x00); |
630 | background.setRgb(0xB2,0x18,0x18); | 657 | background.setRgb(0xB2,0x18,0x18); |
631 | cfg.writeEntry("Schema","9"); | 658 | cfg.writeEntry("Schema","10"); |
632 | colorMenu->setItemChecked(-9,TRUE); | 659 | colorMenu->setItemChecked(-10,TRUE); |
633 | } | 660 | } |
634 | if(iD==-10) {// Red, Black | 661 | if(iD==-11) {// Red, Black |
635 | foreground.setRgb(230,31,31); //0xB2,0x18,0x18 | 662 | foreground.setRgb(230,31,31); //0xB2,0x18,0x18 |
636 | background.setRgb(0x00,0x00,0x00); | 663 | background.setRgb(0x00,0x00,0x00); |
637 | cfg.writeEntry("Schema","10"); | 664 | cfg.writeEntry("Schema","11"); |
638 | colorMenu->setItemChecked(-10,TRUE); | 665 | colorMenu->setItemChecked(-11,TRUE); |
639 | } | 666 | } |
640 | if(iD==-11) {// Green, Yellow - is ugly | 667 | if(iD==-12) {// Green, Yellow - is ugly |
641 | // foreground.setRgb(0x18,0xB2,0x18); | 668 | // foreground.setRgb(0x18,0xB2,0x18); |
642 | foreground.setRgb(36,139,10); | 669 | foreground.setRgb(36,139,10); |
643 | // background.setRgb(0xB2,0x68,0x18); | 670 | // background.setRgb(0xB2,0x68,0x18); |
644 | background.setRgb(255,255,0); | 671 | background.setRgb(255,255,0); |
645 | cfg.writeEntry("Schema","11"); | ||
646 | colorMenu->setItemChecked(-11,TRUE); | ||
647 | } | ||
648 | if(iD==-12) {// Blue, Magenta | ||
649 | foreground.setRgb(0x18,0xB2,0xB2); | ||
650 | background.setRgb(0x18,0x18,0xB2); | ||
651 | cfg.writeEntry("Schema","12"); | 672 | cfg.writeEntry("Schema","12"); |
652 | colorMenu->setItemChecked(-12,TRUE); | 673 | colorMenu->setItemChecked(-12,TRUE); |
653 | } | 674 | } |
654 | if(iD==-13) {// Magenta, Blue | 675 | if(iD==-13) {// Blue, Magenta |
655 | foreground.setRgb(0x18,0x18,0xB2); | 676 | foreground.setRgb(0x18,0xB2,0xB2); |
656 | background.setRgb(0x18,0xB2,0xB2); | 677 | background.setRgb(0x18,0x18,0xB2); |
657 | cfg.writeEntry("Schema","13"); | 678 | cfg.writeEntry("Schema","13"); |
658 | colorMenu->setItemChecked(-13,TRUE); | 679 | colorMenu->setItemChecked(-13,TRUE); |
659 | } | 680 | } |
660 | if(iD==-14) {// Cyan, White | 681 | if(iD==-14) {// Magenta, Blue |
661 | foreground.setRgb(0x18,0xB2,0xB2); | 682 | foreground.setRgb(0x18,0x18,0xB2); |
662 | background.setRgb(0xFF,0xFF,0xFF); | 683 | background.setRgb(0x18,0xB2,0xB2); |
663 | cfg.writeEntry("Schema","14"); | 684 | cfg.writeEntry("Schema","14"); |
664 | colorMenu->setItemChecked(-14,TRUE); | 685 | colorMenu->setItemChecked(-14,TRUE); |
665 | } | 686 | } |
666 | if(iD==-15) {// White, Cyan | 687 | if(iD==-15) {// Cyan, White |
667 | background.setRgb(0x18,0xB2,0xB2); | 688 | foreground.setRgb(0x18,0xB2,0xB2); |
668 | foreground.setRgb(0xFF,0xFF,0xFF); | 689 | background.setRgb(0xFF,0xFF,0xFF); |
669 | cfg.writeEntry("Schema","15"); | 690 | cfg.writeEntry("Schema","15"); |
670 | colorMenu->setItemChecked(-15,TRUE); | 691 | colorMenu->setItemChecked(-15,TRUE); |
671 | } | 692 | } |
672 | if(iD==-16) {// Black, Blue | 693 | if(iD==-16) {// White, Cyan |
673 | background.setRgb(0x00,0x00,0x00); | 694 | background.setRgb(0x18,0xB2,0xB2); |
674 | foreground.setRgb(0x18,0xB2,0xB2); | 695 | foreground.setRgb(0xFF,0xFF,0xFF); |
675 | cfg.writeEntry("Schema","16"); | 696 | cfg.writeEntry("Schema","16"); |
676 | colorMenu->setItemChecked(-16,TRUE); | 697 | colorMenu->setItemChecked(-16,TRUE); |
677 | } | 698 | } |
678 | if(iD==-17) {// Black, Gold | 699 | if(iD==-17) {// Black, Blue |
679 | background.setRgb(0x00,0x00,0x00); | 700 | background.setRgb(0x00,0x00,0x00); |
680 | foreground.setRgb(255,215,0); | 701 | foreground.setRgb(0x18,0xB2,0xB2); |
681 | cfg.writeEntry("Schema","17"); | 702 | cfg.writeEntry("Schema","17"); |
682 | colorMenu->setItemChecked(-17,TRUE); | 703 | colorMenu->setItemChecked(-17,TRUE); |
683 | } | 704 | } |
705 | if(iD==-18) {// Black, Gold | ||
706 | background.setRgb(0x00,0x00,0x00); | ||
707 | foreground.setRgb(255,215,0); | ||
708 | cfg.writeEntry("Schema","18"); | ||
709 | colorMenu->setItemChecked(-18,TRUE); | ||
710 | } | ||
684 | 711 | ||
685 | for (i = 0; i < TABLE_COLORS; i++) { | 712 | for (i = 0; i < TABLE_COLORS; i++) { |
686 | if(i==0 || i == 10) { | 713 | if(i==0 || i == 10) { |
@@ -700,33 +727,33 @@ void Konsole::colorMenuSelected(int iD) | |||
700 | 727 | ||
701 | void Konsole::configMenuSelected(int iD) | 728 | void Konsole::configMenuSelected(int iD) |
702 | { | 729 | { |
703 | QString temp; | 730 | QString temp; |
704 | qDebug( temp.sprintf("%d",iD)); | 731 | qDebug( temp.sprintf("configmenu %d",iD)); |
705 | TEWidget* te = getTe(); | 732 | TEWidget* te = getTe(); |
706 | Config cfg("Konsole"); | 733 | Config cfg("Konsole"); |
707 | cfg.setGroup("Menubar"); | 734 | cfg.setGroup("Menubar"); |
708 | if( iD == -2) { | 735 | // if( iD == -2) { |
709 | if(!secondToolBar->isHidden()) { | 736 | // if(!secondToolBar->isHidden()) { |
710 | secondToolBar->hide(); | 737 | // secondToolBar->hide(); |
711 | configMenu->changeItem( iD,"Show Command List"); | 738 | // configMenu->changeItem( iD,"Show Command List"); |
712 | cfg.writeEntry("Hidden","TRUE"); | 739 | // cfg.writeEntry("Hidden","TRUE"); |
713 | configMenu->setItemEnabled(-20 ,FALSE); | 740 | // configMenu->setItemEnabled(-20 ,FALSE); |
714 | } else { | 741 | // } else { |
715 | secondToolBar->show(); | 742 | // secondToolBar->show(); |
716 | configMenu->changeItem( iD,"Hide Command List"); | 743 | // configMenu->changeItem( iD,"Hide Command List"); |
717 | cfg.writeEntry("Hidden","FALSE"); | 744 | // cfg.writeEntry("Hidden","FALSE"); |
718 | configMenu->setItemEnabled(-20 ,TRUE); | 745 | // configMenu->setItemEnabled(-20 ,TRUE); |
719 | 746 | ||
720 | if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { | 747 | // if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { |
721 | configMenu->setItemChecked(-20,TRUE); | 748 | // configMenu->setItemChecked(-20,TRUE); |
722 | commonCombo->setEditable( TRUE ); | 749 | // commonCombo->setEditable( TRUE ); |
723 | } else { | 750 | // } else { |
724 | configMenu->setItemChecked(-20,FALSE); | 751 | // configMenu->setItemChecked(-20,FALSE); |
725 | commonCombo->setEditable( FALSE ); | 752 | // commonCombo->setEditable( FALSE ); |
726 | } | 753 | // } |
727 | } | 754 | // } |
728 | } | 755 | // } |
729 | if( iD == -3) { | 756 | if( iD == -4) { |
730 | cfg.setGroup("Tabs"); | 757 | cfg.setGroup("Tabs"); |
731 | QString tmp=cfg.readEntry("Position","Top"); | 758 | QString tmp=cfg.readEntry("Position","Top"); |
732 | 759 | ||
@@ -740,22 +767,22 @@ void Konsole::configMenuSelected(int iD) | |||
740 | cfg.writeEntry("Position","Top"); | 767 | cfg.writeEntry("Position","Top"); |
741 | } | 768 | } |
742 | } | 769 | } |
743 | if( iD == -20) { | 770 | // if( iD == -20) { |
744 | cfg.setGroup("Commands"); | 771 | // cfg.setGroup("Commands"); |
745 | // qDebug("enableCommandEdit"); | 772 | // // qDebug("enableCommandEdit"); |
746 | if( !configMenu->isItemChecked(iD) ) { | 773 | // if( !configMenu->isItemChecked(iD) ) { |
747 | commonCombo->setEditable( TRUE ); | 774 | // commonCombo->setEditable( TRUE ); |
748 | configMenu->setItemChecked(iD,TRUE); | 775 | // configMenu->setItemChecked(iD,TRUE); |
749 | commonCombo->setCurrentItem(0); | 776 | // commonCombo->setCurrentItem(0); |
750 | cfg.writeEntry("EditEnabled","TRUE"); | 777 | // cfg.writeEntry("EditEnabled","TRUE"); |
751 | } else { | 778 | // } else { |
752 | commonCombo->setEditable( FALSE ); | 779 | // commonCombo->setEditable( FALSE ); |
753 | configMenu->setItemChecked(iD,FALSE); | 780 | // configMenu->setItemChecked(iD,FALSE); |
754 | cfg.writeEntry("EditEnabled","FALSE"); | 781 | // cfg.writeEntry("EditEnabled","FALSE"); |
755 | commonCombo->setFocusPolicy(QWidget::NoFocus); | 782 | // commonCombo->setFocusPolicy(QWidget::NoFocus); |
756 | te->setFocus(); | 783 | // te->setFocus(); |
757 | } | 784 | // } |
758 | } | 785 | // } |
759 | } | 786 | } |
760 | 787 | ||
761 | void Konsole::changeCommand(const QString &text, int c) | 788 | void Konsole::changeCommand(const QString &text, int c) |
@@ -779,22 +806,77 @@ void Konsole::setColor() | |||
779 | 806 | ||
780 | void Konsole::scrollMenuSelected(int index) | 807 | void Konsole::scrollMenuSelected(int index) |
781 | { | 808 | { |
809 | // QString temp; | ||
810 | // qDebug( temp.sprintf("scrollbar menu %d",index)); | ||
782 | TEWidget* te = getTe(); | 811 | TEWidget* te = getTe(); |
783 | Config cfg("Konsole"); | 812 | Config cfg("Konsole"); |
784 | cfg.setGroup("Scrollbar"); | 813 | cfg.setGroup("Scrollbar"); |
785 | switch( index){ | 814 | switch( index){ |
786 | case -21: | 815 | case -24: |
787 | te->setScrollbarLocation(0); | 816 | te->setScrollbarLocation(0); |
788 | cfg.writeEntry("Position",0); | 817 | cfg.writeEntry("Position",0); |
789 | break; | 818 | break; |
790 | case -22: | 819 | case -25: |
791 | te->setScrollbarLocation(1); | 820 | te->setScrollbarLocation(1); |
792 | cfg.writeEntry("Position",1); | 821 | cfg.writeEntry("Position",1); |
793 | break; | 822 | break; |
794 | case -23: | 823 | case -26: |
795 | te->setScrollbarLocation(2); | 824 | te->setScrollbarLocation(2); |
796 | cfg.writeEntry("Position",2); | 825 | cfg.writeEntry("Position",2); |
797 | break; | 826 | break; |
798 | }; | 827 | }; |
799 | 828 | ||
800 | } | 829 | } |
830 | |||
831 | void Konsole::editCommandListMenuSelected(int iD) | ||
832 | { | ||
833 | // QString temp; | ||
834 | // qDebug( temp.sprintf("edit command list %d",iD)); | ||
835 | TEWidget* te = getTe(); | ||
836 | Config cfg("Konsole"); | ||
837 | cfg.setGroup("Menubar"); | ||
838 | if( iD == -3) { | ||
839 | if(!secondToolBar->isHidden()) { | ||
840 | secondToolBar->hide(); | ||
841 | configMenu->changeItem( iD,"Show Command List"); | ||
842 | cfg.writeEntry("Hidden","TRUE"); | ||
843 | configMenu->setItemEnabled(-22 ,FALSE); | ||
844 | } else { | ||
845 | secondToolBar->show(); | ||
846 | configMenu->changeItem( iD,"Hide Command List"); | ||
847 | cfg.writeEntry("Hidden","FALSE"); | ||
848 | configMenu->setItemEnabled(-22 ,TRUE); | ||
849 | |||
850 | if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { | ||
851 | configMenu->setItemChecked(-22,TRUE); | ||
852 | commonCombo->setEditable( TRUE ); | ||
853 | } else { | ||
854 | configMenu->setItemChecked(-22,FALSE); | ||
855 | commonCombo->setEditable( FALSE ); | ||
856 | } | ||
857 | } | ||
858 | } | ||
859 | if( iD == -22) { | ||
860 | cfg.setGroup("Commands"); | ||
861 | // qDebug("enableCommandEdit"); | ||
862 | if( !configMenu->isItemChecked(iD) ) { | ||
863 | commonCombo->setEditable( TRUE ); | ||
864 | configMenu->setItemChecked(iD,TRUE); | ||
865 | commonCombo->setCurrentItem(0); | ||
866 | cfg.writeEntry("EditEnabled","TRUE"); | ||
867 | } else { | ||
868 | commonCombo->setEditable( FALSE ); | ||
869 | configMenu->setItemChecked(iD,FALSE); | ||
870 | cfg.writeEntry("EditEnabled","FALSE"); | ||
871 | commonCombo->setFocusPolicy(QWidget::NoFocus); | ||
872 | te->setFocus(); | ||
873 | } | ||
874 | } | ||
875 | if(iD == -23) { | ||
876 | // "edit commands" | ||
877 | CommandEditDialog *m = new CommandEditDialog(this); | ||
878 | connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); | ||
879 | m->showMaximized(); | ||
880 | } | ||
881 | |||
882 | } | ||