module: settings

Support for AGUP program settings

A settings file is used to preserve certain values of the application (such as window positions and full path to the project file). The name of the settings file is given in the main window. Note, the settings file may have the suffix ”.ini” on some operating systems. Remove the settings file to clear any settings. There is also a menu item to clear this file and reset it to defaults.

This module uses QSettings (http://doc.qt.io/qt-4.8/qsettings.html).

Note

Multi-monitor support : method restoreWindowGeometry()

On multi-monitor systems such as laptops, window may be restored to offscreen position. Here is how it happens:

  • geo was saved while window was on 2nd screen while docked
  • now re-opened on laptop display and window is off-screen

For now, keep the windows on the main screen or learn how to edit the settings file.


class Assign_GUP.settings.ApplicationQSettings[source]

Bases: PyQt4.QtCore.QSettings

manage and preserve default settings for this application using QSettings

Use the .ini file format and save under user directory

getEmailKeywords()[source]

return the email substitution keywords as a dictionary

getKey(key)[source]

return the Python value (not a QVariant) of key or None if not found

Raises:TypeError – if key is None
getPrpFile()[source]
getReviewCycle()[source]
keyExists(key)[source]

does the named key exist?

resetDefaults()[source]

Reset all application settings to default values.

restoreSplitterDetails(window)[source]

put the splitter back where it was

Parameters:window (obj) – instance of QWidget
restoreWindowGeometry(window, group=None)[source]

put the window back where it was

Parameters:window (obj) – instance of QWidget
saveEmailKeywords(keyword_dict)[source]

remember the email substitution keywords

saveSplitterDetails(window)[source]

remember where the splitter was

Parameters:window (obj) – instance of QWidget
saveWindowGeometry(window, group=None)[source]

remember where the window was

Parameters:window (obj) – instance of QWidget
setKey(key, value)[source]

set the value of a configuration key, creates the key if it does not exist

Parameters:key (str) – either key or group/key

Complement: self.value(key) returns value of key

setPrpFile(prp_file)[source]
setReviewCycle(review_cycle)[source]
updateTimeStamp()[source]