Skip to content

Commit

Permalink
Mobile: reduced the amount of S60 defines to more generic component d…
Browse files Browse the repository at this point in the history
…isabling/platform checks
  • Loading branch information
enricoros committed Jun 6, 2010
1 parent ea4e9f3 commit a73660e
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 19 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/enricomath.h
Expand Up @@ -286,7 +286,7 @@ class Matrix3
#include <math.h>
#include <stdio.h>

#if defined(Q_OS_WIN32) || defined(Q_OS_MAC) || defined(Q_OS_SYMBIAN)
#if !defined(Q_CC_GNU)
//sincos is not defined in win32 and MAC
static inline void sincos(double th, double *s, double *c)
{
Expand Down
25 changes: 18 additions & 7 deletions App/HomeScene.cpp
Expand Up @@ -29,11 +29,11 @@
#if QT_VERSION >= 0x040600
#include <QPropertyAnimation>
#define ANIMATE_PARAM(object, propName, duration, endValue) \
{QPropertyAnimation * ani = new QPropertyAnimation(object, propName, object); \
QPropertyAnimation * ani = new QPropertyAnimation(object, propName, object); \
ani->setEasingCurve(QEasingCurve::OutBack); \
ani->setDuration(duration); \
ani->setEndValue(endValue); \
ani->start(QPropertyAnimation::DeleteWhenStopped);}
ani->start(QPropertyAnimation::DeleteWhenStopped);
#else
#define ANIMATE_PARAM(instance, propName, duration, endValue) \
instance->setProperty(propName, endValue);
Expand Down Expand Up @@ -96,24 +96,27 @@ class HomeLabel : public AbstractContent

void hoverEnterEvent(QGraphicsSceneHoverEvent *)
{
#if !defined(MOBILE_UI)
ANIMATE_PARAM(this, "scale", 300, 1.2);
//ANIMATE_PARAM(this, "rotation", 300, (-20 + (qrand() % 41)));
#endif
}

void hoverLeaveEvent(QGraphicsSceneHoverEvent *)
{
#if !defined(MOBILE_UI)
ANIMATE_PARAM(this, "scale", 300, 1.0);
//ANIMATE_PARAM(this, "rotation", 300, 0.0);
#endif
}

void mousePressEvent(QGraphicsSceneMouseEvent * event)
{
// use an already existing signal.. FIXME!
if (event->button() == Qt::LeftButton) {
#if 0
ANIMATE_PARAM(this, "rotation", 400, 300);
ANIMATE_PARAM(this, "opacity", 500, 0.0);
QTimer::singleShot(300, this, SIGNAL(requestEditing()));
#if defined(MOBILE_UI)
ANIMATE_PARAM(this, "scale", 200, 0.8);
connect(ani, SIGNAL(finished()), this, SIGNAL(requestEditing()));
#else
requestEditing();
#endif
Expand Down Expand Up @@ -172,7 +175,7 @@ HomeScene::HomeScene(QObject * parent)
m_labels.append(newWordcloud);

HomeLabel * newCanvas = new HomeLabel(tr("Create"), QPixmap(":/data/home-newcanvas.png"), this);
connect(newCanvas, SIGNAL(requestEditing()), this, SIGNAL(startCanvas()));
connect(newCanvas, SIGNAL(requestEditing()), this, SLOT(slotStartCanvas()));
newCanvas->setZValue(1.0);
m_labels.append(newCanvas);

Expand Down Expand Up @@ -294,3 +297,11 @@ void HomeScene::slotCreatePencil()
}
#endif
}

void HomeScene::slotStartCanvas()
{
emit startCanvas();

// reset the scale of the pressed button
sender()->setProperty("scale", (qreal)1.0);
}
1 change: 1 addition & 0 deletions App/HomeScene.h
Expand Up @@ -56,6 +56,7 @@ class HomeScene : public AbstractScene

private Q_SLOTS:
void slotCreatePencil();
void slotStartCanvas();
};

