29 #include <QStringList>
87 if (settings->value (
"editor/create_new_file",
false).toBool ())
90 QFileInfo file_info (QString::fromStdString (file));
93 role <<
"AcceptRole" <<
"AcceptRole";
94 btn << tr (
"Yes") << tr (
"No");
97 tr (
"File\n%1\ndoes not exist. Do you want to create it?").
98 arg (QDir::currentPath () + QDir::separator ()
99 + QString::fromStdString (file)),
100 tr (
"Octave Editor"),
"quest", btn, tr (
"Yes"), role );
107 return (answer == tr (
"Yes"));
112 const std::string& msg,
113 const std::string& title)
116 QString::fromStdString (title),
117 QString::fromStdString (dlg),
118 QStringList (), QString (),
130 const std::string& title,
131 const std::string& btn1,
132 const std::string& btn2,
133 const std::string& btn3,
134 const std::string& btndef)
138 role <<
"AcceptRole" <<
"AcceptRole" <<
"AcceptRole";
139 btn << QString::fromStdString (btn1);
143 btn << QString::fromStdString (btn2);
144 btn << QString::fromStdString (btn3);
147 QString::fromStdString (title),
150 QString::fromStdString (btndef),
165 for (std::list<std::string>::const_iterator it = lst.begin ();
166 it != lst.end (); it++)
168 retval.append (QString::fromStdString (*it));
184 for (octave_link::filter_list::const_iterator it = lst.begin ();
185 it != lst.end (); it++)
187 QString ext = QString::fromStdString (it->first);
188 QString name = QString::fromStdString (it->second);
193 name.replace (QRegExp (
"\\(.*\\)"),
"");
194 ext.replace (
";",
" ");
196 if (name.length () == 0)
199 name = ext.toUpper () +
" Files";
202 retval.append (name +
" (" + ext +
")");
208 std::pair<std::list<int>,
int>
210 const std::string& mode,
211 int width,
int height,
212 const std::list<int>& initial,
213 const std::string& name,
214 const std::list<std::string>& prompt,
215 const std::string& ok_string,
216 const std::string& cancel_string)
219 QString::fromStdString (mode),
222 QString::fromStdString (name),
224 QString::fromStdString (ok_string),
225 QString::fromStdString (cancel_string));
234 return std::pair<std::list<int>,
int> (selected->toStdList (), ok);
237 std::list<std::string>
239 const std::string& title,
240 const std::list<float>& nr,
241 const std::list<float>& nc,
242 const std::list<std::string>& defaults)
244 std::list<std::string> retval;
247 QString::fromStdString (title),
248 QFloatList::fromStdList (nr),
249 QFloatList::fromStdList (nc),
258 for (QStringList::const_iterator it = inputLine->begin ();
259 it != inputLine->end (); it++)
261 retval.push_back (it->toStdString ());
267 std::list<std::string>
269 const std::string& title,
270 const std::string& filename,
271 const std::string& dirname,
272 const std::string& multimode)
274 std::list<std::string> retval;
277 QString::fromStdString (title),
278 QString::fromStdString (filename),
279 QString::fromStdString (dirname),
280 QString::fromStdString (multimode));
288 for (QStringList::const_iterator it = inputLine->begin ();
289 it != inputLine->end (); it++)
290 retval.push_back (it->toStdString ());
293 retval.push_back ((QString (
"%1").
arg (
301 const std::string& dir,
306 QString qdir = QString::fromStdString (dir);
307 QString qfile = QString::fromStdString (file);
311 ? tr (
"The file %1 does not exist in the load path. To debug the function you are editing, you must either change to the directory %2 or add that directory to the load path.").arg (qfile).arg (qdir)
312 : tr (
"The file %1 is shadowed by a file with the same name in the load path. To debug the function you are editing, change to the directory %2.").arg (qfile).arg (qdir));
314 QString title = tr (
"Change Directory or Add Directory to Load Path");
316 QString cd_txt = tr (
"Change Directory");
317 QString addpath_txt = tr (
"Add Directory to Load Path");
318 QString cancel_txt = tr (
"Cancel");
323 role <<
"AcceptRole";
327 role <<
"AcceptRole";
330 role <<
"AcceptRole";
339 if (result == cd_txt)
341 else if (result == addpath_txt)
361 const std::list<workspace_element>& ws)
365 QStringList class_names;
366 QStringList dimensions;
370 for (std::list<workspace_element>::const_iterator it = ws.begin ();
371 it != ws.end (); it++)
373 scopes.append (it->scope ());
374 symbols.append (QString::fromStdString (it->symbol ()));
375 class_names.append (QString::fromStdString (it->class_name ()));
376 dimensions.append (QString::fromStdString (it->dimension ()));
377 values.append (QString::fromStdString (it->value ()));
378 complex_flags.append (it->complex_flag ());
382 dimensions, values, complex_flags);
397 qt_hist.append (QString::fromStdString (hist[i]));
446 const std::string& file,
int line)
480 bool addpath_option =
true;
493 if (dir_in_load_path)
511 addpath_option =
false;