فهرست منبع

Fix for #301; copied file chooser behavior in ExportProjectWindow from NewProjectWindow.

Christopher Reed 12 سال پیش
والد
کامیت
f95a911afc
1فایلهای تغییر یافته به همراه20 افزوده شده و 2 حذف شده
  1. 20 2
      IDE/Contents/Source/ExportProjectWindow.cpp

+ 20 - 2
IDE/Contents/Source/ExportProjectWindow.cpp

@@ -21,6 +21,9 @@
  */
  */
  
  
 #include "ExportProjectWindow.h"
 #include "ExportProjectWindow.h"
+#include "PolycodeFrame.h"
+
+extern PolycodeFrame *globalFrame;
 
 
 ExportProjectWindow::ExportProjectWindow() : UIWindow(L"Publish Project", 400, 300) {
 ExportProjectWindow::ExportProjectWindow() : UIWindow(L"Publish Project", 400, 300) {
 
 
@@ -89,8 +92,16 @@ void ExportProjectWindow::resetForm() {
 }
 }
 
 
 void ExportProjectWindow::handleEvent(Event *event) {
 void ExportProjectWindow::handleEvent(Event *event) {
-
 	if(event->getEventType() == "UIEvent") {
 	if(event->getEventType() == "UIEvent") {
+		if(event->getEventCode() == UIEvent::OK_EVENT && event->getDispatcher() == globalFrame->fileDialog) {
+			String pathName = globalFrame->fileDialog->getSelection();
+			if(pathName != "")
+				projectLocationInput->setText(pathName);
+
+		}
+		
+		if(enabled) {						
+
 		if(event->getEventCode() == UIEvent::CLICK_EVENT) {
 		if(event->getEventCode() == UIEvent::CLICK_EVENT) {
 			if(event->getDispatcher() == okButton) {
 			if(event->getDispatcher() == okButton) {
 				dispatchEvent(new UIEvent(), UIEvent::OK_EVENT);						
 				dispatchEvent(new UIEvent(), UIEvent::OK_EVENT);						
@@ -101,14 +112,21 @@ void ExportProjectWindow::handleEvent(Event *event) {
 			}			
 			}			
 			
 			
 			if(event->getDispatcher() == locationSelectButton) {
 			if(event->getDispatcher() == locationSelectButton) {
+#ifdef USE_POLYCODEUI_FILE_DIALOGS
+				std::vector<String> exts;
+				globalFrame->showFileBrowser(CoreServices::getInstance()->getCore()->getUserHomeDirectory(),  true, exts, false);
+				globalFrame->fileDialog->addEventListener(this, UIEvent::OK_EVENT);
+#else
 				String pathName = CoreServices::getInstance()->getCore()->openFolderPicker();
 				String pathName = CoreServices::getInstance()->getCore()->openFolderPicker();
 				if(pathName != "")
 				if(pathName != "")
 					projectLocationInput->setText(pathName);
 					projectLocationInput->setText(pathName);
+#endif
 			}			
 			}			
 			
 			
 		}
 		}
+		
+		}
 	}
 	}
 	
 	
-	
 	UIWindow::handleEvent(event);	
 	UIWindow::handleEvent(event);	
 }
 }