Beispiel #1
0
        public Theme AddTheme(string path)
        {
            Theme theme = new Theme (path);
            mThemes.Add (theme);

            return theme;
        }
Beispiel #2
0
        public ThemeManager()
        {
            string themePath;

            mCurrentTheme = null;
            mThemes = new ArrayList ();

            try {
                LoadThemes (Defines.PERSONAL_THEME_DIR);
                LoadThemes (Defines.THEME_DIR);
            } catch (Exception) {
                /* Do nothing */
            }

            themePath = Conf.Get (Preference.THEME, Defines.DEFAULT_THEME);
            SetTheme (themePath);

            Conf.AddNotify (Conf.GetFullKey(Preference.THEME), ConfNotifyHandler);
        }
Beispiel #3
0
        // -- Private functions --
        private void LoadThemes(string path)
        {
            try {
                string[] dirs = Directory.GetDirectories (path);

            foreach (string dir in dirs) {
                try {
                    Theme theme = new Theme (dir);
                    mThemes.Add (theme);
                } catch (Exception) {
                    /* Do nothing, just continue to the next one */
                }
            }
            } catch (DirectoryNotFoundException) {
                /* This dir doesn't exist, no sweat. */
                return;
            }
        }
Beispiel #4
0
        private void SetTheme(Theme theme)
        {
            if(Conf.Get(Preference.THEME, "") != theme.Path){
                Conf.Set (Preference.THEME, theme.Path);
            }
            if (theme == mCurrentTheme) {
                return;
            }

            mCurrentTheme = theme;
            EmitThemeSelected (theme);
        }
Beispiel #5
0
 private void EmitThemeSelected(Theme theme)
 {
     if (ThemeSelected != null) {
         ThemeSelected (theme);
     }
 }