summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/gui
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-07-01 15:02:32 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-07-01 15:02:32 +0200
commite7fdf80c175c9dd6a86fbe29556ac6ef7bd8ed29 (patch)
tree5a7ca6941bfbca9a9ce9cd171690fa39533bad3e /rbutil/rbutilqt/gui
parentb7931594f9b9a55ba58b4087ab08a4e820e66e7b (diff)
downloadrockbox-e7fdf80c175c9dd6a86fbe29556ac6ef7bd8ed29.tar.gz
rockbox-e7fdf80c175c9dd6a86fbe29556ac6ef7bd8ed29.zip
Do some minor cleanup.
- Move a GUI-only implementation class around. - Make some strings non-translatable which don't make sense translating. - Rename internal state in installation class. There is no current build anymore. Change-Id: I7384c5601de36bc48f858fe5c7b009653d439d94
Diffstat (limited to 'rbutil/rbutilqt/gui')
-rw-r--r--rbutil/rbutilqt/gui/comboboxviewdelegate.cpp54
-rw-r--r--rbutil/rbutilqt/gui/comboboxviewdelegate.h30
-rw-r--r--rbutil/rbutilqt/gui/infowidgetfrm.ui4
-rw-r--r--rbutil/rbutilqt/gui/manualwidgetfrm.ui2
-rw-r--r--rbutil/rbutilqt/gui/selectiveinstallwidget.cpp12
-rw-r--r--rbutil/rbutilqt/gui/selectiveinstallwidgetfrm.ui2
6 files changed, 94 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/gui/comboboxviewdelegate.cpp b/rbutil/rbutilqt/gui/comboboxviewdelegate.cpp
new file mode 100644
index 0000000000..189f71c95e
--- /dev/null
+++ b/rbutil/rbutilqt/gui/comboboxviewdelegate.cpp
@@ -0,0 +1,54 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2011 by Dominik Riebeling
10 *
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
13 *
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
16 *
17 ****************************************************************************/
18
19#include <QtGui>
20#include <qdebug.h>
21#include "comboboxviewdelegate.h"
22
23void ComboBoxViewDelegate::paint(QPainter *painter,
24 const QStyleOptionViewItem &option, const QModelIndex &index) const
25{
26 QPen pen;
27 QFont font;
28 pen = painter->pen();
29 font = painter->font();
30
31 painter->save();
32 // paint selection
33 if(option.state & QStyle::State_Selected) {
34 painter->setPen(QPen(Qt::NoPen));
35 painter->setBrush(QApplication::palette().highlight());
36 painter->drawRect(option.rect);
37 painter->restore();
38 painter->save();
39 pen.setColor(QApplication::palette().color(QPalette::HighlightedText));
40 }
41 else {
42 pen.setColor(QApplication::palette().color(QPalette::Text));
43 }
44 // draw data (text)
45 painter->setPen(pen);
46 painter->drawText(option.rect, Qt::AlignLeft, index.data().toString());
47
48 // draw user data right aligned, italic
49 font.setItalic(true);
50 painter->setFont(font);
51 painter->drawText(option.rect, Qt::AlignRight, index.data(Qt::UserRole).toString());
52 painter->restore();
53}
54
diff --git a/rbutil/rbutilqt/gui/comboboxviewdelegate.h b/rbutil/rbutilqt/gui/comboboxviewdelegate.h
new file mode 100644
index 0000000000..40f6b07d02
--- /dev/null
+++ b/rbutil/rbutilqt/gui/comboboxviewdelegate.h
@@ -0,0 +1,30 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 *
9 * Copyright (C) 2011 by Dominik Riebeling
10 *
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
13 *
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
16 *
17 ****************************************************************************/
18
19#include <QtGui>
20
21class ComboBoxViewDelegate : public QStyledItemDelegate
22{
23 Q_OBJECT
24 public:
25 ComboBoxViewDelegate(QObject* parent = 0) : QStyledItemDelegate(parent) { }
26
27 void paint(QPainter *painter, const QStyleOptionViewItem &option,
28 const QModelIndex &index) const;
29};
30
diff --git a/rbutil/rbutilqt/gui/infowidgetfrm.ui b/rbutil/rbutilqt/gui/infowidgetfrm.ui
index 41ac46f8dc..8c7fdb30f7 100644
--- a/rbutil/rbutilqt/gui/infowidgetfrm.ui
+++ b/rbutil/rbutilqt/gui/infowidgetfrm.ui
@@ -11,7 +11,7 @@
11 </rect> 11 </rect>
12 </property> 12 </property>
13 <property name="windowTitle"> 13 <property name="windowTitle">
14 <string>Form</string> 14 <string>Info</string>
15 </property> 15 </property>
16 <layout class="QGridLayout" name="gridLayout"> 16 <layout class="QGridLayout" name="gridLayout">
17 <item row="0" column="0"> 17 <item row="0" column="0">
@@ -31,7 +31,7 @@
31 <widget class="QTreeWidget" name="treeInfo"> 31 <widget class="QTreeWidget" name="treeInfo">
32 <column> 32 <column>
33 <property name="text"> 33 <property name="text">
34 <string>1</string> 34 <string>Package</string>
35 </property> 35 </property>
36 </column> 36 </column>
37 </widget> 37 </widget>
diff --git a/rbutil/rbutilqt/gui/manualwidgetfrm.ui b/rbutil/rbutilqt/gui/manualwidgetfrm.ui
index 8757c4569e..add26736c9 100644
--- a/rbutil/rbutilqt/gui/manualwidgetfrm.ui
+++ b/rbutil/rbutilqt/gui/manualwidgetfrm.ui
@@ -11,7 +11,7 @@
11 </rect> 11 </rect>
12 </property> 12 </property>
13 <property name="windowTitle"> 13 <property name="windowTitle">
14 <string>Form</string> 14 <string>Manual</string>
15 </property> 15 </property>
16 <layout class="QGridLayout" name="gridLayout"> 16 <layout class="QGridLayout" name="gridLayout">
17 <item row="0" column="0"> 17 <item row="0" column="0">
diff --git a/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp b/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp
index dbbe4afb4d..ec8ce1cc64 100644
--- a/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp
+++ b/rbutil/rbutilqt/gui/selectiveinstallwidget.cpp
@@ -63,7 +63,7 @@ void SelectiveInstallWidget::selectedVersionChanged(int index)
63 if(current == "release") 63 if(current == "release")
64 ui.selectedDescription->setText(tr("This is the latest stable " 64 ui.selectedDescription->setText(tr("This is the latest stable "
65 "release available.")); 65 "release available."));
66 if(current == "current") 66 if(current == "development")
67 ui.selectedDescription->setText(tr("The development version is " 67 ui.selectedDescription->setText(tr("The development version is "
68 "updated on every code change. Last update was on %1").arg( 68 "updated on every code change. Last update was on %1").arg(
69 ServerInfo::value(ServerInfo::BleedingDate).toString())); 69 ServerInfo::value(ServerInfo::BleedingDate).toString()));
@@ -89,7 +89,7 @@ void SelectiveInstallWidget::updateVersion(void)
89 // re-populate all version items 89 // re-populate all version items
90 m_versions.clear(); 90 m_versions.clear();
91 m_versions.insert("release", ServerInfo::value(ServerInfo::CurReleaseVersion).toString()); 91 m_versions.insert("release", ServerInfo::value(ServerInfo::CurReleaseVersion).toString());
92 m_versions.insert("current", ServerInfo::value(ServerInfo::BleedingRevision).toString()); 92 m_versions.insert("development", ServerInfo::value(ServerInfo::BleedingRevision).toString());
93 m_versions.insert("rc", ServerInfo::value(ServerInfo::RelCandidateVersion).toString()); 93 m_versions.insert("rc", ServerInfo::value(ServerInfo::RelCandidateVersion).toString());
94 94
95 ui.selectedVersion->clear(); 95 ui.selectedVersion->clear();
@@ -97,9 +97,9 @@ void SelectiveInstallWidget::updateVersion(void)
97 ui.selectedVersion->addItem(tr("Stable Release (Version %1)").arg( 97 ui.selectedVersion->addItem(tr("Stable Release (Version %1)").arg(
98 m_versions["release"]), "release"); 98 m_versions["release"]), "release");
99 } 99 }
100 if(!m_versions["current"].isEmpty()) { 100 if(!m_versions["development"].isEmpty()) {
101 ui.selectedVersion->addItem(tr("Development Version (Revison %1)").arg( 101 ui.selectedVersion->addItem(tr("Development Version (Revison %1)").arg(
102 m_versions["current"]), "current"); 102 m_versions["development"]), "development");
103 } 103 }
104 if(!m_versions["rc"].isEmpty()) { 104 if(!m_versions["rc"].isEmpty()) {
105 ui.selectedVersion->addItem(tr("Release Candidate (Revison %1)").arg( 105 ui.selectedVersion->addItem(tr("Release Candidate (Revison %1)").arg(
@@ -116,7 +116,7 @@ void SelectiveInstallWidget::updateVersion(void)
116 ui.selectedVersion->setCurrentIndex(index); 116 ui.selectedVersion->setCurrentIndex(index);
117 } 117 }
118 else { 118 else {
119 index = ui.selectedVersion->findData("current"); 119 index = ui.selectedVersion->findData("development");
120 ui.selectedVersion->setCurrentIndex(index); 120 ui.selectedVersion->setCurrentIndex(index);
121 } 121 }
122 // check if Rockbox is installed. If it is untick the bootloader option, as 122 // check if Rockbox is installed. If it is untick the bootloader option, as
@@ -377,7 +377,7 @@ void SelectiveInstallWidget::installRockbox(void)
377 377
378 if(selected == "release") url = ServerInfo::platformValue(m_target, 378 if(selected == "release") url = ServerInfo::platformValue(m_target,
379 ServerInfo::CurReleaseUrl).toString(); 379 ServerInfo::CurReleaseUrl).toString();
380 else if(selected == "current") url = ServerInfo::platformValue(m_target, 380 else if(selected == "development") url = ServerInfo::platformValue(m_target,
381 ServerInfo::CurDevelUrl).toString(); 381 ServerInfo::CurDevelUrl).toString();
382 else if(selected == "rc") url = ServerInfo::platformValue(m_target, 382 else if(selected == "rc") url = ServerInfo::platformValue(m_target,
383 ServerInfo::RelCandidateUrl).toString(); 383 ServerInfo::RelCandidateUrl).toString();
diff --git a/rbutil/rbutilqt/gui/selectiveinstallwidgetfrm.ui b/rbutil/rbutilqt/gui/selectiveinstallwidgetfrm.ui
index 25cf44ba90..65a6f18620 100644
--- a/rbutil/rbutilqt/gui/selectiveinstallwidgetfrm.ui
+++ b/rbutil/rbutilqt/gui/selectiveinstallwidgetfrm.ui
@@ -17,7 +17,7 @@
17 </sizepolicy> 17 </sizepolicy>
18 </property> 18 </property>
19 <property name="windowTitle"> 19 <property name="windowTitle">
20 <string>Form</string> 20 <string>Selective Installation</string>
21 </property> 21 </property>
22 <layout class="QGridLayout" name="gridLayout_3"> 22 <layout class="QGridLayout" name="gridLayout_3">
23 <item row="0" column="0"> 23 <item row="0" column="0">