Skip to content
This repository
Browse code

Added a bunch of stuff

  • Loading branch information...
commit 7f4d1112ecdcfd69fa8ffc7372a60b4c6c1715da 1 parent 46cdf9b
Janne Pulkkinen authored November 12, 2011
59  ImageViewer/Base.cpp
@@ -19,12 +19,21 @@ Base::Base(QWidget *parent) :
19 19
     checkSettings();
20 20
 }
21 21
 
  22
+void Base::quitApplication()
  23
+{
  24
+    settings->sync();
  25
+
  26
+    QApplication::quit();
  27
+}
  28
+
22 29
 void Base::checkSettings()
23 30
 {
24 31
     if (settings->contains("main/imageFolder") == false)
25 32
     {
26 33
         settings->setValue("main/imageFolder", QString("nothing"));
27 34
         settings->setValue("main/resizeToFit", true);
  35
+        settings->setValue("main/showScrollIndicators", false);
  36
+        settings->setValue("main/backgroundColor", "black");
28 37
 
29 38
         settings->sync();
30 39
     }
@@ -33,6 +42,9 @@ void Base::checkSettings()
33 42
         QMetaObject::invokeMethod(viewer.rootObject(), "selectFolder", Q_ARG(QVariant, folderString));
34 43
         QMetaObject::invokeMethod(viewer.rootObject(), "selectSettingsFolder", Q_ARG(QVariant, settings->value("main/imageFolder").toString()));
35 44
         QMetaObject::invokeMethod(viewer.rootObject(), "selectResizeToFit", Q_ARG(QVariant, settings->value("main/resizeToFit").toBool()));
  45
+        QMetaObject::invokeMethod(viewer.rootObject(), "showScrollIndicators", Q_ARG(QVariant, settings->value("main/showScrollIndicators").toBool()));
  46
+        QMetaObject::invokeMethod(viewer.rootObject(), "setBGColor", Q_ARG(QVariant, settings->value("main/backgroundColor").toString()));
  47
+
36 48
         checkDirectory();
37 49
     }
38 50
     return;
@@ -64,6 +76,20 @@ void Base::changeFitToScreen(bool fitToScreen)
64 76
     checkSettings();
65 77
 }
66 78
 
  79
+void Base::changeScrollIndicators(bool showScrollIndicators)
  80
+{
  81
+    settings->setValue("main/showScrollIndicators", showScrollIndicators);
  82
+    settings->sync();
  83
+    checkSettings();
  84
+}
  85
+
  86
+void Base::changeBGColor(QString bgColor)
  87
+{
  88
+    settings->setValue("main/backgroundColor", bgColor);
  89
+    settings->sync();
  90
+    checkSettings();
  91
+}
  92
+
67 93
 void Base::getImageID(QString imageName)
