summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp2
-rw-r--r--noncore/apps/opie-console/script.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index afac542..7ffeca7 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -293,12 +293,13 @@ void MainWindow::slotRecordScript() {
void MainWindow::slotSaveScript() {
if (currentSession() && currentSession()->emulationHandler()->isRecording()) {
MimeTypes types;
QStringList script;
script << "text/plain";
+ script << "text/all";
types.insert("Script", script);
QString filename = OFileDialog::getSaveFileName(2, "/", QString::null, types);
if (!filename.isEmpty()) {
currentSession()->emulationHandler()->script()->saveTo(filename);
currentSession()->emulationHandler()->clearScript();
}
@@ -307,12 +308,13 @@ void MainWindow::slotSaveScript() {
void MainWindow::slotRunScript() {
if (currentSession()) {
MimeTypes types;
QStringList script;
script << "text/plain";
+ script << "text/all";
types.insert("Script", script);
QString filename = OFileDialog::getOpenFileName(2, "/", QString::null, types);
if (!filename.isEmpty()) {
Script script(DocLnk(filename).file());
currentSession()->emulationHandler()->runScript(&script);
}
diff --git a/noncore/apps/opie-console/script.cpp b/noncore/apps/opie-console/script.cpp
index 9cb1cd3..e6e9d6d 100644
--- a/noncore/apps/opie-console/script.cpp
+++ b/noncore/apps/opie-console/script.cpp
@@ -4,12 +4,13 @@
Script::Script() {
}
Script::Script(const QString fileName) {
QFile file(fileName);
+ file.open(IO_ReadOnly );
m_script = file.readAll();
}
void Script::saveTo(const QString fileName) const {
QFile file(fileName);
file.open(IO_WriteOnly);