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 "widgetscreen.h"
20 #include "mainwindowstack.h"
22 MainWindowStack::MainWindowStack(QWidget* parent): WidgetScreen(parent),
27 void MainWindowStack::addScreen(WidgetScreen* screen)
29 screens_.push_back(screen);
30 connect(screen, SIGNAL(minimizePressed()), this, SIGNAL(minimizePressed()));
31 connect(screen, SIGNAL(settingsPressed()), this, SIGNAL(settingsPressed()));
32 connect(screen, SIGNAL(closePressed()), this, SIGNAL(closePressed()));
33 connect(screen, SIGNAL(clicked()), this, SLOT(toggleScreen()));
36 if(currentScreen_ == -1)
42 void MainWindowStack::reArrange()
44 for(int i = 0; i < screens_.size(); i++)
46 screens_.at(i)->reArrange();
50 void MainWindowStack::flip()
52 for(int i = 0; i < screens_.size(); i++)
54 screens_.at(i)->flip();
58 void MainWindowStack::toggleScreen()
60 if(currentScreen_ < 0)
68 if(currentScreen_ >= screens_.size())
74 setCurrentIndex(currentScreen_);