File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,31 @@ def accept_settings(self):
197
197
if 0 <= selected_size_index < len (self .size_options ):
198
198
_ , new_max_src_size_mb = self .size_options [selected_size_index ]
199
199
200
+ # --- Path Creation ---
201
+ # If the path does not exist, ask the user to create it
202
+ if new_path and not os .path .isdir (new_path ):
203
+ reply = QMessageBox .question (
204
+ self ,
205
+ "Create Directory?" ,
206
+ f"The path '{ new_path } ' does not exist.\n Do you want to create it?" ,
207
+ QMessageBox .StandardButton .Yes | QMessageBox .StandardButton .No ,
208
+ QMessageBox .StandardButton .Yes
209
+ )
210
+ if reply == QMessageBox .StandardButton .Yes :
211
+ try :
212
+ os .makedirs (new_path , exist_ok = True )
213
+ logging .info (f"Created backup directory: { new_path } " )
214
+ except OSError as e :
215
+ QMessageBox .critical (
216
+ self ,
217
+ "Creation Failed" ,
218
+ f"Failed to create directory '{ new_path } '.\n \n Error: { e } "
219
+ )
220
+ return # Stop processing
221
+ else :
222
+ # User chose not to create. The validation below will fail and show a message.
223
+ pass
224
+
200
225
# --- PATH VALIDATION (Now uses ProfileCreationManager) ---
201
226
main_window = self .parent ()
202
227
# Check if main_window and its profile_creation_manager exist,
You can’t perform that action at this time.
0 commit comments