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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Nov 8 13:04:41 UTC 2011


Revision: 4023
          http://rkward.svn.sourceforge.net/rkward/?rev=4023&view=rev
Author:   tfry
Date:     2011-11-08 13:04:40 +0000 (Tue, 08 Nov 2011)
Log Message:
-----------
Use consistent workspace filename filter for load / save

Modified Paths:
--------------
    trunk/rkward/rkward/agents/rksaveagent.cpp
    trunk/rkward/rkward/rkward.cpp
    trunk/rkward/rkward/settings/rksettingsmodulegeneral.h

Modified: trunk/rkward/rkward/agents/rksaveagent.cpp
===================================================================
--- trunk/rkward/rkward/agents/rksaveagent.cpp	2011-11-08 12:46:55 UTC (rev 4022)
+++ trunk/rkward/rkward/agents/rksaveagent.cpp	2011-11-08 13:04:40 UTC (rev 4023)
@@ -26,6 +26,7 @@
 #include "../core/robjectlist.h"
 #include "../rkglobals.h"
 #include "../rkward.h"
+#include "../settings/rksettingsmodulegeneral.h"
 #include "../windows/rkworkplace.h"
 
 #include "../debug.h"
@@ -58,7 +59,7 @@
 
 bool RKSaveAgent::askURL () {
 	RK_TRACE (APP);
-	save_url = KFileDialog::getSaveFileName (save_url, "*.RData *.rdata *.rda|R Data Files (*.RData *.rdata *.rda)\n*|All Files (*)");
+	save_url = KFileDialog::getSaveFileName (save_url, i18n ("%1|R Workspace Files (%1)\n*|All files", RKSettingsModuleGeneral::workspaceFilenameFilter ()));
 	if (save_url.isEmpty ()) {
 		if (when_done != DoNothing) {
 			if (KMessageBox::warningYesNo (0, i18n ("No filename given. Your data was NOT saved. Do you still want to proceed?")) != KMessageBox::Yes) when_done = DoNothing;

Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp	2011-11-08 12:46:55 UTC (rev 4022)
+++ trunk/rkward/rkward/rkward.cpp	2011-11-08 13:04:40 UTC (rev 4023)
@@ -705,9 +705,9 @@
 #ifdef Q_WS_WIN
 	// getOpenUrl(KUrl("kfiledialog:///<rfiles>"), ...) causes a hang on windows (KDElibs 4.2.3).
 #	warning Track this bug down and/or report it
-		lurl = KFileDialog::getOpenUrl (KUrl (), i18n("*.RData *.RDA|R Workspace Files (*.RData *.RDA)\n*|All files"), this, i18n("Select workspace to open..."));
+		lurl = KFileDialog::getOpenUrl (KUrl (), i18n("%1|R Workspace Files (%1)\n*|All files", RKSettingsModuleGeneral::workspaceFilenameFilter ()), this, i18n("Select workspace to open..."));
 #else
-		lurl = KFileDialog::getOpenUrl (KUrl ("kfiledialog:///<rfiles>"), i18n("*.RData *.RDA|R Workspace Files (*.RData *.RDA)\n*|All files"), this, i18n("Select workspace to open..."));
+		lurl = KFileDialog::getOpenUrl (KUrl ("kfiledialog:///<rfiles>"), i18n("%1|R Workspace Files (%1)\n*|All files", RKSettingsModuleGeneral::workspaceFilenameFilter ()), this, i18n("Select workspace to open..."));
 #endif
 	}
 	if (!lurl.isEmpty ()) {

Modified: trunk/rkward/rkward/settings/rksettingsmodulegeneral.h
===================================================================
--- trunk/rkward/rkward/settings/rksettingsmodulegeneral.h	2011-11-08 12:46:55 UTC (rev 4022)
+++ trunk/rkward/rkward/settings/rksettingsmodulegeneral.h	2011-11-08 13:04:40 UTC (rev 4023)
@@ -69,6 +69,7 @@
 	static bool cdToWorkspaceOnLoad () { return cd_to_workspace_dir_on_load; };
 	static unsigned long warnLargeObjectThreshold () { return warn_size_object_edit; };
 	static RKMDIFocusPolicy mdiFocusPolicy () { return mdi_focus_policy; }
+	static QString workspaceFilenameFilter () { return ("*.RData *.RDA"); };
 
 	enum RKWardConfigVersion {
 		RKWardConfig_Pre0_5_7,

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