[rkward-cvs] rkward/rkward/settings rksettingsmodulegeneral.cpp,1.2,1.3 rksettingsmodulegeneral.h,1.2,1.3

Thomas Friedrichsmeier tfry at users.sourceforge.net
Thu Oct 20 20:58:43 UTC 2005


Update of /cvsroot/rkward/rkward/rkward/settings
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16707/rkward/settings

Modified Files:
	rksettingsmodulegeneral.cpp rksettingsmodulegeneral.h 
Log Message:
Added option to bypass startup dialog

Index: rksettingsmodulegeneral.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/settings/rksettingsmodulegeneral.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rksettingsmodulegeneral.cpp	20 Oct 2005 19:45:54 -0000	1.2
--- rksettingsmodulegeneral.cpp	20 Oct 2005 20:58:41 -0000	1.3
***************
*** 25,28 ****
--- 25,29 ----
  #include <qlabel.h>
  #include <qdir.h>
+ #include <qcombobox.h>
  
  #include "../misc/getfilenamewidget.h"
***************
*** 33,36 ****
--- 34,38 ----
  QString RKSettingsModuleGeneral::files_path;
  QString RKSettingsModuleGeneral::new_files_path;
+ StartupDialog::Result RKSettingsModuleGeneral::startup_action;
  
  RKSettingsModuleGeneral::RKSettingsModuleGeneral (RKSettings *gui, QWidget *parent) : RKSettingsModule (gui, parent) {
***************
*** 41,50 ****
  	label->setAlignment (Qt::AlignAuto | Qt::AlignVCenter | Qt::ExpandTabs | Qt::WordBreak);
  	main_vbox->addWidget (label);
! 	
! 	main_vbox->addStretch ();
! 	
  	files_choser = new GetFileNameWidget (this, GetFileNameWidget::ExistingDirectory, i18n ("Directory where the logfiles should be kept (*)"), QString::null, new_files_path);
  	connect (files_choser, SIGNAL (locationChanged ()), this, SLOT (pathChanged ()));
  	main_vbox->addWidget (files_choser);
  }
  
--- 43,62 ----
  	label->setAlignment (Qt::AlignAuto | Qt::AlignVCenter | Qt::ExpandTabs | Qt::WordBreak);
  	main_vbox->addWidget (label);
! 
  	files_choser = new GetFileNameWidget (this, GetFileNameWidget::ExistingDirectory, i18n ("Directory where the logfiles should be kept (*)"), QString::null, new_files_path);
  	connect (files_choser, SIGNAL (locationChanged ()), this, SLOT (pathChanged ()));
  	main_vbox->addWidget (files_choser);
+ 
+ 	main_vbox->addWidget (new QLabel (i18n ("Startup Action (*)"), this));
+ 	startup_action_choser = new QComboBox (false, this);
+ 	startup_action_choser->insertItem (i18n ("Start with an empty workspace"), StartupDialog::EmptyWorkspace);
+ 	startup_action_choser->insertItem (i18n ("Start with an empty table"), StartupDialog::EmptyTable);
+ 	startup_action_choser->insertItem (i18n ("Ask for a file to open"), StartupDialog::ChoseFile);
+ 	startup_action_choser->insertItem (i18n ("Show selection dialog (default)"), StartupDialog::NoSavedSetting);
+ 	startup_action_choser->setCurrentItem (startup_action);
+ 	connect (startup_action_choser, SIGNAL (activated (int)), this, SLOT (boxChanged (int)));
+ 	main_vbox->addWidget (startup_action_choser);
+ 
+ 	main_vbox->addStretch ();
  }
  
***************
*** 58,61 ****
--- 70,78 ----
  }
  
+ void RKSettingsModuleGeneral::boxChanged (int) {
+ 	RK_TRACE (SETTINGS);
+ 	change ();
+ }
+ 
  QString RKSettingsModuleGeneral::caption () {
  	RK_TRACE (SETTINGS);
***************
*** 71,74 ****
--- 88,92 ----
  	RK_TRACE (SETTINGS);
  	new_files_path = files_choser->getLocation ();
+ 	startup_action = (StartupDialog::Result) startup_action_choser->currentItem ();
  }
  
***************
*** 83,86 ****
--- 101,107 ----
  	config->setGroup ("Logfiles");
  	config->writeEntry ("logfile dir", new_files_path);
+ 
+ 	config->setGroup ("General");
+ 	config->writeEntry ("startup action", (int) startup_action);
  }
  
***************
*** 90,93 ****
--- 111,117 ----
  	config->setGroup ("Logfiles");
  	files_path = new_files_path = config->readEntry ("logfile dir", QDir ().homeDirPath () + "/.rkward/");
+ 
+ 	config->setGroup ("General");
+ 	startup_action = (StartupDialog::Result) config->readNumEntry ("startup action", StartupDialog::NoSavedSetting);
  }
  

Index: rksettingsmodulegeneral.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/settings/rksettingsmodulegeneral.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rksettingsmodulegeneral.h	20 Oct 2005 19:45:54 -0000	1.2
--- rksettingsmodulegeneral.h	20 Oct 2005 20:58:41 -0000	1.3
***************
*** 22,25 ****
--- 22,26 ----
  
  class GetFileNameWidget;
+ class QComboBox;
  
  /**
***************
*** 45,52 ****
--- 46,56 ----
  	static QString &filesPath () { return files_path; };
  	static StartupDialog::Result startupAction () { return startup_action; };
+ 	static void setStartupAction (StartupDialog::Result action) { startup_action = action; };
  public slots:
  	void pathChanged ();
+ 	void boxChanged (int);
  private:
  	GetFileNameWidget *files_choser;
+ 	QComboBox *startup_action_choser;
  
  	static StartupDialog::Result startup_action;





More information about the rkward-tracker mailing list