Added commandline option "notoolbar" which makes Konsole start without the

toolbar (original patch by Jonathan Singer <jsinger@leeta.net>)

svn path=/trunk/kdebase/konsole/; revision=69367
wilder-portage
Frerich Raabe 26 years ago
parent 4396be20a7
commit 9eef9dbfa4
  1. 14
      src/konsole.C
  2. 7
      src/main.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());
}
/* ------------------------------------------------------------------------- */

@ -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 <command>", 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)

Loading…
Cancel
Save