changeset 46:127b9d99c01c

Rename uses of 'directory' to 'folder' in method names and comments.
author Jordan Miner <jminer7@gmail.com>
date Thu, 30 Jul 2009 19:20:30 -0500
parents 4eebc294a3ac
children 41b76c218851
files dynamin/gui/file_dialog.d dynamin/gui/folder_dialog.d dynamin/gui/windows_file_dialog.d dynamin/gui/windows_folder_dialog.d dynamin/gui/x_file_dialog.d dynamin/gui/x_folder_dialog.d
diffstat 6 files changed, 37 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/dynamin/gui/file_dialog.d	Thu Jul 30 18:10:49 2009 -0500
+++ b/dynamin/gui/file_dialog.d	Thu Jul 30 19:20:30 2009 -0500
@@ -53,7 +53,7 @@
 	bool _multipleSelection;
 	string _initialFileName;
 	string _text;
-	string _directory;
+	string _folder;
 	string[] _files;
 	FileDialogFilter[] _filters;
 	int _selectedFilter;
@@ -135,17 +135,17 @@
 	}
 
 	/**
-	 * Sets the directory that the FileDialog shows. If this is null,
-	 * the default directory is used when the dialog is first shown.
-	 * After the dialog has been shown, this is set to the directory
+	 * Sets the folder that the FileDialog shows. If this is null,
+	 * the default folder is used when the dialog is first shown.
+	 * After the dialog has been shown, this is set to the folder
 	 * the user was last looking at.
 	 */
