changeset 26309:b26b31781b30 stable

separate include file for main window gui preferences * gui-preferences.h: move constant definitions related to main window preferences from here ... * gui_preferences_mw.h: to here * main-window.cc: include gui-preferences-mw.h * module.mk: add new include file * settings-dialog.cc: do not include gui-preferences.h since it is already included in settings-dialog.h
author Torsten <mttl@mailbox.org>
date Fri, 28 Dec 2018 08:37:35 +0100
parents 046b2088843e
children 44670b45ff3b
files libgui/src/gui-preferences-mw.h libgui/src/gui-preferences.h libgui/src/main-window.cc libgui/src/module.mk libgui/src/settings-dialog.cc
diffstat 5 files changed, 88 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libgui/src/gui-preferences-mw.h	Fri Dec 28 08:37:35 2018 +0100
@@ -0,0 +1,84 @@
+/*
+
+Copyright (C) 2018 Torsten <mttl@mailbox.de>
+
+This file is part of Octave.
+
+Octave is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Octave is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<https://www.gnu.org/licenses/>.
+
+*/
+
+#if ! defined (gui_preference_mw_h)
+#define gui_preference_mw_h 1
+
+
+// Main window preferences
+
+const unsigned char ba_geometry_data[] = {
+  0x01,0xd9,0xd0,0xcb,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+  0x00,0x1b,0x00,0x00,0x03,0xaf,0x00,0x00,0x02,0xb8,0x00,0x00,0x00,0x00,
+  0x00,0x00,0x00,0x39,0x00,0x00,0x03,0xaf,0x00,0x00,0x02,0xb8,0x00,0x00,
+  0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00
+};
+
+const gui_pref mw_geometry ("MainWindow/geometry",
+  QVariant (QByteArray (reinterpret_cast<const char*> (ba_geometry_data), sizeof (ba_geometry_data))));
+  // FIXME: usew the following version when Qt4 support is dropped
+  // QVariant (QByteArrayLiteral ("\x1\xd9\xd0\xcb\0\x2\0\0\0\0\0\0\0\0\0\x1b\0\0\x3\xaf\0\0\x2\xb8\0\0\0\0\0\0\0\x39\0\0\x3\xaf\0\0\x2\xb8\0\0\0\0\0\0\0\0\x5\0")));
+
+const unsigned char ba_state_data[] = {
+  '\0','\0','\0',0xff,'\0','\0','\0','\0',0xfd,'\0','\0','\0',0x2,'\0','\0',
+  '\0','\0','\0','\0',0x1,'&','\0','\0',0x2,'+',0xfc,0x2,'\0','\0','\0',0x3,
+  0xfb,'\0','\0','\0',0x1e,'\0','F','\0','i','\0','l','\0','e','\0','s','\0',
+  'D','\0','o','\0','c','\0','k','\0','W','\0','i','\0','d','\0','g','\0','e',
+  '\0','t',0x1,'\0','\0','\0','?','\0','\0','\0',0xac,'\0','\0','\0',0x88,
+  '\0',0xff,0xff,0xff,0xfb,'\0','\0','\0',0x1a,'\0','W','\0','o','\0','r',
+  '\0','k','\0','s','\0','p','\0','a','\0','c','\0','e','\0','V','\0','i',
+  '\0','e','\0','w',0x1,'\0','\0','\0',0xf1,'\0','\0','\0',0xca,'\0','\0',
+  '\0',0x82,'\0',0xff,0xff,0xff,0xfb,'\0','\0','\0','\"','\0','H','\0','i',
+  '\0','s','\0','t','\0','o','\0','r','\0','y','\0','D','\0','o','\0','c',
+  '\0','k','\0','W','\0','i','\0','d','\0','g','\0','e','\0','t',0x1,'\0',
+  '\0',0x1,0xc1,'\0','\0','\0',0xa9,'\0','\0','\0',0x82,'\0',0xff,0xff,0xff,
+  '\0','\0','\0',0x1,'\0','\0',0x2,0x84,'\0','\0',0x2,'+',0xfc,0x2,'\0','\0',
+  '\0',0x1,0xfc,'\0','\0','\0','?','\0','\0',0x2,'+','\0','\0','\0',0xeb,0x1,
+  '\0','\0',0x1b,0xfa,'\0','\0','\0','\0',0x2,'\0','\0','\0',0x4,0xfb,'\0',
+  '\0','\0','$','\0','T','\0','e','\0','r','\0','m','\0','i','\0','n','\0',
+  'a','\0','l','\0','D','\0','o','\0','c','\0','k','\0','W','\0','i','\0',
+  'd','\0','g','\0','e','\0','t',0x1,'\0','\0','\0','\0',0xff,0xff,0xff,0xff,
+  '\0','\0','\0',0x46,'\0',0xff,0xff,0xff,0xfb,'\0','\0','\0','.','\0','D','\0',
+  'o','\0','c','\0','u','\0','m','\0','e','\0','n','\0','t','\0','a','\0','t',
+  '\0','i','\0','o','\0','n','\0','D','\0','o','\0','c','\0','k','\0','W',
+  '\0','i','\0','d','\0','g','\0','e','\0','t',0x1,'\0','\0','\0','\0',0xff,
+  0xff,0xff,0xff,'\0','\0','\0',0xcf,'\0',0xff,0xff,0xff,0xfb,'\0','\0','\0',
+  0x14,'\0','F','\0','i','\0','l','\0','e','\0','E','\0','d','\0','i','\0',
+  't','\0','o','\0','r',0x1,'\0','\0','\0','\0',0xff,0xff,0xff,0xff,'\0',
+  '\0','\0',0x62,'\0',0xff,0xff,0xff,0xfb,'\0','\0','\0',0x1c,'\0','V','\0',
+  'a','\0','r','\0','i','\0','a','\0','b','\0','l','\0','e','\0','E','\0',
+  'D','\0','i','\0','t','\0','o','\0','r',0x1,'\0','\0','\0','\0',0xff,0xff,
+  0xff,0xff,'\0','\0','\0',';','\0',0xff,0xff,0xff,'\0','\0','\0','\0','\0',
+  '\0',0x2,'+','\0','\0','\0',0x4,'\0','\0','\0',0x4,'\0','\0','\0','\b',
+  '\0','\0','\0','\b',0xfc,'\0','\0','\0',0x1,'\0','\0','\0',0x2,'\0','\0',
+  '\0',0x1,'\0','\0','\0',0x16,'\0','M','\0','a','\0','i','\0','n','\0','T',
+  '\0','o','\0','o','\0','l','\0','b','\0','a','\0','r',0x1,'\0','\0','\0',
+  '\0',0xff,0xff,0xff,0xff,'\0','\0','\0','\0','\0','\0','\0','\0'
+};
+
+const gui_pref mw_state ("MainWindow/windowState",
+  QVariant (QByteArray (reinterpret_cast<const char*> (ba_state_data), sizeof (ba_state_data))));
+  // FIXME: usew the following version when Qt4 support is dropped
+  // QVariant (QByteArrayLiteral ("\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\0\0\0\x1&\0\0\x2+\xfc\x2\0\0\0\x3\xfb\0\0\0\x1e\0\x46\0i\0l\0\x65\0s\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\0?\0\0\0\xac\0\0\0\x88\0\xff\xff\xff\xfb\0\0\0\x1a\0W\0o\0r\0k\0s\0p\0\x61\0\x63\0\x65\0V\0i\0\x65\0w\x1\0\0\0\xf1\0\0\0\xca\0\0\0\x82\0\xff\xff\xff\xfb\0\0\0\"\0H\0i\0s\0t\0o\0r\0y\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\x1\xc1\0\0\0\xa9\0\0\0\x82\0\xff\xff\xff\0\0\0\x1\0\0\x2\x84\0\0\x2+\xfc\x2\0\0\0\x1\xfc\0\0\0?\0\0\x2+\0\0\0\xeb\x1\0\0\x1b\xfa\0\0\0\0\x2\0\0\0\x4\xfb\0\0\0$\0T\0\x65\0r\0m\0i\0n\0\x61\0l\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\x46\0\xff\xff\xff\xfb\0\0\0.\0\x44\0o\0\x63\0u\0m\0\x65\0n\0t\0\x61\0t\0i\0o\0n\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\xcf\0\xff\xff\xff\xfb\0\0\0\x14\0\x46\0i\0l\0\x65\0\x45\0\x64\0i\0t\0o\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\x62\0\xff\xff\xff\xfb\0\0\0\x1c\0V\0\x61\0r\0i\0\x61\0\x62\0l\0\x65\0\x45\0\x64\0i\0t\0o\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0;\0\xff\xff\xff\0\0\0\0\0\0\x2+\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x16\0M\0\x61\0i\0n\0T\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0")));
+
+
+#endif
\ No newline at end of file
--- a/libgui/src/gui-preferences.h	Thu Dec 27 22:57:40 2018 +0100
+++ b/libgui/src/gui-preferences.h	Fri Dec 28 08:37:35 2018 +0100
@@ -20,8 +20,8 @@
 
 */
 
