summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/konsole.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index d54fa1f..e2d4886 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -215,25 +215,26 @@ void Konsole::init(const char* _pgm, QStrList & _args)
215 215
216 QPEMenuBar *menuBar = new QPEMenuBar( menuToolBar ); 216 QPEMenuBar *menuBar = new QPEMenuBar( menuToolBar );
217 217
218 fontList = new QPopupMenu( this ); 218 fontList = new QPopupMenu( this );
219 for(uint i = 0; i < fonts.count(); i++) { 219 for(uint i = 0; i < fonts.count(); i++) {
220 VTFont *fnt = fonts.at(i); 220 VTFont *fnt = fonts.at(i);
221 fontList->insertItem(fnt->getName(), i); 221 fontList->insertItem(fnt->getName(), i);
222 } 222 }
223 fontChanged(cfont); 223 fontChanged(cfont);
224 224
225 configMenu = new QPopupMenu( this); 225 configMenu = new QPopupMenu( this);
226 colorMenu = new QPopupMenu( this); 226 colorMenu = new QPopupMenu( this);
227 227 scrollMenu = new QPopupMenu( this);
228
228 bool listHidden; 229 bool listHidden;
229 cfg.setGroup("Menubar"); 230 cfg.setGroup("Menubar");
230 if( cfg.readEntry("Hidden","FALSE") == "TRUE") { 231 if( cfg.readEntry("Hidden","FALSE") == "TRUE") {
231 configMenu->insertItem("Show command list"); 232 configMenu->insertItem("Show command list");
232 listHidden=TRUE; 233 listHidden=TRUE;
233 } else { 234 } else {
234 configMenu->insertItem("Hide command list"); 235 configMenu->insertItem("Hide command list");
235 listHidden=FALSE; 236 listHidden=FALSE;
236 } 237 }
237 238
238 cfg.setGroup("Tabs"); 239 cfg.setGroup("Tabs");
239 tmp=cfg.readEntry("Position","Bottom"); 240 tmp=cfg.readEntry("Position","Bottom");
@@ -254,24 +255,25 @@ void Konsole::init(const char* _pgm, QStrList & _args)
254 colorMenu->insertItem("Red on Black"); 255 colorMenu->insertItem("Red on Black");
255 colorMenu->insertItem("Green on Yellow"); 256 colorMenu->insertItem("Green on Yellow");
256 colorMenu->insertItem("Blue on Magenta"); 257 colorMenu->insertItem("Blue on Magenta");
257 colorMenu->insertItem("Magenta on Blue"); 258 colorMenu->insertItem("Magenta on Blue");
258 colorMenu->insertItem("Cyan on White"); 259 colorMenu->insertItem("Cyan on White");
259 colorMenu->insertItem("White on Cyan"); 260 colorMenu->insertItem("White on Cyan");
260 colorMenu->insertItem("Blue on Black"); 261 colorMenu->insertItem("Blue on Black");
261 configMenu->insertItem("Colors",colorMenu); 262 configMenu->insertItem("Colors",colorMenu);
262 263
263 connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); 264 connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) ));
264 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); 265 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) ));
265 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) )); 266 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) ));
267 connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int)));
266 268
267 menuBar->insertItem( tr("Font"), fontList ); 269 menuBar->insertItem( tr("Font"), fontList );
268 menuBar->insertItem( tr("Options"), configMenu ); 270 menuBar->insertItem( tr("Options"), configMenu );
269 271
270 QPEToolBar *toolbar = new QPEToolBar( this ); 272 QPEToolBar *toolbar = new QPEToolBar( this );
271 273
272 QAction *a; 274 QAction *a;
273 275
274 // Button Commands 276 // Button Commands
275 a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 ); 277 a = new QAction( tr("New"), Resource::loadPixmap( "konsole" ), QString::null, 0, this, 0 );
276 connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar ); 278 connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); a->addTo( toolbar );
277 a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 ); 279 a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 );
@@ -307,24 +309,29 @@ void Konsole::init(const char* _pgm, QStrList & _args)
307 cfg.setGroup("Commands"); 309 cfg.setGroup("Commands");
308 commonCombo->setInsertionPolicy(QComboBox::AtCurrent); 310 commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
309 311
310 for (int i = 0; commonCmds[i] != NULL; i++) { 312 for (int i = 0; commonCmds[i] != NULL; i++) {
311 commonCombo->insertItem( commonCmds[i], i ); 313 commonCombo->insertItem( commonCmds[i], i );
312 tmp = cfg.readEntry( QString::number(i),""); 314 tmp = cfg.readEntry( QString::number(i),"");
313 if(tmp != "") 315 if(tmp != "")
314 commonCombo->changeItem( tmp,i ); 316 commonCombo->changeItem( tmp,i );
315 } 317 }
316 318
317 connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); 319 connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) ));
318 320
321 scrollMenu->insertItem("None");
322 scrollMenu->insertItem("Left");
323 scrollMenu->insertItem("Right");
324 configMenu->insertItem("ScrollBar",scrollMenu);
325
319 // create applications ///////////////////////////////////////////////////// 326 // create applications /////////////////////////////////////////////////////
320 setCentralWidget(tab); 327 setCentralWidget(tab);
321 328
322 // load keymaps //////////////////////////////////////////////////////////// 329 // load keymaps ////////////////////////////////////////////////////////////
323 KeyTrans::loadAll(); 330 KeyTrans::loadAll();
324 for (int i = 0; i < KeyTrans::count(); i++) 331 for (int i = 0; i < KeyTrans::count(); i++)
325 { KeyTrans* s = KeyTrans::find(i); 332 { KeyTrans* s = KeyTrans::find(i);
326 assert( s ); 333 assert( s );
327 } 334 }
328 335
329 se_pgm = _pgm; 336 se_pgm = _pgm;
330 se_args = _args; 337 se_args = _args;
@@ -754,12 +761,34 @@ void Konsole::changeCommand(const QString &text, int c)
754 commonCombo->setCurrentItem(c); 761 commonCombo->setCurrentItem(c);
755 } 762 }
756} 763}
757 764
758void Konsole::setColor() 765void Konsole::setColor()
759{ 766{
760 Config cfg("Konsole"); 767 Config cfg("Konsole");
761 cfg.setGroup("Colors"); 768 cfg.setGroup("Colors");
762 int scheme = cfg.readNumEntry("Schema",1); 769 int scheme = cfg.readNumEntry("Schema",1);
763 if(scheme != 1) colorMenuSelected( -scheme); 770 if(scheme != 1) colorMenuSelected( -scheme);
764 771
765} 772}
773
774void Konsole::scrollMenuSelected(int index)
775{
776 TEWidget* te = getTe();
777Config cfg("Konsole");
778 cfg.setGroup("Scrollbar");
779 switch( index){
780 case -21:
781 te->setScrollbarLocation(0);
782 cfg.writeEntry("Position",0);
783 break;
784 case -22:
785 te->setScrollbarLocation(1);
786 cfg.writeEntry("Position",1);
787 break;
788 case -23:
789 te->setScrollbarLocation(2);
790 cfg.writeEntry("Position",2);
791 break;
792 };
793
794}