Twitter Widget added to InfoPage

This commit is contained in:
Andre Jochems
2016-06-09 12:16:49 +02:00
parent 1b7473bcb2
commit 9f8937da99
22 changed files with 919 additions and 110 deletions

View File

@@ -220,7 +220,8 @@ HEADERS += src/qt/bitcoingui.h \
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.h \ src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.h \
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.h \ src/qt/qtquick_controls/cpp/qmlexchangeslistitem.h \
src/qt/qtquick_controls/cpp/guiexchangeslistview.h \ src/qt/qtquick_controls/cpp/guiexchangeslistview.h \
src/qt/qtquick_controls/cpp/guiexchangescontrol.h src/qt/qtquick_controls/cpp/guiexchangescontrol.h \
src/qt/twitter/twitterwidget.h
SOURCES += src/qt/bitcoin.cpp \ SOURCES += src/qt/bitcoin.cpp \
src/qt/bitcoingui.cpp \ src/qt/bitcoingui.cpp \
@@ -321,7 +322,8 @@ SOURCES += src/qt/bitcoin.cpp \
src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.cpp \ src/qt/qtquick_controls/cpp/qmlexchangeslistmodel.cpp \
src/qt/qtquick_controls/cpp/qmlexchangeslistitem.cpp \ src/qt/qtquick_controls/cpp/qmlexchangeslistitem.cpp \
src/qt/qtquick_controls/cpp/guiexchangeslistview.cpp \ src/qt/qtquick_controls/cpp/guiexchangeslistview.cpp \
src/qt/qtquick_controls/cpp/guiexchangescontrol.cpp src/qt/qtquick_controls/cpp/guiexchangescontrol.cpp \
src/qt/twitter/twitterwidget.cpp
RESOURCES += src/qt/bitcoin.qrc RESOURCES += src/qt/bitcoin.qrc
@@ -357,7 +359,8 @@ OTHER_FILES += README.md \
src/qt/qtquick_controls/qml/QmlGUIExchangesWindow.qml \ src/qt/qtquick_controls/qml/QmlGUIExchangesWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarWindow.qml \ src/qt/qtquick_controls/qml/QmlGUIMenuToolbarWindow.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarListView.qml \ src/qt/qtquick_controls/qml/QmlGUIMenuToolbarListView.qml \
src/qt/qtquick_controls/qml/QmlGUIMenuToolbarControl.qml src/qt/qtquick_controls/qml/QmlGUIMenuToolbarControl.qml \
src/qt/twitter/*.qml
DISTFILES += \ DISTFILES += \
QmlImports.qml QmlImports.qml

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.6.1, 2016-06-01T18:22:22. --> <!-- Written by QtCreator 4.0.0, 2016-06-08T18:03:58. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
@@ -40,6 +40,7 @@
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value> <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value> <value type="int" key="EditorConfiguration.TabSize">8</value>
@@ -58,14 +59,14 @@
<data> <data>
<variable>ProjectExplorer.Project.Target.0</variable> <variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt MinGW-w64 32bit (MSYS2)</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.6.0 (mingw32)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt MinGW-w64 32bit (MSYS2)</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.6.0 (mingw32)</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.M2_MinGW-w64_i686_kit</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{b3cf2641-46bb-4b28-b7a6-2713d9074823}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/casinocoin-issue-18</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -73,61 +74,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">USE_UPNP=0 USE_QRCODE=1 USE_IPV6=1</value> <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">&quot;USE_UPNP=0&quot; &quot;USE_QRCODE=1&quot; &quot;USE_IPV6=1&quot;</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/build-casinocoin-qt-windows-Desktop_Qt_MinGW_w64_32bit_MSYS2-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
@@ -172,8 +119,8 @@
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/build-casinocoin-qt-windows-Desktop_Qt_MinGW_w64_32bit_MSYS2-Profile</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/a.jochems/Documents/GitHub/casinocoin-development</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -181,9 +128,9 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments">&quot;USE_UPNP=0&quot; &quot;USE_QRCODE=1&quot; &quot;USE_IPV6=1&quot;</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value> <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
@@ -220,13 +167,13 @@
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value> <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
@@ -242,6 +189,7 @@
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value> <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value> <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value> <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
@@ -284,13 +232,13 @@
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">casinocoin-qt-windows</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">casinocoin-qt-windows</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/a.jochems/Documents/GitHub/casinocoin-issue-18/casinocoin-qt-windows.pro</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/a.jochems/Documents/GitHub/casinocoin-development/casinocoin-qt-windows.pro</value>
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value> <value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">casinocoin-qt-windows.pro</value> <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">casinocoin-qt-windows.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">C:/Users/a.jochems/Documents/GitHub/casinocoin-development</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>

View File

@@ -135,5 +135,11 @@
<file>qtquick_controls/qml/QmlGUIExchangesWindow.qml</file> <file>qtquick_controls/qml/QmlGUIExchangesWindow.qml</file>
<file>qtquick_controls/qml/QmlGUIExchangesListView.qml</file> <file>qtquick_controls/qml/QmlGUIExchangesListView.qml</file>
<file>qtquick_controls/qml/QmlGUIExchangesControl.qml</file> <file>qtquick_controls/qml/QmlGUIExchangesControl.qml</file>
<file>twitter/FlipBar.qml</file>
<file>twitter/TweetDelegate.qml</file>
<file>twitter/tweetsearch.js</file>
<file>twitter/TweetsModel.qml</file>
<file>twitter/CasinocoinTwitterFeed.qml</file>
<file>twitter/resources/anonymous.png</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -38,9 +38,9 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QFrame" name="coinInfoBox"> <widget class="QFrame" name="coinInfoBox">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>3</horstretch>
<verstretch>0</verstretch> <verstretch>1</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="layoutDirection"> <property name="layoutDirection">
@@ -58,6 +58,12 @@
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="lblInformationHeader"> <widget class="QLabel" name="lblInformationHeader">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>10</pointsize> <pointsize>10</pointsize>
@@ -201,33 +207,13 @@
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="lblCoinFiatValue">
<property name="text">
<string>Coin Fiat Value</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="txtCoinFiatValue">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="lblCoinValue"> <widget class="QLabel" name="lblCoinValue">
<property name="text"> <property name="text">
<string>Coin Value</string> <string>Coin Value</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="3" column="1">
<widget class="QLabel" name="txtCoinValue"> <widget class="QLabel" name="txtCoinValue">
<property name="font"> <property name="font">
<font> <font>
@@ -240,7 +226,47 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0">
<widget class="QLabel" name="lblCoinFiatValue">
<property name="text">
<string>Coin Fiat Value</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="txtCoinFiatValue">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="lblEstimatedMarketCapital">
<property name="text">
<string>Estimated Marketcapital</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="txtEstimatedMarketCapital">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="lblConnections"> <widget class="QLabel" name="lblConnections">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
@@ -253,7 +279,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="6" column="1">
<widget class="QLabel" name="txtConnections"> <widget class="QLabel" name="txtConnections">
<property name="font"> <property name="font">
<font> <font>
@@ -272,7 +298,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="7" column="0">
<widget class="QLabel" name="lblDifficulty"> <widget class="QLabel" name="lblDifficulty">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
@@ -285,7 +311,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item row="7" column="1">
<widget class="QLabel" name="txtDifficulty"> <widget class="QLabel" name="txtDifficulty">
<property name="font"> <property name="font">
<font> <font>
@@ -304,7 +330,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="8" column="0">
<widget class="QLabel" name="lblHashRate"> <widget class="QLabel" name="lblHashRate">
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
@@ -317,7 +343,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="8" column="1">
<widget class="QLabel" name="txtHashRate"> <widget class="QLabel" name="txtHashRate">
<property name="font"> <property name="font">
<font> <font>
@@ -341,8 +367,64 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="0" column="1">
<widget class="QFrame" name="twitterFeedBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>2</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayoutTwitter"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblTwitterHeader">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(166, 27, 31);</string>
</property>
<property name="text">
<string>Twitter</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QFrame" name="exchangeInfoBox"> <widget class="QFrame" name="exchangeInfoBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>

View File

@@ -8,17 +8,21 @@
#include "main.h" #include "main.h"
#include "overviewpage.h" #include "overviewpage.h"
#include "qtquick_controls/cpp/guiexchangeswidget.h" #include "qtquick_controls/cpp/guiexchangeswidget.h"
#include "twitter/twitterwidget.h"
using namespace std; using namespace std;
InfoPage::InfoPage(QWidget *parent) : InfoPage::InfoPage(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::InfoPage), ui(new Ui::InfoPage),
exchangesWidget( 0 ) exchangesWidget( 0 ),
twitterWidget( 0 )
{ {
ui->setupUi(this); ui->setupUi(this);
ui->coinInfoBox->setMinimumHeight(250); ui->coinInfoBox->setMinimumHeight(250);
ui->twitterFeedBox->setMinimumHeight(250);
ui->exchangeInfoBox->setMinimumHeight(250); ui->exchangeInfoBox->setMinimumHeight(250);
createTwitterWidget();
createExchangesWidget(); createExchangesWidget();
} }
@@ -101,6 +105,12 @@ InfoPage::~InfoPage()
delete ui; delete ui;
} }
void InfoPage::createTwitterWidget()
{
twitterWidget = new TwitterWidget( this );
ui->verticalLayoutTwitter->addWidget( twitterWidget->dockQmlToWidget() );
}
void InfoPage::createExchangesWidget() void InfoPage::createExchangesWidget()
{ {
exchangesWidget = new GUIExchangesWidget( this ); exchangesWidget = new GUIExchangesWidget( this );
@@ -108,8 +118,9 @@ void InfoPage::createExchangesWidget()
ui->verticalLayoutExchanges->addWidget( exchangesWidget->dockQmlToWidget() ); ui->verticalLayoutExchanges->addWidget( exchangesWidget->dockQmlToWidget() );
} }
void InfoPage::setCoinValues(QString coinValue, QString coinFiatValue) void InfoPage::setCoinValues(QString coinValue, QString coinFiatValue, QString marketCapital)
{ {
ui->txtCoinValue->setText(coinValue); ui->txtCoinValue->setText(coinValue);
ui->txtCoinFiatValue->setText(coinFiatValue); ui->txtCoinFiatValue->setText(coinFiatValue);
ui->txtEstimatedMarketCapital->setText(marketCapital);
} }

View File

@@ -6,6 +6,7 @@
class WalletModel; class WalletModel;
class ClientModel; class ClientModel;
class GUIExchangesWidget; class GUIExchangesWidget;
class TwitterWidget;
namespace Ui { namespace Ui {
class InfoPage; class InfoPage;
@@ -21,7 +22,7 @@ public slots:
/** Set number of blocks shown in the UI */ /** Set number of blocks shown in the UI */
void setNumBlocks(int count, int countOfPeers); void setNumBlocks(int count, int countOfPeers);
/** Set coin values */ /** Set coin values */
void setCoinValues(const QString coinValue, const QString coinFiatValue); void setCoinValues(const QString coinValue, const QString coinFiatValue, const QString marketCapital);
public: public:
explicit InfoPage(QWidget *parent = 0); explicit InfoPage(QWidget *parent = 0);
@@ -34,8 +35,10 @@ private:
WalletModel *walletModel; WalletModel *walletModel;
ClientModel *clientModel; ClientModel *clientModel;
GUIExchangesWidget* exchangesWidget; GUIExchangesWidget* exchangesWidget;
TwitterWidget* twitterWidget;
void createExchangesWidget(); void createTwitterWidget();
void createExchangesWidget();
double GetNetworkHashRate(int lookup, int height); double GetNetworkHashRate(int lookup, int height);
}; };