68 94
 {
69 95
     int count = 1;
@@ -92,7 +118,9 @@ void Base::nextImage(QString imageName)
92 118
 
93 119
     while(true)
94 120
     {
95  
-        if (images[count].isNull()) break;
  121
+        if (images[count].isNull()) {
  122
+            break;
  123
+        }
96 124
         if (images[count] == imageName)
97 125
         {
98 126
             index = count;
@@ -106,6 +134,13 @@ void Base::nextImage(QString imageName)
106 134
     QString fileName = images[count+1];
107 135
     int nextIndex = index + 1;
108 136
 
  137
+    if (images[count] == imageName && images[count+1].isNull())
  138
+    {
  139
+        nextIndex = 1;
  140
+        fileName = images[1];
  141
+        QMetaObject::invokeMethod(viewer.rootObject(), "showImage", Q_ARG(QVariant, fileName), Q_ARG(QVariant, nextIndex));
  142
+        return;
  143
+    }
109 144
     if (fileName.isEmpty()) return;
110 145
 
111 146
     QMetaObject::invokeMethod(viewer.rootObject(), "showImage", Q_ARG(QVariant, fileName), Q_ARG(QVariant, nextIndex));
@@ -130,11 +165,29 @@ void Base::previousImage(QString imageName)
130 165
     }
131 166
 
132 167
     QString fileName = images[count-1];
133  
-    int nextIndex = index - 1;
  168
+    int previousIndex = index - 1;
134 169
 
  170
+    if (previousIndex < 1)
  171
+    {
  172
+        count = images.size();
  173
+        while (true)
  174
+        {
  175
+            if (images[count].isNull())
  176
+            {
  177
+                count--;
  178
+            }
  179
+            else {
  180
+                break;
  181
+            }
  182
+        }
  183
+        previousIndex = count;
  184
+        fileName = images[previousIndex];
  185
+        QMetaObject::invokeMethod(viewer.rootObject(), "showImage", Q_ARG(QVariant, fileName), Q_ARG(QVariant, previousIndex));
  186
+        return;
  187
+    }
135 188
     if (fileName.isEmpty()) return;
136 189
 
137  
-    QMetaObject::invokeMethod(viewer.rootObject(), "showImage", Q_ARG(QVariant, fileName), Q_ARG(QVariant, nextIndex));
  190
+    QMetaObject::invokeMethod(viewer.rootObject(), "showImage", Q_ARG(QVariant, fileName), Q_ARG(QVariant, previousIndex));
138 191
 }
139 192
 
140 193
 void Base::checkDirectory()
4  ImageViewer/Base.h
@@ -34,6 +34,8 @@ class Base : public QWidget
34 34
 signals:
35 35
 
36 36
 public slots:
  37
+    void quitApplication();
  38
+
37 39
     void checkSettings();
38 40
 
39 41
     void nextImage(QString);
@@ -45,6 +47,8 @@ public slots:
45 47
     void selectFolder();
46 48
 
47 49
     void changeFitToScreen(bool);
  50
+    void changeScrollIndicators(bool);
  51
+    void changeBGColor(QString);
48 52
 
49 53
     void getImageID(QString);
50 54
 };
2  ImageViewer/ImageViewer.loc
... ...
@@ -1,5 +1,5 @@
1 1
 // ============================================================================
2  
-// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-09-02T21:55:39
  2
+// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-12T16:43:29
3 3
 // * This file is generated by qmake and should not be modified by the
4 4
 // * user.
5 5
 // ============================================================================
2  ImageViewer/ImageViewer.pro
@@ -59,3 +59,5 @@ OTHER_FILES += \
59 59
 HEADERS += \
60 60
     Base.h \
61 61
     MediakeyCaptureItem.h
  62
+
  63
+
22  ImageViewer/ImageViewer.pro.user
... ...
@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE QtCreatorProject>
3  
-<!-- Written by Qt Creator 2.3.0, 2011-09-04T11:12:05. -->
  3
+<!-- Written by Qt Creator 2.3.0, 2011-11-12T17:42:34. -->
4 4
 <qtcreator>
5 5
  <data>
6 6
   <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -91,7 +91,7 @@
91 91
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
92 92
    <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
93 93
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
94  
-    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">Qt4ProjectManager.ToolChain.Maemo:d:/qtsdk/madde/targets/harmattan-platform-api/bin/gcc.unknown-unknown-unknown-unknown-unknown.D:/QtSDK/pythongdb/python_2.7based/gdb-arm-none-linux-gnueabi.exe</value>
  94
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">INVALID</value>
95 95
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
96 96
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
97 97
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
@@ -137,11 +137,11 @@
137 137
     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
138 138
     <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
139 139
     <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">D:/QtSDK/Projects/ImageViewer</value>
140  
-    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">41</value>
  140
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">-1</value>
141 141
     <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
142 142
    </valuemap>
143 143
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
144  
-    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">Qt4ProjectManager.ToolChain.Maemo:d:/qtsdk/madde/targets/harmattan-platform-api/bin/gcc.unknown-unknown-unknown-unknown-unknown.D:/QtSDK/pythongdb/python_2.7based/gdb-arm-none-linux-gnueabi.exe</value>
  144
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">INVALID</value>
145 145
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
146 146
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
147 147
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
@@ -187,7 +187,7 @@
187 187
     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
188 188
     <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
189 189
     <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">D:/QtSDK/Projects/ImageViewer</value>
190  
-    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">41</value>
  190
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">-1</value>
191 191
     <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
192 192
    </valuemap>
193 193
    <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
@@ -309,7 +309,7 @@
309 309
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
310 310
    <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
311 311
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
312  
-    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Msvc:d:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat::</value>
  312
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">INVALID</value>
313 313
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
314 314
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
315 315
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
@@ -359,7 +359,7 @@
359 359
     <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
