[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bgluon=5D_player=3A_QML_Player=3A_Add_the_proper_ico?=
From:       Laszlo Papp <djszapi () archlinux ! us>
Date:       2011-03-31 21:06:33
Message-ID: 20110331210633.2E9CCA60A6 () git ! kde ! org
[Download RAW message or body]

Git commit 637a6ad437689eff028303f306bd9cf87c744a5d by Laszlo Papp.
Committed on 31/03/2011 at 23:53.
Pushed by lpapp into branch 'master'.

QML Player: Add the proper icons to the Download/Upload operations

M  +16   -13   player/lib/models/gameitemsmodel.cpp     
M  +7    -6    player/lib/models/gameitemsmodel.h     
M  +7    -3    player/touch/Details.qml     
M  +1    -1    player/touch/Home.qml     
M  +2    -0    player/touch/gluon_qmlplayer.qrc     
A  +-    --    player/touch/icons/download.png         [License: Trivial file]
A  +-    --    player/touch/icons/system-software-update.png         [License: \
Trivial file]

http://commits.kde.org/gluon/637a6ad437689eff028303f306bd9cf87c744a5d

diff --git a/player/lib/models/gameitemsmodel.cpp \
b/player/lib/models/gameitemsmodel.cpp index fa555e4..ee23b71 100644
--- a/player/lib/models/gameitemsmodel.cpp
+++ b/player/lib/models/gameitemsmodel.cpp
@@ -60,16 +60,17 @@ GameItemsModel::GameItemsModel( QObject* parent )
     roles[ProjectFileNameRole] = "projectFileName";
     roles[ProjectDirNameRole] = "projectDirName";
     roles[ScreenshotUrlsRole] = "screenshotUrls";
-    roles[IDRole] = "id";
     roles[StatusRole] = "status";
+    roles[IDRole] = "id";
 
     // Downloadable Game item roles
-    roles[GameNameRoleDownloadable] = "gameNameDownloadable";
-    roles[GameDescriptionRoleDownloadable] = "gameDescriptionDownloadable";
-    roles[ProjectFileNameRoleDownloadable] = "projectFileNameDownloadable";
-    roles[ProjectDirNameRoleDownloadable] = "projectDirNameDownloadable";
-    roles[ScreenshotUrlsRoleDownloadable] = "screenshotUrlsDownloadable";
-    roles[IDRoleDownloadable] = "idDownloadable";
+    roles[GameNameDownloadableRole] = "gameNameDownloadable";
+    roles[GameDescriptionDownloadableRole] = "gameDescriptionDownloadable";
+    roles[ProjectFileNameDownloadableRole] = "projectFileNameDownloadable";
+    roles[ProjectDirNameDownloadableRole] = "projectDirNameDownloadable";
+    roles[ScreenshotUrlsDownloadableRole] = "screenshotUrlsDownloadable";
+    roles[StatusDownloadableRole] = "statusDownloadable";
+    roles[IDDownloadableRole] = "idDownloadable";
     setRoleNames(roles);
 
     fetchGamesList();
@@ -100,17 +101,19 @@ QVariant GameItemsModel::data( const QModelIndex& index, int \
                role ) const
         return m_gameViewItems.values(GameViewItem::Installed).at( index.row() \
)->id();  
     // Downloadable Game item roles
-    case GameNameRoleDownloadable:
+    case GameNameDownloadableRole:
         return m_gameViewItems.values(GameViewItem::Downloadable).at( index.row() \
                )->gameName();
-    case GameDescriptionRoleDownloadable:
+    case GameDescriptionDownloadableRole:
         return m_gameViewItems.values(GameViewItem::Downloadable).at( index.row() \
                )->gameDescription();
-    case ProjectDirNameRoleDownloadable:
+    case ProjectDirNameDownloadableRole:
         return m_gameViewItems.values(GameViewItem::Downloadable).at( index.row() \
                )->projectDirName();
-    case ProjectFileNameRoleDownloadable:
+    case ProjectFileNameDownloadableRole:
         return m_gameViewItems.values(GameViewItem::Downloadable).at( index.row() \
                )->projectFileName();
-    case ScreenshotUrlsRoleDownloadable:
+    case ScreenshotUrlsDownloadableRole:
         return m_gameViewItems.values(GameViewItem::Downloadable).at( index.row() \
                )->screenshotUrls();
-    case IDRoleDownloadable:
+    case StatusDownloadableRole:
+        return m_gameViewItems.values(GameViewItem::Downloadable).at( index.row() \
)->status(); +    case IDDownloadableRole:
         return m_gameViewItems.values(GameViewItem::Downloadable).at( index.row() \
)->id();  default:
         break;
diff --git a/player/lib/models/gameitemsmodel.h b/player/lib/models/gameitemsmodel.h
index 16b219b..61726d7 100644
--- a/player/lib/models/gameitemsmodel.h
+++ b/player/lib/models/gameitemsmodel.h
@@ -62,12 +62,13 @@ namespace GluonPlayer
                 IDRole,
 
                 // Downloadable Game item roles
-                GameNameRoleDownloadable,
-                GameDescriptionRoleDownloadable,
-                ProjectDirNameRoleDownloadable,
-                ProjectFileNameRoleDownloadable,
-                ScreenshotUrlsRoleDownloadable,
-                IDRoleDownloadable,
+                GameNameDownloadableRole,
+                GameDescriptionDownloadableRole,
+                ProjectDirNameDownloadableRole,
+                ProjectFileNameDownloadableRole,
+                ScreenshotUrlsDownloadableRole,
+                StatusDownloadableRole,
+                IDDownloadableRole,
             };
 
             explicit GameItemsModel( QObject* parent = 0 );
