Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_userpref/userpref_ops.c')
-rw-r--r--source/blender/editors/space_userpref/userpref_ops.c54
1 files changed, 51 insertions, 3 deletions
diff --git a/source/blender/editors/space_userpref/userpref_ops.c b/source/blender/editors/space_userpref/userpref_ops.c
index 4ba3c988c4d..f6aaf01747c 100644
--- a/source/blender/editors/space_userpref/userpref_ops.c
+++ b/source/blender/editors/space_userpref/userpref_ops.c
@@ -13,7 +13,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
* All rights reserved.
*/
@@ -21,6 +21,54 @@
* \ingroup spuserpref
*/
-
#include <string.h>
-#include <stdio.h>
+
+#include "DNA_screen_types.h"
+
+#include "BKE_context.h"
+#include "BKE_report.h"
+
+#include "RNA_types.h"
+
+#include "UI_interface.h"
+
+#include "../interface/interface_intern.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_userpref.h"
+
+/* -------------------------------------------------------------------- */
+/** \name Reset Default Theme
+ * \{ */
+
+static int reset_default_theme_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ UI_theme_init_default();
+ UI_style_init_default();
+ WM_event_add_notifier(C, NC_WINDOW, NULL);
+
+ return OPERATOR_FINISHED;
+}
+
+static void PREFERENCES_OT_reset_default_theme(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name = "Reset to Default Theme";
+ ot->idname = "PREFERENCES_OT_reset_default_theme";
+ ot->description = "Reset to the default theme colors";
+
+ /* callbacks */
+ ot->exec = reset_default_theme_exec;
+
+ /* flags */
+ ot->flag = OPTYPE_REGISTER;
+}
+
+/** \} */
+
+void ED_operatortypes_userpref(void)
+{
+ WM_operatortype_append(PREFERENCES_OT_reset_default_theme);
+}