-#if ! defined (octave_editor_settings_h)
-#define octave_editor_settings_h 1
+#if ! defined (gui_preference_h)
+#define gui_preference_h 1
 
 //#if defined (HAVE_CONFIG_H)
 //#  include "config.h"
@@ -66,60 +66,6 @@
 // Style
 const gui_pref global_style ("style", QVariant ("default"));
 
-// Main window preferences
-
-const unsigned char ba_geometry_data[] = {
-  0x01,0xd9,0xd0,0xcb,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-  0x00,0x1b,0x00,0x00,0x03,0xaf,0x00,0x00,0x02,0xb8,0x00,0x00,0x00,0x00,
-  0x00,0x00,0x00,0x39,0x00,0x00,0x03,0xaf,0x00,0x00,0x02,0xb8,0x00,0x00,
-  0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00
-};
-const gui_pref mw_geometry ("MainWindow/geometry",
-  QVariant (QByteArray (reinterpret_cast<const char*> (ba_geometry_data), sizeof (ba_geometry_data))));
-  // FIXME: usew the following version when Qt4 support is dropped
-  // QVariant (QByteArrayLiteral ("\x1\xd9\xd0\xcb\0\x2\0\0\0\0\0\0\0\0\0\x1b\0\0\x3\xaf\0\0\x2\xb8\0\0\0\0\0\0\0\x39\0\0\x3\xaf\0\0\x2\xb8\0\0\0\0\0\0\0\0\x5\0")));
-
-const unsigned char ba_state_data[] = {
-  '\0','\0','\0',0xff,'\0','\0','\0','\0',0xfd,'\0','\0','\0',0x2,'\0','\0',
-  '\0','\0','\0','\0',0x1,'&','\0','\0',0x2,'+',0xfc,0x2,'\0','\0','\0',0x3,
-  0xfb,'\0','\0','\0',0x1e,'\0','F','\0','i','\0','l','\0','e','\0','s','\0',
-  'D','\0','o','\0','c','\0','k','\0','W','\0','i','\0','d','\0','g','\0','e',
-  '\0','t',0x1,'\0','\0','\0','?','\0','\0','\0',0xac,'\0','\0','\0',0x88,
-  '\0',0xff,0xff,0xff,0xfb,'\0','\0','\0',0x1a,'\0','W','\0','o','\0','r',
-  '\0','k','\0','s','\0','p','\0','a','\0','c','\0','e','\0','V','\0','i',
-  '\0','e','\0','w',0x1,'\0','\0','\0',0xf1,'\0','\0','\0',0xca,'\0','\0',
-  '\0',0x82,'\0',0xff,0xff,0xff,0xfb,'\0','\0','\0','\"','\0','H','\0','i',
-  '\0','s','\0','t','\0','o','\0','r','\0','y','\0','D','\0','o','\0','c',
-  '\0','k','\0','W','\0','i','\0','d','\0','g','\0','e','\0','t',0x1,'\0',
-  '\0',0x1,0xc1,'\0','\0','\0',0xa9,'\0','\0','\0',0x82,'\0',0xff,0xff,0xff,
-  '\0','\0','\0',0x1,'\0','\0',0x2,0x84,'\0','\0',0x2,'+',0xfc,0x2,'\0','\0',
-  '\0',0x1,0xfc,'\0','\0','\0','?','\0','\0',0x2,'+','\0','\0','\0',0xeb,0x1,
-  '\0','\0',0x1b,0xfa,'\0','\0','\0','\0',0x2,'\0','\0','\0',0x4,0xfb,'\0',
-  '\0','\0','$','\0','T','\0','e','\0','r','\0','m','\0','i','\0','n','\0',
-  'a','\0','l','\0','D','\0','o','\0','c','\0','k','\0','W','\0','i','\0',
-  'd','\0','g','\0','e','\0','t',0x1,'\0','\0','\0','\0',0xff,0xff,0xff,0xff,
-  '\0','\0','\0',0x46,'\0',0xff,0xff,0xff,0xfb,'\0','\0','\0','.','\0','D','\0',
-  'o','\0','c','\0','u','\0','m','\0','e','\0','n','\0','t','\0','a','\0','t',
-  '\0','i','\0','o','\0','n','\0','D','\0','o','\0','c','\0','k','\0','W',
-  '\0','i','\0','d','\0','g','\0','e','\0','t',0x1,'\0','\0','\0','\0',0xff,
-  0xff,0xff,0xff,'\0','\0','\0',0xcf,'\0',0xff,0xff,0xff,0xfb,'\0','\0','\0',
-  0x14,'\0','F','\0','i','\0','l','\0','e','\0','E','\0','d','\0','i','\0',
-  't','\0','o','\0','r',0x1,'\0','\0','\0','\0',0xff,0xff,0xff,0xff,'\0',
-  '\0','\0',0x62,'\0',0xff,0xff,0xff,0xfb,'\0','\0','\0',0x1c,'\0','V','\0',
-  'a','\0','r','\0','i','\0','a','\0','b','\0','l','\0','e','\0','E','\0',
-  'D','\0','i','\0','t','\0','o','\0','r',0x1,'\0','\0','\0','\0',0xff,0xff,
-  0xff,0xff,'\0','\0','\0',';','\0',0xff,0xff,0xff,'\0','\0','\0','\0','\0',
-  '\0',0x2,'+','\0','\0','\0',0x4,'\0','\0','\0',0x4,'\0','\0','\0','\b',
-  '\0','\0','\0','\b',0xfc,'\0','\0','\0',0x1,'\0','\0','\0',0x2,'\0','\0',
-  '\0',0x1,'\0','\0','\0',0x16,'\0','M','\0','a','\0','i','\0','n','\0','T',
-  '\0','o','\0','o','\0','l','\0','b','\0','a','\0','r',0x1,'\0','\0','\0',
-  '\0',0xff,0xff,0xff,0xff,'\0','\0','\0','\0','\0','\0','\0','\0'
-};
-const gui_pref mw_state ("MainWindow/windowState",
-  QVariant (QByteArray (reinterpret_cast<const char*> (ba_state_data), sizeof (ba_state_data))));
-  // FIXME: usew the following version when Qt4 support is dropped
-  // QVariant (QByteArrayLiteral ("\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\0\0\0\x1&\0\0\x2+\xfc\x2\0\0\0\x3\xfb\0\0\0\x1e\0\x46\0i\0l\0\x65\0s\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\0?\0\0\0\xac\0\0\0\x88\0\xff\xff\xff\xfb\0\0\0\x1a\0W\0o\0r\0k\0s\0p\0\x61\0\x63\0\x65\0V\0i\0\x65\0w\x1\0\0\0\xf1\0\0\0\xca\0\0\0\x82\0\xff\xff\xff\xfb\0\0\0\"\0H\0i\0s\0t\0o\0r\0y\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\x1\xc1\0\0\0\xa9\0\0\0\x82\0\xff\xff\xff\0\0\0\x1\0\0\x2\x84\0\0\x2+\xfc\x2\0\0\0\x1\xfc\0\0\0?\0\0\x2+\0\0\0\xeb\x1\0\0\x1b\xfa\0\0\0\0\x2\0\0\0\x4\xfb\0\0\0$\0T\0\x65\0r\0m\0i\0n\0\x61\0l\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\x46\0\xff\xff\xff\xfb\0\0\0.\0\x44\0o\0\x63\0u\0m\0\x65\0n\0t\0\x61\0t\0i\0o\0n\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\xcf\0\xff\xff\xff\xfb\0\0\0\x14\0\x46\0i\0l\0\x65\0\x45\0\x64\0i\0t\0o\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\x62\0\xff\xff\xff\xfb\0\0\0\x1c\0V\0\x61\0r\0i\0\x61\0\x62\0l\0\x65\0\x45\0\x64\0i\0t\0o\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0;\0\xff\xff\xff\0\0\0\0\0\0\x2+\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x16\0M\0\x61\0i\0n\0T\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0")));
-
 
 // Console preferences
 