diff --git a/player/touch/Details.qml b/player/touch/Details.qml
index 39d57b4..b17ec36 100644
--- a/player/touch/Details.qml
+++ b/player/touch/Details.qml
@@ -28,12 +28,16 @@ Rectangle {
     property int gameIndex;
 
     function propagate(gameName, gameDescription, screenshotUrls, status, index) {
-		if (status == GameViewItem.Downloadable)
+		if (status == GameViewItem.Downloadable) {
         	play_game_btn.text = qsTr("Download " + gameName);
-		else if (status == GameViewItem.Installed)
+        	play_game_btn.icon = "icons/download.png";
+        } else if (status == GameViewItem.Installed) {
         	play_game_btn.text = qsTr("Play " + gameName);
-		else if (status == GameViewItem.Upgradable)
+        	play_game_btn.icon = "icons/media-playback-start.png";
+        } else if (status == GameViewItem.Upgradable) {
         	play_game_btn.text = qsTr("Upgrade " + gameName);
+            play_game_btn.icon = "system-software-update.png";
+        }
 
         read_author_desc_btn.subtext = qsTr(gameDescription);
         previewImages.model = screenshotUrls;
diff --git a/player/touch/Home.qml b/player/touch/Home.qml
index 168e445..ffb1cc5 100644
--- a/player/touch/Home.qml
+++ b/player/touch/Home.qml
@@ -51,7 +51,7 @@ Rectangle {
             subtext: qsTr(gameDescriptionDownloadable);
 
             onClicked: {
-                detailsPage.propagate(gameNameDownloadable, \
gameDescriptionDownloadable, screenshotUrlsDownloadable, status, index); +            \
detailsPage.propagate(gameNameDownloadable, gameDescriptionDownloadable, \
screenshotUrlsDownloadable, statusDownloadable, index);  }
         }
     }
diff --git a/player/touch/gluon_qmlplayer.qrc b/player/touch/gluon_qmlplayer.qrc
index 7eaf971..9625b18 100644
--- a/player/touch/gluon_qmlplayer.qrc
+++ b/player/touch/gluon_qmlplayer.qrc
@@ -22,6 +22,8 @@
         <file>icons/lineedit.png</file>
         <file>icons/list-add-user.png</file>
         <file>icons/media-playback-start.png</file>
+        <file>icons/download.png</file>
+        <file>icons/system-software-update.png</file>
         <file>icons/user-group-new.png</file>
         <file>icons/im-user.png</file>
         <file>icons/hi32-app-gluon.png</file>
diff --git a/player/touch/icons/download.png b/player/touch/icons/download.png
new file mode 100644
index 0000000..e81619b
Binary files /dev/null and b/player/touch/icons/download.png differ
diff --git a/player/touch/icons/system-software-update.png \
b/player/touch/icons/system-software-update.png new file mode 100644
index 0000000..a9448cd
Binary files /dev/null and b/player/touch/icons/system-software-update.png differ


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic