summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp10
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
@@ -245,193 +245,193 @@ void Konsole::init(const char* _pgm, QStrList & _args)
245 QPEMenuBar *menuBar = new QPEMenuBar( menuToolBar ); 245 QPEMenuBar *menuBar = new QPEMenuBar( menuToolBar );
246 246
247 fontList = new QPopupMenu( this ); 247 fontList = new QPopupMenu( this );
248 for(uint i = 0; i < fonts.count(); i++) { 248 for(uint i = 0; i < fonts.count(); i++) {
249 VTFont *fnt = fonts.at(i); 249 VTFont *fnt = fonts.at(i);
250 fontList->insertItem(fnt->getName(), i); 250 fontList->insertItem(fnt->getName(), i);
251 } 251 }
252 fontChanged(cfont); 252 fontChanged(cfont);
253 253
254 configMenu = new QPopupMenu( this); 254 configMenu = new QPopupMenu( this);
255 colorMenu = new QPopupMenu( this); 255 colorMenu = new QPopupMenu( this);
256 scrollMenu = new QPopupMenu( this); 256 scrollMenu = new QPopupMenu( this);
257 editCommandListMenu = new QPopupMenu( this); 257 editCommandListMenu = new QPopupMenu( this);
258 258
259 configMenu->insertItem("Command List",editCommandListMenu); 259 configMenu->insertItem("Command List",editCommandListMenu);
260 260
261 bool listHidden; 261 bool listHidden;
262 cfg.setGroup("Menubar"); 262 cfg.setGroup("Menubar");
263 if( cfg.readEntry("Hidden","FALSE") == "TRUE") { 263 if( cfg.readEntry("Hidden","FALSE") == "TRUE") {
264 editCommandListMenu->insertItem( tr( "Show command list" )); 264 editCommandListMenu->insertItem( tr( "Show command list" ));
265 listHidden=TRUE; 265 listHidden=TRUE;
266 } else { 266 } else {
267 editCommandListMenu->insertItem( tr( "Hide command list" )); 267 editCommandListMenu->insertItem( tr( "Hide command list" ));
268 listHidden=FALSE; 268 listHidden=FALSE;
269 } 269 }
270 270
271 cfg.setGroup("Tabs"); 271 cfg.setGroup("Tabs");
272 tmp=cfg.readEntry("Position","Bottom"); 272 tmp=cfg.readEntry("Position","Bottom");
273 if(tmp=="Top") { 273 if(tmp=="Top") {
274 tab->setTabPosition(QTabWidget::Top); 274 tab->setTabPosition(QTabWidget::Top);
275 configMenu->insertItem( tr( "Tabs on Bottom" ) ); 275 configMenu->insertItem( tr( "Tabs on Bottom" ) );
276 } else { 276 } else {
277 tab->setTabPosition(QTabWidget::Bottom); 277 tab->setTabPosition(QTabWidget::Bottom);
278 configMenu->insertItem("Tabs on Top"); 278 configMenu->insertItem("Tabs on Top");
279 } 279 }
280 configMenu->insertSeparator(2); 280 configMenu->insertSeparator(2);
281 281
282 colorMenu->insertItem(tr( "Green on Black")); 282 colorMenu->insertItem(tr( "Green on Black"));
283 colorMenu->insertItem(tr( "Black on White")); 283 colorMenu->insertItem(tr( "Black on White"));
284 colorMenu->insertItem(tr( "White on Black")); 284 colorMenu->insertItem(tr( "White on Black"));
285 colorMenu->insertItem(tr( "Black on Transparent")); 285 colorMenu->insertItem(tr( "Black on Transparent"));
286 colorMenu->insertItem(tr( "Black on Red")); 286 colorMenu->insertItem(tr( "Black on Red"));
287 colorMenu->insertItem(tr( "Red on Black")); 287 colorMenu->insertItem(tr( "Red on Black"));
288 colorMenu->insertItem(tr( "Green on Yellow")); 288 colorMenu->insertItem(tr( "Green on Yellow"));
289 colorMenu->insertItem(tr( "Blue on Magenta")); 289 colorMenu->insertItem(tr( "Blue on Magenta"));
290 colorMenu->insertItem(tr( "Magenta on Blue")); 290 colorMenu->insertItem(tr( "Magenta on Blue"));
291 colorMenu->insertItem(tr( "Cyan on White")); 291 colorMenu->insertItem(tr( "Cyan on White"));
292 colorMenu->insertItem(tr( "White on Cyan")); 292 colorMenu->insertItem(tr( "White on Cyan"));
293 colorMenu->insertItem(tr( "Blue on Black")); 293 colorMenu->insertItem(tr( "Blue on Black"));
294 colorMenu->insertItem(tr( "Amber on Black")); 294 colorMenu->insertItem(tr( "Amber on Black"));
295 colorMenu->insertItem(tr( "Custom")); 295 colorMenu->insertItem(tr( "Custom"));
296 configMenu->insertItem(tr( "Colors") ,colorMenu); 296 configMenu->insertItem(tr( "Colors") ,colorMenu);
297 297
298 connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); 298 connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) ));
299 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); 299 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) ));
300 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) )); 300 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) ));
301 connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); 301 connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int)));
302 connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); 302 connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int)));
303 menuBar->insertItem( tr("Font"), fontList ); 303 menuBar->insertItem( tr("Font"), fontList );
304 menuBar->insertItem( tr("Options"), configMenu ); 304 menuBar->insertItem( tr("Options"), configMenu );
305 305
306 QPEToolBar *toolbar = new QPEToolBar( this ); 306 QPEToolBar *toolbar = new QPEToolBar( this );
307 307
308 QAction *a; 308 QAction *a;
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;
374 se_args = _args; 374 se_args = _args;
375 375
376parseCommandLine(); 376parseCommandLine();
377 // read and apply default values /////////////////////////////////////////// 377 // read and apply default values ///////////////////////////////////////////
378 resize(321, 321); // Dummy. 378 resize(321, 321); // Dummy.
379 QSize currentSize = size(); 379 QSize currentSize = size();
380 if (currentSize != size()) 380 if (currentSize != size())
381 defaultSize = size(); 381 defaultSize = size();
382} 382}
383 383
384void Konsole::show() 384void Konsole::show()
385{ 385{
386 if ( !nsessions ) { 386 if ( !nsessions ) {
387 newSession(); 387 newSession();
388 } 388 }
389 QMainWindow::show(); 389 QMainWindow::show();
390} 390}
391 391
392void Konsole::initSession(const char*, QStrList &) 392void Konsole::initSession(const char*, QStrList &)
393{ 393{
394 QMainWindow::show(); 394 QMainWindow::show();
395} 395}
396 396
397Konsole::~Konsole() 397Konsole::~Konsole()
398{ 398{
399 while (nsessions > 0) { 399 while (nsessions > 0) {
400 doneSession(getTe()->currentSession, 0); 400 doneSession(getTe()->currentSession, 0);
401 } 401 }
402 402
403 Config cfg("Konsole"); 403 Config cfg("Konsole");
404 cfg.setGroup("Konsole"); 404 cfg.setGroup("Konsole");
405 cfg.writeEntry("FontID", cfont); 405 cfg.writeEntry("FontID", cfont);
406} 406}
407 407
408void Konsole::fontChanged(int f) 408void Konsole::fontChanged(int f)
409{ 409{
410 VTFont* font = fonts.at(f); 410 VTFont* font = fonts.at(f);
411 if (font != 0) { 411 if (font != 0) {
412 for(uint i = 0; i < fonts.count(); i++) { 412 for(uint i = 0; i < fonts.count(); i++) {
413 fontList->setItemChecked(i, (i == (uint) f) ? TRUE : FALSE); 413 fontList->setItemChecked(i, (i == (uint) f) ? TRUE : FALSE);
414 } 414 }
415 415
416 cfont = f; 416 cfont = f;
417 417
418 TEWidget* te = getTe(); 418 TEWidget* te = getTe();
419 if (te != 0) { 419 if (te != 0) {
420 te->setVTFont(font->getFont()); 420 te->setVTFont(font->getFont());
421 } 421 }
422 } 422 }
423} 423}
424 424
425 425
426void Konsole::enterCommand(int c) 426void Konsole::enterCommand(int c)
427{ 427{
428 TEWidget* te = getTe(); 428 TEWidget* te = getTe();
429 if (te != 0) { 429 if (te != 0) {
430 if(!commonCombo->editable()) { 430 if(!commonCombo->editable()) {
431 QString text = commonCombo->text(c); //commonCmds[c]; 431 QString text = commonCombo->text(c); //commonCmds[c];
432 te->emitText(text); 432 te->emitText(text);
433 } else { 433 } else {
434 changeCommand( commonCombo->text(c), c); 434 changeCommand( commonCombo->text(c), c);
435 } 435 }
436 } 436 }
437} 437}
@@ -741,204 +741,204 @@ void Konsole::colorMenuSelected(int iD)
741 741
742 for (i = 0; i < TABLE_COLORS; i++) { 742 for (i = 0; i < TABLE_COLORS; i++) {
743 if(i==0 || i == 10) { 743 if(i==0 || i == 10) {
744 m_table[i].color = foreground; 744 m_table[i].color = foreground;
745 } 745 }
746 else if(i==1 || i == 11) { 746 else if(i==1 || i == 11) {
747 m_table[i].color = background; m_table[i].transparent=0; 747 m_table[i].color = background; m_table[i].transparent=0;
748 } 748 }
749 else 749 else
750 m_table[i].color = defaultCt[i].color; 750 m_table[i].color = defaultCt[i].color;
751 } 751 }
752 } 752 }
753 lastSelectedMenu = iD; 753 lastSelectedMenu = iD;
754 te->setColorTable(m_table); 754 te->setColorTable(m_table);
755 update(); 755 update();
756 756
757} 757}
758 758
759void Konsole::configMenuSelected(int iD) 759void Konsole::configMenuSelected(int iD)
760{ 760{
761// QString temp; 761// QString temp;
762// qDebug( temp.sprintf("configmenu %d",iD)); 762// qDebug( temp.sprintf("configmenu %d",iD));
763 TEWidget* te = getTe(); 763 TEWidget* te = getTe();
764 Config cfg("Konsole"); 764 Config cfg("Konsole");
765 cfg.setGroup("Menubar"); 765 cfg.setGroup("Menubar");
766 if( iD == -4) { 766 if( iD == -4) {
767 cfg.setGroup("Tabs"); 767 cfg.setGroup("Tabs");
768 QString tmp=cfg.readEntry("Position","Bottom"); 768 QString tmp=cfg.readEntry("Position","Bottom");
769 769
770 if(tmp=="Top") { 770 if(tmp=="Top") {
771 tab->setTabPosition(QTabWidget::Bottom); 771 tab->setTabPosition(QTabWidget::Bottom);
772 configMenu->changeItem( iD,"Tabs on Top"); 772 configMenu->changeItem( iD,"Tabs on Top");
773 cfg.writeEntry("Position","Bottom"); 773 cfg.writeEntry("Position","Bottom");
774 } else { 774 } else {
775 tab->setTabPosition(QTabWidget::Top); 775 tab->setTabPosition(QTabWidget::Top);
776 configMenu->changeItem( iD,"Tabs on Bottom"); 776 configMenu->changeItem( iD,"Tabs on Bottom");
777 cfg.writeEntry("Position","Top"); 777 cfg.writeEntry("Position","Top");
778 } 778 }
779 } 779 }
780} 780}
781 781
782void Konsole::changeCommand(const QString &text, int c) 782void Konsole::changeCommand(const QString &text, int c)
783{ 783{
784 Config cfg("Konsole"); 784 Config cfg("Konsole");
785 cfg.setGroup("Commands"); 785 cfg.setGroup("Commands");
786 if(commonCmds[c] != text) { 786 if(commonCmds[c] != text) {
787 cfg.writeEntry(QString::number(c),text); 787 cfg.writeEntry(QString::number(c),text);
788 commonCombo->clearEdit(); 788 commonCombo->clearEdit();
789 commonCombo->setCurrentItem(c); 789 commonCombo->setCurrentItem(c);
790 } 790 }
791} 791}
792 792
793void Konsole::setColor() 793void Konsole::setColor()
794{ 794{
795 Config cfg("Konsole"); 795 Config cfg("Konsole");
796 cfg.setGroup("Colors"); 796 cfg.setGroup("Colors");
797 int scheme = cfg.readNumEntry("Schema",1); 797 int scheme = cfg.readNumEntry("Schema",1);
798 if(scheme != 1) colorMenuSelected( -scheme); 798 if(scheme != 1) colorMenuSelected( -scheme);
799} 799}
800 800
801void Konsole::scrollMenuSelected(int index) 801void Konsole::scrollMenuSelected(int index)
802{ 802{
803// QString temp; 803// QString temp;
804// qDebug( temp.sprintf("scrollbar menu %d",index)); 804// qDebug( temp.sprintf("scrollbar menu %d",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
825void Konsole::editCommandListMenuSelected(int iD) 825void 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'
879void Konsole::setDocument( const QString &cmd) { 879void Konsole::setDocument( const QString &cmd) {
880 newSession(); 880 newSession();
881 TEWidget* te = getTe(); 881 TEWidget* te = getTe();
882 if(cmd.find("-e", 0, TRUE) != -1) { 882 if(cmd.find("-e", 0, TRUE) != -1) {
883 QString cmd2; 883 QString cmd2;
884 cmd2=cmd.right(cmd.length()-3)+" &"; 884 cmd2=cmd.right(cmd.length()-3)+" &";
885 system(cmd2.latin1()); 885 system(cmd2.latin1());
886 if(startUp <= 1 && nsessions < 2) { 886 if(startUp <= 1 && nsessions < 2) {
887 doneSession(getTe()->currentSession, 0); 887 doneSession(getTe()->currentSession, 0);
888 exit(0); 888 exit(0);
889 } else 889 } else
890 doneSession(getTe()->currentSession, 0); 890 doneSession(getTe()->currentSession, 0);
891 } else { 891 } else {
892 if (te != 0) { 892 if (te != 0) {
893 te->emitText(cmd+"\r"); 893 te->emitText(cmd+"\r");
894 } 894 }
895 } 895 }
896 startUp++; 896 startUp++;
897} 897}
898 898
899void Konsole::parseCommandLine() { 899void Konsole::parseCommandLine() {
900 QString cmd; 900 QString cmd;
901 // newSession(); 901 // newSession();
902 for (int i=1;i< qApp->argc();i++) { 902 for (int i=1;i< qApp->argc();i++) {
903 if( QString(qApp->argv()[i]) == "-e") { 903 if( QString(qApp->argv()[i]) == "-e") {
904 i++; 904 i++;
905 for ( int j=i;j< qApp->argc();j++) { 905 for ( int j=i;j< qApp->argc();j++) {
906 cmd+=QString(qApp->argv()[j])+" "; 906 cmd+=QString(qApp->argv()[j])+" ";
907 } 907 }
908 cmd.stripWhiteSpace(); 908 cmd.stripWhiteSpace();
909 system(cmd.latin1()); 909 system(cmd.latin1());
910 exit(0);//close(); 910 exit(0);//close();
911 } // end -e switch 911 } // end -e switch
912 } 912 }
913 startUp++; 913 startUp++;
914} 914}
915 915
916void Konsole::changeForegroundColor(const QColor &color) { 916void Konsole::changeForegroundColor(const QColor &color) {
917 Config cfg("Konsole"); 917 Config cfg("Konsole");
918 cfg.setGroup("Colors"); 918 cfg.setGroup("Colors");
919 int r, g, b; 919 int r, g, b;
920 color.rgb(&r,&g,&b); 920 color.rgb(&r,&g,&b);
921 foreground.setRgb(r,g,b); 921 foreground.setRgb(r,g,b);
922// QString colors; 922// QString colors;
923// colors.sprintf("%d,%d,%d"color.red,color.green,color.blue); 923// colors.sprintf("%d,%d,%d"color.red,color.green,color.blue);
924 cfg.writeEntry("foreground",color.name()); 924 cfg.writeEntry("foreground",color.name());
925 cfg.write(); 925 cfg.write();
926 926
927qDebug("do other dialog"); 927qDebug("do other dialog");
928 ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color"); 928 ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color");
929 connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, 929 connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this,
930 SLOT(changeBackgroundColor(const QColor&))); 930 SLOT(changeBackgroundColor(const QColor&)));
931 penColorPopupMenu2->exec(); 931 penColorPopupMenu2->exec();
932 932
933} 933}
934 934
935void Konsole::changeBackgroundColor(const QColor &color) { 935void Konsole::changeBackgroundColor(const QColor &color) {
936 936
937 qDebug("Change background"); 937 qDebug("Change background");
938 Config cfg("Konsole"); 938 Config cfg("Konsole");
939 cfg.setGroup("Colors"); 939 cfg.setGroup("Colors");
940 int r, g, b; 940 int r, g, b;
941 color.rgb(&r,&g,&b); 941 color.rgb(&r,&g,&b);
942 background.setRgb(r,g,b); 942 background.setRgb(r,g,b);
943// QString colors; 943// QString colors;
944// colors.sprintf("%d,%d,%d"color.red,color.green,color.blue); 944// colors.sprintf("%d,%d,%d"color.red,color.green,color.blue);