Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Theme Editor: Began working on open document functionality (still incomplete), fixed a nested conditional parsing bug in the parser, and fixed segfault-on-codegen-from-empty-tree bug

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26609 a1c6a512-1295-4272-9138-f99709370657

+35 -11
+12
utils/themeeditor/editorwindow.cpp
··· 25 25 #include <QDesktopWidget> 26 26 #include <QFileSystemModel> 27 27 #include <QSettings> 28 + #include <QFileDialog> 28 29 29 30 EditorWindow::EditorWindow(QWidget *parent) : 30 31 QMainWindow(parent), ··· 181 182 { 182 183 if(ui->editorTabs->currentIndex() >= 0) 183 184 dynamic_cast<SkinDocument*>(ui->editorTabs->currentWidget())->saveAs(); 185 + } 186 + 187 + void EditorWindow::openFile() 188 + { 189 + QStringList fileNames; 190 + QSettings settings; 191 + 192 + settings.beginGroup("SkinDocument"); 193 + QString directory = settings.value("defaultDirectory", "").toString(); 194 + fileNames = QFileDialog::getOpenFileNames(this, tr("Open Files"), directory, 195 + SkinDocument::fileFilter()); 184 196 } 185 197 186 198
+1
utils/themeeditor/editorwindow.h
··· 49 49 void closeCurrent(); 50 50 void saveCurrent(); 51 51 void saveCurrentAs(); 52 + void openFile(); 52 53 void tabTitleChanged(QString title); 53 54 void updateCurrent(); /* Generates code in the current tab */ 54 55
+4 -1
utils/themeeditor/parsetreemodel.cpp
··· 49 49 50 50 QString ParseTreeModel::genCode() 51 51 { 52 - return root->genCode(); 52 + if(root) 53 + return root->genCode(); 54 + else 55 + return ""; 53 56 } 54 57 55 58 bool ParseTreeModel::changeTree(const char *document)
+7 -1
utils/themeeditor/skin_parser.c
··· 685 685 while(nested) 686 686 { 687 687 if(*cursor == ENUMLISTOPENSYM) 688 + { 688 689 nested++; 689 - if(*cursor == ENUMLISTCLOSESYM) 690 + break; 691 + } 692 + else if(*cursor == ENUMLISTCLOSESYM) 693 + { 690 694 nested--; 695 + break; 696 + } 691 697 cursor++; 692 698 } 693 699 }
+2 -7
utils/themeeditor/skindocument.cpp
··· 28 28 #include <QFileDialog> 29 29 30 30 SkinDocument::SkinDocument(QWidget *parent) : 31 - QWidget(parent), fileFilter(tr("WPS Files (*.wps *.rwps);;" 32 - "SBS Files (*.sbs *.rsbs);;" 33 - "FMS Files (*.fms *.rfms);;" 34 - "All Skin Files (*.wps *.rwps *.sbs " 35 - "*.rsbs *.fms *.rfms);;" 36 - "All Files (*.*)")) 31 + QWidget(parent) 37 32 { 38 33 setupUI(); 39 34 ··· 147 142 directory = settings.value("defaultDirectory", "").toString(); 148 143 149 144 fileName = QFileDialog::getSaveFileName(this, tr("Save Document"), 150 - directory, fileFilter); 145 + directory, fileFilter()); 151 146 directory = fileName; 152 147 if(fileName == "") 153 148 return;
+9 -2
utils/themeeditor/skindocument.h
··· 33 33 { 34 34 Q_OBJECT 35 35 public: 36 - const QString fileFilter; 37 - 36 + static QString fileFilter() 37 + { 38 + return tr("WPS Files (*.wps *.rwps);;" 39 + "SBS Files (*.sbs *.rsbs);;" 40 + "FMS Files (*.fms *.rfms);;" 41 + "All Skin Files (*.wps *.rwps *.sbs " 42 + "*.rsbs *.fms *.rfms);;" 43 + "All Files (*.*)"); 44 + } 38 45 39 46 SkinDocument(QWidget *parent = 0); 40 47 virtual ~SkinDocument();