2 * This file is part of jSpeed.
4 * jSpeed is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * jSpeed is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with jSpeed. If not, see <http://www.gnu.org/licenses/>.
19 #include "mainwindowstack.h"
21 MainWindowStack::MainWindowStack(QWidget* parent): WidgetScreen(parent),
26 void MainWindowStack::addScreen(WidgetScreen* screen)
28 screens_.push_back(screen);
29 connect(screen, SIGNAL(minimizePressed()), this, SIGNAL(minimizePressed()));
30 connect(screen, SIGNAL(settingsPressed()), this, SIGNAL(settingsPressed()));
31 connect(screen, SIGNAL(closePressed()), this, SIGNAL(closePressed()));
32 connect(screen, SIGNAL(clicked()), this, SLOT(toggleScreen()));
35 if(currentScreen_ == -1)
41 void MainWindowStack::reArrange()
43 for(int i = 0; i < screens_.size(); i++)
45 screens_.at(i)->reArrange();
49 void MainWindowStack::flip()
51 for(int i = 0; i < screens_.size(); i++)
53 screens_.at(i)->flip();
57 void MainWindowStack::toggleScreen()
59 if(currentScreen_ < 0)
67 if(currentScreen_ >= screens_.size())
73 setCurrentIndex(currentScreen_);