forked from len0rd/rockbox
Theme Editor: Implemented document load functionality
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26639 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2a90375c12
commit
fbfdaf5c79
3 changed files with 50 additions and 4 deletions
|
@ -117,6 +117,11 @@ void EditorWindow::setupMenus()
|
|||
QObject::connect(ui->actionToolbarSave, SIGNAL(triggered()),
|
||||
this, SLOT(saveCurrent()));
|
||||
|
||||
QObject::connect(ui->actionOpen_Document, SIGNAL(triggered()),
|
||||
this, SLOT(openFile()));
|
||||
QObject::connect(ui->actionToolbarOpen, SIGNAL(triggered()),
|
||||
this, SLOT(openFile()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -193,6 +198,28 @@ void EditorWindow::openFile()
|
|||
QString directory = settings.value("defaultDirectory", "").toString();
|
||||
fileNames = QFileDialog::getOpenFileNames(this, tr("Open Files"), directory,
|
||||
SkinDocument::fileFilter());
|
||||
|
||||
for(int i = 0; i < fileNames.count(); i++)
|
||||
{
|
||||
if(!QFile::exists(fileNames[i]))
|
||||
continue;
|
||||
|
||||
QString current = fileNames[i];
|
||||
|
||||
/* Adding a new document for each file name */
|
||||
SkinDocument* doc = new SkinDocument(current);
|
||||
ui->editorTabs->addTab(doc, doc->getTitle());
|
||||
|
||||
QObject::connect(doc, SIGNAL(titleChanged(QString)),
|
||||
this, SLOT(tabTitleChanged(QString)));
|
||||
|
||||
/* And setting the new default directory */
|
||||
current.chop(current.length() - current.lastIndexOf('/') - 1);
|
||||
settings.setValue("defaultDirectory", current);
|
||||
|
||||
}
|
||||
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue