-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 63073c4..f3792e4 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -309,65 +309,65 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
309 | 309 | ||
310 | // Button Commands | 310 | // Button Commands |
311 | a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 ); | 311 | a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 ); |
312 | connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar ); | 312 | connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar ); |
313 | a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 ); | 313 | a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 ); |
314 | connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar ); | 314 | connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar ); |
315 | a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 ); | 315 | a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 ); |
316 | connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar ); | 316 | connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar ); |
317 | a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 ); | 317 | a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 ); |
318 | connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar ); | 318 | connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar ); |
319 | a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); | 319 | a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); |
320 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); | 320 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); |
321 | a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); | 321 | a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); |
322 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); | 322 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); |
323 | a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); | 323 | a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); |
324 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); | 324 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); |
325 | /* | 325 | /* |
326 | a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); | 326 | a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); |
327 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); | 327 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); |
328 | a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); | 328 | a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); |
329 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); | 329 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); |
330 | */ | 330 | */ |
331 | 331 | ||
332 | secondToolBar = new QPEToolBar( this ); | 332 | secondToolBar = new QPEToolBar( this ); |
333 | secondToolBar->setHorizontalStretchable( TRUE ); | 333 | secondToolBar->setHorizontalStretchable( TRUE ); |
334 | 334 | ||
335 | commonCombo = new QComboBox( secondToolBar ); | 335 | commonCombo = new QComboBox( secondToolBar ); |
336 | commonCombo->setMaximumWidth(236); | 336 | commonCombo->setMaximumWidth(236); |
337 | 337 | ||
338 | editCommandListMenu->insertItem( tr( "Quick Edit" ) ); | 338 | editCommandListMenu->insertItem( tr( "Quick Edit" ) ); |
339 | if( listHidden) { | 339 | if( listHidden) { |
340 | secondToolBar->hide(); | 340 | secondToolBar->hide(); |
341 | editCommandListMenu->setItemEnabled(-22 ,FALSE); | 341 | editCommandListMenu->setItemEnabled(-23 ,FALSE); |
342 | } | 342 | } |
343 | editCommandListMenu->insertItem(tr( "Edit" ) ); | 343 | editCommandListMenu->insertItem(tr( "Edit" ) ); |
344 | 344 | ||
345 | cfg.setGroup("Commands"); | 345 | cfg.setGroup("Commands"); |
346 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); | 346 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); |
347 | 347 | ||
348 | initCommandList(); | 348 | initCommandList(); |
349 | // for (int i = 0; commonCmds[i] != NULL; i++) { | 349 | // for (int i = 0; commonCmds[i] != NULL; i++) { |
350 | // commonCombo->insertItem( commonCmds[i], i ); | 350 | // commonCombo->insertItem( commonCmds[i], i ); |
351 | // tmp = cfg.readEntry( QString::number(i),""); | 351 | // tmp = cfg.readEntry( QString::number(i),""); |
352 | // if(tmp != "") | 352 | // if(tmp != "") |
353 | // commonCombo->changeItem( tmp,i ); | 353 | // commonCombo->changeItem( tmp,i ); |
354 | // } | 354 | // } |
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 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); | 361 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); |
362 | 362 | ||
363 | // create applications ///////////////////////////////////////////////////// | 363 | // create applications ///////////////////////////////////////////////////// |
364 | setCentralWidget(tab); | 364 | setCentralWidget(tab); |
365 | 365 | ||
366 | // load keymaps //////////////////////////////////////////////////////////// | 366 | // load keymaps //////////////////////////////////////////////////////////// |
367 | KeyTrans::loadAll(); | 367 | KeyTrans::loadAll(); |
368 | for (int i = 0; i < KeyTrans::count(); i++) | 368 | for (int i = 0; i < KeyTrans::count(); i++) |
369 | { KeyTrans* s = KeyTrans::find(i); | 369 | { KeyTrans* s = KeyTrans::find(i); |
370 | assert( s ); | 370 | assert( s ); |
371 | } | 371 | } |
372 | 372 | ||
373 | se_pgm = _pgm; | 373 | se_pgm = _pgm; |
@@ -805,76 +805,76 @@ void Konsole::scrollMenuSelected(int index) | |||
805 | TEWidget* te = getTe(); | 805 | TEWidget* te = getTe(); |
806 | Config cfg("Konsole"); | 806 | Config cfg("Konsole"); |
807 | cfg.setGroup("ScrollBar"); | 807 | cfg.setGroup("ScrollBar"); |
808 | switch( index){ | 808 | switch( index){ |
809 | case -25: | 809 | case -25: |
810 | te->setScrollbarLocation(0); | 810 | te->setScrollbarLocation(0); |
811 | cfg.writeEntry("Position",0); | 811 | cfg.writeEntry("Position",0); |
812 | break; | 812 | break; |
813 | case -26: | 813 | case -26: |
814 | te->setScrollbarLocation(1); | 814 | te->setScrollbarLocation(1); |
815 | cfg.writeEntry("Position",1); | 815 | cfg.writeEntry("Position",1); |
816 | break; | 816 | break; |
817 | case -27: | 817 | case -27: |
818 | te->setScrollbarLocation(2); | 818 | te->setScrollbarLocation(2); |
819 | cfg.writeEntry("Position",2); | 819 | cfg.writeEntry("Position",2); |
820 | break; | 820 | break; |
821 | }; | 821 | }; |
822 | 822 | ||
823 | } | 823 | } |
824 | 824 | ||
825 | void Konsole::editCommandListMenuSelected(int iD) | 825 | void Konsole::editCommandListMenuSelected(int iD) |
826 | { | 826 | { |
827 | // QString temp; | 827 | // QString temp; |
828 | // qDebug( temp.sprintf("edit command list %d",iD)); | 828 | // qDebug( temp.sprintf("edit command list %d",iD)); |
829 | TEWidget* te = getTe(); | 829 | TEWidget* te = getTe(); |
830 | Config cfg("Konsole"); | 830 | Config cfg("Konsole"); |
831 | cfg.setGroup("Menubar"); | 831 | cfg.setGroup("Menubar"); |
832 | if( iD == -3) { | 832 | if( iD == -3) { |
833 | if(!secondToolBar->isHidden()) { | 833 | if(!secondToolBar->isHidden()) { |
834 | secondToolBar->hide(); | 834 | secondToolBar->hide(); |
835 | configMenu->changeItem( iD,tr( "Show Command List" )); | 835 | configMenu->changeItem( iD,tr( "Show Command List" )); |
836 | cfg.writeEntry("Hidden","TRUE"); | 836 | cfg.writeEntry("Hidden","TRUE"); |
837 | configMenu->setItemEnabled(-22 ,FALSE); | 837 | configMenu->setItemEnabled(-23 ,FALSE); |
838 | } else { | 838 | } else { |
839 | secondToolBar->show(); | 839 | secondToolBar->show(); |
840 | configMenu->changeItem( iD,tr( "Hide Command List" )); | 840 | configMenu->changeItem( iD,tr( "Hide Command List" )); |
841 | cfg.writeEntry("Hidden","FALSE"); | 841 | cfg.writeEntry("Hidden","FALSE"); |
842 | configMenu->setItemEnabled(-22 ,TRUE); | 842 | configMenu->setItemEnabled(-23 ,TRUE); |
843 | 843 | ||
844 | if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { | 844 | if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { |
845 | configMenu->setItemChecked(-22,TRUE); | 845 | configMenu->setItemChecked(-23,TRUE); |
846 | commonCombo->setEditable( TRUE ); | 846 | commonCombo->setEditable( TRUE ); |
847 | } else { | 847 | } else { |
848 | configMenu->setItemChecked(-22,FALSE); | 848 | configMenu->setItemChecked(-23,FALSE); |
849 | commonCombo->setEditable( FALSE ); | 849 | commonCombo->setEditable( FALSE ); |
850 | } | 850 | } |
851 | } | 851 | } |
852 | } | 852 | } |
853 | if( iD == -23) { | 853 | if( iD == -23) { |
854 | cfg.setGroup("Commands"); | 854 | cfg.setGroup("Commands"); |
855 | // qDebug("enableCommandEdit"); | 855 | // qDebug("enableCommandEdit"); |
856 | if( !configMenu->isItemChecked(iD) ) { | 856 | if( !configMenu->isItemChecked(iD) ) { |
857 | commonCombo->setEditable( TRUE ); | 857 | commonCombo->setEditable( TRUE ); |
858 | configMenu->setItemChecked(iD,TRUE); | 858 | configMenu->setItemChecked(iD,TRUE); |
859 | commonCombo->setCurrentItem(0); | 859 | commonCombo->setCurrentItem(0); |
860 | cfg.writeEntry("EditEnabled","TRUE"); | 860 | cfg.writeEntry("EditEnabled","TRUE"); |
861 | } else { | 861 | } else { |
862 | commonCombo->setEditable( FALSE ); | 862 | commonCombo->setEditable( FALSE ); |
863 | configMenu->setItemChecked(iD,FALSE); | 863 | configMenu->setItemChecked(iD,FALSE); |
864 | cfg.writeEntry("EditEnabled","FALSE"); | 864 | cfg.writeEntry("EditEnabled","FALSE"); |
865 | commonCombo->setFocusPolicy(QWidget::NoFocus); | 865 | commonCombo->setFocusPolicy(QWidget::NoFocus); |
866 | te->setFocus(); | 866 | te->setFocus(); |
867 | } | 867 | } |
868 | } | 868 | } |
869 | if(iD == -24) { | 869 | if(iD == -24) { |
870 | // "edit commands" | 870 | // "edit commands" |
871 | CommandEditDialog *m = new CommandEditDialog(this); | 871 | CommandEditDialog *m = new CommandEditDialog(this); |
872 | connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); | 872 | connect(m,SIGNAL(commandsEdited()),this,SLOT(initCommandList())); |
873 | m->showMaximized(); | 873 | m->showMaximized(); |
874 | } | 874 | } |
875 | 875 | ||
876 | } | 876 | } |
877 | 877 | ||
878 | // $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' | 878 | // $QPEDIR/bin/qcop QPE/Application/embeddedkonsole 'setDocument(QString)' 'ssh -V' |
879 | void Konsole::setDocument( const QString &cmd) { | 879 | void Konsole::setDocument( const QString &cmd) { |
880 | newSession(); | 880 | newSession(); |