<commit_before>'''
Created on Apr 25, 2013

@author: <NAME>
'''

import main

from PyQt4 import QtCore, QtGui
from ui.MainWindow import Ui_MainWindow
from gui.ActorsTabWrapper import ActorsTabWrapper
from gui.PropertiesTabWrapper import PropertiesTabWrapper
from gui.UseCasesTabWrapper import UseCasesTabWrapper
from gui.PrioritiesTabWrapper import PrioritiesTabWrapper
from gui.GoalLevelsTabWrapper import GoalLevelsTabWrapper
from gui.BusinessObjectsTabWrapper import BusinessObjectsTabWrapper
from gui.BusinessRulesTabWrapper import BusinessRulesTabWrapper
from gui.TestCasesTabWrapper import TestCasesTabWrapper
import format.writer.xml
import format.reader.xml
import format.model

try:
		_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
		_fromUtf8 = lambda s: s

class MainWindowWrapper(QtGui.QMainWindow):
	def __init__(self, parent=None):
		QtGui.QWidget.__init__(self, parent)
		self.mainWindow = Ui_MainWindow()
		self.afefuc = {'project': None}
		self.filename = None

	def show(self):
		super(QtGui.QMainWindow, self).show()

		self.mainWindow.setupUi(self)

		self.afefuc = {'project': main.project}

		screen = QtGui.QApplication.desktop().screenGeometry()
		self.move(screen.center() - self.rect().center())
		self.activateWindow()

		self.mainWindow.actionNew.triggered.connect(self.clickedNew)
		self.mainWindow.actionOpen.triggered.connect(self.clickedOpen)
		self.mainWindow.actionSave.triggered.connect(self.clickedSave)
		self.mainWindow.actionSaveAs.triggered.connect(self.clickedSaveAs)
		self.mainWindow.actionClose.triggered.connect(self.clickedClose)
		self.mainWindow.actionQuit.triggered.connect(self.clickedQuit)
		self.mainWindow.actionDump.triggered.connect(self.clickedDump)

		self.propertiesTab = PropertiesTabWrapper(self, self.afefuc)
		self.propertiesTab.show()

		self.prioritiesTab = PrioritiesTabWrapper(self, self.afefuc)
		self.prioritiesTab.show()

		self.goalLevelTab = GoalLevelsTabWrapper(self, self.afefuc)
		self.goalLevelTab.show()

		self.businessObjectsTab = BusinessObjectsTabWrapper(self, self.afefuc)
		self.businessObjectsTab.show()

		self.businessRulesTab = BusinessRulesTabWrapper(self, self.afefuc)
		self.businessRulesTab.show()

		self.actorsTab = ActorsTabWrapper(self, self.afefuc)
		self.actorsTab.show()

		self.usecasesTab = UseCasesTabWrapper(self, self.afefuc)
		self.usecasesTab.show()

		self.testcasesTab = TestCasesTabWrapper(self, self.afefuc)
		self.testcasesTab.show()

		self.load()

	def load(self):
		self.propertiesTab.load()
		self.prioritiesTab.load()
		self.goalLevelTab.load()
		self.businessObjectsTab.load()
		#self.businessRulesTab.load()
		self.actorsTab.load()
		self.usecasesTab.load()
		self.testcasesTab.load()

	def clickedNew(self):
		self.clickedClose()
		self.mainWindow.tabWidget.show()

		self.afefuc["project"] = format.model.Project()

		self.load()

	def clickedOpen(self):
		filename = QtGui.QFileDialog.getOpenFileName(self, "Open", "", "AFEFUC (*.auc)")

		if filename:
			filename = unicode(filename.toUtf8(), "utf-8")

			self.clickedClose()

			self.filename = filename<commit_msg>create empty project on start<commit_after>'''
Created on Apr 25, 2013

@author: <NAME>
'''