View File

@@ -284,10 +284,13 @@ void OverviewPage::updateFiatBalance(int currency)
QString conversionCurrency = QString("Price").append(Currencies::name(currency)); QString conversionCurrency = QString("Price").append(Currencies::name(currency));
QString coinValue = QString::number( coinInformation.find("PriceBTC").value().toDouble(), 'f', 8 ); QString coinValue = QString::number( coinInformation.find("PriceBTC").value().toDouble(), 'f', 8 );
double currencyValue = coinInformation.find(conversionCurrency).value().toDouble(); double currencyValue = coinInformation.find(conversionCurrency).value().toDouble();
double marketCapValue = coinInformation.find("MarketCapital").value().toDouble();
// create formated fiat value // create formated fiat value
QString formattedFiatValue = Currencies::format(currency, currencyValue, true, 4, false); QString formattedFiatValue = Currencies::format(currency, currencyValue, true, 4, false);
// create formatted market capital value
QString formattedMarketCapital = Currencies::format(Currencies::USD, marketCapValue, true, 2, false);
// emit signal for change value // emit signal for change value
emit coinValueChanged(coinValue, formattedFiatValue); emit coinValueChanged(coinValue, formattedFiatValue, formattedMarketCapital);
// calculate and set fiat balance // calculate and set fiat balance
double fiatBalance = currentBalance * currencyValue; double fiatBalance = currentBalance * currencyValue;
QString fiatBalanceString = Currencies::format(currency,fiatBalance,true, 2, true); QString fiatBalanceString = Currencies::format(currency,fiatBalance,true, 2, true);

