From 9eef9dbfa44d767f0c0ce7e563a5fe7e0d7c7c0f Mon Sep 17 00:00:00 2001 From: Frerich Raabe Date: Mon, 30 Oct 2000 03:03:28 +0000 Subject: [PATCH] Added commandline option "notoolbar" which makes Konsole start without the toolbar (original patch by Jonathan Singer ) svn path=/trunk/kdebase/konsole/; revision=69367 --- src/konsole.C | 14 ++++++++------ src/main.C | 7 +++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/konsole.C b/src/konsole.C index b8893997..485ff260 100644 --- a/src/konsole.C +++ b/src/konsole.C @@ -151,7 +151,7 @@ const char *fonts[] = { Konsole::Konsole(const char* name, const char* _pgm, QStrList & _args, - int histon) : KMainWindow(0, name), pgm(_pgm), args(_args) + int histon, bool toolbaron) : KMainWindow(0, name), pgm(_pgm), args(_args) { no2command.setAutoDelete(true); session_no = 0; @@ -165,6 +165,7 @@ Konsole::Konsole(const char* name, n_keytab = 0; n_render = 0; + // create terminal emulation framework //////////////////////////////////// te = new TEWidget(this); @@ -178,11 +179,10 @@ Konsole::Konsole(const char* name, setCentralWidget(te); makeMenu(); - setDockEnabled( toolBar(), QMainWindow::Left, FALSE ); setDockEnabled( toolBar(), QMainWindow::Right, FALSE ); toolBar()->setFullSize( TRUE ); - // toolBar()->setIconText( KToolBar::IconTextRight); + // toolBar()->setIconText( KToolBar::IconTextRight); // load session commands /////////////////////////////////////////////////// @@ -244,7 +244,11 @@ Konsole::Konsole(const char* name, defaultSize = size(); config->setGroup("options"); readProperties(config); + if (!toolbaron) + toolBar()->hide(); + showToolbar->setChecked(!toolBar()->isHidden()); + showMenubar->setChecked(!menuBar()->isHidden()); // activate and run first session ////////////////////////////////////////// runSession(initial); @@ -503,7 +507,7 @@ void Konsole::saveProperties(KConfig* config) config->writeEntry("keytab",n_keytab); if (args.count() > 0) config->writeEntry("konsolearguments", args); - config->writeEntry("class",name()); + config->writeEntry("class",name()); } @@ -555,8 +559,6 @@ void Konsole::readProperties(KConfig* config) else { fprintf(stderr,"session 1 not found\n"); } // oops - showToolbar->setChecked(!toolBar()->isHidden()); - showMenubar->setChecked(!menuBar()->isHidden()); } /* ------------------------------------------------------------------------- */ diff --git a/src/main.C b/src/main.C index f1f6d3f5..8c4f26d8 100644 --- a/src/main.C +++ b/src/main.C @@ -35,6 +35,7 @@ static KCmdLineOptions options[] = { "title", I18N_NOOP("Set the window title"), 0 }, { "xwin", I18N_NOOP("ignored"), 0 }, { "nohist", I18N_NOOP("Do not save lines in scroll-back buffer"), 0 }, + { "notoolbar", I18N_NOOP("Do not display toolbar"), 0 }, { "vt_sz CCxLL", I18N_NOOP("Terminal size in columns x lines"), 0 }, { "!e ", I18N_NOOP("Execute 'command' instead of shell"), 0 }, // WABA: All options after -e are treated as arguments. @@ -52,6 +53,7 @@ int main(int argc, char* argv[]) bool login_shell = false; bool welcome = true; bool histon = true; + bool toolbaron = true; const char* wname = PACKAGE; KAboutData aboutData( PACKAGE, I18N_NOOP("Konsole"), @@ -141,6 +143,7 @@ int main(int argc, char* argv[]) QCString sz = ""; sz = args->getOption("vt_sz"); histon = args->isSet("hist"); + toolbaron = args->isSet("toolbar"); wname = args->getOption("name"); login_shell = args->isSet("ls"); welcome = args->isSet("welcome"); @@ -180,11 +183,11 @@ int main(int argc, char* argv[]) sessionconfig->setGroup("options"); sessionconfig->readListEntry("konsolearguments", eargs); wname = sessionconfig->readEntry("class",wname).latin1(); - RESTORE( Konsole(wname,shell,eargs,histon) ) + RESTORE( Konsole(wname,shell,eargs,histon,toolbaron) ) } else { - Konsole* m = new Konsole(wname,shell,eargs,histon); + Konsole* m = new Konsole(wname,shell,eargs,histon,toolbaron); m->setColLin(c,l); // will use default height and width if called with (0,0) if (welcome)