#endif
7 changes: 6 additions & 1 deletion App/UrlHistoryBox.cpp
Expand Up @@ -56,7 +56,12 @@ void UrlHistoryBox::changeUrls(const QList<QUrl> & urls, bool delayPreview)
return;

// add buttons
for (int i = 0; i < qMin(5, urls.size()); i++) {
#if defined(MOBILE_UI)
const int maxButtons = 3;
#else
const int maxButtons = 5;
#endif
for (int i = 0; i < qMin(maxButtons, urls.size()); i++) {
const QUrl & url = urls[i];
PixmapButton * button = new PixmapButton(this);
connect(button, SIGNAL(clicked()), this, SLOT(slotClicked()));
Expand Down
2 changes: 1 addition & 1 deletion Canvas/AbstractContent.cpp
Expand Up @@ -135,7 +135,7 @@ void AbstractContent::dispose()
setMirrored(false);

// little rotate animation
#if QT_VERSION >= 0x040600
#if !defined(MOBILE_UI)
QPropertyAnimation * ani = new QPropertyAnimation(this, "rotation");
ani->setEasingCurve(QEasingCurve::InQuad);
ani->setDuration(300);
Expand Down
7 changes: 6 additions & 1 deletion fotowall.pri
Expand Up @@ -22,12 +22,17 @@ include(3rdparty/richtextedit/richtextedit.pri)
include(3rdparty/videocapture/videocapture.pri)

# Translations of the core Fotowall files
!symbian:!simulator: {
!contains(CONFIG, no-translations): {
DEFINES += HAS_TRANSLATIONS

TRANSLATIONS += \
translations/fotowall_de.ts \
translations/fotowall_en.ts \
translations/fotowall_fr.ts \
translations/fotowall_it.ts \
translations/fotowall_pl.ts \
translations/fotowall_pt_BR.ts
} else: {
message("Translations won't be compiled")
DEFINES -= HAS_TRANSLATIONS
}
4 changes: 3 additions & 1 deletion fotowall.pro
Expand Up @@ -21,7 +21,7 @@ QT = core \
xml

# use OpenGL where available
!symbian:contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) {
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) {
QT += opengl
}

Expand All @@ -32,6 +32,8 @@ symbian|simulator: {
CONFIG += no-export
CONFIG += no-likeback
CONFIG += no-webcam
CONFIG += no-translations
QT -= opengl
}

# disable the Webcam source (only stable on linux)
Expand Down
18 changes: 11 additions & 7 deletions main.cpp
Expand Up @@ -19,17 +19,21 @@
#include <QSettings>
#include <QStyle>
#include <QTime>
#include <QTranslator>
#include <QtPlugin>
#include "App/App.h"
#include "App/Settings.h"
#include "Shared/RenderOpts.h"
#include "Shared/VideoProvider.h"

#if defined(MOBILE_UI)
#include "App/MainWindowMobile.h"
#else
#include "App/MainWindow.h"
#endif
#include "App/Settings.h"
#include "Shared/RenderOpts.h"
#include "Shared/VideoProvider.h"

#if defined(HAS_TRANSLATIONS)
#include <QTranslator>
#endif

// init RenderOpts defaults
bool RenderOpts::LastMirrored = true;
Expand All @@ -43,8 +47,8 @@ QColor RenderOpts::hiColor;

int main( int argc, char ** args )
{
#if !defined(Q_OS_MAC) && !defined(Q_OS_SYMBIAN)
// use the Raster GraphicsSystem (but not on OsX and Symbian)
// use the Raster GraphicsSystem on X11
#if defined(Q_WS_X11)
QApplication::setGraphicsSystem("raster");
#endif

Expand All @@ -55,7 +59,7 @@ int main( int argc, char ** args )

qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));

#if !defined(MOBILE_UI)
#if defined(HAS_TRANSLATIONS)
// translate fotowall + default-qt messages
QString locale;
QStringList arguments = app.arguments();
Expand Down

0 comments on commit a73660e

Please sign in to comment.