Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

The "View Output" window's Save As dialog only saved JSON content regardless of file extension or filter selection. Users could not save the text output format.

Changes

gsc_text_window.h:

  • Add text_contents_ member and set_text_contents() to store text output separately from JSON
  • Add separate "JSON Files" and "Text Files" filters (previously only combined filter existed)
  • Save text content when .txt extension or Text filter selected
  • Fix filter comparison for GTK < 3.20 compatibility using proper conditional compilation

gsc_info_window.cpp:

  • Pass smartctl/output property to text window via set_text_contents()
  • Fix existing filter comparison for GTK < 3.20 compatibility
// Text window now receives both JSON (displayed) and text (for .txt save)
win->set_text_from_command(_("Smartctl Output"), output);  // JSON
if (auto p = drive_->get_property_repository().lookup_property("smartctl/output"); !p.empty()) {
    win->set_text_contents(p.get_value<std::string>());  // Text
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Save log as txt not working from "View Output" window</issue_title>
<issue_description> - GSmartControl version: 2.0.2

  • OS: Windows 10 / Parted Magic 2025_04_01

Save log as txt is not working from "View Output" window.

This was improved in #76 but not completely.

  1. Open "Device information"
  2. Click on "View Output"
  3. Text window opens showing JSON output
  4. Click on "SaveAs"
  5. Dialog is offering Save as type = "JSON and Text files"
  6. Here is the unexpected behaviour:
  • it is not possible to save in .txt format, since there is no multiple selection of "JSON and Text Files" / "JSON files"/ "txt files" / "All files" as in the "Save As" dialog that opens from "Device Information" windows and file is always saved in JSON format.
  • changing file extension manually to .txt still saves in JSON format.

Apart from correcting inability to save as .txt from "View Output" window, I also have two suggestions to improve this process.

  1. Have two buttons labeled "View JSON output" and "View text output", saving from each would automatically choose the right save format and file name extension and would also show correctly formatted text (either JSON or text) in the "View output" window. This would also allow correct format to be copied and pasted without having to save file.
  2. Consider adding Preferences option to choose preferred save format for all save dialogs.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 25, 2025
Copilot AI and others added 2 commits November 25, 2025 18:40
Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
Co-authored-by: ashaduri <2302268+ashaduri@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix saving log as txt from View Output window Fix View Output window Save As to support TXT format Nov 25, 2025
Copilot AI requested a review from ashaduri November 25, 2025 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Save log as txt not working from "View Output" window

2 participants