remove whitewidget of kamoso

This commit is contained in:
Ivailo Monev 2015-03-04 07:27:53 +00:00
parent 5c45ccc72d
commit 30797fa9c7
6 changed files with 0 additions and 237 deletions

View file

@ -14,8 +14,6 @@ set(kamoso_SRCS
thumbnailview.cpp
kamoso.cpp
main.cpp
whitewidget.cpp
whitewidgetmanager.cpp
countdownwidget.cpp
webcamwidget.cpp
customDelegate.cpp

View file

@ -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);

View file

@ -1,41 +0,0 @@
/*************************************************************************************
* Copyright (C) 2008-2011 by Aleix Pol <aleixpol@kde.org> *
* Copyright (C) 2008-2011 by Alex Fiestas <alex@eyeos.org> *
* *
* 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 <QPaintEvent>
#include <QPainter>
#include <QTimer>
#include <KLocale>
#include <KWindowSystem>
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! :)"));
}

View file

@ -1,33 +0,0 @@
/*************************************************************************************
* Copyright (C) 2008-2011 by Aleix Pol <aleixpol@gmail.com> *
* Copyright (C) 2008-2011 by Alex Fiestas <alex@eyeos.org> *
* *
* 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 <QWidget>
class WhiteWidget : public QWidget
{
Q_OBJECT
public:
WhiteWidget(QWidget* parent=0);
virtual void paintEvent (QPaintEvent*);
};
#endif //WHITEWIDGET

View file

@ -1,111 +0,0 @@
/*************************************************************************************
* Copyright (C) 2008-2011 by Aleix Pol <aleixpol@kde.org> *
* Copyright (C) 2008-2011 by Alex Fiestas <alex@eyeos.org> *
* *
* 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 <QPaintEvent>
#include <QPainter>
#include <QTimer>
#include <QDesktopWidget>
#include <QApplication>
#include <KDebug>
#include <KLocale>
/**
*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;x<desktopInfo->numScreens();++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();
}

View file

@ -1,45 +0,0 @@
/*************************************************************************************
* Copyright (C) 2008-2011 by Aleix Pol <aleixpol@kde.org> *
* Copyright (C) 2008-2011 by Alex Fiestas <alex@eyeos.org> *
* *
* 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 <QObject>
#include <QDesktopWidget>
#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<WhiteWidget*> whitewidgetList;
QTimer* m_timer;
int m_currentStep;
private slots:
void tick();
};
#endif //WHITEWIDGETMANAGER