-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 16ff4df..f13d0c9 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -233,145 +233,145 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
233 | // create terminal toolbar //////////////////////////////////////////////// | 233 | // create terminal toolbar //////////////////////////////////////////////// |
234 | setToolBarsMovable( FALSE ); | 234 | setToolBarsMovable( FALSE ); |
235 | QPEToolBar *menuToolBar = new QPEToolBar( this ); | 235 | QPEToolBar *menuToolBar = new QPEToolBar( this ); |
236 | menuToolBar->setHorizontalStretchable( TRUE ); | 236 | menuToolBar->setHorizontalStretchable( TRUE ); |
237 | 237 | ||
238 | QPEMenuBar *menuBar = new QPEMenuBar( menuToolBar ); | 238 | QPEMenuBar *menuBar = new QPEMenuBar( menuToolBar ); |
239 | 239 | ||
240 | fontList = new QPopupMenu( this ); | 240 | fontList = new QPopupMenu( this ); |
241 | for(uint i = 0; i < fonts.count(); i++) { | 241 | for(uint i = 0; i < fonts.count(); i++) { |
242 | VTFont *fnt = fonts.at(i); | 242 | VTFont *fnt = fonts.at(i); |
243 | fontList->insertItem(fnt->getName(), i); | 243 | fontList->insertItem(fnt->getName(), i); |
244 | } | 244 | } |
245 | fontChanged(cfont); | 245 | fontChanged(cfont); |
246 | 246 | ||
247 | configMenu = new QPopupMenu( this); | 247 | configMenu = new QPopupMenu( this); |
248 | colorMenu = new QPopupMenu( this); | 248 | colorMenu = new QPopupMenu( this); |
249 | scrollMenu = new QPopupMenu( this); | 249 | scrollMenu = new QPopupMenu( this); |
250 | editCommandListMenu = new QPopupMenu( this); | 250 | editCommandListMenu = new QPopupMenu( this); |
251 | 251 | ||
252 | configMenu->insertItem("Command List",editCommandListMenu); | 252 | configMenu->insertItem("Command List",editCommandListMenu); |
253 | 253 | ||
254 | bool listHidden; | 254 | bool listHidden; |
255 | cfg.setGroup("Menubar"); | 255 | cfg.setGroup("Menubar"); |
256 | if( cfg.readEntry("Hidden","FALSE") == "TRUE") { | 256 | if( cfg.readEntry("Hidden","FALSE") == "TRUE") { |
257 | editCommandListMenu->insertItem("Show command list"); | 257 | editCommandListMenu->insertItem( tr( "Show command list" )); |
258 | listHidden=TRUE; | 258 | listHidden=TRUE; |
259 | } else { | 259 | } else { |
260 | editCommandListMenu->insertItem("Hide command list"); | 260 | editCommandListMenu->insertItem( tr( "Hide command list" )); |
261 | listHidden=FALSE; | 261 | listHidden=FALSE; |
262 | } | 262 | } |
263 | 263 | ||
264 | cfg.setGroup("Tabs"); | 264 | cfg.setGroup("Tabs"); |
265 | tmp=cfg.readEntry("Position","Bottom"); | 265 | tmp=cfg.readEntry("Position","Bottom"); |
266 | if(tmp=="Top") { | 266 | if(tmp=="Top") { |
267 | tab->setTabPosition(QTabWidget::Top); | 267 | tab->setTabPosition(QTabWidget::Top); |
268 | configMenu->insertItem("Tabs on Bottom"); | 268 | configMenu->insertItem( tr( "Tabs on Bottom" ) ); |
269 | } else { | 269 | } else { |
270 | tab->setTabPosition(QTabWidget::Bottom); | 270 | tab->setTabPosition(QTabWidget::Bottom); |
271 | configMenu->insertItem("Tabs on Top"); | 271 | configMenu->insertItem("Tabs on Top"); |
272 | } | 272 | } |
273 | configMenu->insertSeparator(2); | 273 | configMenu->insertSeparator(2); |
274 | 274 | ||
275 | colorMenu->insertItem("Green on Black"); | 275 | colorMenu->insertItem(tr( "Green on Black")); |
276 | colorMenu->insertItem("Black on White"); | 276 | colorMenu->insertItem(tr( "Black on White")); |
277 | colorMenu->insertItem("White on Black"); | 277 | colorMenu->insertItem(tr( "White on Black")); |
278 | colorMenu->insertItem("Black on Transparent"); | 278 | colorMenu->insertItem(tr( "Black on Transparent")); |
279 | colorMenu->insertItem("Black on Red"); | 279 | colorMenu->insertItem(tr( "Black on Red")); |
280 | colorMenu->insertItem("Red on Black"); | 280 | colorMenu->insertItem(tr( "Red on Black")); |
281 | colorMenu->insertItem("Green on Yellow"); | 281 | colorMenu->insertItem(tr( "Green on Yellow")); |
282 | colorMenu->insertItem("Blue on Magenta"); | 282 | colorMenu->insertItem(tr( "Blue on Magenta")); |
283 | colorMenu->insertItem("Magenta on Blue"); | 283 | colorMenu->insertItem(tr( "Magenta on Blue")); |
284 | colorMenu->insertItem("Cyan on White"); | 284 | colorMenu->insertItem(tr( "Cyan on White")); |
285 | colorMenu->insertItem("White on Cyan"); | 285 | colorMenu->insertItem(tr( "White on Cyan")); |
286 | colorMenu->insertItem("Blue on Black"); | 286 | colorMenu->insertItem(tr( "Blue on Black")); |
287 | colorMenu->insertItem("Amber on Black"); | 287 | colorMenu->insertItem(tr( "Amber on Black")); |
288 | configMenu->insertItem("Colors",colorMenu); | 288 | configMenu->insertItem(tr( "Colors") ,colorMenu); |
289 | 289 | ||
290 | connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); | 290 | connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); |
291 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); | 291 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); |
292 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) )); | 292 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) )); |
293 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); | 293 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); |
294 | connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); | 294 | connect(editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); |
295 | menuBar->insertItem( tr("Font"), fontList ); | 295 | menuBar->insertItem( tr("Font"), fontList ); |
296 | menuBar->insertItem( tr("Options"), configMenu ); | 296 | menuBar->insertItem( tr("Options"), configMenu ); |
297 | 297 | ||
298 | QPEToolBar *toolbar = new QPEToolBar( this ); | 298 | QPEToolBar *toolbar = new QPEToolBar( this ); |
299 | 299 | ||
300 | QAction *a; | 300 | QAction *a; |
301 | 301 | ||
302 | // Button Commands | 302 | // Button Commands |
303 | a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 ); | 303 | a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 ); |
304 | connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar ); | 304 | connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar ); |
305 | a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 ); | 305 | a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 ); |
306 | connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar ); | 306 | connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolbar ); |
307 | a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 ); | 307 | a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 ); |
308 | connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar ); | 308 | connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolbar ); |
309 | a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 ); | 309 | a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 ); |
310 | connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar ); | 310 | connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolbar ); |
311 | a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); | 311 | a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); |
312 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); | 312 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); |
313 | a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); | 313 | a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); |
314 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); | 314 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); |
315 | a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); | 315 | a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); |
316 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); | 316 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); a->addTo( toolbar ); |
317 | /* | 317 | /* |
318 | a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); | 318 | a = new QAction( tr("Up"), Resource::loadPixmap( "up" ), QString::null, 0, this, 0 ); |
319 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); | 319 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolbar ); |
320 | a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); | 320 | a = new QAction( tr("Down"), Resource::loadPixmap( "down" ), QString::null, 0, this, 0 ); |
321 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); | 321 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolbar ); |
322 | */ | 322 | */ |
323 | 323 | ||
324 | secondToolBar = new QPEToolBar( this ); | 324 | secondToolBar = new QPEToolBar( this ); |
325 | secondToolBar->setHorizontalStretchable( TRUE ); | 325 | secondToolBar->setHorizontalStretchable( TRUE ); |
326 | 326 | ||
327 | commonCombo = new QComboBox( secondToolBar ); | 327 | commonCombo = new QComboBox( secondToolBar ); |
328 | commonCombo->setMaximumWidth(236); | 328 | commonCombo->setMaximumWidth(236); |
329 | 329 | ||
330 | editCommandListMenu->insertItem( "Quick Edit"); | 330 | editCommandListMenu->insertItem( tr( "Quick Edit" ) ); |
331 | if( listHidden) { | 331 | if( listHidden) { |
332 | secondToolBar->hide(); | 332 | secondToolBar->hide(); |
333 | editCommandListMenu->setItemEnabled(-22 ,FALSE); | 333 | editCommandListMenu->setItemEnabled(-22 ,FALSE); |
334 | } | 334 | } |
335 | editCommandListMenu->insertItem( "Edit"); | 335 | editCommandListMenu->insertItem(tr( "Edit" ) ); |
336 | 336 | ||
337 | cfg.setGroup("Commands"); | 337 | cfg.setGroup("Commands"); |
338 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); | 338 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); |
339 | 339 | ||
340 | initCommandList(); | 340 | initCommandList(); |
341 | // for (int i = 0; commonCmds[i] != NULL; i++) { | 341 | // for (int i = 0; commonCmds[i] != NULL; i++) { |
342 | // commonCombo->insertItem( commonCmds[i], i ); | 342 | // commonCombo->insertItem( commonCmds[i], i ); |
343 | // tmp = cfg.readEntry( QString::number(i),""); | 343 | // tmp = cfg.readEntry( QString::number(i),""); |
344 | // if(tmp != "") | 344 | // if(tmp != "") |
345 | // commonCombo->changeItem( tmp,i ); | 345 | // commonCombo->changeItem( tmp,i ); |
346 | // } | 346 | // } |
347 | 347 | ||
348 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); | 348 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); |
349 | 349 | ||
350 | scrollMenu->insertItem("None"); | 350 | scrollMenu->insertItem(tr( "None" )); |
351 | scrollMenu->insertItem("Left"); | 351 | scrollMenu->insertItem(tr( "Left" )); |
352 | scrollMenu->insertItem("Right"); | 352 | scrollMenu->insertItem(tr( "Right" )); |
353 | configMenu->insertItem("ScrollBar",scrollMenu); | 353 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); |
354 | 354 | ||
355 | // create applications ///////////////////////////////////////////////////// | 355 | // create applications ///////////////////////////////////////////////////// |
356 | setCentralWidget(tab); | 356 | setCentralWidget(tab); |
357 | 357 | ||
358 | // load keymaps //////////////////////////////////////////////////////////// | 358 | // load keymaps //////////////////////////////////////////////////////////// |
359 | KeyTrans::loadAll(); | 359 | KeyTrans::loadAll(); |
360 | for (int i = 0; i < KeyTrans::count(); i++) | 360 | for (int i = 0; i < KeyTrans::count(); i++) |
361 | { KeyTrans* s = KeyTrans::find(i); | 361 | { KeyTrans* s = KeyTrans::find(i); |
362 | assert( s ); | 362 | assert( s ); |
363 | } | 363 | } |
364 | 364 | ||
365 | se_pgm = _pgm; | 365 | se_pgm = _pgm; |
366 | se_args = _args; | 366 | se_args = _args; |
367 | 367 | ||
368 | parseCommandLine(); | 368 | parseCommandLine(); |
369 | // read and apply default values /////////////////////////////////////////// | 369 | // read and apply default values /////////////////////////////////////////// |
370 | resize(321, 321); // Dummy. | 370 | resize(321, 321); // Dummy. |
371 | QSize currentSize = size(); | 371 | QSize currentSize = size(); |
372 | if (currentSize != size()) | 372 | if (currentSize != size()) |
373 | defaultSize = size(); | 373 | defaultSize = size(); |
374 | } | 374 | } |
375 | 375 | ||
376 | void Konsole::show() | 376 | void Konsole::show() |
377 | { | 377 | { |
@@ -781,54 +781,54 @@ void Konsole::scrollMenuSelected(int index) | |||
781 | cfg.writeEntry("Position",0); | 781 | cfg.writeEntry("Position",0); |
782 | break; | 782 | break; |
783 | case -25: | 783 | case -25: |
784 | te->setScrollbarLocation(1); | 784 | te->setScrollbarLocation(1); |
785 | cfg.writeEntry("Position",1); | 785 | cfg.writeEntry("Position",1); |
786 | break; | 786 | break; |
787 | case -26: | 787 | case -26: |
788 | te->setScrollbarLocation(2); | 788 | te->setScrollbarLocation(2); |
789 | cfg.writeEntry("Position",2); | 789 | cfg.writeEntry("Position",2); |
790 | break; | 790 | break; |
791 | }; | 791 | }; |
792 | 792 | ||
793 | } | 793 | } |
794 | 794 | ||
795 | void Konsole::editCommandListMenuSelected(int iD) | 795 | void Konsole::editCommandListMenuSelected(int iD) |
796 | { | 796 | { |
797 | // QString temp; | 797 | // QString temp; |
798 | // qDebug( temp.sprintf("edit command list %d",iD)); | 798 | // qDebug( temp.sprintf("edit command list %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 | if( iD == -3) { | 802 | if( iD == -3) { |
803 | if(!secondToolBar->isHidden()) { | 803 | if(!secondToolBar->isHidden()) { |
804 | secondToolBar->hide(); | 804 | secondToolBar->hide(); |
805 | configMenu->changeItem( iD,"Show Command List"); | 805 | configMenu->changeItem( iD,tr( "Show Command List" )); |
806 | cfg.writeEntry("Hidden","TRUE"); | 806 | cfg.writeEntry("Hidden","TRUE"); |
807 | configMenu->setItemEnabled(-22 ,FALSE); | 807 | configMenu->setItemEnabled(-22 ,FALSE); |
808 | } else { | 808 | } else { |
809 | secondToolBar->show(); | 809 | secondToolBar->show(); |
810 | configMenu->changeItem( iD,"Hide Command List"); | 810 | configMenu->changeItem( iD,tr( "Hide Command List" )); |
811 | cfg.writeEntry("Hidden","FALSE"); | 811 | cfg.writeEntry("Hidden","FALSE"); |
812 | configMenu->setItemEnabled(-22 ,TRUE); | 812 | configMenu->setItemEnabled(-22 ,TRUE); |
813 | 813 | ||
814 | if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { | 814 | if(cfg.readEntry("EditEnabled","FALSE")=="TRUE") { |
815 | configMenu->setItemChecked(-22,TRUE); | 815 | configMenu->setItemChecked(-22,TRUE); |
816 | commonCombo->setEditable( TRUE ); | 816 | commonCombo->setEditable( TRUE ); |
817 | } else { | 817 | } else { |
818 | configMenu->setItemChecked(-22,FALSE); | 818 | configMenu->setItemChecked(-22,FALSE); |
819 | commonCombo->setEditable( FALSE ); | 819 | commonCombo->setEditable( FALSE ); |
820 | } | 820 | } |
821 | } | 821 | } |
822 | } | 822 | } |
823 | if( iD == -22) { | 823 | if( iD == -22) { |
824 | cfg.setGroup("Commands"); | 824 | cfg.setGroup("Commands"); |
825 | // qDebug("enableCommandEdit"); | 825 | // qDebug("enableCommandEdit"); |
826 | if( !configMenu->isItemChecked(iD) ) { | 826 | if( !configMenu->isItemChecked(iD) ) { |
827 | commonCombo->setEditable( TRUE ); | 827 | commonCombo->setEditable( TRUE ); |
828 | configMenu->setItemChecked(iD,TRUE); | 828 | configMenu->setItemChecked(iD,TRUE); |
829 | commonCombo->setCurrentItem(0); | 829 | commonCombo->setCurrentItem(0); |
830 | cfg.writeEntry("EditEnabled","TRUE"); | 830 | cfg.writeEntry("EditEnabled","TRUE"); |
831 | } else { | 831 | } else { |
832 | commonCombo->setEditable( FALSE ); | 832 | commonCombo->setEditable( FALSE ); |
833 | configMenu->setItemChecked(iD,FALSE); | 833 | configMenu->setItemChecked(iD,FALSE); |
834 | cfg.writeEntry("EditEnabled","FALSE"); | 834 | cfg.writeEntry("EditEnabled","FALSE"); |