--- a/libgui/src/main-window.cc	Thu Dec 27 22:57:40 2018 +0100
+++ b/libgui/src/main-window.cc	Fri Dec 28 08:37:35 2018 +0100
@@ -59,6 +59,7 @@
 #include "settings-dialog.h"
 #include "shortcut-manager.h"
 #include "welcome-wizard.h"
+#include "gui-preferences-mw.h"
 
 #include "Array.h"
 #include "cmd-edit.h"
--- a/libgui/src/module.mk	Thu Dec 27 22:57:40 2018 +0100
+++ b/libgui/src/module.mk	Fri Dec 28 08:37:35 2018 +0100
@@ -163,6 +163,7 @@
   %reldir%/documentation.h \
   %reldir%/dw-main-window.h \
   %reldir%/gui-preferences.h \
+  %reldir%/gui-preferences-mw.h \
   %reldir%/external-editor-interface.h \
   %reldir%/files-dock-widget.h \
   %reldir%/history-dock-widget.h \
--- a/libgui/src/settings-dialog.cc	Thu Dec 27 22:57:40 2018 +0100
+++ b/libgui/src/settings-dialog.cc	Fri Dec 28 08:37:35 2018 +0100
@@ -33,7 +33,6 @@
 #include "variable-editor.h"
 #include "workspace-model.h"
 #include "settings-dialog.h"
-#include "gui-preferences.h"
 
 #include <QButtonGroup>
 #include <QDir>