diff --git a/kamoso/src/CMakeLists.txt b/kamoso/src/CMakeLists.txt index 81c0cb01..35a7a341 100644 --- a/kamoso/src/CMakeLists.txt +++ b/kamoso/src/CMakeLists.txt @@ -14,8 +14,6 @@ set(kamoso_SRCS thumbnailview.cpp kamoso.cpp main.cpp - whitewidget.cpp - whitewidgetmanager.cpp countdownwidget.cpp webcamwidget.cpp customDelegate.cpp diff --git a/kamoso/src/kamoso.cpp b/kamoso/src/kamoso.cpp index a2369f3a..0d39d0f0 100644 --- a/kamoso/src/kamoso.cpp +++ b/kamoso/src/kamoso.cpp @@ -20,7 +20,6 @@ #include "kamoso.h" #include "thumbnailview.h" -#include "whitewidget.h" #include "webcamwidget.h" #include "countdownwidget.h" #include "settings.h" @@ -28,7 +27,6 @@ #include "ui_pictureConfig.h" #include "ui_mainWidget.h" #include "ui_videoConfig.h" -#include "whitewidgetmanager.h" #include "devicemanager.h" #include "kipiinterface.h" #include "kamosoplugin.h" @@ -158,7 +156,6 @@ Kamoso::Kamoso(QWidget* parent) connect(mainWidgetUi->scrollLeft, SIGNAL(clicked(bool)), SLOT(slotScrollLeft())); connect(mainWidgetUi->scrollRight, SIGNAL(clicked(bool)), SLOT(slotScrollRight())); - whiteWidgetManager = new WhiteWidgetManager(this); mainWidgetUi->thirdRow->addWidget(m_countdown); connect(m_countdown, SIGNAL(finished()), SLOT(takePhoto())); @@ -437,7 +434,6 @@ void Kamoso::takePhoto() org::kde::Solid::PowerManagement power("org.kde.Solid.PowerManagement", "/org/kde/Solid/PowerManagement", QDBusConnection::sessionBus()); brightBack = power.brightness().value(); power.setBrightness(100); - whiteWidgetManager->showAll(); } QTimer::singleShot(1000, this, SLOT(restore())); @@ -468,7 +464,6 @@ void Kamoso::stopCountdown() */ void Kamoso::restore() { - whiteWidgetManager->hideAll(); if(m_flashEnabled) { org::kde::Solid::PowerManagement power("org.kde.Solid.PowerManagement", "/org/kde/Solid/PowerManagement", QDBusConnection::sessionBus()); power.setBrightness(brightBack); diff --git a/kamoso/src/whitewidget.cpp b/kamoso/src/whitewidget.cpp deleted file mode 100644 index 9e526f21..00000000 --- a/kamoso/src/whitewidget.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************************************* - * Copyright (C) 2008-2011 by Aleix Pol * - * Copyright (C) 2008-2011 by Alex Fiestas * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * - *************************************************************************************/ - -#include "whitewidget.h" -#include -#include -#include -#include -#include - -WhiteWidget::WhiteWidget(QWidget* parent) - : QWidget(parent) -{ - setAutoFillBackground(false); -} - - -void WhiteWidget::paintEvent (QPaintEvent* paintEvent) -{ - QPainter painter(this); - - painter.setBrush(Qt::white); - painter.drawRect(paintEvent->rect()); - painter.drawText(paintEvent->rect().center(), i18n("Smile! :)")); -} diff --git a/kamoso/src/whitewidget.h b/kamoso/src/whitewidget.h deleted file mode 100644 index 3557f0f4..00000000 --- a/kamoso/src/whitewidget.h +++ /dev/null @@ -1,33 +0,0 @@ -/************************************************************************************* - * Copyright (C) 2008-2011 by Aleix Pol * - * Copyright (C) 2008-2011 by Alex Fiestas * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * - *************************************************************************************/ - -#ifndef WHITEWIDGET_H -#define WHITEWIDGET_H - -#include - -class WhiteWidget : public QWidget -{ - Q_OBJECT - public: - WhiteWidget(QWidget* parent=0); - virtual void paintEvent (QPaintEvent*); -}; - -#endif //WHITEWIDGET diff --git a/kamoso/src/whitewidgetmanager.cpp b/kamoso/src/whitewidgetmanager.cpp deleted file mode 100644 index be60c404..00000000 --- a/kamoso/src/whitewidgetmanager.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************************* - * Copyright (C) 2008-2011 by Aleix Pol * - * Copyright (C) 2008-2011 by Alex Fiestas * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * - *************************************************************************************/ - -#include "whitewidgetmanager.h" -#include -#include -#include -#include -#include - -#include -#include - -/** -*This class create and manage 1 white widget per screen, creating an unified interface for all of them -*/ -WhiteWidgetManager::WhiteWidgetManager(QWidget* parent) : QObject(parent) -{ - kDebug() << "WhiteWidgetManager has been instanced"; - createWhiteWidgets(); - - //Call tick each 30 ms on showAll call - m_timer = new QTimer(this); - m_currentStep = 0; - - //Maybe we should set it as cons again, but at the moment I'd like the idea to have it variable - //I've also moved it to public scope - m_steps = 10; - - connect(m_timer, SIGNAL(timeout()), SLOT(tick())); -} - -/** -*This method detect the current screens and create one whiteWidget per screen -*/ -void WhiteWidgetManager::createWhiteWidgets() -{ - kDebug() << "Creating whiteWidgets"; - WhiteWidget *whiteWidget; - QDesktopWidget *desktopInfo = qApp->desktop(); - - kDebug() << "Num of whidgets to be created: " << desktopInfo->numScreens(); - for(uchar x=0;xnumScreens();++x) - { - whiteWidget = new WhiteWidget; - whiteWidget->setGeometry(desktopInfo->screenGeometry(x)); - whitewidgetList.append(whiteWidget); - } -} - -/** -*This method show all whiteWidgets, and start the unified Qtimer -*/ -void WhiteWidgetManager::showAll() -{ - WhiteWidget *iteratorWidget; - m_timer->start(30); - - foreach(iteratorWidget,whitewidgetList) - { - iteratorWidget->showFullScreen(); - } -} - -/** -*This method is usually called by timeout, and hide all the whiteWidgets -*/ -void WhiteWidgetManager::hideAll() -{ - WhiteWidget *iteratorWidget; - foreach(iteratorWidget,whitewidgetList) - { - iteratorWidget->hide(); - } -} - -/** -*This slot is called each time that Qtimer each timeout (each 30s) -*/ -void WhiteWidgetManager::tick() -{ - WhiteWidget *iteratorWidget; - m_currentStep=qMin(m_currentStep+1, m_steps); - - foreach(iteratorWidget,whitewidgetList) - { - iteratorWidget->setWindowOpacity(m_currentStep); - } -} - -WhiteWidgetManager::~WhiteWidgetManager() -{ - qDeleteAll(whitewidgetList.begin(),whitewidgetList.end()); - whitewidgetList.clear(); -} diff --git a/kamoso/src/whitewidgetmanager.h b/kamoso/src/whitewidgetmanager.h deleted file mode 100644 index e2e75dd2..00000000 --- a/kamoso/src/whitewidgetmanager.h +++ /dev/null @@ -1,45 +0,0 @@ -/************************************************************************************* - * Copyright (C) 2008-2011 by Aleix Pol * - * Copyright (C) 2008-2011 by Alex Fiestas * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * - *************************************************************************************/ - -#ifndef WHITEWIDGETMANAGER_H -#define WHITEWIDGETMANAGER_H - -#include -#include -#include "whitewidget.h" - -class WhiteWidgetManager : public QObject -{ - Q_OBJECT - public: - WhiteWidgetManager(QWidget* parent=0); - ~WhiteWidgetManager(); - void showAll(); - void hideAll(); - int m_steps; - private: - void createWhiteWidgets(); - QList whitewidgetList; - QTimer* m_timer; - int m_currentStep; - private slots: - void tick(); -}; - -#endif //WHITEWIDGETMANAGER