summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/themeeditor/gui/devicestate.cpp3
-rw-r--r--utils/themeeditor/gui/devicestate.h5
-rw-r--r--utils/themeeditor/gui/editorwindow.cpp15
-rw-r--r--utils/themeeditor/gui/skindocument.cpp4
-rw-r--r--utils/themeeditor/gui/skindocument.h1
-rw-r--r--utils/themeeditor/main.cpp8
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp9
-rw-r--r--utils/themeeditor/resources/deviceoptions15
8 files changed, 32 insertions, 28 deletions
diff --git a/utils/themeeditor/gui/devicestate.cpp b/utils/themeeditor/gui/devicestate.cpp
index 80efd4d4d1..f4907e1935 100644
--- a/utils/themeeditor/gui/devicestate.cpp
+++ b/utils/themeeditor/gui/devicestate.cpp
@@ -202,7 +202,8 @@ DeviceState::~DeviceState()
202{ 202{
203} 203}
204 204
205QVariant DeviceState::data(QString tag) 205QVariant DeviceState::data(QString tag, int paramCount,
206 skin_tag_parameter *params)
206{ 207{
207 QPair<InputType, QWidget*> found = 208 QPair<InputType, QWidget*> found =
208 inputs.value(tag, QPair<InputType, QWidget*>(Slide, 0)); 209 inputs.value(tag, QPair<InputType, QWidget*>(Slide, 0));
diff --git a/utils/themeeditor/gui/devicestate.h b/utils/themeeditor/gui/devicestate.h
index cae3cef7e1..d3a6c4650f 100644
--- a/utils/themeeditor/gui/devicestate.h
+++ b/utils/themeeditor/gui/devicestate.h
@@ -28,6 +28,8 @@
28#include <QVariant> 28#include <QVariant>
29#include <QTabWidget> 29#include <QTabWidget>
30 30
31#include "skin_parser.h"
32
31class DeviceState : public QWidget { 33class DeviceState : public QWidget {
32 34
33 Q_OBJECT 35 Q_OBJECT
@@ -46,7 +48,8 @@ public:
46 DeviceState(QWidget *parent = 0); 48 DeviceState(QWidget *parent = 0);
47 virtual ~DeviceState(); 49 virtual ~DeviceState();
48 50
49 QVariant data(QString tag); 51 QVariant data(QString tag, int paramCount = 0,
52 skin_tag_parameter* params = 0);
50 void setData(QString tag, QVariant data); 53 void setData(QString tag, QVariant data);
51 54
52signals: 55signals:
diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp
index ea6c91f074..96f855242d 100644
--- a/utils/themeeditor/gui/editorwindow.cpp
+++ b/utils/themeeditor/gui/editorwindow.cpp
@@ -499,14 +499,13 @@ void EditorWindow::updateCurrent()
499 499
500void EditorWindow::lineChanged(int line) 500void EditorWindow::lineChanged(int line)
501{ 501{
502 ui->parseTree->collapseAll(); 502 ui->parseTree->collapseAll();
503 ParseTreeModel* model = dynamic_cast<ParseTreeModel*> 503 ParseTreeModel* model = dynamic_cast<ParseTreeModel*>
504 (ui->parseTree->model()); 504 (ui->parseTree->model());
505 parseTreeSelection = new QItemSelectionModel(model); 505 parseTreeSelection = new QItemSelectionModel(model);
506 expandLine(model, QModelIndex(), line); 506 expandLine(model, QModelIndex(), line);
507 sizeColumns(); 507 sizeColumns();
508 ui->parseTree->setSelectionModel(parseTreeSelection); 508 ui->parseTree->setSelectionModel(parseTreeSelection);
509
510} 509}
511 510
512void EditorWindow::undo() 511void EditorWindow::undo()
diff --git a/utils/themeeditor/gui/skindocument.cpp b/utils/themeeditor/gui/skindocument.cpp
index f8206e1a26..28e5297b48 100644
--- a/utils/themeeditor/gui/skindocument.cpp
+++ b/utils/themeeditor/gui/skindocument.cpp
@@ -41,6 +41,7 @@ SkinDocument::SkinDocument(QLabel* statusLabel, ProjectModel* project,
41 saved = ""; 41 saved = "";
42 parseStatus = tr("Empty document"); 42 parseStatus = tr("Empty document");
43 blockUpdate = false; 43 blockUpdate = false;
44 currentLine = -1;
44} 45}
45 46
46SkinDocument::SkinDocument(QLabel* statusLabel, QString file, 47SkinDocument::SkinDocument(QLabel* statusLabel, QString file,
@@ -208,8 +209,9 @@ void SkinDocument::cursorChanged()
208 parseStatus = tr("Errors in document"); 209 parseStatus = tr("Errors in document");
209 statusLabel->setText(parseStatus); 210 statusLabel->setText(parseStatus);
210 } 211 }
211 else 212 else if(editor->textCursor().blockNumber() != currentLine)
212 { 213 {
214 currentLine = editor->textCursor().blockNumber();
213 emit lineChanged(editor->textCursor().blockNumber() + 1); 215 emit lineChanged(editor->textCursor().blockNumber() + 1);
214 } 216 }
215 217
diff --git a/utils/themeeditor/gui/skindocument.h b/utils/themeeditor/gui/skindocument.h
index 1713023779..7563b3cb53 100644
--- a/utils/themeeditor/gui/skindocument.h
+++ b/utils/themeeditor/gui/skindocument.h
@@ -97,6 +97,7 @@ private:
97 QString fileName; 97 QString fileName;
98 QString saved; 98 QString saved;
99 QString parseStatus; 99 QString parseStatus;
100 int currentLine;
100 101
101 QLayout* layout; 102 QLayout* layout;
102 CodeEditor* editor; 103 CodeEditor* editor;
diff --git a/utils/themeeditor/main.cpp b/utils/themeeditor/main.cpp
index 78df1878f6..5dc52a0b88 100644
--- a/utils/themeeditor/main.cpp
+++ b/utils/themeeditor/main.cpp
@@ -19,18 +19,10 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "skin_parser.h"
23#include "skin_debug.h"
24#include "editorwindow.h" 22#include "editorwindow.h"
25 23
26#include <cstdlib>
27#include <cstdio>
28#include <iostream>
29
30#include <QtGui/QApplication> 24#include <QtGui/QApplication>
31 25
32#include "parsetreemodel.h"
33
34int main(int argc, char* argv[]) 26int main(int argc, char* argv[])
35{ 27{
36 QApplication app(argc, argv); 28 QApplication app(argc, argv);
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index 45cd62f8a6..bdc0c309b8 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -509,7 +509,7 @@ void ParseTreeNode::render(const RBRenderInfo& info)
509 509
510} 510}
511 511
512/* This version is called for logical lines and such */ 512/* This version is called for logical lines, tags, conditionals and such */
513void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport) 513void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport)
514{ 514{
515 if(element->type == LINE) 515 if(element->type == LINE)
@@ -524,10 +524,13 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport)
524 } 524 }
525 else if(element->type == TAG) 525 else if(element->type == TAG)
526 { 526 {
527
528 if(!execTag(info, viewport)) 527 if(!execTag(info, viewport))
529 viewport->write(evalTag(info).toString()); 528 viewport->write(evalTag(info).toString());
530 529 }
530 else if(element->type == CONDITIONAL)
531 {
532 int child = evalTag(info, true, element->children_count).toInt();
533 //children[0]->render(info, viewport);
531 } 534 }
532} 535}
533 536
diff --git a/utils/themeeditor/resources/deviceoptions b/utils/themeeditor/resources/deviceoptions
index 855c8baaeb..b9081c6253 100644
--- a/utils/themeeditor/resources/deviceoptions
+++ b/utils/themeeditor/resources/deviceoptions
@@ -23,6 +23,9 @@
23# 23#
24# Blank lines are ignored 24# Blank lines are ignored
25# 25#
26# A ? at the beginning of a field indicates that it's a special value for
27# conditionals
28#
26# Be warned: because this file is compiled into the application, I'm not 29# Be warned: because this file is compiled into the application, I'm not
27# performing much of any error checking on it: screwing up the syntax may very 30# performing much of any error checking on it: screwing up the syntax may very
28# well segfault the application on startup 31# well segfault the application on startup
@@ -100,14 +103,14 @@ pr ; Time Remaining ; text ; 2:00
100ps ; Shuffle ; check ; true 103ps ; Shuffle ; check ; true
101pt ; Total Track Time ; text ; 3:00 104pt ; Total Track Time ; text ; 3:00
102pv ; Current Volume (dB) ; spin(-100,100) ; 0 105pv ; Current Volume (dB) ; spin(-100,100) ; 0
103$pv ; Current Volume (Conditional) ; combo(Mute, Below 0 dB, 0 dB, Above 0 dB) ; 0 dB 106?pv ; Current Volume (Conditional) ; combo(Mute, Below 0 dB, 0 dB, Above 0 dB) ; 0 dB
104pS ; Track Starting ; check ; true 107pS ; Track Starting ; check ; true
105pE ; Track Ending ; check ; false 108pE ; Track Ending ; check ; false
106Sp ; Playback Pitch ; fspin(50,200) ; 100 109Sp ; Playback Pitch ; fspin(50,200) ; 100
107rp ; Song Playcount ; spin(0,10000) ; 20 110rp ; Song Playcount ; spin(0,10000) ; 20
108rr ; Song Rating ; spin(0,10) ; 5 111rr ; Song Rating ; spin(0,10) ; 5
109ra ; Autoscore ; spin(0,10) ; 7 112ra ; Autoscore ; spin(0,10) ; 7
110$C ; Album Art Available ; check ; true 113?C ; Album Art Available ; check ; true
111 114
112[Hardware Status] 115[Hardware Status]
113bl ; Battery Level (-1 for unknown) ; spin(-1,100) ; 50 116bl ; Battery Level (-1 for unknown) ; spin(-1,100) ; 50
@@ -122,7 +125,7 @@ lh ; Hard Disk Activity ; check ; true
122 125
123[Playback Status] 126[Playback Status]
124rg ; Replaygain Value (dB) ; fspin(-100,20) ; 0 127rg ; Replaygain Value (dB) ; fspin(-100,20) ; 0
125$rg ; Replaygain Status (Conditional) ; combo(Off, Track, Album, TrackShuffle, AlbumShuffle, No Tag) ; Off 128?rg ; Replaygain Status (Conditional) ; combo(Off, Track, Album, TrackShuffle, AlbumShuffle, No Tag) ; Off
126mm ; Repeat Mode ; combo(Off, All, One, Shuffle, A-B) ; All 129mm ; Repeat Mode ; combo(Off, All, One, Shuffle, A-B) ; All
127mp ; Playback Mode ; combo(Stop, Play, Pause, Fast Forward, Rewind, Recording, Recording Paused, FM Radio Playing, FM Radio Muted) ; Play 130mp ; Playback Mode ; combo(Stop, Play, Pause, Fast Forward, Rewind, Recording, Recording Paused, FM Radio Playing, FM Radio Muted) ; Play
128xf ; Crossfade Type ; combo(Off, Automatic Track Skip Only, Shuffle, Shuffle or Manual Track Skip, Always) ; Always 131xf ; Crossfade Type ; combo(Off, Automatic Track Skip Only, Shuffle, Shuffle or Manual Track Skip, Always) ; Always
@@ -137,7 +140,7 @@ ck ; 24h Hour (No Padding) ; text ; 9
137cI ; 12h Hour ; text ; 09 140cI ; 12h Hour ; text ; 09
138cl ; 12h Hour (No Padding) ; text ; 9 141cl ; 12h Hour (No Padding) ; text ; 9
139cm ; Month (Padded) ; text ; 03 142cm ; Month (Padded) ; text ; 03
140$cm ; Month (Conditional) ; combo(January, February, March, April, May, Jun, July, August, September, October, November, December) ; January 143?cm ; Month (Conditional) ; combo(January, February, March, April, May, Jun, July, August, September, October, November, December) ; January
141cM ; Minute (Padded) ; text ; 29 144cM ; Minute (Padded) ; text ; 29
142cS ; Second (Padded) ; text ; 50 145cS ; Second (Padded) ; text ; 50
143cy ; Last Two Digits of Year (Padded) ; text ; 09 146cy ; Last Two Digits of Year (Padded) ; text ; 09
@@ -147,9 +150,9 @@ cp ; Lowercase AM or PM ; combo(am,pm) ; am
147ca ; Abbreviated Weekday Name ; combo(Sun, Mon, Tue, Thu, Fri, Sat); Tue 150ca ; Abbreviated Weekday Name ; combo(Sun, Mon, Tue, Thu, Fri, Sat); Tue
148cb ; Abbreviated Month Name ; combo(Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) ; Jan 151cb ; Abbreviated Month Name ; combo(Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) ; Jan
149cu ; Day of Week (1..7, 1 is Monday) ; spin(1,7) ; 2 152cu ; Day of Week (1..7, 1 is Monday) ; spin(1,7) ; 2
150$cu ; Day of Week (Monday First, Conditional) ; combo(Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) ; Tuesday 153?cu ; Day of Week (Monday First, Conditional) ; combo(Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) ; Tuesday
151cw ; Day of Week (0..6, 0 is Sunday) ; spin(0,6) ; 2 154cw ; Day of Week (0..6, 0 is Sunday) ; spin(0,6) ; 2
152$cw ; Day of Week (Sunday First, Conditional) ; combo(Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) ; Tuesday 155?cw ; Day of Week (Sunday First, Conditional) ; combo(Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) ; Tuesday
153 156
154[Recording Status] 157[Recording Status]
155Rp ; Target Has Recorder ; check ; false 158Rp ; Target Has Recorder ; check ; false