mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
This implements the proposal from @SrNeto: - new toolbar with the new dialog button and all the "new" data soource buttons - old layer toolbar hidden by default - new dialog open from first item in layer menu
78 lines
2.4 KiB
Python
78 lines
2.4 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
***************************************************************************
|
|
mkuidefaults.py
|
|
---------------------
|
|
Date : June 2013
|
|
Copyright : (C) 2013 by Juergen E. Fischer
|
|
Email : jef at norbit dot de
|
|
***************************************************************************
|
|
* *
|
|
* This program 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 2 of the License, or *
|
|
* (at your option) any later version. *
|
|
* *
|
|
***************************************************************************
|
|
"""
|
|
|
|
__author__ = 'Juergen E. Fischer'
|
|
__date__ = 'June 2013'
|
|
__copyright__ = '(C) 2013, Juergen E. Fischer'
|
|
# This will get replaced with a git SHA1 when you do a git archive
|
|
__revision__ = '$Format:%H$'
|
|
|
|
from qgis.PyQt.QtCore import QCoreApplication, QSettings
|
|
|
|
|
|
def chunks(l, n):
|
|
for i in range(0, len(l), n):
|
|
yield l[i:i + n]
|
|
|
|
|
|
QCoreApplication.setOrganizationName("QGIS")
|
|
QCoreApplication.setOrganizationDomain("qgis.org")
|
|
QCoreApplication.setApplicationName("QGIS3")
|
|
|
|
s = QSettings()
|
|
|
|
ba = bytes(s.value("/UI/geometry"))
|
|
|
|
f = open("src/app/ui_defaults.h", "w")
|
|
|
|
f.write("#ifndef UI_DEFAULTS_H\n#define UI_DEFAULTS_H\n\nstatic const unsigned char defaultUIgeometry[] =\n{\n")
|
|
|
|
for chunk in chunks(ba, 16):
|
|
f.write(" %s,\n" % ", ".join(map(lambda x: "0x%02x" % x, chunk)))
|
|
|
|
f.write("};\n\nstatic const unsigned char defaultUIstate[] =\n{\n")
|
|
|
|
ba = bytes(s.value("/UI/state"))
|
|
|
|
for chunk in chunks(ba, 16):
|
|
f.write(" %s,\n" % ", ".join(map(lambda x: "0x%02x" % x, chunk)))
|
|
|
|
try:
|
|
ba = bytes(s.value("/Composer/geometry"))
|
|
|
|
f.write("};\n\nstatic const unsigned char defaultComposerUIgeometry[] =\n{\n")
|
|
|
|
for chunk in chunks(ba, 16):
|
|
f.write(" %s,\n" % ", ".join(map(lambda x: "0x%02x" % x, chunk)))
|
|
except TypeError as ex:
|
|
pass
|
|
|
|
try:
|
|
ba = bytes(s.value("/ComposerUI/state"))
|
|
f.write("};\n\nstatic const unsigned char defaultComposerUIstate[] =\n{\n")
|
|
|
|
for chunk in chunks(ba, 16):
|
|
f.write(" %s,\n" % ", ".join(map(lambda x: "0x%02x" % x, chunk)))
|
|
except TypeError as ex:
|
|
pass
|
|
|
|
f.write("};\n\n#endif // UI_DEFAULTS_H\n")
|
|
|
|
f.close()
|