View File

@@ -40,7 +40,7 @@ public slots:
signals: signals:
void transactionClicked(const QModelIndex &index); void transactionClicked(const QModelIndex &index);
void coinValueChanged(const QString coinValue, const QString formattedCoinFiatValue); void coinValueChanged(const QString coinValue, const QString formattedCoinFiatValue, const QString marketCapital);
private: private:
Ui::OverviewPage *ui; Ui::OverviewPage *ui;

View File

@@ -0,0 +1,139 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "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.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may 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
** OWNER 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."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
import "tweetsearch.js" as Helper
import QtQuick.Controls 1.4
Rectangle {
id: id_TwitterRoot
width: parent ? parent.width : 0
height: parent ? parent.height : 0
color: GUI20Skin.colorFrameBackground
property int inAnimDur: 250
property int counter: 0
property alias isLoading: tweetsModel.isLoading
property var idx
property var ids
Component.onCompleted: ids = new Array()
function idInModel(id)
{
for (var j = 0; j < ids.length; j++)
if (ids[j] === id)
return 1
return 0
}
TweetsModel {
id: tweetsModel
onIsLoaded: {
console.debug("Reload")
idx = new Array()
for (var i = 0; i < tweetsModel.model.count; i++) {
var id = tweetsModel.model.get(i).id
if (!idInModel(id))
idx.push(i)
}
console.debug(idx.length + " new tweets")
id_TwitterRoot.counter = idx.length
}
}
Timer {
id: timer
interval: 500; running: id_TwitterRoot.counter; repeat: true
onTriggered: {
id_TwitterRoot.counter--;
var id = tweetsModel.model.get(idx[id_TwitterRoot.counter]).id;
var item = tweetsModel.model.get(id_TwitterRoot.counter);
if(item.retweeted_status != undefined){
item = item.retweeted_status;
}
mainListView.add( { "statusText": Helper.insertLinks(item.text, item.entities),
"twitterName": item.user.screen_name,
"name" : item.user.name,
"userImage": item.user.profile_image_url,
"source": item.source,
"id": id,
"uri": Helper.insertLinks(item.user.url, item.user.entities),
"published": item.created_at } );
ids.push(id)
}
}
Timer {
id: refreshTwitterFeedTimer
interval: 600000;
running: true;
repeat: true;
onTriggered: tweetsModel.reload()
}
ScrollView {
id: mainScrollView
anchors.fill: id_TwitterRoot
ListView {
id: mainListView
anchors.fill: mainScrollView
delegate: TweetDelegate { }
model: ListModel { id: finalModel }
add: Transition {
NumberAnimation { property: "hm"; from: 0; to: 1.0; duration: 300; easing.type: Easing.OutQuad }
PropertyAction { property: "appear"; value: 250 }
}
onDragEnded: tweetsModel.reload()
function clear() {
ids = new Array()
model.clear()
}
function add(obj) {
model.insert(0, obj)
}
}
}
}

