Bug 130610 - KCron doesn't remember toolbar settings (Icon Size, Text Position)
Summary: KCron doesn't remember toolbar settings (Icon Size, Text Position)
Status: RESOLVED FIXED
Alias: None
Product: kcron
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR minor (vote)
Target Milestone: ---
Assignee: Gary Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-11 12:26 UTC by Stefan Borggraefe
Modified: 2007-05-04 00:04 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Borggraefe 2006-07-11 12:26:20 UTC
Version:            (using KDE KDE 3.5.3)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Steps to reproduce:
1. Start KCron
2. Right Click on the Toolbar and change the Icon Size and Text Position
3. Quit KCron
4. Start KCron again

Result:
The Toolbar settings just made aren't remembered.
Comment 1 Aaron J. Seigo 2007-05-04 00:04:51 UTC
SVN commit 660835 by aseigo:

fix loading of toolbars by ... getting rid of lots of code and using
kde's facilities directly.

original patch by dave selby; thanks, dave =)

CCMAIL:dave6502@googlemail.com
BUG:130610


 M  +1 -80     ktapp.cpp  
 M  +0 -10     ktapp.h  


--- trunk/KDE/kdeadmin/kcron/ktapp.cpp #660834:660835
@@ -52,7 +52,7 @@
   // Initialize document.
   cthost = new CTHost(crontab);
 
-  createGUI();
+  setupGUI(QSize(600, 320));
 
   // Initialize view.
   view = new KTView(this);
@@ -155,19 +155,7 @@
 
   QAction *runAct = actionCollection()->addAction( "edit_run" );
   runAct->setText( i18n("&Run Now") );
-
   connect(runAct, SIGNAL(triggered(bool)), SLOT(slotEditRunNow()));
-
-  //Settings menu
-  KToggleAction* showToolbarAct = actionCollection()->add<KToggleAction>( "show_toolbar" );
-  showToolbarAct->setText( i18n("Show &Toolbar") );
-  connect(showToolbarAct, SIGNAL(triggered(bool)), SLOT(slotViewToolBar()));
-  showToolbarAct->setCheckedState(KGuiItem(i18n("Show &Toolbar")));
-
-  KToggleAction* showStatusbarAct = actionCollection()->add<KToggleAction>( "show_statusbar" );
-  showStatusbarAct->setText( i18n("Show &Statusbar") );
-  connect(showStatusbarAct, SIGNAL(triggered(bool)), SLOT(slotViewStatusBar()));
-  showStatusbarAct->setCheckedState(KGuiItem(i18n("Show &Statusbar")));
 }
 
 void KTApp::initStatusBar()
@@ -179,10 +167,6 @@
 void KTApp::saveOptions()
 {
   KConfigGroup group(config, "General Options");
-  group.writeEntry(QString("Geometry"), size());
-  group.writeEntry(QString("Show Toolbar"), toolBar()->isVisible());
-  group.writeEntry(QString("Show Statusbar"), statusBar()->isVisible());
-  group.writeEntry(QString("ToolBarArea"),  (int)toolBarArea(toolBar()));
   group.writeEntry(QString("Path to crontab"), crontab);
 }
 
@@ -191,44 +175,6 @@
 {
   KConfigGroup group(config, "General Options");
 
-  // bar status settings
-  bool bViewToolbar = group.readEntry(QString("Show Toolbar"), true);
-  actionCollection()->action("show_toolbar")->setChecked(bViewToolbar);
-  if (!bViewToolbar)
-    toolBar()->hide();
-
-  bool bViewStatusbar = group.readEntry(QString("Show Statusbar"), true);
-  actionCollection()->action("show_statusbar")->setChecked(bViewStatusbar);
-  if (!bViewStatusbar)
-    statusBar()->hide();
-
-  // bar position settings
-  Qt::ToolBarArea tool_bar_area;
-  tool_bar_area = (Qt::ToolBarArea)group.readEntry(QString("ToolBarArea"),
-						     (int)Qt::TopToolBarArea);
-  addToolBar(tool_bar_area, toolBar());
-
-  QSize size=group.readEntry(QString("Geometry"),QSize());
-
-  // Minimum size is 350 by 250
-
-  if (size.isEmpty())
-  {
-    size.setWidth(350);
-    size.setHeight(250);
-  }
-
-  if (size.width() < 350)
-  {
-    size.setWidth(350);
-  }
-  if (size.height() < 250)
-  {
-    size.setHeight(250);
-  }
-
-  resize(size);
-
   // get the path to the crontab binary
   crontab = group.readEntry(QString("Path to crontab"), QString("crontab"));
 }
@@ -377,30 +323,6 @@
   slotStatusMsg(i18n("Ready."));
 }
 
-void KTApp::slotViewToolBar()
-{
-  if(toolBar()->isVisible())
-    toolBar()->hide();
-  else
-    toolBar()->show();
-
-  actionCollection()->action("show_toolbar")->setChecked(toolBar()->isVisible());
-
-  slotStatusMsg(i18n("Ready."));
-}
-
-void KTApp::slotViewStatusBar()
-{
-  if (statusBar()->isVisible())
-    statusBar()->hide();
-  else
-    statusBar()->show();
-
-  actionCollection()->action("show_toolbar")->setChecked(statusBar()->isVisible());
-
-  slotStatusMsg(i18n("Ready."));
-}
-
 void KTApp::slotStatusMsg(const QString & text)
 {
   statusBar()->clearMessage();
@@ -470,4 +392,3 @@
 }
 
 #include "ktapp.moc"
-
--- trunk/KDE/kdeadmin/kcron/ktapp.h #660834:660835
@@ -155,16 +155,6 @@
   void slotEditRunNow();
 
 /**
-  * Toggle the toolbar being visible.
-  */
-  void slotViewToolBar();
-
-/**
-  * Toggles the status bar being visible.
-  */
-  void slotViewStatusBar();
-
-/**
   * Changes the status bar contents for the standard label permanently;
   * used to indicate current actions.
   */