MNE-CPP  beta 1.0
mainwindow.cpp
Go to the documentation of this file.
1 //=============================================================================================================
43 //*************************************************************************************************************
44 //=============================================================================================================
45 // INCLUDES
46 //=============================================================================================================
47 
48 #include "mainwindow.h"
49 #include "ui_mainwindow.h"
50 #include "viewerwidget.h"
51 
52 //*************************************************************************************************************
53 //=============================================================================================================
54 // DEFINE MEMBER METHODS
55 //=============================================================================================================
56 
57 
58 MainWindow::MainWindow(QWidget *parent)
59 : QMainWindow(parent)
60 , ui(new Ui::MainWindow)
61 {
62  ui->setupUi(this);
63  this->setWindowState(Qt::WindowMaximized);
64  //Instance of ViewerWIdget
65  m_viewerWidget = new ViewerWidget(this);
66  this->setCentralWidget(m_viewerWidget);
67  //Dock windows
68  CreateDockWindows();
69 }
70 
71 //*************************************************************************************************************
72 
73 MainWindow::~MainWindow()
74 {
75  delete ui;
76 }
77 
78 //*************************************************************************************************************
79 
80 void MainWindow::on_actionAbout_triggered()
81 {
82  //AboutWindow pops up with info about the software
83  m_about = new AboutWindow();
84  m_about->show();
85 }
86 
87 //*************************************************************************************************************
88 
89 void MainWindow::on_actionCascade_triggered()
90 {
91  //Since we need to acces some private attributes from ViewerWIdget, we need a method to do it
92  //Used to arrange the subwindows that contains the surfaces and 2D plots, in a Cascade mode
93  this->m_viewerWidget->CascadeSubWindows();
94 }
95 
96 //*************************************************************************************************************
97 
98 void MainWindow::on_actionTile_triggered()
99 {
100  //Since we need to acces some private attributes from ViewerWIdget, we need a method to do it
101  //Used to arrange the subwindows that contains the surfaces and 2D plots, in a Tile mode
102  this->m_viewerWidget->TileSubWindows();
103 }
104 
105 //*************************************************************************************************************
106 
107 void MainWindow::on_actionOpen_data_file_triggered()
108 {
109  //Open a FIFF file
110 
111  //Get the path
112  m_fiffFileName = QFileDialog::getOpenFileName(this,
113  ("Open File"),
114  "C:/",
115  ("fiff File(*.fiff)"));
116  //Open file
117  QFile m_fiffFile(m_fiffFileName);
118 }
119 
120 //*************************************************************************************************************
121 
122 void MainWindow::CreateDockWindows()
123 {
124  //
125  //Layers DockWidget
126  //
127  m_layersDock = new QDockWidget(tr("Layers"), this);
128  m_layersDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
129  addDockWidget(Qt::RightDockWidgetArea,m_layersDock);
130  m_layersDock->setMinimumWidth(128);
131  m_layersDock->setMinimumHeight(128);
132 
133  //
134  //Information DockWidget
135  //
136  m_informationDock = new QDockWidget(tr("Information"), this);
137  m_informationDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
138  addDockWidget(Qt::RightDockWidgetArea,m_informationDock);
139  m_informationDock->setMinimumWidth(128);
140 
141 }
142 
143 //*************************************************************************************************************
144 
145 void MainWindow::on_actionReload_surfaces_triggered()
146 {
147  //m_viewerWidget->ReloadSurfaces();
148 }
Definition: aboutwindow.h:52