173
src/qt/twitter/FlipBar.qml Normal file
View File

@@ -0,0 +1,173 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "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.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may 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
** OWNER 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."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
Item {
id: container
property int animDuration: 300
property Item front: Item {}
property Item back: Item {}
property real factor: 0.1 // amount the edges fold in for the 3D effect
property alias delta: effect.delta
property Item cur: frontShown ? front : back
property Item noncur: frontShown ? back : front
function swap() {
var tmp = front;
front = back;
back = tmp;
resync();
}
width: cur.width
height: cur.height
onFrontChanged: resync();
onBackChanged: resync();
function resync() {//TODO: Are the items ever actually visible?
back.parent = container;
front.parent = container;
frontShown ? back.visible = false : front.visible = false;
}
property bool frontShown: true
onFrontShownChanged: {
back.visible = !frontShown
front.visible = frontShown
}
function flipUp(start) {
effect.visible = true;
effect.sourceA = effect.source1
effect.sourceB = effect.source2
if (start == undefined)
start = 1.0;
deltaAnim.from = start;
deltaAnim.to = 0.0
dAnim.start();
frontShown = false;
}
function flipDown(start) {
effect.visible = true;
effect.sourceA = effect.source1
effect.sourceB = effect.source2
if (start == undefined)
start = 0.0;
deltaAnim.from = start;
deltaAnim.to = 1.0
dAnim.start();
frontShown = true;
}
ShaderEffect {
id: effect
width: cur.width
height: cur.height
property real factor: container.factor * width
property real delta: 1.0
mesh: GridMesh { resolution: Qt.size(8,2) }
SequentialAnimation on delta {
id: dAnim
running: false
NumberAnimation {
id: deltaAnim
duration: animDuration//expose anim
}
}
property variant sourceA: source1
property variant sourceB: source1
property variant source1: ShaderEffectSource {
sourceItem: front
hideSource: effect.visible
}
property variant source2: ShaderEffectSource {
sourceItem: back
hideSource: effect.visible
}
fragmentShader: "
uniform lowp float qt_Opacity;
uniform sampler2D sourceA;
uniform sampler2D sourceB;
uniform highp float delta;
varying highp vec2 qt_TexCoord0;
void main() {
highp vec4 tex = vec4(qt_TexCoord0.x, qt_TexCoord0.y * 2.0, qt_TexCoord0.x, (qt_TexCoord0.y-0.5) * 2.0);
highp float shade = clamp(delta*2.0, 0.5, 1.0);
highp vec4 col;
if (qt_TexCoord0.y < 0.5) {
col = texture2D(sourceA, tex.xy) * (shade);
} else {
col = texture2D(sourceB, tex.zw) * (1.5 - shade);
col.w = 1.0;
}
gl_FragColor = col * qt_Opacity;
}
"
property real h: height
vertexShader: "
uniform highp float delta;
uniform highp float factor;
uniform highp float h;
uniform highp mat4 qt_Matrix;
attribute highp vec4 qt_Vertex;
attribute highp vec2 qt_MultiTexCoord0;
varying highp vec2 qt_TexCoord0;
void main() {
highp vec4 pos = qt_Vertex;
if (qt_MultiTexCoord0.y == 0.0)
pos.x += factor * (1. - delta) * (qt_MultiTexCoord0.x * -2.0 + 1.0);
else if (qt_MultiTexCoord0.y == 1.0)
pos.x += factor * (delta) * (qt_MultiTexCoord0.x * -2.0 + 1.0);
else
pos.y = delta * h;
gl_Position = qt_Matrix * pos;
qt_TexCoord0 = qt_MultiTexCoord0;
}"
}
}

