diff options
Diffstat (limited to 'utils/themeeditor/editorwindow.cpp')
-rw-r--r-- | utils/themeeditor/editorwindow.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/utils/themeeditor/editorwindow.cpp b/utils/themeeditor/editorwindow.cpp index dfc4b5981e..91e099ebf7 100644 --- a/utils/themeeditor/editorwindow.cpp +++ b/utils/themeeditor/editorwindow.cpp | |||
@@ -117,6 +117,11 @@ void EditorWindow::setupMenus() | |||
117 | QObject::connect(ui->actionToolbarSave, SIGNAL(triggered()), | 117 | QObject::connect(ui->actionToolbarSave, SIGNAL(triggered()), |
118 | this, SLOT(saveCurrent())); | 118 | this, SLOT(saveCurrent())); |
119 | 119 | ||
120 | QObject::connect(ui->actionOpen_Document, SIGNAL(triggered()), | ||
121 | this, SLOT(openFile())); | ||
122 | QObject::connect(ui->actionToolbarOpen, SIGNAL(triggered()), | ||
123 | this, SLOT(openFile())); | ||
124 | |||
120 | } | 125 | } |
121 | 126 | ||
122 | 127 | ||
@@ -193,6 +198,28 @@ void EditorWindow::openFile() | |||
193 | QString directory = settings.value("defaultDirectory", "").toString(); | 198 | QString directory = settings.value("defaultDirectory", "").toString(); |
194 | fileNames = QFileDialog::getOpenFileNames(this, tr("Open Files"), directory, | 199 | fileNames = QFileDialog::getOpenFileNames(this, tr("Open Files"), directory, |
195 | SkinDocument::fileFilter()); | 200 | SkinDocument::fileFilter()); |
201 | |||
202 | for(int i = 0; i < fileNames.count(); i++) | ||
203 | { | ||
204 | if(!QFile::exists(fileNames[i])) | ||
205 | continue; | ||
206 | |||
207 | QString current = fileNames[i]; | ||
208 | |||
209 | /* Adding a new document for each file name */ | ||
210 | SkinDocument* doc = new SkinDocument(current); | ||
211 | ui->editorTabs->addTab(doc, doc->getTitle()); | ||
212 | |||
213 | QObject::connect(doc, SIGNAL(titleChanged(QString)), | ||
214 | this, SLOT(tabTitleChanged(QString))); | ||
215 | |||
216 | /* And setting the new default directory */ | ||
217 | current.chop(current.length() - current.lastIndexOf('/') - 1); | ||
218 | settings.setValue("defaultDirectory", current); | ||
219 | |||
220 | } | ||
221 | |||
222 | settings.endGroup(); | ||
196 | } | 223 | } |
197 | 224 | ||
198 | 225 | ||