Moved mesongui into module.

pull/356/head
Jussi Pakkanen 9 years ago
parent 2ee27504a8
commit 1510522b1b
  1. 0
      meson/mesonmain.ui
  2. 0
      meson/mesonrunner.ui
  3. 0
      meson/mesonstart.ui
  4. 26
      meson/mgui.py
  5. 16
      meson/mintro.py
  6. 20
      mesongui
  7. 20
      mesonintrospect

@ -15,7 +15,7 @@
# limitations under the License.
import sys, os, pickle, time, shutil
import build, coredata, environment, mesonlib
from . import build, coredata, environment, mesonlib
from PyQt5 import uic
from PyQt5.QtWidgets import QApplication, QMainWindow, QHeaderView
from PyQt5.QtWidgets import QComboBox, QCheckBox
@ -242,23 +242,23 @@ class OptionForm:
combo.addItem('debug')
combo.addItem('debugoptimized')
combo.addItem('release')
combo.setCurrentText(self.coredata.buildtype)
combo.setCurrentText(self.coredata.get_builtin_option('buildtype'))
combo.currentTextChanged.connect(self.build_type_changed)
self.form.addRow('Build type', combo)
strip = QCheckBox("")
strip.setChecked(self.coredata.strip)
strip.setChecked(self.coredata.get_builtin_option('strip'))
strip.stateChanged.connect(self.strip_changed)
self.form.addRow('Strip on install', strip)
coverage = QCheckBox("")
coverage.setChecked(self.coredata.coverage)
coverage.setChecked(self.coredata.get_builtin_option('coverage'))
coverage.stateChanged.connect(self.coverage_changed)
self.form.addRow('Enable coverage', coverage)
pch = QCheckBox("")
pch.setChecked(self.coredata.use_pch)
pch.setChecked(self.coredata.get_builtin_option('use_pch'))
pch.stateChanged.connect(self.pch_changed)
self.form.addRow('Enable pch', pch)
unity = QCheckBox("")
unity.setChecked(self.coredata.unity)
unity.setChecked(self.coredata.get_builtin_option('unity'))
unity.stateChanged.connect(self.unity_changed)
self.form.addRow('Unity build', unity)
form.addRow(PyQt5.QtWidgets.QLabel("Project options"))
@ -545,17 +545,21 @@ class MesonGuiRespawner():
self.gui.resize(s)
# Garbage collection takes care of the old gui widget
if __name__ == '__main__':
def run(args): # SPECIAL, Qt wants all args, including command name.
app = QApplication(sys.argv)
if len(sys.argv) == 1:
if len(args) == 1:
arg = ""
elif len(sys.argv) == 2:
elif len(args) == 2:
arg = sys.argv[1]
else:
print(sys.argv[0], "<build or source dir>")
sys.exit(1)
return 1
if os.path.exists(os.path.join(arg, 'meson-private/coredata.dat')):
guirespawner = MesonGuiRespawner(arg)
else:
runner = Starter(arg)
sys.exit(app.exec_())
return app.exec_()
if __name__ == '__main__':
sys.exit(run(sys.argv))

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright 2014-2015 The Meson development team
# Copyright 2014-2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -22,7 +22,7 @@ Currently only works for the Ninja backend. Others use generated
project files and don't need this info."""
import json, pickle
import coredata, build, mesonlib
from . import coredata, build, mesonlib
import argparse
import sys, os
@ -172,11 +172,11 @@ def list_tests(testdata):
result.append(to)
print(json.dumps(result))
if __name__ == '__main__':
options = parser.parse_args()
def run(args):
options = parser.parse_args(args)
if len(options.args) > 1:
print('Too many arguments')
sys.exit(1)
return 1
elif len(options.args) == 1:
bdir = options.args[0]
else:
@ -205,4 +205,8 @@ if __name__ == '__main__':
list_deps(coredata)
else:
print('No command specified')
sys.exit(1)
return 1
return 0
if __name__ == '__main__':
sys.exit(run(sys.argv[1:]))

@ -0,0 +1,20 @@
#!/usr/bin/env python3
# Copyright 2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from meson import mgui
import sys
sys.exit(mgui.run(sys.argv))

@ -0,0 +1,20 @@
#!/usr/bin/env python3
# Copyright 2016 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from meson import mintro
import sys
sys.exit(mintro.run(sys.argv[1:]))
Loading…
Cancel
Save