Skip to content

Commit 4ea2769

Browse files
committed
- move ui defaults to ui_defaults.h
- add scripts/mkuidefaults.py to create ui_defaults.h from current setting - default ui state with two toolbar rows (fixes #8117) - update plugin registry state of nsis installer
1 parent dd9b7b2 commit 4ea2769

File tree

7 files changed

+140
-50
lines changed

7 files changed

+140
-50
lines changed

ms-windows/QGIS-Installer.nsi

-2
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ Section "QGIS" SecQGIS
270270

271271
SectionIn RO
272272

273-
;Added by Tim to set the reg key so we get default toolbar layout
274-
!include ui.nsh
275273
;Added by Tim to set the reg key so we get default plugin loading
276274
!include plugins.nsh
277275
;Added by Tim to set the reg key so we get default python & py plugins

ms-windows/plugins.nsh

+10-12
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,23 @@
88
################################################################################
99

1010
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "coordinatecaptureplugin" "true"
11-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "copyrightlabelplugin" "true"
12-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "delimitedtextplugin" "true"
11+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "diagramoverlay" "true"
1312
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "dxf2shpconverterplugin" "true"
13+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "evis" "true"
1414
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "georefplugin" "true"
15+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "globeplugin" "false"
1516
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "gpsimporterplugin" "true"
16-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "gridmakerplugin" "true"
17-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "interpolationplugin" "true"
18-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "northarrowplugin" "true"
19-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "ogrconverterplugin" "true"
20-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "quickprintplugin" "true"
21-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "scalebarplugin" "true"
22-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "spitplugin" "true"
23-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "wfsplugin" "true"
2417
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "grassplugin" "true"
25-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "diagramoverlay" "true"
18+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "heatmapplugin" "true"
19+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "interpolationplugin" "true"
20+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "offlineeditingplugin" "true"
2621
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "oracleplugin" "true"
27-
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "evis" "true"
2822
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "rasterterrainplugin" "true"
2923
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "roadgraphplugin" "true"
24+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "spitplugin" "true"
3025
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "spatialqueryplugin" "true"
26+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "sqlanywhereplugin" "true"
27+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "topolplugin" "true"
28+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\Plugins" "zonalstatisticsplugin" "true"
3129

3230
############################### reg2nsis end #################################

ms-windows/python_plugins.nsh

+3
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@
99

1010
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\PythonPlugins" "fTools" "true"
1111
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\PythonPlugins" "GdalTools" "true"
12+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\PythonPlugins" "db_manager" "true"
13+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\PythonPlugins" "sextante" "true"
14+
WriteRegStr HKEY_CURRENT_USER "Software\QGIS\QGIS2\PythonPlugins" "mapserver_export" "false"
1215

1316
############################### reg2nsis end #################################

ms-windows/ui.nsh

-23
This file was deleted.

scripts/mkuidefaults.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from PyQt4.QtCore import QCoreApplication, QSettings
2+
3+
def chunks(l, n):
4+
for i in xrange(0, len(l), n):
5+
yield l[i:i+n]
6+
7+
QCoreApplication.setOrganizationName( "QGIS" )
8+
QCoreApplication.setOrganizationDomain( "qgis.org" )
9+
QCoreApplication.setApplicationName( "QGIS2" )
10+
11+
s = QSettings()
12+
13+
ba = s.value("/UI/geometry").toByteArray()
14+
15+
f = open("src/app/ui_defaults.h", "w")
16+
17+
f.write( "#ifndef UI_DEFAULTS_H\n#define UI_DEFAULTS_H\n\nstatic const unsigned char defaultUIgeometry[] =\n{\n" )
18+
19+
for chunk in chunks(ba,16):
20+
f.write( " %s,\n" % ", ".join( map( lambda x : "0x%02x" % ord(x), chunk ) ) )
21+
22+
f.write( "};\n\nstatic const unsigned char defaultUIstate[] =\n{\n" )
23+
24+
ba = s.value("/UI/state").toByteArray()
25+
26+
for chunk in chunks(ba,16):
27+
f.write( " %s,\n" % ", ".join( map( lambda x : "0x%02x" % ord(x), chunk ) ) )
28+
29+
f.write( "};\n\n#endif // UI_DEFAULTS_H\n" )
30+
31+
f.close()

src/app/qgisapp.cpp

+1-13
Original file line numberDiff line numberDiff line change
@@ -2365,19 +2365,7 @@ void QgisApp::saveWindowState()
23652365
QgsPluginRegistry::instance()->unloadAll();
23662366
}
23672367

2368-
static const unsigned char defaultUIgeometry[] =
2369-
{
2370-
0x01, 0xd9, 0xd0, 0xcb, 0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x04, 0xb8, 0x00, 0x00, 0x03, 0x22, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x02, 0xaf, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00
2371-
};
2372-
2373-
static const unsigned char defaultUIstate[] =
2374-
{
2375-
0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x87, 0xfc, 0x02, 0x00, 0x00, 0x00, 0x03, 0xfb, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x4c, 0x00, 0x65, 0x00, 0x67, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x64, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x87, 0x00, 0x00, 0x00, 0x72, 0x00, 0xff, 0xff, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x00, 0x4f, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x69, 0x00, 0x65, 0x00, 0x77, 0x00, 0x00, 0x00, 0x01, 0xf4, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x14, 0x00, 0xff, 0xff, 0xff, 0xfb, 0x00, 0x00, 0x00, 0x22, 0x00, 0x43, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x64, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x61, 0x00, 0x74, 0x00, 0x65, 0x00, 0x43,
2376-
0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x75, 0x00, 0x72, 0x00, 0x65, 0x00, 0x00, 0x00, 0x01, 0x7e, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x7e, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x03, 0xaf, 0x00, 0x00, 0x02, 0x87, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x16, 0x00, 0x46, 0x00, 0x69, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x54, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x6c, 0x00, 0x42, 0x00, 0x61, 0x00, 0x72, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x4c, 0x00, 0x61, 0x00, 0x79, 0x00, 0x65, 0x00,
2377-
0x72, 0x00, 0x54, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x6c, 0x00, 0x42, 0x00, 0x61, 0x00, 0x72, 0x01, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x41, 0x00, 0x74, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69, 0x00, 0x62, 0x00, 0x75, 0x00, 0x74, 0x00, 0x65, 0x00, 0x73, 0x01, 0x00, 0x00, 0x02, 0x4e, 0x00, 0x00, 0x01, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x48, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x70, 0x00, 0x00, 0x00, 0x03, 0xd9, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x50, 0x00, 0x6c, 0x00, 0x75, 0x00, 0x67, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x73, 0x01, 0x00, 0x00, 0x03, 0x75, 0x00, 0x00, 0x01, 0x40, 0x00,
2378-
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x44, 0x00, 0x69, 0x00, 0x67, 0x00, 0x69, 0x00, 0x74, 0x00, 0x69, 0x00, 0x7a, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x4d, 0x00, 0x61, 0x00, 0x70, 0x00, 0x20, 0x00, 0x4e, 0x00, 0x61, 0x00, 0x76, 0x00, 0x69, 0x00, 0x67, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x01, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x02, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00
2379-
};
2380-
2368+
#include "ui_defaults.h"
23812369

23822370
void QgisApp::restoreWindowState()
23832371
{

0 commit comments

Comments
 (0)