View File

@@ -0,0 +1,188 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "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.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may 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
** OWNER 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."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
import "tweetsearch.js" as Helper
Item {
id: container
property real hm: 1.0
property int appear: -1
property real startRotation: 1
onAppearChanged: {
container.startRotation = 0.5
flipBar.animDuration = appear;
delayedAnim.start();
}
SequentialAnimation {
id: delayedAnim
PauseAnimation { duration: 50 }
ScriptAction { script: flipBar.flipDown(startRotation); }
}
width: parent ? parent.width : 0
height: flipBar.height * hm
FlipBar {
id: flipBar
property bool flipped: false
delta: startRotation
anchors.bottom: parent.bottom
width: container.ListView.view ? container.ListView.view.width : 0
height: Math.max(72, tweet.y + tweet.height + 10)
front: Rectangle {
width: container.ListView.view ? container.ListView.view.width : 0
height: Math.max(72, tweet.y + tweet.height + 10)
Rectangle { color: GUI20Skin.colorToolbarMainGradientEnd; width: parent.width; height: 1 }
Rectangle { color: GUI20Skin.colorToolbarMainGradientEnd; width: parent.width; height: 1; anchors.bottom: parent.bottom }
Image {
id: placeHolder
source: "resources/anonymous.png"
x: 10; y: 9
visible: avatar.status != Image.Ready
}
Image {
id: avatar
source: model.userImage
anchors.fill: placeHolder
MouseArea {
id: mouseArea
anchors.fill: parent
onClicked: {
flipBar.flipUp()
flipBar.flipped = true
}
}
}
Text {
id: name
text: model.name
anchors { left: avatar.right; leftMargin: 10; top: avatar.top; topMargin: -3 }
font.pixelSize: 12
font.bold: true
color: GUI20Skin.colorToolbarMainGradientEnd
linkColor: "blue"
}
Text {
id: tweet
text: model.statusText
anchors { left: avatar.right; leftMargin: 10; top: name.bottom; topMargin: 0; right: parent.right; rightMargin: 10 }
wrapMode: Text.WordWrap
font.pixelSize: 12
font.bold: false
color: "black"
linkColor: "blue"
onLinkActivated: {
var tag = link.split("https://twitter.com/search?q=%23")
var user = link.split("https://twitter.com/")
if (tag[1] != undefined) {
mainListView.positionViewAtBeginning()
mainListView.clear()
mainListView.autoSearch('tag', tag[1])
tweetsModel.from = ""
tweetsModel.phrase = "#" + tag[1]
} else if (user[1] != undefined) {
mainListView.positionViewAtBeginning()
mainListView.clear()
mainListView.autoSearch('user', user[1])
tweetsModel.phrase = ""
tweetsModel.from = user[1]
} else
Qt.openUrlExternally(link)
}
}
}
back: Rectangle {
width: container.ListView.view ? container.ListView.view.width : 0
height: Math.max(72, tweet.y + tweet.height + 10)
color: "#be4a25"
Rectangle { color: "#ff6633"; width: parent.width; height: 1 }
Rectangle { color: "#80341a"; width: parent.width; height: 1; anchors.bottom: parent.bottom }
Image {
id: avatar2
source: model.userImage
anchors.right: parent.right
anchors.rightMargin: 10
y: 9
MouseArea {
anchors.fill: parent
onClicked: {
flipBar.flipDown()
flipBar.flipped = false
}
}
}
Text {
id: username
text: model.twitterName
x: 10; anchors { top: avatar2.top; topMargin: -3 }
font.pixelSize: 12
font.bold: true
color: "black"
linkColor: "blue"
}
Text {
text: model.source + "<br>" + Helper.formatDate(model.published) + "<br>" + model.uri
x: 10; anchors { top: username.bottom; topMargin: 0 }
wrapMode: Text.WordWrap
font.pixelSize: 12
font.bold: false
color: "#ffc2ad"
linkColor: "blue"
onLinkActivated: Qt.openUrlExternally(link);
}
}
}
}

