void MainWindow::setupUiActions(){ ui.setupUi(this); connect(ui.actionExit, SIGNAL(triggered()), this, SLOT(close())); connect(ui.actionRestart, SIGNAL(triggered()), this, SLOT(actionRestart())); connect(ui.actionOpen, SIGNAL(triggered()), this, SLOT(actionOpen())); connect(ui.actionOpen_Directory, SIGNAL(triggered()), this, SLOT(actionOpen_Directory())); connect(ui.actionFull_Screen, SIGNAL(triggered(bool)), this, SLOT(actionFull_Screen(bool))); connect(ui.actionHide_Menu, SIGNAL(triggered()), this, SLOT(actionHide_Menu())); connect(ui.actionAlways_on_Top, SIGNAL(triggered(bool)), this, SLOT(actionAlwaysOnTop(bool))); connect(ui.actionQuarter, SIGNAL(triggered()), this, SLOT(actionScale())); connect(ui.actionHalf, SIGNAL(triggered()), this, SLOT(actionScale())); connect(ui.actionOriginal, SIGNAL(triggered()), this, SLOT(actionScale())); connect(ui.actionDouble, SIGNAL(triggered()), this, SLOT(actionScale())); connect(ui.actionTriple, SIGNAL(triggered()), this, SLOT(actionScale())); connect(ui.actionZoom_In, SIGNAL(triggered()), this, SLOT(actionScale())); connect(ui.actionZoom_Out, SIGNAL(triggered()), this, SLOT(actionScale())); connect(ui.actionFit_To_Window, SIGNAL(triggered()), this, SLOT(actionScale())); connect(ui.actionFit_To_App, SIGNAL(triggered()), this, SLOT(actionFitWindow())); connect(ui.actionDraw_Infos, SIGNAL(triggered(bool)), this, SLOT(actionDraw_Infos(bool))); connect(ui.actionAuto_Scale, SIGNAL(triggered(bool)), this, SLOT(actionAuto_Scale(bool))); connect(ui.actionRotate_Left, SIGNAL(triggered()), this, SLOT(actionRotate())); connect(ui.actionRotate_Right, SIGNAL(triggered()), this, SLOT(actionRotate())); connect(ui.actionPortrait, SIGNAL(triggered()), this, SLOT(actionOrientation())); connect(ui.actionPortrait_Upside_Down, SIGNAL(triggered()), this, SLOT(actionOrientation())); connect(ui.actionLandscape_Left, SIGNAL(triggered()), this, SLOT(actionOrientation())); connect(ui.actionLandscape_Right, SIGNAL(triggered()), this, SLOT(actionOrientation())); connect(ui.action320x480, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action768x1024, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action640x960, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action1536x2048, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action320x568, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action640x1136, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action480x800, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action240x320, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action540x960, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action480x854, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action240x400, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action360x640, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action800x1280, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action600x1024, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action600x800, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action768x1366, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action720x1280, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action1080x1920, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action750x1334, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action1242x2208, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action900x1200, SIGNAL(triggered()), this, SLOT(actionResolution())); connect(ui.action15_fps, SIGNAL(triggered()), this, SLOT(actionFps())); connect(ui.action30_fps, SIGNAL(triggered()), this, SLOT(actionFps())); connect(ui.action60_fps, SIGNAL(triggered()), this, SLOT(actionFps())); connect(ui.actionUnlimited, SIGNAL(triggered()), this, SLOT(actionFps())); connect(ui.actionSettings, SIGNAL(triggered()), this, SLOT(actionSettings())); connect(ui.glCanvas, SIGNAL(projectNameChanged(const QString&)), this, SLOT(projectNameChanged(const QString&))); }
SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : QMainWindow(parent) , fCentralSplitter(this) , fStatusBar(this) , fToolBar(this) , fActionOpen(this) , fActionBreakpoint(this) , fActionToggleIndexStyle(this) , fActionProfile(this) , fActionCancel(this) , fActionClearBreakpoints(this) , fActionClearDeletes(this) , fActionClose(this) , fActionCreateBreakpoint(this) , fActionDelete(this) , fActionDirectory(this) , fActionGoToLine(this) , fActionInspector(this) , fActionSettings(this) , fActionPlay(this) , fActionPause(this) , fActionRewind(this) , fActionSave(this) , fActionSaveAs(this) , fActionShowDeletes(this) , fActionStepBack(this) , fActionStepForward(this) , fActionZoomIn(this) , fActionZoomOut(this) , fMapper(this) , fListWidget(&fCentralSplitter) , fDirectoryWidget(&fCentralSplitter) , fCanvasWidget(this, &fDebugger) , fImageWidget(&fDebugger) , fMenuBar(this) , fMenuFile(this) , fMenuNavigate(this) , fMenuView(this) , fBreakpointsActivated(false) , fIndexStyleToggle(false) , fDeletesActivated(false) , fPause(false) , fLoading(false) { setupUi(this); fListWidget.setSelectionMode(QAbstractItemView::ExtendedSelection); connect(&fListWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(registerListClick(QListWidgetItem *))); connect(&fActionOpen, SIGNAL(triggered()), this, SLOT(openFile())); connect(&fActionDirectory, SIGNAL(triggered()), this, SLOT(toggleDirectory())); connect(&fDirectoryWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(loadFile(QListWidgetItem *))); connect(&fActionDelete, SIGNAL(triggered()), this, SLOT(actionDelete())); connect(&fListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(toggleBreakpoint())); connect(&fActionRewind, SIGNAL(triggered()), this, SLOT(actionRewind())); connect(&fActionPlay, SIGNAL(triggered()), this, SLOT(actionPlay())); connect(&fActionStepBack, SIGNAL(triggered()), this, SLOT(actionStepBack())); connect(&fActionStepForward, SIGNAL(triggered()), this, SLOT(actionStepForward())); connect(&fActionBreakpoint, SIGNAL(triggered()), this, SLOT(actionBreakpoints())); connect(&fActionToggleIndexStyle, SIGNAL(triggered()), this, SLOT(actionToggleIndexStyle())); connect(&fActionInspector, SIGNAL(triggered()), this, SLOT(actionInspector())); connect(&fActionSettings, SIGNAL(triggered()), this, SLOT(actionSettings())); connect(&fFilter, SIGNAL(activated(QString)), this, SLOT(toggleFilter(QString))); connect(&fActionProfile, SIGNAL(triggered()), this, SLOT(actionProfile())); connect(&fActionCancel, SIGNAL(triggered()), this, SLOT(actionCancel())); connect(&fActionClearBreakpoints, SIGNAL(triggered()), this, SLOT(actionClearBreakpoints())); connect(&fActionClearDeletes, SIGNAL(triggered()), this, SLOT(actionClearDeletes())); connect(&fActionClose, SIGNAL(triggered()), this, SLOT(actionClose())); connect(&fSettingsWidget, SIGNAL(visibilityFilterChanged()), this, SLOT(actionCommandFilter())); #if SK_SUPPORT_GPU connect(&fSettingsWidget, SIGNAL(glSettingsChanged()), this, SLOT(actionGLWidget())); #endif connect(&fSettingsWidget, SIGNAL(texFilterSettingsChanged()), this, SLOT(actionTextureFilter())); connect(fSettingsWidget.getRasterCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionRasterWidget(bool))); connect(fSettingsWidget.getOverdrawVizCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionOverdrawVizWidget(bool))); connect(fSettingsWidget.getMegaVizCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionMegaVizWidget(bool))); connect(fSettingsWidget.getPathOpsCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionPathOpsWidget(bool))); connect(&fActionPause, SIGNAL(toggled(bool)), this, SLOT(pauseDrawing(bool))); connect(&fActionCreateBreakpoint, SIGNAL(activated()), this, SLOT(toggleBreakpoint())); connect(&fActionShowDeletes, SIGNAL(triggered()), this, SLOT(showDeletes())); connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(selectCommand(int))); connect(&fCanvasWidget, SIGNAL(hitChanged(int)), &fSettingsWidget, SLOT(updateHit(int))); connect(&fCanvasWidget, SIGNAL(scaleFactorChanged(float)), this, SLOT(actionScale(float))); connect(&fCanvasWidget, SIGNAL(commandChanged(int)), &fSettingsWidget, SLOT(updateCommand(int))); connect(&fActionSaveAs, SIGNAL(triggered()), this, SLOT(actionSaveAs())); connect(&fActionSave, SIGNAL(triggered()), this, SLOT(actionSave())); fMapper.setMapping(&fActionZoomIn, SkCanvasWidget::kIn_ZoomCommand); fMapper.setMapping(&fActionZoomOut, SkCanvasWidget::kOut_ZoomCommand); connect(&fActionZoomIn, SIGNAL(triggered()), &fMapper, SLOT(map())); connect(&fActionZoomOut, SIGNAL(triggered()), &fMapper, SLOT(map())); connect(&fMapper, SIGNAL(mapped(int)), &fCanvasWidget, SLOT(zoom(int))); fInspectorWidget.setDisabled(true); fMenuEdit.setDisabled(true); fMenuNavigate.setDisabled(true); fMenuView.setDisabled(true); SkGraphics::Init(); }
SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : QMainWindow(parent) , fCentralSplitter(this) , fStatusBar(this) , fToolBar(this) , fActionOpen(this) , fActionBreakpoint(this) , fActionCancel(this) , fActionClearBreakpoints(this) , fActionClearDeletes(this) , fActionClose(this) , fActionCreateBreakpoint(this) , fActionDelete(this) , fActionDirectory(this) , fActionGoToLine(this) , fActionInspector(this) , fActionSettings(this) , fActionPlay(this) , fActionPause(this) , fActionRewind(this) , fActionSave(this) , fActionSaveAs(this) , fActionShowDeletes(this) , fActionStepBack(this) , fActionStepForward(this) , fActionZoomIn(this) , fActionZoomOut(this) , fMapper(this) , fListWidget(&fCentralSplitter) , fDirectoryWidget(&fCentralSplitter) , fCanvasWidget(this, &fDebugger) , fDrawCommandGeometryWidget(&fDebugger) , fMenuBar(this) , fMenuFile(this) , fMenuNavigate(this) , fMenuView(this) , fLoading(false) { setupUi(this); fListWidget.setSelectionMode(QAbstractItemView::ExtendedSelection); connect(&fListWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(updateDrawCommandInfo())); connect(&fActionOpen, SIGNAL(triggered()), this, SLOT(openFile())); connect(&fActionDirectory, SIGNAL(triggered()), this, SLOT(toggleDirectory())); connect(&fDirectoryWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(loadFile(QListWidgetItem *))); connect(&fDirectoryWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(populateDirectoryWidget())); connect(&fActionDelete, SIGNAL(triggered()), this, SLOT(actionDelete())); connect(&fListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(toggleBreakpoint())); connect(&fActionRewind, SIGNAL(triggered()), this, SLOT(actionRewind())); connect(&fActionPlay, SIGNAL(triggered()), this, SLOT(actionPlay())); connect(&fActionStepBack, SIGNAL(triggered()), this, SLOT(actionStepBack())); connect(&fActionStepForward, SIGNAL(triggered()), this, SLOT(actionStepForward())); connect(&fActionBreakpoint, SIGNAL(triggered()), this, SLOT(actionBreakpoints())); connect(&fActionInspector, SIGNAL(triggered()), this, SLOT(actionInspector())); connect(&fActionSettings, SIGNAL(triggered()), this, SLOT(actionSettings())); connect(&fFilter, SIGNAL(activated(QString)), this, SLOT(toggleFilter(QString))); connect(&fActionCancel, SIGNAL(triggered()), this, SLOT(actionCancel())); connect(&fActionClearBreakpoints, SIGNAL(triggered()), this, SLOT(actionClearBreakpoints())); connect(&fActionClearDeletes, SIGNAL(triggered()), this, SLOT(actionClearDeletes())); connect(&fActionClose, SIGNAL(triggered()), this, SLOT(actionClose())); #if SK_SUPPORT_GPU connect(&fSettingsWidget, SIGNAL(glSettingsChanged()), this, SLOT(actionGLSettingsChanged())); #endif connect(&fSettingsWidget, SIGNAL(rasterSettingsChanged()), this, SLOT(actionRasterSettingsChanged())); connect(&fSettingsWidget, SIGNAL(visualizationsChanged()), this, SLOT(actionVisualizationsChanged())); connect(&fSettingsWidget, SIGNAL(texFilterSettingsChanged()), this, SLOT(actionTextureFilter())); connect(&fActionPause, SIGNAL(toggled(bool)), this, SLOT(pauseDrawing(bool))); connect(&fActionCreateBreakpoint, SIGNAL(activated()), this, SLOT(toggleBreakpoint())); connect(&fActionShowDeletes, SIGNAL(triggered()), this, SLOT(showDeletes())); connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(selectCommand(int))); connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(updateHit(int))); connect(&fCanvasWidget, SIGNAL(scaleFactorChanged(float)), this, SLOT(actionScale(float))); connect(&fActionSaveAs, SIGNAL(triggered()), this, SLOT(actionSaveAs())); connect(&fActionSave, SIGNAL(triggered()), this, SLOT(actionSave())); fMapper.setMapping(&fActionZoomIn, SkCanvasWidget::kIn_ZoomCommand); fMapper.setMapping(&fActionZoomOut, SkCanvasWidget::kOut_ZoomCommand); connect(&fActionZoomIn, SIGNAL(triggered()), &fMapper, SLOT(map())); connect(&fActionZoomOut, SIGNAL(triggered()), &fMapper, SLOT(map())); connect(&fMapper, SIGNAL(mapped(int)), &fCanvasWidget, SLOT(zoom(int))); fViewStateFrame.setDisabled(true); fInspectorWidget.setDisabled(true); fMenuEdit.setDisabled(true); fMenuNavigate.setDisabled(true); fMenuView.setDisabled(true); }