-	void directory(string str) {
-		_directory = str;
+	void folder(string str) {
+		_folder = str;
 	}
-	/// TODO: Should this be selectedDirectory ?
-	string directory() {
-		return _directory;
+	/// TODO: Should this be selectedFolder ?
+	string folder() {
+		return _folder;
 	}
 
 	/**
--- a/dynamin/gui/folder_dialog.d	Thu Jul 30 18:10:49 2009 -0500
+++ b/dynamin/gui/folder_dialog.d	Thu Jul 30 19:20:30 2009 -0500
@@ -31,28 +31,28 @@
 /**
  *
  *
- * The appearance of a directory dialog with Windows Classic:
+ * The appearance of a folder dialog with Windows Classic:
  *
- * $(IMAGE ../web/example_directory_dialog.png)
+ * $(IMAGE ../web/example_folder_dialog.png)
  */
 class FolderDialog {
 private:
 	mixin FolderDialogBackend;
 	string _text;
-	string _directory;
+	string _folder;
 public:
 	/// Gets or sets the text that is displayed in the dialog's title bar.
 	string text() { return _text; }
 	/// ditto
 	void text(string str) { _text = str; }
 
-	/// Gets or sets the selected directory.
-	string directory() {
-		return _directory;
+	/// Gets or sets the selected folder.
+	string folder() {
+		return _folder;
 	}
 	/// ditto
-	void directory(string str) {
-		_directory = str;
+	void folder(string str) {
+		_folder = str;
 	}
 
 	DialogResult showDialog() {
--- a/dynamin/gui/windows_file_dialog.d	Thu Jul 30 18:10:49 2009 -0500
+++ b/dynamin/gui/windows_file_dialog.d	Thu Jul 30 19:20:30 2009 -0500
@@ -57,7 +57,7 @@
 		scope(exit) delete filesBufferW;
 		ofn.lpstrFile = filesBufferW.ptr;
 		ofn.nMaxFile = filesBufferW.length;
-		ofn.lpstrInitialDir = _directory.toWcharPtr();
+		ofn.lpstrInitialDir = _folder.toWcharPtr();
 		ofn.lpstrTitle = _text.toWcharPtr();
 		ofn.Flags = OFN_EXPLORER;
 		//if(canChooseLinks)
@@ -90,22 +90,22 @@
 		scope(exit) delete filesBuffer;
 		if(filesBuffer.contains('\0')) { // multiple files
 			auto arr = filesBuffer.split("\0");
-			_directory = arr[0];
-			// make sure directory ends with a backslash
+			_folder = arr[0];
+			// make sure folder ends with a backslash
 			// "C:\" does but "C:\Program Files" does not
-			if(!_directory.endsWith("\\"))
-				_directory ~= "\\";
+			if(!_folder.endsWith("\\"))
+				_folder ~= "\\";
 			_files = new string[arr.length-1];
 			for(int i = 1; i < arr.length; ++i) {
 				if(arr[i].contains('\\')) // a dereferenced link--absolute
 					_files[i-1] = arr[i];
 				else
-					_files[i-1] = _directory ~ arr[i];
+					_files[i-1] = _folder ~ arr[i];
 				maybeAddExt(_files[i-1]);
 			}
 		} else { //single file
 			assert(filesBuffer.contains('\\'));
-			_directory = filesBuffer[0..filesBuffer.findLast("\\")].dup;
+			_folder = filesBuffer[0..filesBuffer.findLast("\\")].dup;
 			_files = [filesBuffer.dup];
 			maybeAddExt(_files[0]);
 		}
--- a/dynamin/gui/windows_folder_dialog.d	Thu Jul 30 18:10:49 2009 -0500
+++ b/dynamin/gui/windows_folder_dialog.d	Thu Jul 30 19:20:30 2009 -0500
@@ -28,7 +28,7 @@
 public import Utf = tango.text.convert.Utf;
 
 template FolderDialogBackend() {
-	extern(Windows) static int setSelectedDirectory(HWND hwnd,
+	extern(Windows) static int setSelectedFolder(HWND hwnd,
 			UINT uMsg, LPARAM lParam, LPARAM lpData) {
 		if(uMsg == BFFM_INITIALIZED)
 			SendMessage(hwnd, BFFM_SETSELECTION, true, lpData);
@@ -41,9 +41,9 @@
 		bi.lpszTitle = "Choose a folder:";
 		bi.ulFlags |= BIF_RETURNONLYFSDIRS;
 		bi.ulFlags |= BIF_USENEWUI;
-		if(directory) {
-			bi.lpfn = &setSelectedDirectory;
-			bi.lParam = cast(LPARAM)toWcharPtr(directory);
+		if(_folder) {
+			bi.lpfn = &setSelectedFolder;
+			bi.lParam = cast(LPARAM)toWcharPtr(_folder);
 		}
 
 		ITEMIDLIST* pidl = SHBrowseForFolder(&bi);
@@ -65,7 +65,7 @@
 				}
 				break;
 			}
-		_directory = Utf.toString(dirBuffer[0..index]);
+		_folder = Utf.toString(dirBuffer[0..index]);
 		return DialogResult.OK;
 	}
 }
--- a/dynamin/gui/x_file_dialog.d	Thu Jul 30 18:10:49 2009 -0500
+++ b/dynamin/gui/x_file_dialog.d	Thu Jul 30 19:20:30 2009 -0500
@@ -61,8 +61,8 @@
 		if(fileDialogType == Open)
 			gtk_file_chooser_set_select_multiple(dialog, multipleSelection);
 		gtk_file_chooser_set_do_overwrite_confirmation(dialog, true);
-		if(_directory)
-			gtk_file_chooser_set_current_folder(dialog, toCharPtr(_directory));
+		if(_folder)
+			gtk_file_chooser_set_current_folder(dialog, toCharPtr(_folder));
 		if(_initialFileName)
 			gtk_file_chooser_set_current_name(dialog, toCharPtr(_initialFileName));
 
@@ -89,7 +89,7 @@
 			g_slist_free(list);
 
 			char* fold = gtk_file_chooser_get_current_folder(dialog);
-			_directory = fold[0..strlen(fold)].dup;
+			_folder = fold[0..strlen(fold)].dup;
 			g_free(fold);
 
 			return DialogResult.OK;
--- a/dynamin/gui/x_folder_dialog.d	Thu Jul 30 18:10:49 2009 -0500
+++ b/dynamin/gui/x_folder_dialog.d	Thu Jul 30 19:20:30 2009 -0500
@@ -36,17 +36,17 @@
 			GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
 			GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 			GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, null);
-		if(_directory)
-			gtk_file_chooser_set_current_folder(dialog, toCharPtr(_directory));
+		if(_folder)
+			gtk_file_chooser_set_current_folder(dialog, toCharPtr(_folder));
 		scope(exit) {
 			gtk_widget_destroy(dialog);
 			while(gtk_events_pending())
 				gtk_main_iteration();
 		}
 		if(gtk_dialog_run(dialog) == GTK_RESPONSE_ACCEPT) {
-			char* folder = gtk_file_chooser_get_filename(dialog);
-			_directory = folder[0..strlen(folder)].dup;
-			g_free(folder);
+			char* fold = gtk_file_chooser_get_filename(dialog);
+			_folder = fold[0..strlen(fold)].dup;
+			g_free(fold);
 			return DialogResult.OK;
 		}
 		return DialogResult.Cancel;