from PyQt4 import QtCore, QtGui
from ui.MainWindow import Ui_MainWindow
from gui.ActorsTabWrapper import ActorsTabWrapper
from gui.PropertiesTabWrapper import PropertiesTabWrapper
from gui.UseCasesTabWrapper import UseCasesTabWrapper
from gui.PrioritiesTabWrapper import PrioritiesTabWrapper
from gui.GoalLevelsTabWrapper import GoalLevelsTabWrapper
from gui.BusinessObjectsTabWrapper import BusinessObjectsTabWrapper
from gui.BusinessRulesTabWrapper import BusinessRulesTabWrapper
from gui.TestCasesTabWrapper import TestCasesTabWrapper
import format.writer.xml
import format.reader.xml
import format.model

try:
		_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
		_fromUtf8 = lambda s: s

class MainWindowWrapper(QtGui.QMainWindow):
	def __init__(self, parent=None):
		QtGui.QWidget.__init__(self, parent)
		self.mainWindow = Ui_MainWindow()
		self.afefuc = {'project': None}
		self.filename = None

	def show(self):
		super(QtGui.QMainWindow, self).show()

		self.mainWindow.setupUi(self)

		self.afefuc["project"] = format.model.Project()
		self.mainWindow.tabWidget.hide()

		screen = QtGui.QApplication.desktop().screenGeometry()
		self.move(screen.center() - self.rect().center())
		self.activateWindow()

		self.mainWindow.actionNew.triggered.connect(self.clickedNew)
		self.mainWindow.actionOpen.triggered.connect(self.clickedOpen)
		self.mainWindow.actionSave.triggered.connect(self.clickedSave)
		self.mainWindow.actionSaveAs.triggered.connect(self.clickedSaveAs)
		self.mainWindow.actionClose.triggered.connect(self.clickedClose)
		self.mainWindow.actionQuit.triggered.connect(self.clickedQuit)
		self.mainWindow.actionDump.triggered.connect(self.clickedDump)

		self.propertiesTab = PropertiesTabWrapper(self, self.afefuc)
		self.propertiesTab.show()

		self.prioritiesTab = PrioritiesTabWrapper(self, self.afefuc)
		self.prioritiesTab.show()

		self.goalLevelTab = GoalLevelsTabWrapper(self, self.afefuc)
		self.goalLevelTab.show()

		self.businessObjectsTab = BusinessObjectsTabWrapper(self, self.afefuc)
		self.businessObjectsTab.show()

		self.businessRulesTab = BusinessRulesTabWrapper(self, self.afefuc)
		self.businessRulesTab.show()

		self.actorsTab = ActorsTabWrapper(self, self.afefuc)
		self.actorsTab.show()

		self.usecasesTab = UseCasesTabWrapper(self, self.afefuc)
		self.usecasesTab.show()

		self.testcasesTab = TestCasesTabWrapper(self, self.afefuc)
		self.testcasesTab.show()

	def load(self):
		self.propertiesTab.load()
		self.prioritiesTab.load()
		self.goalLevelTab.load()
		self.businessObjectsTab.load()
		self.businessRulesTab.load()
		self.actorsTab.load()
		self.usecasesTab.load()
		self.testcasesTab.load()

	def clickedNew(self):
		self.clickedClose()
		self.mainWindow.tabWidget.show()

		self.afefuc["project"] = format.model.Project()

		self.load()

	def clickedOpen(self):
		filename = QtGui.QFileDialog.getOpenFileName(self, "Open", "", "AFEFUC (*.auc)")

		if filename:
			filename = unicode(filename.toUtf8(), "utf-8")

			self.clickedClose()

			self.filename = filename
{'fraction_non_alphanumeric': 0.10905878573723096, 'fraction_numerical': 0.0038548024413748794, 'mean_word_length': 5.7029063509149625, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7364033', 'n_tokens_mistral': 2231, 'n_tokens_neox': 2033, 'n_words': 330}