View File

@@ -0,0 +1,126 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "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.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may 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
** OWNER 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."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
import "tweetsearch.js" as Helper
Item {
id: wrapper
//! [auth tokens]
property string consumerKey : ""
property string consumerSecret : ""
//! [auth tokens]
property string bearerToken : ""
property variant model: tweets
property string from : "CasinocoinNews"
property string phrase : ""
property int status: XMLHttpRequest.UNSENT
property bool isLoading: status === XMLHttpRequest.LOADING
property bool wasLoading: false
signal isLoaded
ListModel { id: tweets }
function encodePhrase(x) { return encodeURIComponent(x); }
function reload() {
tweets.clear()
if (from == "" && phrase == "")
return;
//! [requesting]
var req = new XMLHttpRequest;
req.open("GET", "https://api.twitter.com/1.1/statuses/user_timeline.json?" +
"&count=10&screen_name=" + from);
req.setRequestHeader("Authorization", "Bearer " + bearerToken);
req.onreadystatechange = function() {
status = req.readyState;
if (status === XMLHttpRequest.DONE) {
var objectArray = JSON.parse(req.responseText);
if (objectArray.errors !== undefined)
console.log("Error fetching tweets: " + objectArray.errors[0].message)
else {
for (var key in objectArray) {
var jsonObject = objectArray[key];
tweets.append(jsonObject);
}
}
if (wasLoading == true)
wrapper.isLoaded()
}
wasLoading = (status === XMLHttpRequest.LOADING);
}
req.send();
//! [requesting]
}
onPhraseChanged: reload();
onFromChanged: reload();
Component.onCompleted: {
if (consumerKey === "" || consumerSecret == "") {
bearerToken = encodeURIComponent(Helper.demoToken())
return;
}
var authReq = new XMLHttpRequest;
authReq.open("POST", "https://api.twitter.com/oauth2/token");
authReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
authReq.setRequestHeader("Authorization", "Basic " + Qt.btoa(consumerKey + ":" + consumerSecret));
authReq.onreadystatechange = function() {
if (authReq.readyState === XMLHttpRequest.DONE) {
var jsonResponse = JSON.parse(authReq.responseText);
if (jsonResponse.errors !== undefined)
console.log("Authentication error: " + jsonResponse.errors[0].message)
else
{
bearerToken = jsonResponse.access_token;
reload();
}
}
}
authReq.send("grant_type=client_credentials");
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,62 @@
.pragma library
function formatDate(date)
{
var da = new Date(date)
return da.toDateString()
}
function demoToken()
{
var a = new Array(22).join('A')
return a + String.fromCharCode(0x44, 0x69, 0x4a, 0x52, 0x51, 0x41, 0x41, 0x41, 0x41,
0x41, 0x41, 0x74, 0x2b, 0x72, 0x6a, 0x6c, 0x2b, 0x71,
0x6d, 0x7a, 0x30, 0x72, 0x63, 0x79, 0x2b, 0x42, 0x62,
0x75, 0x58, 0x42, 0x42, 0x73, 0x72, 0x55, 0x48, 0x47,
0x45, 0x67, 0x3d, 0x71, 0x30, 0x45, 0x4b, 0x32, 0x61,
0x57, 0x71, 0x51, 0x4d, 0x62, 0x31, 0x35, 0x67, 0x43,
0x5a, 0x4e, 0x77, 0x5a, 0x6f, 0x39, 0x79, 0x71, 0x61,
0x65, 0x30, 0x68, 0x70, 0x65, 0x32, 0x46, 0x44, 0x73,
0x53, 0x39, 0x32, 0x57, 0x41, 0x75, 0x30, 0x67)
}
function linkForEntity(entity)
{
return (entity.url ? entity.url :
(entity.screen_name ? 'https://twitter.com/' + entity.screen_name :
'https://twitter.com/search?q=%23' + entity.text))
}
function textForEntity(entity)
{
return (entity.display_url ? entity.display_url :
(entity.screen_name ? entity.screen_name : entity.text))
}
function insertLinks(text, entities)
{
if (typeof text !== 'string')
return "";
if (!entities)
return text;
// Add all links (urls, usernames and hashtags) to an array and sort them in
// descending order of appearance in text
var links = []
if (entities.urls)
links = entities.urls.concat(entities.hashtags, entities.user_mentions)
else if (entities.url)
links = entities.url.urls
links.sort(function(a, b) { return b.indices[0] - a.indices[0] })
for (var i = 0; i < links.length; i++) {
var offset = links[i].url ? 0 : 1
text = text.substring(0, links[i].indices[0] + offset) +
'<a href=\"' + linkForEntity(links[i]) + '\">' +
textForEntity(links[i]) + '</a>' +
text.substring(links[i].indices[1])
}
return text.replace(/\n/g, '<br>');
}

View File

@@ -0,0 +1,40 @@
#include "twitterwidget.h"
#include <QHBoxLayout>
#include <QCheckBox>
#include <QQuickView>
#include <QQmlContext>
#include "gui20_skin.h"
TwitterWidget::TwitterWidget(QWidget *parent)
: QWidget(parent)
{
}
TwitterWidget::~TwitterWidget()
{
// member objects are moved to qml engine and it manages their instances
}
QWidget* TwitterWidget::dockQmlToWidget()
{
QQuickView* pTwitterWindow = new QQuickView;
QWidget* pPlaceHolder = 0;
if ( pTwitterWindow )
{
QQmlContext* pContext = pTwitterWindow->rootContext();
if ( pContext )
{
pContext->setContextProperty( "GUI20Skin", &GUI20Skin::Instance() );
}
pTwitterWindow->setSource( QUrl( QStringLiteral( "qrc:/qml/twitter/CasinocoinTwitterFeed.qml" ) ) );
pPlaceHolder = QWidget::createWindowContainer( pTwitterWindow, this );
if ( pPlaceHolder )
{
pPlaceHolder->setMinimumSize( 500, 170 );
pPlaceHolder->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
}
}
return pPlaceHolder;
}

View File

@@ -0,0 +1,25 @@
#ifndef TWITTERWIDGET_H
#define TWITTERWIDGET_H
#include <QWidget>
class TwitterWidget : public QWidget
{
Q_OBJECT
public:
TwitterWidget( QWidget *parent = 0) ;
~TwitterWidget();
QWidget* dockQmlToWidget();
public slots:
private:
void registerCustomQmlTypes();
private slots:
};
#endif // TWITTERWIDGET_H

View File

@@ -92,7 +92,7 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
// Clicking on "Export" allows to export the transaction list // Clicking on "Export" allows to export the transaction list
connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked())); connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked()));
// subscribe to coin value changes // subscribe to coin value changes
connect(overviewPage, SIGNAL(coinValueChanged(const QString, const QString)), infoPage, SLOT(setCoinValues(const QString, const QString))); connect(overviewPage, SIGNAL(coinValueChanged(const QString, const QString, const QString)), infoPage, SLOT(setCoinValues(const QString, const QString, const QString)));
gotoOverviewPage(); gotoOverviewPage();
} }