]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
Merge branch 'master' of ssh.alwaysdata.com:git/diary-mobile
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Wed, 28 May 2014 08:30:13 +0000 (10:30 +0200)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Wed, 28 May 2014 08:30:13 +0000 (10:30 +0200)
Conflicts:
mainwindow.cpp
mainwindow.h

1  2 
QsKineticScroller.cpp
QsKineticScroller.h
android/AndroidManifest.xml
jean_victor_balin_book.png
mainwindow.cpp
mainwindow.h
mainwindow.ui
sax2.cpp
sax2.h
ui.sql

diff --cc QsKineticScroller.cpp
index 129d5e5509739974e2a4fa646af14cf447631f65,129d5e5509739974e2a4fa646af14cf447631f65..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,213 -1,213 +1,0 @@@
--// Copyright (c) 2010, Razvan Petru
--// All rights reserved.
--
--// Redistribution and use in source and binary forms, with or without modification,
--// are permitted provided that the following conditions are met:
--
--// * Redistributions of source code must retain the above copyright notice, this
--//   list of conditions and the following disclaimer.
--// * Redistributions in binary form must reproduce the above copyright notice, this
--//   list of conditions and the following disclaimer in the documentation and/or other
--//   materials provided with the distribution.
--// * The name of the contributors may not be used to endorse or promote products
--//   derived from this software without specific prior written permission.
--
--// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
--// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
--// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
--// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
--// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
--// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
--// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
--// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
--// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
--// OF THE POSSIBILITY OF SUCH DAMAGE.
--
--#include "QsKineticScroller.h"
--#include <QApplication>
--#include <QScrollBar>
--#include <QAbstractScrollArea>
--#include <QMouseEvent>
--#include <QEvent>
--#include <QTimer>
--#include <cstddef> // for NULL
--
--// A number of mouse moves are ignored after a press to differentiate
--// it from a press & drag.
--static const int gMaxIgnoredMouseMoves = 4;
--// The timer measures the drag speed & handles kinetic scrolling. Adjusting
--// the timer interval will change the scrolling speed and smoothness.
--static const int gTimerInterval = 30;
--// The speed measurement is imprecise, limit it so that the scrolling is not
--// too fast.
--static const int gMaxDecelerationSpeed = 30;
--// influences how fast the scroller decelerates
--static const int gFriction = 1;
--
--class QsKineticScrollerImpl
--{
--public:
--   QsKineticScrollerImpl()
--      : scrollArea(NULL)
--      , isPressed(false)
--      , isMoving(false)
--      , lastMouseYPos(0)
--      , lastScrollBarPosition(0)
--      , velocity(0)
--      , ignoredMouseMoves(0)
--      , ignoredMouseActions(0) {}
--
--   void stopMotion()
--   {
--      isMoving = false;
--      velocity = 0;
--      kineticTimer.stop();
--   }
--
--   QAbstractScrollArea* scrollArea;
--   bool isPressed;
--   bool isMoving;
--   QPoint lastPressPoint;
--   int lastMouseYPos;
--   int lastScrollBarPosition;
--   int velocity;
--   int ignoredMouseMoves;
--   int ignoredMouseActions;
--   QTimer kineticTimer;
--};
--
--QsKineticScroller::QsKineticScroller(QObject *parent)
--   : QObject(parent)
--   , d(new QsKineticScrollerImpl)
--{
--   connect(&d->kineticTimer, SIGNAL(timeout()), SLOT(onKineticTimerElapsed()));
--}
--
--// needed by smart pointer
--QsKineticScroller::~QsKineticScroller()
--{
--}
--
--void QsKineticScroller::enableKineticScrollFor(QAbstractScrollArea* scrollArea)
--{
--   if( !scrollArea )
--   {
--      Q_ASSERT_X(0, "kinetic scroller", "missing scroll area");
--      return;
--   }
--
--   // remove existing association
--   if( d->scrollArea )
--   {
--      d->scrollArea->viewport()->removeEventFilter(this);
--      d->scrollArea->removeEventFilter(this);
--      d->scrollArea = NULL;
--   }
--
--   // associate
--   scrollArea->installEventFilter(this);
--   scrollArea->viewport()->installEventFilter(this);
--   d->scrollArea = scrollArea;
--}
--
--//! intercepts mouse events to make the scrolling work
--bool QsKineticScroller::eventFilter(QObject* object, QEvent* event)
--{
--   const QEvent::Type eventType = event->type();
--   const bool isMouseAction = QEvent::MouseButtonPress == eventType
--      || QEvent::MouseButtonRelease == eventType;
--   const bool isMouseEvent = isMouseAction || QEvent::MouseMove == eventType;
--   if( !isMouseEvent || !d->scrollArea )
--     return false;
--   if( isMouseAction && d->ignoredMouseActions-- > 0 ) // don't filter simulated click
--     return false;
--
--   QMouseEvent* const mouseEvent = static_cast<QMouseEvent*>(event);
--   switch( eventType )
--   {
--   case QEvent::MouseButtonPress:
--      {
--         d->isPressed = true;
--         d->lastPressPoint = mouseEvent->pos();
--         d->lastScrollBarPosition = d->scrollArea->verticalScrollBar()->value();
--         if( d->isMoving ) // press while kinetic scrolling, so stop
--            d->stopMotion();
--      }
--      break;
--   case QEvent::MouseMove:
--      {
--         if( !d->isMoving )
--         {
--            // A few move events are ignored as "click jitter", but after that we
--            // assume that the user is doing a click & drag
--            if( d->ignoredMouseMoves < gMaxIgnoredMouseMoves )
--               ++d->ignoredMouseMoves;
--            else
--            {
--               d->ignoredMouseMoves = 0;
--               d->isMoving = true;
--               d->lastMouseYPos = mouseEvent->pos().y();
--               if( !d->kineticTimer.isActive() )
--                  d->kineticTimer.start(gTimerInterval);
--            }
--         }
--         else
--         {
--            // manual scroll
--            const int dragDistance = mouseEvent->pos().y() - d->lastPressPoint.y();
--            d->scrollArea->verticalScrollBar()->setValue(
--               d->lastScrollBarPosition - dragDistance);
--         }
--      }
--      break;
--   case QEvent::MouseButtonRelease:
--      {
--         d->isPressed = false;
--         // Looks like the user wanted a single click. Simulate the click,
--         // as the events were already consumed
--         if( !d->isMoving )
--         {
--            QMouseEvent* mousePress = new QMouseEvent(QEvent::MouseButtonPress,
--               d->lastPressPoint, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
--            QMouseEvent* mouseRelease = new QMouseEvent(QEvent::MouseButtonRelease,
--               d->lastPressPoint, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
--
--            d->ignoredMouseActions = 2;
--            QApplication::postEvent(object, mousePress);
--            QApplication::postEvent(object, mouseRelease);
--         }
--      }
--      break;
--   default:
--      break;
--   }
--
--   return true; // filter event
--}
--
--void QsKineticScroller::onKineticTimerElapsed()
--{
--   if( d->isPressed && d->isMoving )
--   {
--      // the speed is measured between two timer ticks
--      const int cursorYPos = d->scrollArea->mapFromGlobal(QCursor::pos()).y();
--      d->velocity = cursorYPos - d->lastMouseYPos;
--      d->lastMouseYPos = cursorYPos;
--   }
--   else if( !d->isPressed && d->isMoving )
--   {
--      // use the previously recorded speed and gradually decelerate
--      d->velocity = qBound(-gMaxDecelerationSpeed, d->velocity, gMaxDecelerationSpeed);
--      if( d->velocity > 0 )
--         d->velocity -= gFriction;
--      else if( d->velocity < 0 )
--         d->velocity += gFriction;
--      if( qAbs(d->velocity) < qAbs(gFriction) )
--         d->stopMotion();
--
--      const int scrollBarYPos = d->scrollArea->verticalScrollBar()->value();
--      d->scrollArea->verticalScrollBar()->setValue(scrollBarYPos - d->velocity);
--   }
--   else
--      d->stopMotion();
--}
diff --cc QsKineticScroller.h
index 41c0da76083b8bc92abe9edb044689c0ab009165,41c0da76083b8bc92abe9edb044689c0ab009165..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,56 -1,56 +1,0 @@@
--// Copyright (c) 2010, Razvan Petru
--// All rights reserved.
--
--// Redistribution and use in source and binary forms, with or without modification,
--// are permitted provided that the following conditions are met:
--
--// * Redistributions of source code must retain the above copyright notice, this
--//   list of conditions and the following disclaimer.
--// * Redistributions in binary form must reproduce the above copyright notice, this
--//   list of conditions and the following disclaimer in the documentation and/or other
--//   materials provided with the distribution.
--// * The name of the contributors may not be used to endorse or promote products
--//   derived from this software without specific prior written permission.
--
--// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
--// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
--// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
--// IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
--// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
--// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
--// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
--// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
--// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
--// OF THE POSSIBILITY OF SUCH DAMAGE.
--
--#ifndef QSKINETICSCROLLER_H
--#define QSKINETICSCROLLER_H
--
--#include <QObject>
--#include <QScopedPointer>
--class QsKineticScrollerImpl;
--class QAbstractScrollArea;
--class QEvent;
--
--//! Vertical kinetic scroller implementation without overshoot and bouncing.
--//! A temporary solution to get kinetic-like scrolling on Symbian.
--class QsKineticScroller: public QObject
--{
--   Q_OBJECT
--public:
--   QsKineticScroller(QObject* parent = 0);
--   ~QsKineticScroller();
--   //! enabled for one widget only, new calls remove previous association
--   void enableKineticScrollFor(QAbstractScrollArea* scrollArea);
--
--protected:
--   bool eventFilter(QObject* object, QEvent* event);
--
--private slots:
--   void onKineticTimerElapsed();
--
--private:
--   QScopedPointer<QsKineticScrollerImpl> d;
--};
--
--#endif // QSKINETICSCROLLER_H
diff --cc android/AndroidManifest.xml
index 0b52f9eda08b4e99f988ec77aa522c0e357f257b,0b52f9eda08b4e99f988ec77aa522c0e357f257b..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,48 -1,48 +1,0 @@@
--<?xml version="1.0"?>
--<manifest android:versionCode="1" android:versionName="0.2" package="eu.nothing2do.diarymobile" xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
--    <application android:label="diary-mobile" android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:icon="@drawable/icon">
--        <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" android:screenOrientation="unspecified" android:label="@string/app_name" android:launchMode="singleTop" android:name="org.qtproject.qt5.android.bindings.QtActivity">
--            <intent-filter>
--                <action android:name="android.intent.action.MAIN"/>
--                <category android:name="android.intent.category.LAUNCHER"/>
--            </intent-filter>
--            <meta-data android:value="diary-mobile" android:name="android.app.lib_name"/>
--            <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
--            <meta-data android:value="default" android:name="android.app.repository"/>
--            <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
--            <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
--            <!-- Deploy Qt libs as part of package -->
--            <meta-data android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --" android:name="android.app.bundle_local_qt_libs"/>
--            <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
--            <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
--            <!-- Run with local libs -->
--            <meta-data android:value="-- %%USE_LOCAL_QT_LIBS%% --" android:name="android.app.use_local_qt_libs"/>
--            <meta-data android:value="/data/local/tmp/qt/" android:name="android.app.libs_prefix"/>
--            <meta-data android:value="-- %%INSERT_LOCAL_LIBS%% --" android:name="android.app.load_local_libs"/>
--            <meta-data android:value="-- %%INSERT_LOCAL_JARS%% --" android:name="android.app.load_local_jars"/>
--            <meta-data android:value="-- %%INSERT_INIT_CLASSES%% --" android:name="android.app.static_init_classes"/>
--            <!--  Messages maps -->
--            <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
--            <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
--            <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
--            <!--  Messages maps -->
--            <!-- Splash screen -->
--            <!--
--            <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/>
--            -->
--            <!-- Splash screen -->
--        </activity>
--    </application>
--    <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="17"/>
--    <supports-screens android:anyDensity="true" android:normalScreens="true" android:smallScreens="true" android:largeScreens="true"/>
--    <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
--         Remove the comment if you do not require these default permissions. -->
--    <!-- %%INSERT_PERMISSIONS -->
--    <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
--         Remove the comment if you do not require these default features. -->
--    <!-- %%INSERT_FEATURES -->
--    <uses-permission android:name="android.permission.INTERNET"/>
--    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
--    <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
--<uses-permission android:name="android.permission.BIND_INPUT_METHOD"/>
--</manifest>
diff --cc jean_victor_balin_book.png
index 962ad3a6a852ea9d19d860a93e79ba47cdd0686c,962ad3a6a852ea9d19d860a93e79ba47cdd0686c..0000000000000000000000000000000000000000
deleted file mode 100644,100644
Binary files differ
diff --cc mainwindow.cpp
index 32f584a58dcb7c042058076e940768a7373784cb,fd81620627bd03f072678b0a2b29278d0c2e8522..6919dd7eb386a691b74e034aed1d891ed1017070
@@@ -322,10 -366,10 +366,14 @@@ void MainWindow::firstrun()
      conf->setValue(QString("getbuttons"), QVariant("select label,action from ui where keyword like ? order by label;"));
      conf->setValue(QString("editbuttons"), QVariant("select id,keyword,label,action from ui where id=?;"));
      conf->setValue(QString("updatebuttons"), QVariant("update ui set keyword=?, label=?, action=? where id=?;"));
-     conf->setValue(QString("deletebuttons"), QVariant("delete from ui where id=?"));
+     conf->setValue(QString("deletebutton"), QVariant("delete from ui where id=?"));
      conf->setValue(QString("testbuttons"), QVariant("select id,keyword from ui where label=? and action=?;"));
      conf->setValue(QString("volumdown"), QVariant("back"));
++<<<<<<< HEAD
 +    conf->setValue(QString("volumup"), QVariant("Montpellier"));
++=======
+     conf->setValue(QString("volumup"), QVariant("begin"));
++>>>>>>> 388baafb8a2a686f467cd1605a7ba5037fb1fe0c
      qDebug()<<"firstrun() finished";
  }
  QString &MainWindow::get(int row, int column){
@@@ -563,6 -605,39 +609,42 @@@ void MainWindow::readButtons(const QByt
          qDebug()<<"q->exec() : "<<q->exec()<<" lastError()="<<q->lastError();
  
      };
++<<<<<<< HEAD
++=======
+     /*QDomDocument a("buttons");
+     if (!a.setContent(in)){
+             qDebug()<<"a.setcontent failed";
+             return;
+     }
+     QDomElement root = a.documentElement();
+     QDomNode n = root.firstChild();
+     QList<QString> cmd;
+     while(!n.isNull()) {
+         QDomNode e = n.firstChild();
+         //if((cmd.size()<1)&&(n.isText()))e.toText().nodeValue();
+         qDebug()<<"n.nodeName()="<<n.nodeName()<<" e.nodevalue="<<qPrintable(e.nodeValue());
+         if(e.nodeName()=="sql"){
+             cmd.insert(0, e.nodeValue());
+             qDebug()<<"cmd[0]="<<cmd[0];
+             }
+         else if(e.nodeName()=="b"){
+             QDomNode f=e.firstChild();
+             while(!f.isNull()){
+                 qDebug()<<"f.nodeName()="<<f.nodeName()<<" e.nodeValue()="<<qPrintable(e.nodeValue())<<" e.nodeType()="<<e.nodeType();
+                 f=f.nextSibling();
+             }
+         }
+         while(!e.isNull()){
+             qDebug()<<"e.nodeName = "<<e.nodeName()<<" e.nodevalue="<<e.nodeValue();
+             e=e.nextSibling();
+             }
+         n=n.nextSibling();
+         }*/
++>>>>>>> 388baafb8a2a686f467cd1605a7ba5037fb1fe0c
      db.commit();
      flush();
      emit datafilled();
diff --cc mainwindow.h
index 70023c3809ce008f475dbd73f3c8abb55d6838ab,46d3a28e499abf7bfcba27df1651a8298457a882..66eabc82021c2ff978eca373858776dc470d92a8
@@@ -93,8 -118,8 +118,9 @@@ public
      void keyReleaseEvent(QKeyEvent *event);
      explicit MainWindow(QWidget *parent = 0);
      virtual ~MainWindow();
 -    void insertbutton(const QString &, const QString &, const QString &);
 -    void removebutton(const QString &, const QString &, const QString &);
 +    void insertButton(const QString &, const QString &, const QString &);
 +    void removeButton(const QString &, const QString &, const QString &);
++
      // Note that this will only have an effect on Symbian and Fremantle.
      void setOrientation(ScreenOrientation orientation);
  
diff --cc mainwindow.ui
index 7ebf8731b642671b04b67083b2f752144a12ded9,7ebf8731b642671b04b67083b2f752144a12ded9..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,21 -1,21 +1,0 @@@
--<ui version="4.0">
-- <class>MainWindow</class>
-- <widget class="QMainWindow" name="MainWindow" >
--  <property name="geometry" >
--   <rect>
--    <x>0</x>
--    <y>0</y>
--    <width>800</width>
--    <height>480</height>
--   </rect>
--  </property>
--  <property name="windowTitle" >
--   <string>MainWindow</string>
--  </property>
--  <widget class="QWidget" name="centralWidget" />
-- </widget>
-- <layoutDefault spacing="6" margin="11" />
-- <pixmapfunction></pixmapfunction>
-- <resources/>
-- <connections/>
--</ui>
diff --cc sax2.cpp
index 738676fbe345e100547613233fca459305a97c49,738676fbe345e100547613233fca459305a97c49..0000000000000000000000000000000000000000
deleted file mode 100644,100644
+++ /dev/null
@@@ -1,14 -1,14 +1,0 @@@
--#include "sax2.h"
--
--sax2::sax2() :
--    QXmlSimpleReader()
--{
--    reader.setContentHandler(&handler);
--    reader.setErrorHandler(&handler);
--
--}
--bool sax2::parse(const QByteArray &input){
--
--
--
--}
diff --cc sax2.h
index f146750f6115c68bec942b0366f27c76e5ef1117,f146750f6115c68bec942b0366f27c76e5ef1117..0000000000000000000000000000000000000000
deleted file mode 100644,100644
--- 1/sax2.h
--- 2/sax2.h
+++ /dev/null
@@@ -1,24 -1,24 +1,0 @@@
--#ifndef SAX2_H
--#define SAX2_H
--
--#include <QtXml/QXmlSimpleReader>
--
--class sax2 : public QXmlSimpleReader
--{
--    Q_OBJECT
--    //QByteArray data;
--    QXmlSimpleReader reader;
--    QXmlDefaultHandler handler;
--    QXmlInputSource source;
--
--
--public:
--    explicit sax2();
--    bool parse(const QByteArray &input);
--signals:
--
--public slots:
--
--};
--
--#endif // SAX2_H
diff --cc ui.sql
index e4beea6eb0db93faefd848af6bd2f26b40bc8f27,e4beea6eb0db93faefd848af6bd2f26b40bc8f27..0000000000000000000000000000000000000000
deleted file mode 100644,100644
--- 1/ui.sql
--- 2/ui.sql
+++ /dev/null
@@@ -1,22 -1,22 +1,0 @@@
--INSERT INTO ui (keyword,label,action) VALUES(?,?,?);
--begin$config$config
--menuback$config$config
--menuback$help$main help
--config$max column$setint maxcolumn
--config$host$settext host
--config$port$setint port
--config$user$settext user
--config$password$settext pass
--config$database$settext database
--config$filesave$settext file
--config$SQLsettings$settext SQLsettings
--config$button$settext button
--config$download$settext download
--config$uploadDB$settext uploadRAW
--config$uploadUi$settext uploadUi
--config$start$settext start
--config$DB file$settext db
--config$restore DB$settext restore
--config$selectraw$settext selectraw
--config$menu$settext menuback
--main help$action$box action can be : set #1 #2, settext #1, setint #1, setfile #1, box #, quit, # (getbuttons), clear (way clear)