Create a GUI program that stores a user's preferences for a program. Think of the file ("preferences.txt") where the preferences are stored as a configuration file. Include a module for the data layer and another for the presentation layer. GUI with valid data Preferences Name: Joel Murach Language: English Auto Save Every X Minutes: 15 Save Cancel GUI with invalid data after clicking the Save button Preferences Name: Required. Language: English Auto Save Every X Minutes: x Must be valid integer. Save Cancel

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Help make PYTHON program to write .txt to dictionary and dictionary to .txt file. INSTRUCTIONS IN IMAGES.

Create a GUI program that stores a user's preferences for a program. Think of the file
("preferences.txt") where the preferences are stored as a configuration file. Include a module for
the data layer and another for the presentation layer.
GUI with valid data
( Preferences
Name: Joel Murach
Language: English
Auto Save Every X Minutes: 15
Save
Cancel
GUI with invalid data after clicking the Save button
O Preferences
Name:
Required.
Language: English
Auto Save Every X Minutes: x
Must be valid integer.
Save
Cancel
Transcribed Image Text:Create a GUI program that stores a user's preferences for a program. Think of the file ("preferences.txt") where the preferences are stored as a configuration file. Include a module for the data layer and another for the presentation layer. GUI with valid data ( Preferences Name: Joel Murach Language: English Auto Save Every X Minutes: 15 Save Cancel GUI with invalid data after clicking the Save button O Preferences Name: Required. Language: English Auto Save Every X Minutes: x Must be valid integer. Save Cancel
Specifications
When the program starts, it should read the preferences from a file, create a dictionary of
preferences (use name, language, and autosave as the three keys) to be sent from one
module to another, and display them in the GUI. If the program can’t find the preferences
file, it should display a blank name and standard default values, of your choosing, for
language and auto save minutes.
• If the user enters valid data and clicks the Save button, the program will write the
preferences to the "preferences.txt" file and close the GUI. The old preferences will be
replaced with the current values.
If the user enters invalid data and clicks the Save button, the program should not save the
data or elose the GUI. Instead, it should display an appropriate message to the right of the
text field if, and only if, the data is not valid. A field can have multiple reasons for being
invalid but only one message should be displayed at a time. See example above.
• For the data to be valid the following must be true:
•Values are required in the Auto Save, Name, and Language fields.
• The Name and Language field can be any non-numeric string value.
• The Auto Save field must be an integer value greater than zero.
If the user clicks the Cancel button, the program should close the GUI without saving any
changes.
Note
• To display the validation messages, add a label to the third column after each text entry
field. Then, use the same technique for setting text in this label as you do for text entry
fields, and set the text to an empty string if there's no message for the field.
• When the program starts the presentation layer module should create a root window, set
the title of the root window, create a "preferencesFrame" object by calling the class
constructor, and display the frame.
• The preferencesFrame constructor should have code to define string variables for the
three input text fields and three output error labels, get the preferences from the file, and
set the input text field variable values. It should also call an 'initComponents' method
that sets up the GUI components.
• The GUI will have four rows. The first three rows will have a label, entry field, and label.
The last row will have two buttons. The initComponents method will have code to
populate the first three rows of components and will call a makeButtons method that will
populate the two buttons. The Save button will be set to call a "save' method.
The save method will hold the business logic that checks for valid data and calls the
method that saves the preferences if the data is valid.
Transcribed Image Text:Specifications When the program starts, it should read the preferences from a file, create a dictionary of preferences (use name, language, and autosave as the three keys) to be sent from one module to another, and display them in the GUI. If the program can’t find the preferences file, it should display a blank name and standard default values, of your choosing, for language and auto save minutes. • If the user enters valid data and clicks the Save button, the program will write the preferences to the "preferences.txt" file and close the GUI. The old preferences will be replaced with the current values. If the user enters invalid data and clicks the Save button, the program should not save the data or elose the GUI. Instead, it should display an appropriate message to the right of the text field if, and only if, the data is not valid. A field can have multiple reasons for being invalid but only one message should be displayed at a time. See example above. • For the data to be valid the following must be true: •Values are required in the Auto Save, Name, and Language fields. • The Name and Language field can be any non-numeric string value. • The Auto Save field must be an integer value greater than zero. If the user clicks the Cancel button, the program should close the GUI without saving any changes. Note • To display the validation messages, add a label to the third column after each text entry field. Then, use the same technique for setting text in this label as you do for text entry fields, and set the text to an empty string if there's no message for the field. • When the program starts the presentation layer module should create a root window, set the title of the root window, create a "preferencesFrame" object by calling the class constructor, and display the frame. • The preferencesFrame constructor should have code to define string variables for the three input text fields and three output error labels, get the preferences from the file, and set the input text field variable values. It should also call an 'initComponents' method that sets up the GUI components. • The GUI will have four rows. The first three rows will have a label, entry field, and label. The last row will have two buttons. The initComponents method will have code to populate the first three rows of components and will call a makeButtons method that will populate the two buttons. The Save button will be set to call a "save' method. The save method will hold the business logic that checks for valid data and calls the method that saves the preferences if the data is valid.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 8 images

Blurred answer
Knowledge Booster
Huffman coding
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education