~ubuntu-branches/ubuntu/karmic/rkward/karmic

« back to all changes in this revision

Viewing changes to rkward/agents/showedittextfileagent.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2006-11-06 16:30:00 UTC
  • mfrom: (1.2.1 upstream) (3.1.1 feisty)
  • Revision ID: james.westby@ubuntu.com-20061106163000-qi8ju75eqecrfay7
* new upstream release
* depend on either php4-cli or php5-cli

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "../windows/rkcommandeditorwindow.h"
28
28
#include "../rbackend/rinterface.h"
29
29
#include "../rbackend/rembedinternal.h"
 
30
#include "../windows/rkworkplace.h"
30
31
#include "../rkglobals.h"
31
32
#include "../rkward.h"
32
33
 
33
34
#include "../debug.h"
34
35
 
35
 
ShowEditTextFileAgent::ShowEditTextFileAgent (RCallbackArgs *args, const QString &text, const QString &caption) : QObject (RKGlobals::rkApp ()) {
 
36
ShowEditTextFileAgent::ShowEditTextFileAgent (RCallbackArgs *args, const QString &text, const QString &caption) : QObject (RKwardApp::getApp ()) {
36
37
        RK_TRACE (APP);
37
38
 
38
39
        ShowEditTextFileAgent::args = args;
66
67
                for (int n = 0; n < args->int_a; ++n) {
67
68
                        message.append (args->chars_a[n]).append (" (\"").append (args->chars_b[n]).append ("\")\n");
68
69
 
69
 
                        RKCommandEditorWindow *window = new RKCommandEditorWindow (0, false);
70
 
                        bool ok = window->openURL (KURL (args->chars_a[n]), false, true);
 
70
                        bool ok = RKWorkplace::mainWorkplace ()->openScriptEditor (KURL (args->chars_a[n]), false, true, QString (*(args->chars_c)));
71
71
 
72
 
                        if (ok) {
73
 
                                if (qstrlen (*(args->chars_c))) window->setTabCaption (*(args->chars_c));
74
 
                                RKGlobals::rkApp ()->addWindow (window);
75
 
                        } else {
76
 
                                delete (window);
 
72
                        if (!ok)  {
77
73
                                bad_files_list.append ("- ").append (args->chars_a[n]).append (" (\"").append (args->chars_b[n]).append ("\")\n");
78
74
                        }
79
75
                }
84
80
                for (int n = 0; n < args->int_a; ++n) {
85
81
                        message.append (args->chars_a[n]).append (" (\"").append (args->chars_b[n]).append ("\")\n");
86
82
 
87
 
                        RKCommandEditorWindow *window = new RKCommandEditorWindow (0, false);
88
 
                        bool ok = window->openURL (KURL (args->chars_a[n]), true, false);
 
83
                        bool ok = RKWorkplace::mainWorkplace ()->openScriptEditor (KURL (args->chars_a[n]), true, false, QString (args->chars_b[n]));
89
84
 
90
 
                        if (ok) {
91
 
                                if (qstrlen (args->chars_b[n])) window->setTabCaption (args->chars_b[n]);
92
 
                                RKGlobals::rkApp ()->addWindow (window);
93
 
                        } else {
94
 
                                delete (window);
 
85
                        if (!ok) {
95
86
                                bad_files_list.append ("- ").append (args->chars_a[n]).append (" (\"").append (args->chars_b[n]).append ("\")\n");
96
87
                        }
97
88
                }