diff libgui/src/resource-manager.cc @ 16641:64f9a3e301d3

don't store default values in resource manager class * QTerminal.h, QTerminal.cc (QTerminal::default_colors, QTerminal::color_names): New functions. (QTerminal::notice_settings): Call default_colors. * workspace-model.h, workspace-model.cc (workspace_model::storage_class_default_colors, workspace_model::storage_class_names): New functions. * resource-manager.cc (resource_manager::storage_class_names, resource_manager::storage_class_default_colors): Get values from workspace_model. (resource_manager::terminal_color_names, resource_manager::terminal_default_colors): Get values from QTerminal.
author John W. Eaton <jwe@octave.org>
date Sun, 12 May 2013 16:17:48 -0400
parents 818eef7b2618
children cd29604214c5
line wrap: on
line diff
--- a/libgui/src/resource-manager.cc	Sun May 12 15:33:05 2013 -0400
+++ b/libgui/src/resource-manager.cc	Sun May 12 16:17:48 2013 -0400
@@ -33,11 +33,14 @@
 
 #include "error.h"
 #include "file-ops.h"
+#include "help.h"
 #include "oct-env.h"
 #include "singleton-cleanup.h"
 
 #include "defaults.h"
 
+#include "QTerminal.h"
+#include "workspace-model.h"
 #include "resource-manager.h"
 
 resource_manager *resource_manager::instance = 0;
@@ -198,41 +201,25 @@
 QStringList 
 resource_manager::storage_class_names (void)
 {
-  return QStringList () << QObject::tr ("automatic")
-                        << QObject::tr ("function")
-                        << QObject::tr ("global")
-                        << QObject::tr ("hidden")
-                        << QObject::tr ("inherited")
-                        << QObject::tr ("persistent");
+  return workspace_model::storage_class_names ();
 }
 
 QList<QColor>
 resource_manager::storage_class_default_colors (void)
 {
-  return QList<QColor> () << QColor(190,255,255)
-                          << QColor(220,255,220)
-                          << QColor(220,220,255)
-                          << QColor(255,255,190)
-                          << QColor(255,220,220)
-                          << QColor(255,190,255);
+  return workspace_model::storage_class_default_colors ();
 }
 
 QStringList 
 resource_manager::terminal_color_names (void)
 {
-  return QStringList () << QObject::tr ("foreground")
-                        << QObject::tr ("background")
-                        << QObject::tr ("selection")
-                        << QObject::tr ("cursor");
+  return QTerminal::color_names ();
 }
 
 QList<QColor>
 resource_manager::terminal_default_colors (void)
 {
-  return QList<QColor> () << QColor(0,0,0)
-                          << QColor(255,255,255)
-                          << QColor(192,192,192)
-                          << QColor(128,128,128);
+  return QTerminal::default_colors ();
 }
 
 const char*