summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index 8885b58..8ca55fe 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -217,129 +217,129 @@ void Konsole::init(const char* _pgm, QStrList & _args)
217 setIcon( Resource::loadPixmap( "konsole" ) ); 217 setIcon( Resource::loadPixmap( "konsole" ) );
218 218
219 Config cfg("Konsole"); 219 Config cfg("Konsole");
220 cfg.setGroup("Konsole"); 220 cfg.setGroup("Konsole");
221 QString tmp; 221 QString tmp;
222 // initialize the list of allowed fonts /////////////////////////////////// 222 // initialize the list of allowed fonts ///////////////////////////////////
223 cfont = cfg.readNumEntry("FontID", 1); 223 cfont = cfg.readNumEntry("FontID", 1);
224 QFont f = QFont("Micro", 4, QFont::Normal); 224 QFont f = QFont("Micro", 4, QFont::Normal);
225 f.setFixedPitch(TRUE); 225 f.setFixedPitch(TRUE);
226 fonts.append(new VTFont(tr("Micro"), f)); 226 fonts.append(new VTFont(tr("Micro"), f));
227 227
228 f = QFont("Fixed", 7, QFont::Normal); 228 f = QFont("Fixed", 7, QFont::Normal);
229 f.setFixedPitch(TRUE); 229 f.setFixedPitch(TRUE);
230 fonts.append(new VTFont(tr("Small Fixed"), f)); 230 fonts.append(new VTFont(tr("Small Fixed"), f));
231 231
232 f = QFont("Fixed", 12, QFont::Normal); 232 f = QFont("Fixed", 12, QFont::Normal);
233 f.setFixedPitch(TRUE); 233 f.setFixedPitch(TRUE);
234 fonts.append(new VTFont(tr("Medium Fixed"), f)); 234 fonts.append(new VTFont(tr("Medium Fixed"), f));
235 235
236 // create terminal emulation framework //////////////////////////////////// 236 // create terminal emulation framework ////////////////////////////////////
237 nsessions = 0; 237 nsessions = 0;
238 238
239 tab = new EKNumTabWidget(this); 239 tab = new EKNumTabWidget(this);
240 240
241 connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*))); 241 connect(tab, SIGNAL(currentChanged(QWidget*)), this, SLOT(switchSession(QWidget*)));
242 242
243 // create terminal toolbar //////////////////////////////////////////////// 243 // create terminal toolbar ////////////////////////////////////////////////
244 setToolBarsMovable( FALSE ); 244 setToolBarsMovable( FALSE );
245 QPEToolBar *menuToolBar = new QPEToolBar( this ); 245 QPEToolBar *menuToolBar = new QPEToolBar( this );
246 menuToolBar->setHorizontalStretchable( TRUE ); 246 menuToolBar->setHorizontalStretchable( TRUE );
247 247
248 QPEMenuBar *menuBar = new QPEMenuBar( menuToolBar ); 248 QPEMenuBar *menuBar = new QPEMenuBar( menuToolBar );
249 249
250 fontList = new QPopupMenu( this ); 250 fontList = new QPopupMenu( this );
251 for(uint i = 0; i < fonts.count(); i++) { 251 for(uint i = 0; i < fonts.count(); i++) {
252 VTFont *fnt = fonts.at(i); 252 VTFont *fnt = fonts.at(i);
253 fontList->insertItem(fnt->getName(), i); 253 fontList->insertItem(fnt->getName(), i);
254 } 254 }
255 fontChanged(cfont); 255 fontChanged(cfont);
256 256
257 configMenu = new QPopupMenu( this); 257 configMenu = new QPopupMenu( this);
258 colorMenu = new QPopupMenu( this); 258 colorMenu = new QPopupMenu( this);
259 scrollMenu = new QPopupMenu( this); 259 scrollMenu = new QPopupMenu( this);
260 editCommandListMenu = new QPopupMenu( this); 260 editCommandListMenu = new QPopupMenu( this);
261 261
262 configMenu->insertItem(tr("Command List"), editCommandListMenu); 262 configMenu->insertItem(tr("Command List"), editCommandListMenu);
263 263
264 bool listHidden; 264 bool listHidden;
265 cfg.setGroup("Menubar"); 265 cfg.setGroup("Menubar");
266 if( cfg.readEntry("Hidden","FALSE") == "TRUE") { 266 if( cfg.readEntry("Hidden","FALSE") == "TRUE") {
267 editCommandListMenu->insertItem( tr( "Show command list" )); 267 editCommandListMenu->insertItem( tr( "Show command list" ));
268 listHidden=TRUE; 268 listHidden=TRUE;
269 } else { 269 } else {
270 editCommandListMenu->insertItem( tr( "Hide command list" )); 270 editCommandListMenu->insertItem( tr( "Hide command list" ));
271 listHidden=FALSE; 271 listHidden=FALSE;
272 } 272 }
273 273
274 cfg.setGroup("Tabs"); 274 cfg.setGroup("Tabs");
275 tmp=cfg.readEntry("Position","Bottom"); 275 tmp=cfg.readEntry("Position","Bottom");
276 if(tmp=="Top") { 276 if(tmp=="Top") {
277 tab->setTabPosition(QTabWidget::Top); 277 tab->setTabPosition(QTabWidget::Top);
278 configMenu->insertItem( tr( "Tabs on Bottom" ) ); 278 configMenu->insertItem( tr( "Tabs on Bottom" ) );
279 } else { 279 } else {
280 tab->setTabPosition(QTabWidget::Bottom); 280 tab->setTabPosition(QTabWidget::Bottom);
281 configMenu->insertItem("Tabs on Top"); 281 configMenu->insertItem(tr("Tabs on Top"));
282 } 282 }
283 configMenu->insertSeparator(2); 283 configMenu->insertSeparator(2);
284 284
285 colorMenu->insertItem(tr( "Green on Black")); 285 colorMenu->insertItem(tr( "Green on Black"));
286 colorMenu->insertItem(tr( "Black on White")); 286 colorMenu->insertItem(tr( "Black on White"));
287 colorMenu->insertItem(tr( "White on Black")); 287 colorMenu->insertItem(tr( "White on Black"));
288 colorMenu->insertItem(tr( "Black on Transparent")); 288 colorMenu->insertItem(tr( "Black on Transparent"));
289 colorMenu->insertItem(tr( "Black on Red")); 289 colorMenu->insertItem(tr( "Black on Red"));
290 colorMenu->insertItem(tr( "Red on Black")); 290 colorMenu->insertItem(tr( "Red on Black"));
291 colorMenu->insertItem(tr( "Green on Yellow")); 291 colorMenu->insertItem(tr( "Green on Yellow"));
292 colorMenu->insertItem(tr( "Blue on Magenta")); 292 colorMenu->insertItem(tr( "Blue on Magenta"));
293 colorMenu->insertItem(tr( "Magenta on Blue")); 293 colorMenu->insertItem(tr( "Magenta on Blue"));
294 colorMenu->insertItem(tr( "Cyan on White")); 294 colorMenu->insertItem(tr( "Cyan on White"));
295 colorMenu->insertItem(tr( "White on Cyan")); 295 colorMenu->insertItem(tr( "White on Cyan"));
296 colorMenu->insertItem(tr( "Blue on Black")); 296 colorMenu->insertItem(tr( "Blue on Black"));
297 colorMenu->insertItem(tr( "Amber on Black")); 297 colorMenu->insertItem(tr( "Amber on Black"));
298 298
299#ifdef QT_QWS_OPIE 299#ifdef QT_QWS_OPIE
300 colorMenu->insertItem(tr( "Custom")); 300 colorMenu->insertItem(tr( "Custom"));
301#endif 301#endif
302 302
303 configMenu->insertItem(tr( "Colors") ,colorMenu); 303 configMenu->insertItem(tr( "Colors") ,colorMenu);
304 304
305 connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); 305 connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) ));
306 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); 306 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) ));
307 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) )); 307 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) ));
308 connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); 308 connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int)));
309 connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); 309 connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int)));
310 menuBar->insertItem( tr("Font"), fontList ); 310 menuBar->insertItem( tr("Font"), fontList );
311 menuBar->insertItem( tr("Options"), configMenu ); 311 menuBar->insertItem( tr("Options"), configMenu );
312 312
313 QPEToolBar *toolbar = new QPEToolBar( this ); 313 QPEToolBar *toolbar = new QPEToolBar( this );
314 314
315 QAction *a; 315 QAction *a;
316 316
317 // Button Commands 317 // Button Commands
318 a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 ); 318 a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 );
319 connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar ); 319 connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar );
320 a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 ); 320 a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 );
321 connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar ); 321 connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar );
322 a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 ); 322 a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 );
323 connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar ); 323 connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar );
324 a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 ); 324 a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 );
325 connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar ); 325 connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar );
326 a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); 326 a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/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( "konsole/down" ), QString::null, 0, this, 0 ); 328 a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/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 a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); 330 a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 );
331 connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); 331 connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar );
332/* 332/*
333 a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); 333 a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 );
334 connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); 334 connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar );
335 a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); 335 a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 );
336 connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); 336 connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar );
337*/ 337*/
338 338
339 secondToolBar = new QPEToolBar( this ); 339 secondToolBar = new QPEToolBar( this );
340 secondToolBar->setHorizontalStretchable( TRUE ); 340 secondToolBar->setHorizontalStretchable( TRUE );
341 341
342 commonCombo = new QComboBox( secondToolBar ); 342 commonCombo = new QComboBox( secondToolBar );
343 commonCombo->setMaximumWidth(236); 343 commonCombo->setMaximumWidth(236);
344 344
345 editCommandListMenu->insertItem( tr( "Quick Edit" ) ); 345 editCommandListMenu->insertItem( tr( "Quick Edit" ) );
@@ -751,133 +751,133 @@ void Konsole::colorMenuSelected(int iD)
751 colorMenu->setItemChecked(-17,TRUE); 751 colorMenu->setItemChecked(-17,TRUE);
752 } 752 }
753 if(iD==-18) {// Black, Gold 753 if(iD==-18) {// Black, Gold
754 background.setRgb(0x00,0x00,0x00); 754 background.setRgb(0x00,0x00,0x00);
755 foreground.setRgb(255,215,0); 755 foreground.setRgb(255,215,0);
756 cfg.writeEntry("Schema","18"); 756 cfg.writeEntry("Schema","18");
757 colorMenu->setItemChecked(-18,TRUE); 757 colorMenu->setItemChecked(-18,TRUE);
758 } 758 }
759#ifdef QT_QWS_OPIE 759#ifdef QT_QWS_OPIE
760 if(iD==-19) { 760 if(iD==-19) {
761// Custom 761// Custom
762 qDebug("do custom"); 762 qDebug("do custom");
763 if(fromMenu) { 763 if(fromMenu) {
764 ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color"); 764 ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color");
765 connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, 765 connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this,
766 SLOT(changeForegroundColor(const QColor&))); 766 SLOT(changeForegroundColor(const QColor&)));
767 penColorPopupMenu->exec(); 767 penColorPopupMenu->exec();
768 } 768 }
769 cfg.writeEntry("Schema","19"); 769 cfg.writeEntry("Schema","19");
770 if(!fromMenu) { 770 if(!fromMenu) {
771 foreground.setNamedColor(cfg.readEntry("foreground","")); 771 foreground.setNamedColor(cfg.readEntry("foreground",""));
772 background.setNamedColor(cfg.readEntry("background","")); 772 background.setNamedColor(cfg.readEntry("background",""));
773 } 773 }
774 fromMenu=FALSE; 774 fromMenu=FALSE;
775 colorMenu->setItemChecked(-19,TRUE); 775 colorMenu->setItemChecked(-19,TRUE);
776 } 776 }
777#endif 777#endif
778 for (i = 0; i < TABLE_COLORS; i++) { 778 for (i = 0; i < TABLE_COLORS; i++) {
779 if(i==0 || i == 10) { 779 if(i==0 || i == 10) {
780 m_table[i].color = foreground; 780 m_table[i].color = foreground;
781 } 781 }
782 else if(i==1 || i == 11) { 782 else if(i==1 || i == 11) {
783 m_table[i].color = background; m_table[i].transparent=0; 783 m_table[i].color = background; m_table[i].transparent=0;
784 } 784 }
785 else 785 else
786 m_table[i].color = defaultCt[i].color; 786 m_table[i].color = defaultCt[i].color;
787 } 787 }
788 } 788 }
789 lastSelectedMenu = iD; 789 lastSelectedMenu = iD;
790 te->setColorTable(m_table); 790 te->setColorTable(m_table);
791 update(); 791 update();
792 792
793} 793}
794 794
795void Konsole::configMenuSelected(int iD) 795void Konsole::configMenuSelected(int iD)
796{ 796{
797// QString temp; 797// QString temp;
798// qDebug( temp.sprintf("configmenu %d",iD)); 798// qDebug( temp.sprintf("configmenu %d",iD));
799 TEWidget* te = getTe(); 799 TEWidget* te = getTe();
800 Config cfg("Konsole"); 800 Config cfg("Konsole");
801 cfg.setGroup("Menubar"); 801 cfg.setGroup("Menubar");
802 int i,j; 802 int i,j;
803#ifdef QT_QWS_OPIE 803#ifdef QT_QWS_OPIE
804 i=-29;j=-30; 804 i=-29;j=-30;
805#else 805#else
806 i=-28;j=-29; 806 i=-28;j=-29;
807#endif 807#endif
808 808
809 if(iD == -4) { 809 if(iD == -4) {
810 cfg.setGroup("Tabs"); 810 cfg.setGroup("Tabs");
811 QString tmp=cfg.readEntry("Position","Bottom"); 811 QString tmp=cfg.readEntry("Position","Bottom");
812 812
813 if(tmp=="Top") { 813 if(tmp=="Top") {
814 tab->setTabPosition(QTabWidget::Bottom); 814 tab->setTabPosition(QTabWidget::Bottom);
815 configMenu->changeItem( iD,"Tabs on Top"); 815 configMenu->changeItem( iD, tr("Tabs on Top"));
816 cfg.writeEntry("Position","Bottom"); 816 cfg.writeEntry("Position","Bottom");
817 } else { 817 } else {
818 tab->setTabPosition(QTabWidget::Top); 818 tab->setTabPosition(QTabWidget::Top);
819 configMenu->changeItem( iD,"Tabs on Bottom"); 819 configMenu->changeItem( iD, tr("Tabs on Bottom"));
820 cfg.writeEntry("Position","Top"); 820 cfg.writeEntry("Position","Top");
821 } 821 }
822 } 822 }
823 if(iD == i) { 823 if(iD == i) {
824 cfg.setGroup("ScrollBar"); 824 cfg.setGroup("ScrollBar");
825 bool b=cfg.readBoolEntry("HorzScroll",0); 825 bool b=cfg.readBoolEntry("HorzScroll",0);
826 b=!b; 826 b=!b;
827 cfg.writeEntry("HorzScroll", b ); 827 cfg.writeEntry("HorzScroll", b );
828 cfg.write(); 828 cfg.write();
829 doWrap(); 829 doWrap();
830 if(cfg.readNumEntry("Position",2) == 0) { 830 if(cfg.readNumEntry("Position",2) == 0) {
831 te->setScrollbarLocation(1); 831 te->setScrollbarLocation(1);
832 } else { 832 } else {
833 te->setScrollbarLocation(0); 833 te->setScrollbarLocation(0);
834 } 834 }
835 te->setScrollbarLocation( cfg.readNumEntry("Position",2)); 835 te->setScrollbarLocation( cfg.readNumEntry("Position",2));
836 } 836 }
837 if(iD == j) { 837 if(iD == j) {
838 cfg.setGroup("Menubar"); 838 cfg.setGroup("Menubar");
839 bool b=cfg.readBoolEntry("useBeep",0); 839 bool b=cfg.readBoolEntry("useBeep",0);
840 b=!b; 840 b=!b;
841 cfg.writeEntry("useBeep", b ); 841 cfg.writeEntry("useBeep", b );
842 cfg.write(); 842 cfg.write();
843 configMenu->setItemChecked(j,b); 843 configMenu->setItemChecked(j,b);
844 te->useBeep=b; 844 te->useBeep=b;
845 } 845 }
846} 846}
847 847
848void Konsole::changeCommand(const QString &text, int c) 848void Konsole::changeCommand(const QString &text, int c)
849{ 849{
850 Config cfg("Konsole"); 850 Config cfg("Konsole");
851 cfg.setGroup("Commands"); 851 cfg.setGroup("Commands");
852 if(commonCmds[c] != text) { 852 if(commonCmds[c] != text) {
853 cfg.writeEntry(QString::number(c),text); 853 cfg.writeEntry(QString::number(c),text);
854 commonCombo->clearEdit(); 854 commonCombo->clearEdit();
855 commonCombo->setCurrentItem(c); 855 commonCombo->setCurrentItem(c);
856 } 856 }
857} 857}
858 858
859void Konsole::setColor() 859void Konsole::setColor()
860{ 860{
861 Config cfg("Konsole"); 861 Config cfg("Konsole");
862 cfg.setGroup("Colors"); 862 cfg.setGroup("Colors");
863 int scheme = cfg.readNumEntry("Schema",1); 863 int scheme = cfg.readNumEntry("Schema",1);
864 if(scheme != 1) colorMenuSelected( -scheme); 864 if(scheme != 1) colorMenuSelected( -scheme);
865} 865}
866 866
867void Konsole::scrollMenuSelected(int index) 867void Konsole::scrollMenuSelected(int index)
868{ 868{
869 qDebug( "scrollbar menu %d",index); 869 qDebug( "scrollbar menu %d",index);
870 TEWidget* te = getTe(); 870 TEWidget* te = getTe();
871 Config cfg("Konsole"); 871 Config cfg("Konsole");
872 cfg.setGroup("ScrollBar"); 872 cfg.setGroup("ScrollBar");
873 int i,j,k; 873 int i,j,k;
874#ifdef QT_QWS_OPIE 874#ifdef QT_QWS_OPIE
875i=-25;j=-26;k=-27; 875i=-25;j=-26;k=-27;
876#else 876#else
877i=-24;j=-25;k=-26; 877i=-24;j=-25;k=-26;
878#endif 878#endif
879 if(index == i) { 879 if(index == i) {
880 880
881 te->setScrollbarLocation(0); 881 te->setScrollbarLocation(0);
882 cfg.writeEntry("Position",0); 882 cfg.writeEntry("Position",0);
883 } else if(index == j) { 883 } else if(index == j) {