@@ -3,9 +3,9 @@ package com.github.cnrture.quickprojectwizard.common
33import com.github.cnrture.quickprojectwizard.common.file.FileWriter
44import com.github.cnrture.quickprojectwizard.common.file.ImportAnalyzer
55import com.github.cnrture.quickprojectwizard.common.file.LibraryDependencyFinder
6+ import com.github.cnrture.quickprojectwizard.components.QPWMessageDialog
67import com.github.cnrture.quickprojectwizard.data.FeatureTemplate
78import com.github.cnrture.quickprojectwizard.data.ModuleTemplate
8- import com.github.cnrture.quickprojectwizard.dialog.MessageDialog
99import com.intellij.ide.BrowserUtil
1010import com.intellij.ide.starters.local.GeneratorTemplateFile
1111import com.intellij.notification.NotificationGroupManager
@@ -58,16 +58,16 @@ object Utils {
5858 file = File (projectRoot, cleanSelectedPath),
5959 featureName = featureName,
6060 packageName = packagePath.plus(" .${featureName.lowercase()} " ),
61- showErrorDialog = { MessageDialog (" Error: $it " ).show() },
61+ showErrorDialog = { QPWMessageDialog (" Error: $it " ).show() },
6262 showSuccessDialog = {
63- MessageDialog (" Success" ).show()
63+ QPWMessageDialog (" Success" ).show()
6464 val currentlySelectedFile = project.getCurrentlySelectedFile(selectedSrc)
6565 listOf (currentlySelectedFile).refreshFileSystem()
6666 },
6767 selectedTemplate = selectedTemplate
6868 )
6969 } catch (e: Exception ) {
70- MessageDialog (" Error: ${e.message} " ).show()
70+ QPWMessageDialog (" Error: ${e.message} " ).show()
7171 }
7272 }
7373
@@ -96,7 +96,7 @@ object Utils {
9696 if (settingsGradleFile != null ) {
9797 val moduleName = moduleName.trim()
9898 if (! moduleName.startsWith(" :" )) {
99- MessageDialog (" Module name must start with ':' (e.g. ':home' or ':feature:home')" ).show()
99+ QPWMessageDialog (" Module name must start with ':' (e.g. ':home' or ':feature:home')" ).show()
100100 return emptyList()
101101 }
102102
@@ -117,9 +117,9 @@ object Utils {
117117 settingsGradleFile = settingsGradleFile,
118118 modulePathAsString = moduleName,
119119 moduleType = moduleType,
120- showErrorDialog = { MessageDialog (it).show() },
120+ showErrorDialog = { QPWMessageDialog (it).show() },
121121 showSuccessDialog = {
122- MessageDialog (" Module '$moduleName ' created successfully" ).show()
122+ QPWMessageDialog (" Module '$moduleName ' created successfully" ).show()
123123
124124 val projectDir = File (project.basePath.orEmpty())
125125 VfsUtil .markDirtyAndRefresh(false , true , true , VfsUtil .findFileByIoFile(projectDir, true ))
@@ -150,11 +150,11 @@ object Utils {
150150 )
151151 return filesCreated
152152 } else {
153- MessageDialog (" Couldn't find settings.gradle(.kts) file" ).show()
153+ QPWMessageDialog (" Couldn't find settings.gradle(.kts) file" ).show()
154154 return emptyList()
155155 }
156156 } catch (e: Exception ) {
157- MessageDialog (" Error: ${e.message} " ).show()
157+ QPWMessageDialog (" Error: ${e.message} " ).show()
158158 return emptyList()
159159 }
160160 }
@@ -170,7 +170,7 @@ object Utils {
170170
171171 try {
172172 if (! sourceDir.exists() || ! sourceDir.isDirectory) {
173- MessageDialog (" Source directory does not exist or is not a directory" ).show()
173+ QPWMessageDialog (" Source directory does not exist or is not a directory" ).show()
174174 return
175175 }
176176
@@ -187,7 +187,7 @@ object Utils {
187187 }.toList()
188188
189189 if (sourceFiles.isEmpty()) {
190- MessageDialog (" No source files found to move in ${sourceDir.absolutePath} " ).show()
190+ QPWMessageDialog (" No source files found to move in ${sourceDir.absolutePath} " ).show()
191191 return
192192 }
193193
@@ -258,9 +258,9 @@ object Utils {
258258 openNewModule(project, modulePath, movedFiles)
259259 }
260260
261- MessageDialog (" Moved ${movedFiles.size} files to new module" ).show()
261+ QPWMessageDialog (" Moved ${movedFiles.size} files to new module" ).show()
262262 } catch (e: Exception ) {
263- MessageDialog (" Error moving files: ${e.message} " ).show()
263+ QPWMessageDialog (" Error moving files: ${e.message} " ).show()
264264 e.printStackTrace()
265265 }
266266 }
@@ -292,7 +292,7 @@ object Utils {
292292 val settingsFile = listOf (settingsGradleKtsPath, settingsGradlePath).firstOrNull {
293293 it.exists()
294294 } ? : run {
295- MessageDialog (" Can't find settings.gradle(.kts) file" )
295+ QPWMessageDialog (" Can't find settings.gradle(.kts) file" )
296296 return null
297297 }
298298
0 commit comments