diff --git a/Aminet/MintPRINT.readme b/Aminet/MintPRINT.readme index 10a61f7..3537e6e 100644 --- a/Aminet/MintPRINT.readme +++ b/Aminet/MintPRINT.readme @@ -2,7 +2,7 @@ Short: IPP/AirPrint driver and setup tool Author: Darren Banfi (boingball) Uploader: boingball@gmail.com Type: driver/print -Version: 1.3.2 +Version: 1.3.3 Requires: 68000+; AmigaOS 2.04+; TCP/IP stack providing bsdsocket.library Architecture: m68k-amigaos >= 2.04 @@ -148,8 +148,9 @@ After rebooting: 7. Use Test Print to verify the complete printer.device -> MintPRINT -> IPP path. -The active printer configuration is Unit0. Additional configurations can -be stored in Unit1-Unit7 and copied to Unit0 when required. +The active printer configuration is kept separately in ENV:MintPRINT/Active +and ENVARC:MintPRINT/Active. Unit0 through Unit7 remain independent saved +profiles; Activate changes the live profile without overwriting any Unit. AmigaOS 2.x/3.0/3.1 notes -------------------------- @@ -224,13 +225,14 @@ cross-project collaboration: sharing compatibility findings and recent fixes, allowing MintPRINT's implementation to be compared against AmiAirPrint, and helping identify gaps in classic application and printer compatibility. -What's new in 1.3.2 +What's new in 1.3.3 ------------------- - Final driver revision 41.19. - Test Print uses the selected Unit1-Unit7 profile for that one job without - replacing the active Unit0 printer. - - Activating a saved unit accepts profiles stored in either ENV: or ENVARC:. + replacing the active printer. + - Activate now writes a separate live ENV:/ENVARC: profile, preserving + Unit0 through Unit7. - Query Printer selections for media/tray, colour, quality and scaling now save correctly, including on the AmigaOS 2.x-compatible event path. - View Spooler now shows the current RAM/T: job and retains a failed rendered diff --git a/CHANGELOG.md b/CHANGELOG.md index c8e765f..0d8bd1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,18 @@ Keep the full version-by-version history here. The front page and Aminet readme should carry only a short summary of the latest version, with a link to this page; replace that summary when preparing the next release. -[1.3.2](#132) | [1.3.1](#131) | [1.3.0](#130) | [1.2.7](#127) | [1.2.6](#126) | [1.2.5](#125) | [1.2.4](#124) | [1.2.3](#123) | [1.2.2](#122) | [1.2.1](#121) | [1.2.0](#120) | [1.1.0](#110) | [1.0.3b](#103b) | [1.0.3](#103) | [1.0.2](#102) | [1.0.0](#100) +[1.3.3](#133) | [1.3.2](#132) | [1.3.1](#131) | [1.3.0](#130) | [1.2.7](#127) | [1.2.6](#126) | [1.2.5](#125) | [1.2.4](#124) | [1.2.3](#123) | [1.2.2](#122) | [1.2.1](#121) | [1.2.0](#120) | [1.1.0](#110) | [1.0.3b](#103b) | [1.0.3](#103) | [1.0.2](#102) | [1.0.0](#100) + +## 1.3.3 + +MintPRINT 1.3.3 fixes non-destructive activation of saved printer profiles. + +- **Unit profiles are preserved.** Activate now writes a separate live + `ENV:MintPRINT/Active` and `ENVARC:MintPRINT/Active` profile, leaving + Unit0 through Unit7 untouched. +- **Active-unit state is restored at startup.** The GUI records the active + Unit separately and opens on that profile. Existing installations without + Active continue to use their legacy Unit0 configuration. ## 1.3.2 diff --git a/README.md b/README.md index a7b7070..86aa747 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,13 @@ MintPrint Settings for setup, discovery and test printing. image -## What's new in 1.3.2 +## What's new in 1.3.3 - **Final driver revision 41.19.** - **Selected-unit Test Print:** testing Unit1-Unit7 uses that profile for the - one job without replacing the active Unit0 printer. -- **Reliable unit activation:** profiles stored in either ENV: or ENVARC: can - now be activated successfully. + one job without replacing the active printer. +- **Non-destructive activation:** Activate writes a separate live profile; + Unit0-Unit7 are preserved as independent saved printer profiles. - **Query results now save correctly:** media/tray, colour, quality and scaling choices selected by **Query Printer** are synchronised with the Unit config, including on the AmigaOS 2.x-compatible event path. diff --git a/docs/MINTPRINT_CONFIG.md b/docs/MINTPRINT_CONFIG.md index ba17f96..d4aad9c 100644 --- a/docs/MINTPRINT_CONFIG.md +++ b/docs/MINTPRINT_CONFIG.md @@ -3,28 +3,28 @@ MintPRINT reads its printer endpoint at the start of every graphics print job. The live profile is: - ENV:MintPRINT/Unit0 + ENV:MintPRINT/Active If that file is absent, the driver falls back to: + ENVARC:MintPRINT/Active + +For older installations that have no separate Active profile, it then +falls back to the legacy live paths: + + ENV:MintPRINT/Unit0 ENVARC:MintPRINT/Unit0 -If neither exists, the driver defaults to an empty host and simply does +If none exists, the driver defaults to an empty host and simply does nothing (query or print) rather than falling back to any hardcoded -address - an early build defaulted to a specific test printer's address, -which meant an unconfigured Unit0 could silently send traffic to -whatever device happened to be at that address on someone else's -network. - -The driver itself has no concept of multiple units - it only ever reads -`Unit0`. MintPrint Settings' Unit dropdown (see `docs/MINTPRINT_PREFS.md`) -manages `Unit1`, `Unit2`, ... as switchable saved profiles for people with -more than one printer, and its **Activate** button is how one of those -becomes the live `Unit0` this driver reads. +address. Unit0 through Unit7 are saved printer profiles; the separate +Active file is the profile currently used by the driver. MintPrint +Settings' **Activate** button writes the selected profile to Active +without changing any Unit profile. -## Unit0 format +## Active and Unit profile format -The file is plain text (`HOST=` below is a placeholder - MintPrint +Active and Unit profile files are plain text (`HOST=` below is a placeholder - MintPrint Settings always fills in a real printer address before saving): HOST=192.168.1.100 diff --git a/docs/MINTPRINT_PREFS.md b/docs/MINTPRINT_PREFS.md index c161e3b..b0c3f47 100644 --- a/docs/MINTPRINT_PREFS.md +++ b/docs/MINTPRINT_PREFS.md @@ -6,8 +6,11 @@ MintPrint Settings (`src/MintPrintSettings.c`, formerly `IPP-Test16.c` / Startup behaviour: -- Load `ENV:MintPRINT/Unit0` first (the Unit dropdown starts on Unit0). -- Fall back to `ENVARC:MintPRINT/Unit0`. +- Load the recorded active unit, defaulting to Unit0 for older installations. +- Load that unit's saved profile from `ENV:MintPRINT/UnitN`, falling back to + `ENVARC:MintPRINT/UnitN`. +- The driver reads the separate live profile from `ENV:MintPRINT/Active`, + falling back to `ENVARC:MintPRINT/Active`, with legacy Unit0 fallback. - Saved media, colour, quality and scaling values are shown before a query. - If no saved value exists, capability controls show `Not Detected` and are ghosted until Query Printer succeeds. @@ -41,29 +44,31 @@ engine, media, cached capabilities, everything - from that unit's saved files, exactly like **File > Reload Driver Settings** does for the current one. -**Only Unit0 is what `DEVS:Printers/MintPRINT` actually reads at print -time** - the driver has no concept of "which unit" it was opened as, so -Unit1+ are switchable *saved profiles*, not simultaneously-active printers. -**Activate**, next to the Unit dropdown, is how a different printer becomes -the one that actually prints: it copies the selected unit's saved -`ENV:`/`ENVARC:` config (and cached capabilities, if any) over Unit0's, then -switches the dropdown back to Unit0 so the window reflects what is now -live. Unit0's own previous settings are overwritten by this - if they are -worth keeping, save them to an empty unit slot first. Activate on Unit0 -itself is a no-op (it is already active); on a unit with nothing saved yet -it just reports that there is nothing to copy. +The **Unit** dropdown is the saved-profile selector. Unit0 through Unit7 +remain independent profiles and are never overwritten by activation. + +MintPrint Settings keeps the currently active printer in a separate live +profile: + + ENV:MintPRINT/Active + ENVARC:MintPRINT/Active + +**Activate** writes the selected Unit's current settings to that Active +profile and records which Unit is active. It does not modify Unit0 or any +other saved Unit profile. Saving the active Unit also updates Active so the +driver stays in step. `ENGINE=jpeg`, `ENGINE=postscript`, `ENGINE=pwg-raster`, `ENGINE=urf`, and `ENGINE=pdf` are persisted by the preferences program and all five are real driver backends: -`DEVS:Printers/MintPRINT` reads Unit0's `ENGINE=` and produces a JPEG, a +`DEVS:Printers/MintPRINT` reads the Active profile's `ENGINE=` and produces a JPEG, a PostScript (`application/postscript`), PWG Raster (`image/pwg-raster`), Apple Raster (`image/urf`), or a PDF (`application/pdf`) document accordingly. See `docs/POSTSCRIPT_ENGINE.md`, `docs/PWG_RASTER.md`, and `docs/PDF_ENGINE.md` for how each encoder works and what has and hasn't been physically test-printed yet. -The driver reloads Unit0 at the start of every graphics print. Replacing the +The driver reloads the Active profile at the start of every graphics print. Replacing the printer driver binary itself still requires a reboot before testing it. ## Duplex diff --git a/docs/MintPrintSettings.guide b/docs/MintPrintSettings.guide index a45373c..5abb56f 100644 --- a/docs/MintPrintSettings.guide +++ b/docs/MintPrintSettings.guide @@ -66,7 +66,7 @@ For a brand new printer, the quickest path is: in AmigaOS Printer Preferences and save there too. 6. Click Test Print to confirm everything actually reaches paper. -Only Unit0 is what the installed driver reads when it prints - see +The installed driver reads the separate Active profile when it prints - see @{" Multiple printers (Units) " LINK "Units"} if you have more than one network printer. @@ -293,14 +293,17 @@ Picking a different Unit reloads the entire window - IP/host, path, engine, media, cached capabilities, everything - from that Unit's own saved files. -IMPORTANT: only Unit0 is what the installed MintPRINT driver actually -reads when it prints. Unit1-7 are switchable saved profiles, not -simultaneously active printers. To make a different Unit the one that -actually prints, select it and click Activate: this copies that Unit's -saved settings (and cached capabilities) over Unit0's, then switches -the dropdown back to Unit0. Activating overwrites Unit0's previous -settings, so save them to a spare empty Unit first if you want to keep -them. +The installed MintPRINT driver reads the separate live profile: + + ENV:MintPRINT/Active + ENVARC:MintPRINT/Active + +Unit0 through Unit7 are independent saved profiles. To make a different +Unit the one that actually prints, select it and click Activate: this +writes that Unit's settings to the Active profile and records it as the +active Unit. Unit0 and every other saved profile remain unchanged. Saving +the active Unit also updates the Active profile. Older installations +without Active fall back to their existing Unit0 configuration. @{" Back to Contents " LINK "Main"} @endnode diff --git a/driver/config.c b/driver/config.c index b16e16f..bd942da 100644 --- a/driver/config.c +++ b/driver/config.c @@ -1,9 +1,10 @@ /* * MintPRINT runtime configuration. * - * Live settings are read from ENV:MintPRINT/Unit0. If that file does not - * exist, ENVARC:MintPRINT/Unit0 is used. Missing or invalid values fall back - * to the known-good development defaults. + * Live settings are read from ENV:MintPRINT/Active first. If that file + * does not exist, ENVARC:MintPRINT/Active is used. Older installations that + * have no Active file fall back to ENV:/ENVARC:MintPRINT/Unit0. Missing or + * invalid values fall back to the known-good development defaults. */ #include @@ -247,20 +248,34 @@ LONG mp_config_load(struct MPConfig *cfg) if (!DOSBase) return MP_CONFIG_SOURCE_DEFAULTS; /* MintPrint Settings' regression suite writes a complete, one-job - * override here. It deliberately wins over Unit0 so the suite never - * mutates the user's saved printer profile. DriverOpen removes it - * after loading; Init may read it first when the driver is cold, so - * config.c itself must not consume/delete it. */ + * override here. It deliberately wins over the live Active profile so + * the suite never mutates any user's saved printer profile. DriverOpen + * removes it after loading; Init may read it first when the driver is + * cold, so config.c itself must not consume/delete it. */ fh = Open((CONST_STRPTR)"T:MintPRINT-testsuite.cfg", MODE_OLDFILE); if (fh) { source = MP_CONFIG_SOURCE_TEST; } else { - fh = Open((CONST_STRPTR)"ENV:MintPRINT/Unit0", MODE_OLDFILE); + /* Active is the live printer configuration. Unit0 remains a normal + * saved profile; the Unit0 paths below are the legacy fallback for + * installations created before the separate Active profile existed. */ + fh = Open((CONST_STRPTR)"ENV:MintPRINT/Active", MODE_OLDFILE); if (fh) { source = MP_CONFIG_SOURCE_ENV; } else { - fh = Open((CONST_STRPTR)"ENVARC:MintPRINT/Unit0", MODE_OLDFILE); - if (fh) source = MP_CONFIG_SOURCE_ENVARC; + fh = Open((CONST_STRPTR)"ENVARC:MintPRINT/Active", MODE_OLDFILE); + if (fh) { + source = MP_CONFIG_SOURCE_ENVARC; + } else { + fh = Open((CONST_STRPTR)"ENV:MintPRINT/Unit0", MODE_OLDFILE); + if (fh) { + source = MP_CONFIG_SOURCE_ENV; + } else { + fh = Open((CONST_STRPTR)"ENVARC:MintPRINT/Unit0", + MODE_OLDFILE); + if (fh) source = MP_CONFIG_SOURCE_ENVARC; + } + } } } diff --git a/src/MintPrintSettings.c b/src/MintPrintSettings.c index be4e9a4..331c1f9 100644 --- a/src/MintPrintSettings.c +++ b/src/MintPrintSettings.c @@ -177,15 +177,15 @@ static int mp_test_print_extra_pages_requested = 0; static BOOL mp_test_print_skip_config_save = FALSE; static BOOL mp_test_suite_capture_mode = FALSE; -/* printer.device always loads MintPRINT's live Unit0 profile. A normal Test - * Print made while another GUI profile is selected therefore needs the same - * one-job override used by the regression suite; otherwise its page says - * "Unit1" while the job is actually sent to Unit0. */ +/* printer.device always loads MintPRINT's separate live Active profile. A + * normal Test Print made while another GUI profile is selected therefore + * needs the same one-job override used by the regression suite; otherwise its + * page says "Unit1" while the job is sent to the active printer. */ #define MP_TEST_PRINT_CONFIG ((CONST_STRPTR)"T:MintPRINT-testsuite.cfg") -// Saved printer profiles: ENV:MintPRINT/Unit0 .. Unit(MAX_UNITS-1). Only -// Unit0 is what the driver actually reads at print time; the others are -// switchable GUI-side profiles (e.g. for a second/third network printer). +// Saved printer profiles: ENV:MintPRINT/Unit0 .. Unit(MAX_UNITS-1). The +// separate Active profile is what the driver reads at print time; Unit0-7 +// remain independent GUI-side profiles. #define MAX_UNITS 8 static BOOL mp_copy_file(CONST_STRPTR src, CONST_STRPTR dst); @@ -203,7 +203,7 @@ static BOOL mp_copy_file(CONST_STRPTR src, CONST_STRPTR dst); // Define the USED macro for GCC #define USED __attribute__((used)) -#define MINTPRINT_SETTINGS_VERSION "1.3.2" +#define MINTPRINT_SETTINGS_VERSION "1.3.3" #define MINTPRINT_DRIVER_DEST ((CONST_STRPTR)"DEVS:Printers/MintPRINT") /* MintPrint Settings now ships as a single drawer containing both bundled @@ -788,6 +788,7 @@ char driver_spool_buffer[MAX_ATTR_LEN] = "RAM"; * and its GAD_SPOOL_KEEP gating below. */ BOOL driver_spool_keep = FALSE; int current_unit_index = 0; +int active_unit_index = 0; char printer_make_model[128] = ""; char printer_icon_uri[256] = ""; @@ -998,6 +999,16 @@ static void unit_config_path(int idx, BOOL envarc, char *out, int out_size) { snprintf(out, out_size, "%s:MintPRINT/Unit%d", envarc ? "ENVARC" : "ENV", idx); } +static void active_config_path(BOOL envarc, char *out, int out_size) { + snprintf(out, out_size, "%s:MintPRINT/Active", + envarc ? "ENVARC" : "ENV"); +} + +static void active_unit_marker_path(BOOL envarc, char *out, int out_size) { + snprintf(out, out_size, "%s:MintPRINT/ActiveUnit", + envarc ? "ENVARC" : "ENV"); +} + static void unit_cache_path(int idx, BOOL envarc, char *out, int out_size) { snprintf(out, out_size, "%s:MintPRINT/Unit%d.cache", envarc ? "ENVARC" : "ENV", idx); } @@ -1055,6 +1066,58 @@ static BOOL unit_config_source_path(int idx, char *out, int out_size) { return FALSE; } +static void load_active_unit_index(void) { + BPTR file; + char path[64]; + char line[32]; + int idx; + + active_unit_index = 0; + active_unit_marker_path(FALSE, path, sizeof(path)); + file = Open((CONST_STRPTR)path, MODE_OLDFILE); + if (!file) { + active_unit_marker_path(TRUE, path, sizeof(path)); + file = Open((CONST_STRPTR)path, MODE_OLDFILE); + } + if (!file) return; + + if (FGets(file, line, sizeof(line))) { + idx = atoi(line); + if (idx >= 0 && idx < MAX_UNITS) + active_unit_index = idx; + } + Close(file); +} + +static BOOL write_active_unit_marker(int idx) { + BPTR file; + char path[64]; + char line[16]; + BOOL env_ok = FALSE; + BOOL envarc_ok = FALSE; + + if (idx < 0 || idx >= MAX_UNITS) return FALSE; + snprintf(line, sizeof(line), "%d\n", idx); + + active_unit_marker_path(FALSE, path, sizeof(path)); + file = Open((CONST_STRPTR)path, MODE_NEWFILE); + if (file) { + FPuts(file, line); + Close(file); + env_ok = TRUE; + } + + active_unit_marker_path(TRUE, path, sizeof(path)); + file = Open((CONST_STRPTR)path, MODE_NEWFILE); + if (file) { + FPuts(file, line); + Close(file); + envarc_ok = TRUE; + } + + return env_ok && envarc_ok; +} + /* Peeks just the MODEL= line out of a saved unit file, without disturbing * any of the live GUI/driver-config state. Used to label the Unit dropdown. */ static void peek_unit_model(int idx, char *out, int out_size) { @@ -1333,8 +1396,13 @@ static BOOL write_driver_config_file(CONST_STRPTR filename) { static BOOL save_driver_config(struct Window *win) { BOOL env_ok; BOOL envarc_ok; + BOOL active_env_ok = TRUE; + BOOL active_envarc_ok = TRUE; + BOOL active_marker_ok = TRUE; char env_path[64]; char envarc_path[64]; + char active_env_path[64]; + char active_envarc_path[64]; capture_driver_settings(win); mp_ensure_hidden_spool_dir(driver_spool_buffer); @@ -1354,6 +1422,16 @@ static BOOL save_driver_config(struct Window *win) { env_ok = write_driver_config_file((CONST_STRPTR)env_path); envarc_ok = write_driver_config_file((CONST_STRPTR)envarc_path); + /* Keep the separate live profile in step when the active unit itself is + * being edited. Unit0-Unit7 remain independent saved profiles. */ + if (env_ok && envarc_ok && current_unit_index == active_unit_index) { + active_config_path(FALSE, active_env_path, sizeof(active_env_path)); + active_config_path(TRUE, active_envarc_path, sizeof(active_envarc_path)); + active_env_ok = write_driver_config_file((CONST_STRPTR)active_env_path); + active_envarc_ok = write_driver_config_file((CONST_STRPTR)active_envarc_path); + active_marker_ok = write_active_unit_marker(current_unit_index); + } + /* * Do NOT replace the live Unit cycle gadget's GTCY_Labels here. * @@ -1370,7 +1448,8 @@ static BOOL save_driver_config(struct Window *win) { */ (void)win; - return env_ok && envarc_ok; + return env_ok && envarc_ok && active_env_ok && + active_envarc_ok && active_marker_ok; } static BOOL load_driver_config(void) { @@ -2120,7 +2199,7 @@ static BOOL mintprint_test_page(struct Window *win) { DeleteFile(MP_TEST_PRINT_CONFIG); return FALSE; } - printf("Test Print: using Unit%d for this job; Unit0 remains active\n", + printf("Test Print: using Unit%d for this job; active printer remains unchanged\n", current_unit_index); } @@ -10294,67 +10373,37 @@ void process_window_events(struct Window *win) { { custom_printf("CLEAR"); - if (current_unit_index == 0) { - custom_printf("Unit0 is already the active printer.\n"); - } else if (!unit_file_exists(current_unit_index)) { + if (!unit_file_exists(current_unit_index)) { custom_printf("Unit%d has no saved settings yet - nothing to activate.\n", current_unit_index); } else { int selected_unit = current_unit_index; - char dst_env[64], dst_envarc[64]; + char active_env[64], active_envarc[64]; BOOL ok; - unit_config_path(0, FALSE, dst_env, sizeof(dst_env)); - unit_config_path(0, TRUE, dst_envarc, sizeof(dst_envarc)); + active_config_path(FALSE, active_env, + sizeof(active_env)); + active_config_path(TRUE, active_envarc, + sizeof(active_envarc)); - /* Activate the settings currently loaded in the - * GUI directly. The previous implementation copied - * UnitN through a .new/.bak Rename() sequence; - * that is not reliable on all ENV:/ENVARC: - * handlers and hid the failing operation behind - * the generic "Could not copy" message. */ + /* Activate into the separate live profile. + * Unit0-Unit7 are never overwritten. */ capture_driver_settings(win); - current_unit_index = 0; ok = ensure_config_dir((CONST_STRPTR)"ENV:MintPRINT") && ensure_config_dir((CONST_STRPTR)"ENVARC:MintPRINT") && - write_driver_config_file((CONST_STRPTR)dst_env) && - write_driver_config_file((CONST_STRPTR)dst_envarc); - current_unit_index = selected_unit; + write_driver_config_file((CONST_STRPTR)active_env) && + write_driver_config_file((CONST_STRPTR)active_envarc); - if (ok) { - char src_cache_env[64], src_cache_envarc[64]; - char dst_cache_env[64], dst_cache_envarc[64]; - - /* Best-effort: carry the cached capabilities over too, so - * Unit0 doesn't need a fresh Query. Fine if there is none. */ - unit_cache_path(current_unit_index, FALSE, src_cache_env, sizeof(src_cache_env)); - unit_cache_path(current_unit_index, TRUE, src_cache_envarc, sizeof(src_cache_envarc)); - unit_cache_path(0, FALSE, dst_cache_env, sizeof(dst_cache_env)); - unit_cache_path(0, TRUE, dst_cache_envarc, sizeof(dst_cache_envarc)); - mp_copy_file((CONST_STRPTR)src_cache_env, (CONST_STRPTR)dst_cache_env); - mp_copy_file((CONST_STRPTR)src_cache_envarc, (CONST_STRPTR)dst_cache_envarc); - - /* Carry the processed printer artwork too. */ - { - char src_icon_env[96], src_icon_envarc[96]; - char dst_icon_env[96], dst_icon_envarc[96]; - ensure_config_dir((CONST_STRPTR)"ENV:MintPRINT/Art"); - ensure_config_dir((CONST_STRPTR)"ENVARC:MintPRINT/Art"); - unit_icon_cache_path(current_unit_index, FALSE, src_icon_env, sizeof(src_icon_env)); - unit_icon_cache_path(current_unit_index, TRUE, src_icon_envarc, sizeof(src_icon_envarc)); - unit_icon_cache_path(0, FALSE, dst_icon_env, sizeof(dst_icon_env)); - unit_icon_cache_path(0, TRUE, dst_icon_envarc, sizeof(dst_icon_envarc)); - mp_copy_file((CONST_STRPTR)src_icon_env, (CONST_STRPTR)dst_icon_env); - mp_copy_file((CONST_STRPTR)src_icon_envarc, (CONST_STRPTR)dst_icon_envarc); - } + if (ok) + ok = write_active_unit_marker(selected_unit); - custom_printf("Unit%d copied to Unit0 - it is now the active printer.\n", - current_unit_index); - current_unit_index = 0; - reload_current_unit(win); - refresh_unit_dropdown(win); + if (ok) { + active_unit_index = selected_unit; + custom_printf("Unit%d is now active; saved Unit profiles unchanged.\n", + selected_unit); } else { - custom_printf("Could not copy Unit%d to Unit0.\n", current_unit_index); + custom_printf("Could not activate Unit%d; saved Unit profiles were not changed.\n", + selected_unit); } } } @@ -10874,7 +10923,9 @@ int main(void) { g_topborder = topborder; /* Cycle label pointers already target process-lifetime static storage. * seed_saved_option_labels() populated those arrays above. */ - // Load the same Unit0 profile used by DEVS:Printers/MintPRINT. + // Load the active profile used by DEVS:Printers/MintPRINT. + load_active_unit_index(); + current_unit_index = active_unit_index; load_driver_config(); mp_build_spool_options(); seed_saved_option_labels();