[rkward-cvs] SF.net SVN: rkward:[3442] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Feb 16 13:30:18 UTC 2011


Revision: 3442
          http://rkward.svn.sourceforge.net/rkward/?rev=3442&view=rev
Author:   tfry
Date:     2011-02-16 13:30:17 +0000 (Wed, 16 Feb 2011)

Log Message:
-----------
Tweaks to the new toolbar collections.

Modified Paths:
--------------
    trunk/rkward/rkward/rkward.cpp
    trunk/rkward/rkward/rkward.h
    trunk/rkward/rkward/rkwardui.rc

Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp	2011-02-16 12:46:14 UTC (rev 3441)
+++ trunk/rkward/rkward/rkward.cpp	2011-02-16 13:30:17 UTC (rev 3442)
@@ -136,6 +136,9 @@
 	createShellGUI (true);
 	RKXMLGUISyncer::self ()->watchXMLGUIClientUIrc (this);
 
+	proxy_import->setMenu (dynamic_cast<QMenu*>(guiFactory ()->container ("import", this)));
+	proxy_export->setMenu (dynamic_cast<QMenu*>(guiFactory ()->container ("export", this)));
+
 	RKGlobals::mtracker = new RKModificationTracker (this);
 	RKComponentMap::initialize ();
 
@@ -308,7 +311,7 @@
 void RKWardMainWindow::initActions()
 {  
 	RK_TRACE (APP);
-	KAction *action, *import_data_action = 0;
+	KAction *action;
 
 	// TODO: is there a way to insert actions between standard actions without having to give all standard actions custom ids?
 	new_data_frame = actionCollection ()->addAction ("new_data_frame", this, SLOT (slotNewDataFrame ()));
@@ -330,7 +333,7 @@
 	// TODO: find the cause and fix it! http://sourceforge.net/tracker/?func=detail&aid=2848341&group_id=50231&atid=459007
 #	warning TODO: import data dialog is disabled on windows due to bug in kdelibs
 #else
-	import_data_action = action = actionCollection ()->addAction ("import_data", this, SLOT (importData()));
+	action = actionCollection ()->addAction ("import_data", this, SLOT (importData()));
 	action->setText (i18n ("Import Data"));
 	action->setStatusTip (i18n ("Import data from a variety of file formats"));
 #endif
@@ -404,10 +407,9 @@
 	open_any_action->addSeparator ();
 	open_any_action->addAction (fileOpen);
 	open_any_action->addAction (fileOpenRecent);
-	if (import_data_action) {		// not on Windows, currently.
-		open_any_action->addSeparator ();
-		open_any_action->addAction (import_data_action);
-	}
+	open_any_action->addSeparator ();
+	proxy_import = new KAction (i18n ("Import"), this);
+	open_any_action->addAction (proxy_import);
 
 	KActionMenu* new_any_action = new KActionMenu (KIcon ("document-new"), i18n ("Create..."), this);
 	new_any_action->setDelayed (false);
@@ -415,6 +417,17 @@
 
 	new_any_action->addAction (new_data_frame);
 	new_any_action->addAction (new_command_editor);
+
+	KActionMenu* save_any_action = new KActionMenu (KIcon ("document-save"), i18n ("Save..."), this);
+	save_any_action->setDelayed (false);
+	actionCollection ()->addAction ("save_any", save_any_action);
+
+	proxy_export = new KAction (i18n ("Export"), this);
+	save_any_action->addAction (fileSaveWorkspace);
+	save_any_action->addAction (fileSaveWorkspaceAs);
+// TODO: A way to add R-script-save actions, dynamically, would be nice
+	save_any_action->addSeparator ();
+	save_any_action->addAction (proxy_export);
 }
 
 /*

Modified: trunk/rkward/rkward/rkward.h
===================================================================
--- trunk/rkward/rkward/rkward.h	2011-02-16 12:46:14 UTC (rev 3441)
+++ trunk/rkward/rkward/rkward.h	2011-02-16 13:30:17 UTC (rev 3442)
@@ -162,9 +162,6 @@
 	KAction* close_all_editors;
 	KAction* new_data_frame;
 	KAction* new_command_editor;
-	
-	KAction* editUndo;
-	KAction* editRedo;
 
 	KAction* window_close_all;
 	KAction* window_detach;
@@ -178,6 +175,8 @@
 	/** used so that if the menu is empty, there is a note in it, explaining that fact */
 	KAction* run_menu_dummy;
 
+	KAction* proxy_export, *proxy_import;
+
 	friend class RKSettingsModule;
 	friend class RKSettingsModulePlugins;
 	friend class RKSettings;

Modified: trunk/rkward/rkward/rkwardui.rc
===================================================================
--- trunk/rkward/rkward/rkwardui.rc	2011-02-16 12:46:14 UTC (rev 3441)
+++ trunk/rkward/rkward/rkwardui.rc	2011-02-16 13:30:17 UTC (rev 3442)
@@ -17,6 +17,7 @@
 			<Separator/>
 			<Merge/>
 		</Menu>
+		<Menu name="export"><text>&Export</text></Menu>
 		<Merge/>
 		<Separator/>
 		<Action name="file_quitx"/>
@@ -91,6 +92,7 @@
 <ToolBar fullWidth="true" name="mainToolBar">
 		<Action name="open_any"/>
 		<Action name="new_any"/>
+		<Action name="save_any"/>
 </ToolBar>
 <ToolBar fullWidth="true" name="mdiToolBar">
 	<DefineGroup name="pretoolbar_actions_merge" append="pretoolbar_actions_merge"/>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list