def mainwindow(args): '''Open the main window with any loaded files.''' from veusz.windows.mainwindow import MainWindow if len(args) > 1: # load in filenames given for filename in args[1:]: MainWindow.CreateWindow(filename) else: # create blank window MainWindow.CreateWindow()
def openMainWindow(self, docs): """Open the main window with any loaded files.""" from veusz.windows.mainwindow import MainWindow emptywins = [] for w in self.topLevelWidgets(): if isinstance(w, MainWindow) and w.document.isBlank(): emptywins.append(w) if docs: # load in filenames given for filename in docs: if not emptywins: MainWindow.CreateWindow(filename) else: emptywins[0].openFile(filename) else: # create blank window MainWindow.CreateWindow()
def openMainWindow(self, args): """Open the main window with any loaded files.""" from veusz.windows.mainwindow import MainWindow emptywins = [] for w in self.topLevelWidgets(): if isinstance(w, MainWindow) and w.document.isBlank(): emptywins.append(w) # Detect OS type and adjust number of parameter after python call startarg = 2 if sys.platform.startswith('win32') else 1 if len(args) > startarg: # load in filenames given for filename in args[startarg:]: if not emptywins: MainWindow.CreateWindow(filename) else: emptywins[0].openFile(filename) else: # create blank window MainWindow.CreateWindow()
def openMainWindow(self, args): """Open the main window with any loaded files.""" MainWindow = Graphics emptywins = [] for w in self.topLevelWidgets(): if isinstance(w, MainWindow) and w.document.isBlank(): emptywins.append(w) created = 0 if len(args) > 1: # load in filenames given for filename in args[1:]: if filename.endswith('.py') or filename.endswith( '.pyc') or filename.endswith('.pyd'): continue created += 1 if not emptywins: MainWindow.CreateWindow(filename) else: emptywins[0].openFile(filename) if not created: # create blank window logging.debug('creating blank window') MainWindow.CreateWindow()
def __init__(self, *a): configure_logger('graphics.log') iutils.loadIcons() logging.debug('Load Icons OK') self._document = MisuraDocument() # Shortcuts to command interpreter and interface MainWindow.__init__(self, *a) logging.debug('MainWindow init') self.ci = self.console.interpreter self.cmd = self.ci.interface # misura Interface logging.debug('misura Interface') self.m4 = MisuraInterface(self) # Misura3 Interface # print 'Misura3 Interface' self.m3 = Misura3Interface(self) self.datadock.hide() self.plot.doPick = lambda mouse_position: plugin.InterceptPlugin.clicked_curve( mouse_position, self) self.setWindowIcon( QtGui.QIcon(os.path.join(params.pathArt, 'graphics.svg'))) self.plot.dragMoveEvent = self.dragEnterEvent self.plot.dropEvent = self.dropEvent