360 360
    </valuemap>
361 361
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
362  
-    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Msvc:d:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat::</value>
  362
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">INVALID</value>
363 363
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
364 364
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
365 365
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
@@ -409,7 +409,7 @@
409 409
     <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
410 410
    </valuemap>
411 411
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
412  
-    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Mingw:D:/QtSDK/mingw/bin/g++.exe.x86-windows-msys-pe-32bit.D:/QtSDK/pythongdb/python_2.7based/gdb-i686-pc-mingw32.exe</value>
  412
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">INVALID</value>
413 413
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
414 414
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
415 415
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
@@ -459,7 +459,7 @@
459 459
     <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
460 460
    </valuemap>
461 461
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
462  
-    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Mingw:D:/QtSDK/mingw/bin/g++.exe.x86-windows-msys-pe-32bit.D:/QtSDK/pythongdb/python_2.7based/gdb-i686-pc-mingw32.exe</value>
  462
+    <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">INVALID</value>
463 463
     <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
464 464
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
465 465
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
@@ -772,7 +772,7 @@
772 772
       <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
773 773
       <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
774 774
       <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
775  
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
  775
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">true</value>
776 776
      </valuemap>
777 777
      <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
778 778
       <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
@@ -840,7 +840,7 @@
840 840
     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
841 841
     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.S60DeployConfiguration</value>
842 842
     <value type="int" key="Qt4ProjectManager.S60DeployConfiguration.CommunicationChannel">1</value>
843  
-    <value type="QString" key="Qt4ProjectManager.S60DeployConfiguration.DeviceAddress">169.254.233.75</value>
  843
+    <value type="QString" key="Qt4ProjectManager.S60DeployConfiguration.DeviceAddress">192.168.1.36</value>
844 844
     <value type="QString" key="Qt4ProjectManager.S60DeployConfiguration.DevicePort">1534</value>
845 845
     <value type="QChar" key="Qt4ProjectManager.S60DeployConfiguration.InstallationDriveLetter">C</value>
846 846
     <value type="QString" key="Qt4ProjectManager.S60DeployConfiguration.SerialPortName"></value>
2  ImageViewer/ImageViewer.rss
... ...
@@ -1,5 +1,5 @@
1 1
 // ============================================================================
2  
-// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-09-02T21:55:39
  2
+// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-12T16:43:29
3 3
 // * This file is generated by qmake and should not be modified by the
4 4
 // * user.
5 5
 // ============================================================================
2  ImageViewer/ImageViewer_exe.mmp
... ...
@@ -1,5 +1,5 @@
1 1
 // ==============================================================================
2  
-// Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-09-02T21:55:39
  2
+// Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-12T16:43:29
3 3
 // This file is generated by qmake and should not be modified by the
4 4
 // user.
5 5
 //  Name        : ImageViewer_exe.mmp
2  ImageViewer/ImageViewer_installer.pkg
... ...
@@ -1,4 +1,4 @@
1  
-; D:/QtSDK/Projects/ImageViewer//ImageViewer_installer.pkg generated by qmake at 2011-09-02T21:55:39
  1
+; D:/QtSDK/Projects/ImageViewer//ImageViewer_installer.pkg generated by qmake at 2011-11-12T16:43:29
2 2
 ; This file is generated by qmake and should not be modified by the user
3 3
 ;
4 4
 
2  ImageViewer/ImageViewer_reg.rss
... ...
@@ -1,5 +1,5 @@
1 1
 // ============================================================================
2  
-// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-09-02T21:55:39
  2
+// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-12T16:43:29
3 3
 // * This file is generated by qmake and should not be modified by the
4 4
 // * user.
5 5
 // ============================================================================
3  ImageViewer/ImageViewer_stub.pkg
... ...
@@ -1,4 +1,4 @@
1  
-; D:/QtSDK/Projects/ImageViewer//ImageViewer_stub.pkg generated by qmake at 2011-09-02T21:55:39
  1
+; D:/QtSDK/Projects/ImageViewer//ImageViewer_stub.pkg generated by qmake at 2011-11-12T16:43:29
2 2
 ; This file is generated by qmake and should not be modified by the user
3 3
 ;
4 4
 
