diff options
-rw-r--r-- | utils/themeeditor/gui/devicestate.cpp | 3 | ||||
-rw-r--r-- | utils/themeeditor/gui/devicestate.h | 5 | ||||
-rw-r--r-- | utils/themeeditor/gui/editorwindow.cpp | 15 | ||||
-rw-r--r-- | utils/themeeditor/gui/skindocument.cpp | 4 | ||||
-rw-r--r-- | utils/themeeditor/gui/skindocument.h | 1 | ||||
-rw-r--r-- | utils/themeeditor/main.cpp | 8 | ||||
-rw-r--r-- | utils/themeeditor/models/parsetreenode.cpp | 9 | ||||
-rw-r--r-- | utils/themeeditor/resources/deviceoptions | 15 |
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 | ||
205 | QVariant DeviceState::data(QString tag) | 205 | QVariant 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 | |||
31 | class DeviceState : public QWidget { | 33 | class 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 | ||
52 | signals: | 55 | signals: |
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 | ||
500 | void EditorWindow::lineChanged(int line) | 500 | void 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 | ||
512 | void EditorWindow::undo() | 511 | void 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 | ||
46 | SkinDocument::SkinDocument(QLabel* statusLabel, QString file, | 47 | SkinDocument::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 | |||
34 | int main(int argc, char* argv[]) | 26 | int 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 */ |
513 | void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport) | 513 | void 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 | |||
100 | ps ; Shuffle ; check ; true | 103 | ps ; Shuffle ; check ; true |
101 | pt ; Total Track Time ; text ; 3:00 | 104 | pt ; Total Track Time ; text ; 3:00 |
102 | pv ; Current Volume (dB) ; spin(-100,100) ; 0 | 105 | pv ; 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 |
104 | pS ; Track Starting ; check ; true | 107 | pS ; Track Starting ; check ; true |
105 | pE ; Track Ending ; check ; false | 108 | pE ; Track Ending ; check ; false |
106 | Sp ; Playback Pitch ; fspin(50,200) ; 100 | 109 | Sp ; Playback Pitch ; fspin(50,200) ; 100 |
107 | rp ; Song Playcount ; spin(0,10000) ; 20 | 110 | rp ; Song Playcount ; spin(0,10000) ; 20 |
108 | rr ; Song Rating ; spin(0,10) ; 5 | 111 | rr ; Song Rating ; spin(0,10) ; 5 |
109 | ra ; Autoscore ; spin(0,10) ; 7 | 112 | ra ; 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] |
113 | bl ; Battery Level (-1 for unknown) ; spin(-1,100) ; 50 | 116 | bl ; 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] |
124 | rg ; Replaygain Value (dB) ; fspin(-100,20) ; 0 | 127 | rg ; 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 |
126 | mm ; Repeat Mode ; combo(Off, All, One, Shuffle, A-B) ; All | 129 | mm ; Repeat Mode ; combo(Off, All, One, Shuffle, A-B) ; All |
127 | mp ; Playback Mode ; combo(Stop, Play, Pause, Fast Forward, Rewind, Recording, Recording Paused, FM Radio Playing, FM Radio Muted) ; Play | 130 | mp ; Playback Mode ; combo(Stop, Play, Pause, Fast Forward, Rewind, Recording, Recording Paused, FM Radio Playing, FM Radio Muted) ; Play |
128 | xf ; Crossfade Type ; combo(Off, Automatic Track Skip Only, Shuffle, Shuffle or Manual Track Skip, Always) ; Always | 131 | xf ; 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 | |||
137 | cI ; 12h Hour ; text ; 09 | 140 | cI ; 12h Hour ; text ; 09 |
138 | cl ; 12h Hour (No Padding) ; text ; 9 | 141 | cl ; 12h Hour (No Padding) ; text ; 9 |
139 | cm ; Month (Padded) ; text ; 03 | 142 | cm ; 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 |
141 | cM ; Minute (Padded) ; text ; 29 | 144 | cM ; Minute (Padded) ; text ; 29 |
142 | cS ; Second (Padded) ; text ; 50 | 145 | cS ; Second (Padded) ; text ; 50 |
143 | cy ; Last Two Digits of Year (Padded) ; text ; 09 | 146 | cy ; Last Two Digits of Year (Padded) ; text ; 09 |
@@ -147,9 +150,9 @@ cp ; Lowercase AM or PM ; combo(am,pm) ; am | |||
147 | ca ; Abbreviated Weekday Name ; combo(Sun, Mon, Tue, Thu, Fri, Sat); Tue | 150 | ca ; Abbreviated Weekday Name ; combo(Sun, Mon, Tue, Thu, Fri, Sat); Tue |
148 | cb ; Abbreviated Month Name ; combo(Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) ; Jan | 151 | cb ; Abbreviated Month Name ; combo(Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) ; Jan |
149 | cu ; Day of Week (1..7, 1 is Monday) ; spin(1,7) ; 2 | 152 | cu ; 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 |
151 | cw ; Day of Week (0..6, 0 is Sunday) ; spin(0,6) ; 2 | 154 | cw ; 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] |
155 | Rp ; Target Has Recorder ; check ; false | 158 | Rp ; Target Has Recorder ; check ; false |