# Path: ggpo/common/settings.py
# class Settings:
#     # list of saved setting for autocomplete and avoid typos
#     IGNORED = 'ignored'
#     SELECTED_CHANNEL = 'channel'
#     AUTOLOGIN = 'autoLogin'
#     USERNAME = 'username'
#     PASSWORD = 'password'
#     SMOOTHING = 'smoothing'
#     MUTE_CHALLENGE_SOUND = 'mute'
#     NOTIFY_PLAYER_STATE_CHANGE = 'notifyPlayerStateChange'
#     SHOW_COUNTRY_FLAG_IN_CHAT = 'showCountryFlagInChat'
#     SHOW_TIMESTAMP_IN_CHAT = 'ShowTimestampInChat'
#     WINDOW_GEOMETRY = 'mainWindowGeometry'
#     WINDOW_STATE = 'mainWindowState'
#     SPLITTER_STATE = 'splitterState'
#     TABLE_HEADER_STATE = 'tableHeaderState'
#     EMOTICON_DIALOG_GEOMETRY = 'emoticonDialogGeometry'
#     SAVESTATES_DIALOG_GEOMETRY = 'savestatesDialogGeometry'
#     SAVESTATES_DIALOG_TABLE_HEADER_STATE = 'savestatesDialogTableHeaderState'
#     COLORTHEME = 'colortheme'
#     CUSTOM_THEME_FILENAME = 'customThemeFilename'
#     CUSTOM_EMOTICONS = 'customEmoticons'
#     CHAT_HISTORY_FONT = 'chatFont'
#     DEBUG_LOG = 'debuglog'
#     USER_LOG_CHAT = 'userlogchat'
#     USER_LOG_PLAYHISTORY = 'userlogplayhistory'
#     SAVE_USERNAME_PASSWORD = 'saveUsernameAndPassword'
#     GGPOFBA_LOCATION = 'ggpofbaLocation'
#     WINE_LOCATION = 'wineLocation'
#     GEOIP2DB_LOCATION = 'geoip2dbLocation'
#     CUSTOM_CHALLENGE_SOUND_LOCATION = 'customChallengeSoundLocation'
#     UNSUPPORTED_GAMESAVES_DIR = 'unsupportedGamesavesDir'
#     DISABLE_AUTO_ANNOUNCE_UNSUPPORTED = 'disableAutoAnnounceUnsupported'
#     SERVER_ADDRESS = 'serverAddress'
# 
#     _settings = QSettings(os.path.join(os.path.expanduser("~"), 'ggpo.ini'), QSettings.IniFormat)
# 
#     @staticmethod
#     def setBoolean(key, val):
#         if val:
#             val = '1'
#         else:
#             val = ''
#         Settings._settings.setValue(key, val)
# 
#     @staticmethod
#     def setPythonValue(key, val):
#         try:
#             Settings._settings.setValue(key, pickle.dumps(val))
#         except pickle.PickleError:
#             pass
# 
#     @staticmethod
#     def pythonValue(key):
#         # noinspection PyBroadException
#         try:
#             return pickle.loads(Settings._settings.value(key))
#         except:
#             return None
# 
#     @staticmethod
#     def setValue(key, val):
#         Settings._settings.setValue(key, val)
# 
#     @staticmethod
#     def value(key):
#         return Settings._settings.value(key)


import cgi
from PyQt4 import QtGui
from PyQt4.QtCore import QFile, QIODevice
from ggpo.common.settings import Settings
                   'CC99FF',
                   'ECECEC',
                   '9999FF',
                   'FFFFCC',
                   'CCFFFF',
                   'FF8080',
                   'CCCCFF']
    }

    SAFE = {
        'player': ['FF6600', 'CC99FF', '00CCFF', '00FF00',
                    '9999FF', 'FF8080', 'FF00FF', '33CCCC', '99CC00']
    }

    SELECTED = LIGHT

    @staticmethod
    def getPlayerColor(playerid):
        return '#' + ColorTheme.SELECTED['player'][playerid % ColorTheme.SELECTED['count']]

    @classmethod
    def saveDefaultStyle(cls):
        cls.originalStyle = QtGui.QApplication.style().objectName()
        cls.originalPalette = QtGui.QApplication.palette()

    @staticmethod
    def setDarkTheme(boolean):
        if boolean:
            qss = ''
            ColorTheme.SELECTED = ColorTheme.DARK

# Path: ggpo/common/settings.py
# class Settings:
#     # list of saved setting for autocomplete and avoid typos
#     IGNORED = 'ignored'
#     SELECTED_CHANNEL = 'channel'
#     AUTOLOGIN = 'autoLogin'
#     USERNAME = 'username'
#     PASSWORD = 'password'
#     SMOOTHING = 'smoothing'
#     MUTE_CHALLENGE_SOUND = 'mute'
#     NOTIFY_PLAYER_STATE_CHANGE = 'notifyPlayerStateChange'
#     SHOW_COUNTRY_FLAG_IN_CHAT = 'showCountryFlagInChat'
#     SHOW_TIMESTAMP_IN_CHAT = 'ShowTimestampInChat'
#     WINDOW_GEOMETRY = 'mainWindowGeometry'
#     WINDOW_STATE = 'mainWindowState'
#     SPLITTER_STATE = 'splitterState'
#     TABLE_HEADER_STATE = 'tableHeaderState'
#     EMOTICON_DIALOG_GEOMETRY = 'emoticonDialogGeometry'
#     SAVESTATES_DIALOG_GEOMETRY = 'savestatesDialogGeometry'
#     SAVESTATES_DIALOG_TABLE_HEADER_STATE = 'savestatesDialogTableHeaderState'
#     COLORTHEME = 'colortheme'
#     CUSTOM_THEME_FILENAME = 'customThemeFilename'
#     CUSTOM_EMOTICONS = 'customEmoticons'
#     CHAT_HISTORY_FONT = 'chatFont'
#     DEBUG_LOG = 'debuglog'
#     USER_LOG_CHAT = 'userlogchat'
#     USER_LOG_PLAYHISTORY = 'userlogplayhistory'
#     SAVE_USERNAME_PASSWORD = 'saveUsernameAndPassword'
#     GGPOFBA_LOCATION = 'ggpofbaLocation'
#     WINE_LOCATION = 'wineLocation'
#     GEOIP2DB_LOCATION = 'geoip2dbLocation'
#     CUSTOM_CHALLENGE_SOUND_LOCATION = 'customChallengeSoundLocation'
#     UNSUPPORTED_GAMESAVES_DIR = 'unsupportedGamesavesDir'
#     DISABLE_AUTO_ANNOUNCE_UNSUPPORTED = 'disableAutoAnnounceUnsupported'
#     SERVER_ADDRESS = 'serverAddress'
# 
#     _settings = QSettings(os.path.join(os.path.expanduser("~"), 'ggpo.ini'), QSettings.IniFormat)
# 
#     @staticmethod
#     def setBoolean(key, val):
#         if val:
#             val = '1'
#         else:
#             val = ''
#         Settings._settings.setValue(key, val)
# 
#     @staticmethod
#     def setPythonValue(key, val):
#         try:
#             Settings._settings.setValue(key, pickle.dumps(val))
#         except pickle.PickleError:
#             pass
# 
#     @staticmethod
#     def pythonValue(key):
#         # noinspection PyBroadException
#         try:
#             return pickle.loads(Settings._settings.value(key))
#         except:
#             return None
# 
#     @staticmethod
#     def setValue(key, val):
#         Settings._settings.setValue(key, val)
# 
#     @staticmethod
#     def value(key):
#         return Settings._settings.value(key)


# Path: ggpo/gui/colortheme.py
import cgi
from PyQt4 import QtGui
from PyQt4.QtCore import QFile, QIODevice
from ggpo.common.settings import Settings

                   'CC99FF',
                   'ECECEC',
                   '9999FF',
                   'FFFFCC',
                   'CCFFFF',
                   'FF8080',
                   'CCCCFF']
    }

    SAFE = {
        'player': ['FF6600', 'CC99FF', '00CCFF', '00FF00',
                    '9999FF', 'FF8080', 'FF00FF', '33CCCC', '99CC00']
    }

    SELECTED = LIGHT

    @staticmethod
    def getPlayerColor(playerid):
        return '#' + ColorTheme.SELECTED['player'][playerid % ColorTheme.SELECTED['count']]

    @classmethod
    def saveDefaultStyle(cls):
        cls.originalStyle = QtGui.QApplication.style().objectName()
        cls.originalPalette = QtGui.QApplication.palette()

    @staticmethod
    def setDarkTheme(boolean):
        if boolean:
            qss = ''
            ColorTheme.SELECTED = ColorTheme.DARK

            Settings.setValue(Settings.COLORTHEME, 'darkorange')