@@ -30,6 +30,7 @@
30 30
 "" - "z:\private\e6a3ea2d\qml\ImageViewer\gfx\arrow_left.png"
31 31
 "" - "z:\private\e6a3ea2d\qml\ImageViewer\gfx\arrow_right.png"
32 32
 "" - "z:\private\e6a3ea2d\qml\ImageViewer\gfx\back_to_grid.png"
  33
+"" - "z:\private\e6a3ea2d\qml\ImageViewer\gfx\information.png"
33 34
 "" - "z:\private\e6a3ea2d\qml\ImageViewer\gfx\zoom_down.png"
34 35
 "" - "z:\private\e6a3ea2d\qml\ImageViewer\gfx\zoom_up.png"
35 36
 "" - "z:\private\e6a3ea2d\qml\ImageViewer\GridList.qml"
3  ImageViewer/ImageViewer_template.pkg
... ...
@@ -1,4 +1,4 @@
1  
-; D:/QtSDK/Projects/ImageViewer//ImageViewer_template.pkg generated by qmake at 2011-09-02T21:55:39
  1
+; D:/QtSDK/Projects/ImageViewer//ImageViewer_template.pkg generated by qmake at 2011-11-12T16:43:29
2 2
 ; This file is generated by qmake and should not be modified by the user
3 3
 ;
4 4
 
@@ -34,6 +34,7 @@
34 34
 "D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/data/z/private/e6a3ea2d/qml/ImageViewer/gfx/arrow_left.png" - "!:\private\e6a3ea2d\qml\ImageViewer\gfx\arrow_left.png"
35 35
 "D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/data/z/private/e6a3ea2d/qml/ImageViewer/gfx/arrow_right.png" - "!:\private\e6a3ea2d\qml\ImageViewer\gfx\arrow_right.png"
36 36
 "D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/data/z/private/e6a3ea2d/qml/ImageViewer/gfx/back_to_grid.png" - "!:\private\e6a3ea2d\qml\ImageViewer\gfx\back_to_grid.png"
  37
+"D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/data/z/private/e6a3ea2d/qml/ImageViewer/gfx/information.png" - "!:\private\e6a3ea2d\qml\ImageViewer\gfx\information.png"
37 38
 "D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/data/z/private/e6a3ea2d/qml/ImageViewer/gfx/zoom_down.png" - "!:\private\e6a3ea2d\qml\ImageViewer\gfx\zoom_down.png"
38 39
 "D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/data/z/private/e6a3ea2d/qml/ImageViewer/gfx/zoom_up.png" - "!:\private\e6a3ea2d\qml\ImageViewer\gfx\zoom_up.png"
39 40
 "D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/data/z/private/e6a3ea2d/qml/ImageViewer/GridList.qml" - "!:\private\e6a3ea2d\qml\ImageViewer\GridList.qml"
2  ImageViewer/Makefile
... ...
@@ -1,6 +1,6 @@
1 1
 #############################################################################
2 2
 # Makefile for building: ImageViewer
3  
-# Generated by qmake (2.01a) (Qt 4.7.3) on: pe 2. syys 21:55:39 2011
  3
+# Generated by qmake (2.01a) (Qt 4.7.3) on: la 12. marras 16:43:29 2011
4 4
 # Project:  ImageViewer.pro
5 5
 # Template: app
6 6
 # Command: d:\qtsdk\symbian\sdks\symbian3qt473\bin\qmake.exe -spec ..\..\Symbian\SDKs\Symbian3Qt473\mkspecs\symbian-sbsv2 CONFIG+=release -after  OBJECTS_DIR=obj MOC_DIR=moc UI_DIR=ui RCC_DIR=rcc -o bld.inf ImageViewer.pro
10  ImageViewer/bld.inf
... ...
@@ -1,6 +1,6 @@
1 1
 // ============================================================================
2 2
 // * Makefile for building: ImageViewer
3  
-// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-09-02T21:55:39
  3
+// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-12T16:43:29
4 4
 // * This file is generated by qmake and should not be modified by the
5 5
 // * user.
6 6
 // * Project:  ImageViewer.pro
@@ -51,6 +51,10 @@ OPTION DEPLOY_SOURCE d:/QtSDK/Projects/ImageViewer/qml/ImageViewer/gfx/back_to_g
51 51
 OPTION DEPLOY_TARGET d:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/winscw/c/private/e6a3ea2d/qml/ImageViewer/gfx/back_to_grid.png
52 52
 END
53 53
 START EXTENSION qt/qmake_emulator_deployment
  54
+OPTION DEPLOY_SOURCE d:/QtSDK/Projects/ImageViewer/qml/ImageViewer/gfx/information.png
  55
+OPTION DEPLOY_TARGET d:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/winscw/c/private/e6a3ea2d/qml/ImageViewer/gfx/information.png
  56
+END
  57
+START EXTENSION qt/qmake_emulator_deployment
54 58
 OPTION DEPLOY_SOURCE d:/QtSDK/Projects/ImageViewer/qml/ImageViewer/gfx/zoom_down.png
55 59
 OPTION DEPLOY_TARGET d:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/winscw/c/private/e6a3ea2d/qml/ImageViewer/gfx/zoom_down.png
56 60
 END
@@ -88,6 +92,10 @@ OPTION DEPLOY_SOURCE d:/QtSDK/Projects/ImageViewer/qml/ImageViewer/gfx/back_to_g
88 92
 OPTION DEPLOY_TARGET d:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/data/z/private/e6a3ea2d/qml/ImageViewer/gfx/back_to_grid.png
89 93
 END
90 94
 START EXTENSION qt/qmake_emulator_deployment
  95
+OPTION DEPLOY_SOURCE d:/QtSDK/Projects/ImageViewer/qml/ImageViewer/gfx/information.png
  96
+OPTION DEPLOY_TARGET d:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/data/z/private/e6a3ea2d/qml/ImageViewer/gfx/information.png
  97
+END
  98
+START EXTENSION qt/qmake_emulator_deployment
91 99
 OPTION DEPLOY_SOURCE d:/QtSDK/Projects/ImageViewer/qml/ImageViewer/gfx/zoom_down.png
92 100
 OPTION DEPLOY_TARGET d:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/data/z/private/e6a3ea2d/qml/ImageViewer/gfx/zoom_down.png
93 101
 END
5  ImageViewer/qml/ImageViewer/GridList.qml
@@ -29,6 +29,11 @@ Page {
29 29
 
30 30
         highlightFollowsCurrentItem: true
31 31
 
  32
+        ScrollDecorator {
  33
+            id: scrollDecorator
  34
+            flickableItem: gridView
  35
+        }
  36
+
32 37
         FolderListModel {
33 38
             id: folderModel
34 39
             nameFilters: ["*.jpg", "*.png", "*.gif", "*.jpeg"]
136  ImageViewer/qml/ImageViewer/ImageView.qml
@@ -24,6 +24,8 @@ Page {
24 24
 
25 25
     property int totalImages;
26 26
 
  27
+    property bool detailsVisible: false;
  28
+
27 29
     signal back();
28 30
 
29 31
     signal goForward(string source);
@@ -42,6 +44,32 @@ Page {
42 44
         onHeightChanged: adjustImage();
43 45
         onWidthChanged: adjustImage();
44 46
 
  47
+        Rectangle {
  48
+            id: rectangle
  49
+
  50
+            color: "black"
  51
+
  52
+            x:-1000
  53
+            y:-1000
  54
+            width:6000
  55
+            height:6000
  56
+        }
  57
+
  58
+        Flickable {
  59
+            id: flickableOut
  60
+
  61
+            x: -5000
  62
+            y: -5000
  63
+
  64
+            height: 1
  65
+            width: 1
  66
+        }
  67
+
  68
+        ScrollDecorator {
  69
+            id: scrollDecorator
  70
+            flickableItem: flickable
  71
+        }
  72
+
45 73
         Image {
46 74
             id: currentImage
47 75
 
@@ -91,6 +119,22 @@ Page {
91 119
         }
92 120
 
93 121
         MouseArea {
  122
+            id: areaInfo
  123
+            x: page.width - 80 + flickable.contentX
  124
+            y: 0 + flickable.contentY
  125
+            width: 80
  126
+            height: 80
  127
+            onClicked: showInfo();
  128
+            Image {
  129
+                id: infoIcon
  130
+                opacity: 0.5
  131
+                source: "gfx/information.png"
  132
+                anchors.centerIn: parent
  133
+                visible: false
  134
+            }
  135
+        }
  136
+
  137
+        MouseArea {
94 138
             id: areaZoomUp
95 139
             x: page.width - 80 + flickable.contentX
96 140
             y: page.height - 80 + flickable.contentY
@@ -155,6 +199,46 @@ Page {
155 199
                 height: 100
156 200
                 width: 100
157 201
             }
  202
+
  203
+            Rectangle {
  204
+                id: detailsRectangle
  205
+
  206
+                color: "gainsboro"
  207
+                opacity: 0.5
  208
+
  209
+                scale: 1.05
  210
+
  211
+                visible: false
  212
+
  213
+                anchors {
  214
+                    top: detailsText.top
  215
+                    bottom: detailsText.bottom
  216
+                    left: detailsText.left
  217
+                    right: detailsText.right
  218
+                }
  219
+
  220
+            }
  221
+
  222
+            Text {
  223
+                id: detailsText
  224
+                visible: false
  225
+                color: "white"
  226
+
  227
+                font.pointSize: 6
  228
+
  229
+                anchors {
  230
+                    centerIn: parent
  231
+                }
  232
+
  233
+                text: "File name:\nsomething.jpg"
  234
+                wrapMode: Text.WordWrap
  235
+                horizontalAlignment: Text.AlignHCenter
  236
+                verticalAlignment: Text.AlignVCenter
  237
+
  238
+                style: Text.Outline
  239
+                styleColor: "black"
  240
+            }
  241
+
158 242
             Text {
159 243
                 id: errorText
160 244
                 visible: false
@@ -186,6 +270,8 @@ Page {
186 270
                     right: parent.right
187 271
                 }
188 272
 
  273
+                font.pointSize: 5
  274
+
189 275
                 text: "100 %"
190 276
                 horizontalAlignment: Text.AlignHCenter
191 277
                 verticalAlignment: Text.AlignTop
@@ -206,6 +292,8 @@ Page {
206 292
                     right: parent.right
207 293
                 }
208 294
 
  295
+                font.pointSize: 5
  296
+
209 297
                 text: "0/1"
210 298
                 horizontalAlignment: Text.AlignHCenter
211 299
                 verticalAlignment: Text.AlignBottom
@@ -224,6 +312,19 @@ Page {
224 312
         }
225 313
     }
226 314
 
  315
+    function showScrollIndicators(scrollBarsEnabled) {
  316
+        if (scrollBarsEnabled === true)
  317
+            scrollDecorator.flickableItem = flickable;
  318
+        else if (scrollBarsEnabled === false)
  319
+            scrollDecorator.flickableItem = flickableOut;
  320
+    }
  321
+
  322
+    function pinched() {
  323
+        setZoomText();
  324
+        centerIn();
  325
+        resize();
  326
+    }
  327
+
227 328
     function flicked() {
228 329
         imageHandled = true;
229 330
         imageFlicked = true;
@@ -249,6 +350,7 @@ Page {
249 350
             centerIn();
250 351
             setZoomText();
251 352
         }
  353
+        imageHandled = true;
252 354
     }
253 355
 
254 356
     function setZoomText() {
@@ -306,6 +408,7 @@ Page {
306 408
 
307 409
         resize();
308 410
         showIcons();
  411
+        flickable.returnToBounds();
309 412
     }
310 413
 
311 414
     function centerOnZoom() {
@@ -329,6 +432,7 @@ Page {
329 432
         setTotalText();
330 433
         currentImage.scale = 1;
331 434
         currentImage.source = string;
  435
+
332 436
         resize();
333 437
     }
334 438
 
@@ -352,6 +456,12 @@ Page {
352 456
             }
353 457
             if (resizeToFit == true) fitToScreen();
354 458
             setZoomText();
  459
+            var fileName;
  460
+            var filePath = String(currentImage.source);
  461
+
  462
+            var separatorID = filePath.lastIndexOf("/");
  463
+            fileName = filePath.substring(separatorID+1);
  464
+            detailsText.text = "File name:\n" + fileName + "\n\nSize:\n"+originalHeight+"x"+originalWidth;
355 465
             return;
356 466
         }
357 467
         if (currentImage.status == Image.Error) {
@@ -413,6 +523,11 @@ Page {
413 523
         back();
414 524
     }
415 525
 
  526
+    function showInfo() {
  527
+        detailsVisible = !detailsVisible;
  528
+        showIcons();
  529
+    }
  530
+
416 531
     function addListItem(imageFileName) {
417 532
         listID++;
418 533
         console.log("Added " + imageFileName);
@@ -426,20 +541,39 @@ Page {
426 541
         zoomDownIcon.visible = true;
427 542
         zoomUpIcon.visible = true;
428 543
         backToGrid.visible = true;
429  
-        setZoomText();
  544
+        infoIcon.visible = true;
430 545
         zoomText.visible = true;
431 546
         totalText.visible = true;
  547
+        setZoomText();
  548
+
  549
+        if (detailsVisible === false) {
  550
+            detailsText.visible = false;
  551
+            detailsRectangle.visible = false;
  552
+        }
  553
+        else {
  554
+            detailsText.visible = true;
  555
+            detailsRectangle.visible = true;
  556
+        }
  557
+
432 558
         timer.restart();
433 559
     }
434 560
 
  561
+    function setBGColor(newColor)
  562
+    {
  563
+        rectangle.color = newColor;
  564
+    }
  565
+
435 566
     function hideIcons() {
436 567
         arrowRight.visible = false;
437 568
         arrowLeft.visible = false;
438 569
         zoomDownIcon.visible = false;
439 570
         zoomUpIcon.visible = false;
440 571
         backToGrid.visible = false;
  572
+        infoIcon.visible = false;
441 573
         zoomText.visible = false;
442 574
         totalText.visible = false;
  575
+        detailsText.visible = false;
  576
+        detailsRectangle.visible = false;
443 577
     }
444 578
 
445 579
     function nextImage(sourceImage) {
84  ImageViewer/qml/ImageViewer/Settings.qml
@@ -6,7 +6,9 @@ Page {
6 6
 
7 7
     signal openFolderBrowser();
8 8
 
9  
-    signal resizeToFitChanged(bool value);
  9
+    signal resizeToFitChanged(bool resizeToFit);
  10
+    signal showScrollBarChanged(bool scrollBarChanged);
  11
+    signal bgColorChanged(string bgColor);
10 12
 
11 13
     function selectFolder(folderLocation) {
12 14
         folderTextfield.text = folderLocation;
@@ -16,14 +18,26 @@ Page {
16 18
         generalListModel.setProperty(0, "selected", resizeToFit);
17 19
     }
18 20
 
19  
-    anchors.fill: parent
  21
+    function setScrollIndicators(scrollBarsEnabled) {
  22
+        generalListModel.setProperty(1, "selected", scrollBarsEnabled);
  23
+    }
  24
+
  25
+    function setBGColor(bgColor)
  26
+    {
  27
+        colorSelection.subTitle = bgColor;
  28
+    }
  29
+
  30
+    anchors {
  31
+        top: parent.top
  32
+        bottom: parent.bottom
  33
+    }
20 34
 
21 35
     Flickable {
22 36
         id: flickable
23 37
 
24 38
         anchors.fill: parent
25 39
 
26  
-        contentHeight: folderSelectButton.y + folderSelectButton.height
  40
+        contentHeight: colorSelection.y + colorSelection.height + 50
27 41
 
28 42
         clip: true
29 43
 
@@ -66,31 +80,85 @@ Page {
66 80
 
67 81
         ListView {
68 82
             id: generalListView
  83
+
  84
+            interactive: false
  85
+
69 86
             anchors {
70 87
                 top: folderTitle.bottom
71 88
                 topMargin: 60
  89
+                bottom: parent.bottom
72 90
                 left: parent.left
73 91
                 right: parent.right
74 92
             }
75 93
 
76  
-
77 94
             model: generalListModel
78 95
             delegate: generalListDelegate
79 96
 
80 97
         }
81 98
 
82  
-        ListModel {
83  
-            id: generalListModel
  99
+        SelectionListItem {
  100
+            id: colorSelection
  101
+            title: "Background color"
  102
+            subTitle: colorDialog.selectedIndex >= 0
  103
+                      ? colorDialog.model.get(colorDialog.selectedIndex).name
  104
+                      : "Please select"
84 105
 
85  
-            function changeSelection(id, value) {
86  
-                if (id === 0) resizeToFitChanged(value);
  106
+            anchors {
  107
+                left: parent.left
  108
+                right: parent.right
  109
+            }
  110
+
  111
+            y: 235
  112
+
  113
+            onClicked: colorDialog.open();
  114
+
  115
+            SelectionDialog {
  116
+                id: colorDialog
  117
+                titleText: "Select one of the colors"
  118
+                selectedIndex: -1
  119
+                model: ListModel {
  120
+                    ListElement { name: "black" }
  121
+                    ListElement { name: "white" }
  122
+                    ListElement { name: "blue" }
  123
+                    ListElement { name: "darkblue" }
  124
+                    ListElement { name: "lightblue" }
  125
+                    ListElement { name: "red" }
  126
+                    ListElement { name: "pink" }
  127
+                    ListElement { name: "darkred" }
  128
+                    ListElement { name: "green" }
  129
+                    ListElement { name: "darkgreen" }
  130
+                    ListElement { name: "red" }
  131
+                    ListElement { name: "darkred" }
  132
+                    ListElement { name: "pink" }
  133
+                    ListElement { name: "gray" }
  134
+                    ListElement { name: "lightgray" }
  135
+                    ListElement { name: "darkgray" }
  136
+                }
  137
+
  138
+                onSelectedIndexChanged: bgColorChanged(colorDialog.model.get(colorDialog.selectedIndex).name)
87 139
             }
  140
+        }
  141
+
  142
+        ListModel {
  143
+            id: generalListModel
88 144
 
89 145
             ListElement {
90 146
                 name: "Resize to fit"
91 147
                 role: "Title"
92 148
                 selected: true
93 149
             }
  150
+
  151
+            ListElement {
  152
+                name: "Show scroll indicators"
  153
+                role: "Title"
  154
+                selected: false
  155
+            }
  156
+
  157
+            function changeSelection(id, value) {
  158
+                if (id === 0) resizeToFitChanged(value);
  159
+                if (id === 1) showScrollBarChanged(value);
  160
+            }
  161
+
94 162
         }
95 163
     }
96 164
     Component {
BIN  ImageViewer/qml/ImageViewer/gfx/information.png
21  ImageViewer/qml/ImageViewer/main.qml
@@ -73,10 +73,12 @@ Window {
73 73
             anchors.fill: parent
74 74
 
75 75
             onOpenFolderBrowser: base.selectFolder();
76  
-            onResizeToFitChanged: base.changeFitToScreen(value);
  76
+            onResizeToFitChanged: base.changeFitToScreen(resizeToFit);
  77
+            onShowScrollBarChanged: base.changeScrollIndicators(scrollBarChanged);
  78
+            onBgColorChanged: base.changeBGColor(bgColor);
77 79
         }
78 80
 
79  
-        }
  81
+    }
80 82
 
81 83
     ToolBar {
82 84
         id: toolBar
@@ -109,7 +111,7 @@ Window {
109 111
     }
110 112
 
111 113
     function setCurrentID(id) {
112  
-        gridList.setIndex(id);
  114
+        gridList.setIndex(id-1);
113 115
         imageView.currentID = id;
114 116
     }
115 117
 
@@ -127,6 +129,17 @@ Window {
127 129
         settings.setResizeToFit(resizeToFit);
128 130
     }
129 131
 
  132
+    function showScrollIndicators(scrollBarsEnabled) {
  133
+        imageView.showScrollIndicators(scrollBarsEnabled);
  134
+        settings.setScrollIndicators(scrollBarsEnabled);
  135
+    }
  136
+
  137
+    function setBGColor(newColor)
  138
+    {
  139
+        settings.setBGColor(newColor);
  140
+        imageView.setBGColor(newColor);
  141
+    }
  142
+
130 143
     function showGrid() {
131 144
         toolBar.visible = true;
132 145
         toolBar.opacity = 0.5;
@@ -156,7 +169,7 @@ Window {
156 169
 
157 170
     function back() {
158 171
         if (settingsOpen == false) {
159  
-            Qt.quit();
  172
+            base.quitApplication ();
160 173
             return;
161 174
         }
162 175
         else {

0 notes on commit 7f4d111

Please sign in to comment.
Something went wrong with that request. Please try again.