annotate libgui/src/workspace-view.cc @ 21724:aba2e6293dd8

use "#if ..." consistently instead of "#ifdef" and "#ifndef" * configure.ac, Doxyfile.in, make_int.cc, Backend.cc, BaseControl.cc, ButtonControl.cc, Canvas.cc, CheckBoxControl.cc, Container.cc, ContextMenu.cc, EditControl.cc, Figure.cc, FigureWindow.cc, GLCanvas.cc, KeyMap.cc, ListBoxControl.cc, Logger.cc, Menu.cc, MouseModeActionGroup.cc, Object.cc, ObjectFactory.cc, ObjectProxy.cc, Panel.cc, PopupMenuControl.cc, PushButtonControl.cc, PushTool.cc, QtHandlesUtils.cc, RadioButtonControl.cc, SliderControl.cc, TextControl.cc, TextEdit.cc, ToggleButtonControl.cc, ToggleTool.cc, ToolBar.cc, __init_qt__.cc, annotation-dialog.cc, gl-select.cc, module.mk, color-picker.cc, dialog.cc, documentation-dock-widget.cc, files-dock-widget.cc, find-files-dialog.cc, find-files-model.cc, history-dock-widget.cc, liboctgui-build-info.in.cc, file-editor-tab.cc, file-editor.cc, find-dialog.cc, marker.cc, marker.h, octave-qscintilla.cc, octave-txt-lexer.cc, main-window.cc, octave-cmd.cc, octave-dock-widget.cc, octave-gui.cc, octave-interpreter.cc, octave-qt-link.cc, parser.cc, webinfo.cc, resource-manager.cc, settings-dialog.cc, shortcut-manager.cc, terminal-dock-widget.cc, thread-manager.cc, welcome-wizard.cc, workspace-model.cc, workspace-view.cc, build-env.in.cc, Cell.cc, __contourc__.cc, __dispatch__.cc, __dsearchn__.cc, __ichol__.cc, __ilu__.cc, __lin_interpn__.cc, __luinc__.cc, __magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, balance.cc, besselj.cc, betainc.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h, cdisplay.c, cdisplay.h, cellfun.cc, coct-hdf5-types.c, colloc.cc, comment-list.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, debug.cc, defaults.cc, defaults.in.h, defun.cc, det.cc, dirfns.cc, display.cc, dlmread.cc, dot.cc, dynamic-ld.cc, eig.cc, ellipj.cc, error.cc, errwarn.cc, event-queue.cc, fft.cc, fft2.cc, fftn.cc, file-io.cc, filter.cc, find.cc, ft-text-renderer.cc, gammainc.cc, gcd.cc, getgrent.cc, getpwent.cc, getrusage.cc, givens.cc, gl-render.cc, gl2ps-print.cc, graphics.cc, gripes.cc, hash.cc, help.cc, hess.cc, hex2num.cc, input.cc, inv.cc, jit-ir.cc, jit-ir.h, jit-typeinfo.cc, jit-typeinfo.h, jit-util.cc, jit-util.h, kron.cc, load-path.cc, load-save.cc, lookup.cc, ls-ascii-helper.cc, ls-hdf5.cc, ls-mat-ascii.cc, ls-mat4.cc, ls-mat5.cc, ls-oct-binary.cc, ls-oct-text.cc, ls-oct-text.h, ls-utils.cc, lsode.cc, lu.cc, mappers.cc, matrix_type.cc, max.cc, mex.cc, mex.h, mexproto.h, mgorth.cc, nproc.cc, oct-errno.in.cc, oct-fstrm.cc, oct-hdf5-types.cc, oct-hdf5-types.h, oct-hist.cc, oct-iostrm.cc, oct-lvalue.cc, oct-map.cc, oct-prcstrm.cc, oct-procbuf.cc, oct-stdstrm.h, oct-stream.cc, oct-strstrm.cc, oct-tex-lexer.in.ll, oct-tex-parser.in.yy, octave-link.cc, ordschur.cc, pager.cc, pinv.cc, pr-output.cc, procstream.cc, profiler.cc, psi.cc, pt-jit.cc, pt-jit.h, quad.cc, quadcc.cc, qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, sighandlers.cc, sighandlers.h, siglist.c, siglist.h, sparse-xdiv.cc, sparse-xpow.cc, sparse.cc, spparms.cc, sqrtm.cc, str2double.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, sylvester.cc, symtab.cc, syscalls.cc, sysdep.cc, text-renderer.cc, time.cc, toplev.cc, tril.cc, tsearch.cc, txt-eng.cc, typecast.cc, urlwrite.cc, utils.cc, variables.cc, xdiv.cc, xgl2ps.c, xnorm.cc, xpow.cc, zfstream.cc, zfstream.h, __delaunayn__.cc, __eigs__.cc, __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc, __init_gnuplot__.cc, __osmesa_print__.cc, __voronoi__.cc, amd.cc, audiodevinfo.cc, audioread.cc, ccolamd.cc, chol.cc, colamd.cc, convhulln.cc, dmperm.cc, fftw.cc, qr.cc, symbfact.cc, symrcm.cc, liboctinterp-build-info.in.cc, mkbuiltins, mkops, ov-base.cc, ov-bool-mat.cc, ov-bool-sparse.cc, ov-bool.cc, ov-builtin.cc, ov-cell.cc, ov-ch-mat.cc, ov-class.cc, ov-classdef.cc, ov-colon.cc, ov-complex.cc, ov-cs-list.cc, ov-cx-diag.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-dld-fcn.cc, ov-fcn-handle.cc, ov-fcn-inline.cc, ov-fcn.cc, ov-float.cc, ov-flt-complex.cc, ov-flt-cx-diag.cc, ov-flt-cx-mat.cc, ov-flt-re-diag.cc, ov-flt-re-mat.cc, ov-int16.cc, ov-int32.cc, ov-int64.cc, ov-int8.cc, ov-java.cc, ov-lazy-idx.cc, ov-mex-fcn.cc, ov-null-mat.cc, ov-oncleanup.cc, ov-perm.cc, ov-range.cc, ov-re-diag.cc, ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-str-mat.cc, ov-struct.cc, ov-typeinfo.cc, ov-uint16.cc, ov-uint32.cc, ov-uint64.cc, ov-uint8.cc, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc, ovl.cc, octave.cc, octave.h, op-b-b.cc, op-b-bm.cc, op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cdm-cm.cc, op-cdm-dm.cc, op-cdm-m.cc, op-cell.cc, op-chm.cc, op-class.cc, op-cm-cdm.cc, op-cm-cm.cc, op-cm-cs.cc, op-cm-dm.cc, op-cm-m.cc, op-cm-s.cc, op-cm-scm.cc, op-cm-sm.cc, op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc, op-cs-scm.cc, op-cs-sm.cc, op-dm-cdm.cc, op-dm-cm.cc, op-dm-dm.cc, op-dm-m.cc, op-dm-scm.cc, op-dm-sm.cc, op-dm-template.cc, op-dms-template.cc, op-double-conv.cc, op-fcdm-fcdm.cc, op-fcdm-fcm.cc, op-fcdm-fdm.cc, op-fcdm-fm.cc, op-fcm-fcdm.cc, op-fcm-fcm.cc, op-fcm-fcs.cc, op-fcm-fdm.cc, op-fcm-fm.cc, op-fcm-fs.cc, op-fcn.cc, op-fcs-fcm.cc, op-fcs-fcs.cc, op-fcs-fm.cc, op-fcs-fs.cc, op-fdm-fcdm.cc, op-fdm-fcm.cc, op-fdm-fdm.cc, op-fdm-fm.cc, op-float-conv.cc, op-fm-fcdm.cc, op-fm-fcm.cc, op-fm-fcs.cc, op-fm-fdm.cc, op-fm-fm.cc, op-fm-fs.cc, op-fs-fcm.cc, op-fs-fcs.cc, op-fs-fm.cc, op-fs-fs.cc, op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc, op-i8-i8.cc, op-int-concat.cc, op-int-conv.cc, op-m-cdm.cc, op-m-cm.cc, op-m-cs.cc, op-m-dm.cc, op-m-m.cc, op-m-s.cc, op-m-scm.cc, op-m-sm.cc, op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc, op-pm-template.cc, op-range.cc, op-s-cm.cc, op-s-cs.cc, op-s-m.cc, op-s-s.cc, op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-sbm-sbm.cc, op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-scm-scm.cc, op-scm-sm.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-sm-scm.cc, op-sm-sm.cc, op-str-m.cc, op-str-s.cc, op-str-str.cc, op-struct.cc, op-ui16-ui16.cc, op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, lex.ll, oct-parse.in.yy, pt-arg-list.cc, pt-array-list.cc, pt-assign.cc, pt-binop.cc, pt-bp.cc, pt-cbinop.cc, pt-cell.cc, pt-check.cc, pt-classdef.cc, pt-cmd.cc, pt-colon.cc, pt-const.cc, pt-decl.cc, pt-eval.cc, pt-except.cc, pt-exp.cc, pt-fcn-handle.cc, pt-funcall.cc, pt-id.cc, pt-idx.cc, pt-jump.cc, pt-loop.cc, pt-loop.h, pt-mat.cc, pt-misc.cc, pt-pr-code.cc, pt-select.cc, pt-stmt.cc, pt-unop.cc, pt.cc, token.cc, Array-jit.cc, Array-tc.cc, version.cc, Array-C.cc, Array-b.cc, Array-ch.cc, Array-d.cc, Array-f.cc, Array-fC.cc, Array-i.cc, Array-idx-vec.cc, Array-s.cc, Array-str.cc, Array-util.cc, Array-voidp.cc, Array.cc, CColVector.cc, CDiagMatrix.cc, CMatrix.cc, CNDArray.cc, CRowVector.cc, CSparse.cc, MArray-C.cc, MArray-d.cc, MArray-f.cc, MArray-fC.cc, MArray-i.cc, MArray-s.cc, MSparse-C.cc, MSparse-d.cc, MatrixType.cc, PermMatrix.cc, Range.cc, Sparse-C.cc, Sparse-b.cc, Sparse-d.cc, boolMatrix.cc, boolNDArray.cc, boolSparse.cc, chMatrix.cc, chNDArray.cc, dColVector.cc, dDiagMatrix.cc, dMatrix.cc, dNDArray.cc, dRowVector.cc, dSparse.cc, dim-vector.cc, dim-vector.h, fCColVector.cc, fCDiagMatrix.cc, fCMatrix.cc, fCNDArray.cc, fCRowVector.cc, fColVector.cc, fDiagMatrix.cc, fMatrix.cc, fNDArray.cc, fRowVector.cc, idx-vector.cc, int16NDArray.cc, int32NDArray.cc, int64NDArray.cc, int8NDArray.cc, uint16NDArray.cc, uint32NDArray.cc, uint64NDArray.cc, uint8NDArray.cc, Faddeeva.cc, blaswrap.c, cquit.c, f77-extern.cc, f77-fcn.c, f77-fcn.h, lo-error.c, lo-error.h, quit.cc, quit.h, liboctave-build-info.in.cc, CollocWt.cc, DASPK.cc, DASRT.cc, DASSL.cc, EIG.cc, LSODE.cc, ODES.cc, Quad.cc, aepbalance.cc, chol.cc, eigs-base.cc, fEIG.cc, gepbalance.cc, hess.cc, lo-mappers.cc, lo-specfun.cc, lu.cc, oct-convn.cc, oct-fftw.cc, oct-norm.cc, oct-rand.cc, oct-spparms.cc, qr.cc, qrp.cc, randmtzig.cc, randpoisson.cc, schur.cc, sparse-chol.cc, sparse-dmsolve.cc, sparse-lu.cc, sparse-qr.cc, svd.cc, mk-ops.awk, mx-defs.h, dir-ops.cc, file-ops.cc, file-stat.cc, lo-sysdep.cc, mach-info.cc, oct-env.cc, oct-group.cc, oct-passwd.cc, oct-syscalls.cc, oct-time.cc, oct-uname.cc, pathlen.h, syswait.h, cmd-edit.cc, cmd-hist.cc, data-conv.cc, f2c-main.c, glob-match.cc, kpse.cc, lo-array-errwarn.cc, lo-array-gripes.cc, lo-cutils.c, lo-cutils.h, lo-ieee.cc, lo-ieee.h, lo-regexp.cc, lo-utils.cc, oct-base64.cc, oct-glob.cc, oct-inttypes.cc, oct-inttypes.h, oct-locbuf.cc, oct-mutex.cc, oct-rl-edit.c, oct-rl-edit.h, oct-rl-hist.c, oct-rl-hist.h, oct-shlib.cc, oct-sort.cc, pathsearch.cc, singleton-cleanup.cc, sparse-sort.cc, sparse-util.cc, statdefs.h, str-vec.cc, unwind-prot.cc, url-transfer.cc, acinclude.m4, display-available.c, display-available.h, main-cli.cc, main-gui.cc, main.in.cc, mkoctfile.in.cc, octave-build-info.in.cc, octave-config.in.cc, shared-fcns.h: Use "#if ..." consistently instead of "#ifdef" and "#ifndef".
author John W. Eaton <jwe@octave.org>
date Tue, 17 May 2016 12:09:30 -0400
parents 3d60ed163b70
children 6e9f5408c0db
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
1 /*
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19595
diff changeset
3 Copyright (C) 2013-2015 John W. Eaton
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19595
diff changeset
4 Copyright (C) 2011-2015 Jacob Dawid
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
5
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
6 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
7
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
9 under the terms of the GNU General Public License as published by the
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
11 option) any later version.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
12
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
16 for more details.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
17
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
18 You should have received a copy of the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
19 along with Octave; see the file COPYING. If not, see
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
20 <http://www.gnu.org/licenses/>.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
21
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
22 */
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21568
diff changeset
24 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21203
diff changeset
25 # include "config.h"
15286
ae9079bbc627 Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents: 15204
diff changeset
26 #endif
ae9079bbc627 Add '#include <config.h>' to C++ files in libgui/src
Rik <rik@octave.org>
parents: 15204
diff changeset
27
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
28 #include <QInputDialog>
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
29 #include <QApplication>
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
30 #include <QClipboard>
16502
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16478
diff changeset
31 #include <QMessageBox>
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16478
diff changeset
32 #include <QLineEdit>
15460
7f36f7dc25b2 save and restore the columns order and width of the workspace-view
Torsten <ttl@justmail.de>
parents: 15389
diff changeset
33 #include <QHeaderView>
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
34 #include <QHBoxLayout>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
35 #include <QVBoxLayout>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
36 #include <QPushButton>
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
37 #include <QMenu>
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
38 #include <QLabel>
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
39 #include <QCompleter>
20641
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
40 #include <QSignalMapper>
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
41
16502
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16478
diff changeset
42 #include "workspace-view.h"
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16478
diff changeset
43 #include "resource-manager.h"
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
44 #include "symtab.h"
16502
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16478
diff changeset
45
15368
36ececf69385 avoid some GCC warnings in the libgui code
John W. Eaton <jwe@octave.org>
parents: 15367
diff changeset
46 workspace_view::workspace_view (QWidget *p)
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
47 : octave_dock_widget (p), view (new QTableView (this))
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
48 {
13683
25dc40d24a44 Renamed VariablesDockWidget to WorkspaceView and optimized memory footprint for 30%.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13678
diff changeset
49 setObjectName ("WorkspaceView");
16478
079ec7ce60e0 delete useless connection; style fixes
John W. Eaton <jwe@octave.org>
parents: 16477
diff changeset
50 setWindowIcon (QIcon (":/actions/icons/logo.png"));
16798
d749c9b588e5 make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents: 16611
diff changeset
51 set_title (tr ("Workspace"));
16459
cbc39a3d0c42 improve encapsulation of workspace window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
52 setStatusTip (tr ("View the variables in the active workspace."));
13523
103b7bebb38f Moved load/save/clear workspace into main menu.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
53
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
54 _filter = new QComboBox (this);
19562
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
55 _filter->setToolTip (tr ("Enter text to filter the workspace"));
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
56 _filter->setEditable (true);
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
57 _filter->setMaxCount (MaxFilterHistory);
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
58 _filter->setInsertPolicy (QComboBox::NoInsert);
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
59 _filter->setSizeAdjustPolicy (
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19846
diff changeset
60 QComboBox::AdjustToMinimumContentsLengthWithIcon);
19846
72fe9df87fe8 improve scalability of gui objects (as discussed in bug #41938)
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
61 QSizePolicy sizePol (QSizePolicy::Expanding, QSizePolicy::Preferred);
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
62 _filter->setSizePolicy (sizePol);
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
63 _filter->completer ()->setCaseSensitivity (Qt::CaseSensitive);
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
64
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
65 QLabel *filter_label = new QLabel (tr ("Filter"));
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
66
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
67 _filter_checkbox = new QCheckBox ();
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
68
16463
8e2a853cdd7d derive workspace_view from octave_dock_widget; style fixes
John W. Eaton <jwe@octave.org>
parents: 16462
diff changeset
69 view->setWordWrap (false);
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
70 view->setContextMenuPolicy (Qt::CustomContextMenu);
19162
362071d9bf5b replace grid with alternating row colors in workspace view (bug #43196)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
71 view->setShowGrid (false);
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
72 (view->verticalHeader) ()->hide ();
19162
362071d9bf5b replace grid with alternating row colors in workspace view (bug #43196)
Torsten <ttl@justmail.de>
parents: 19042
diff changeset
73 view->setAlternatingRowColors (true);
16572
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
74 view_previous_row_count = 0;
13523
103b7bebb38f Moved load/save/clear workspace into main menu.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
75
14874
5d74d8b982a5 Forgot to have a fallback lexer when the file suffix is unknown. Removed unused variable and added comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14783
diff changeset
76 // Set an empty widget, so we can assign a layout to it.
13523
103b7bebb38f Moved load/save/clear workspace into main menu.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
77 setWidget (new QWidget (this));
14874
5d74d8b982a5 Forgot to have a fallback lexer when the file suffix is unknown. Removed unused variable and added comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14783
diff changeset
78
20570
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
79 // Create the layouts
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
80 _filter_widget = new QWidget (this);
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
81 QHBoxLayout *filter_layout = new QHBoxLayout ();
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
82
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
83 filter_layout->addWidget (filter_label);
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
84 filter_layout->addWidget (_filter_checkbox);
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
85 filter_layout->addWidget (_filter);
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
86 filter_layout->setMargin(0);
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
87 _filter_widget->setLayout (filter_layout);
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
88
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
89 QVBoxLayout *ws_layout = new QVBoxLayout ();
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
90 ws_layout->addWidget (_filter_widget);
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
91 ws_layout->addWidget (view);
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
92
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
93 QSettings *settings = resource_manager::get_settings ();
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
94
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
95 _filter_shown = settings->value ("workspaceview/filter_shown",true).toBool();
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
96 _filter_widget->setVisible (_filter_shown);
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
97
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
98 ws_layout->setMargin (2);
14874
5d74d8b982a5 Forgot to have a fallback lexer when the file suffix is unknown. Removed unused variable and added comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14783
diff changeset
99
5d74d8b982a5 Forgot to have a fallback lexer when the file suffix is unknown. Removed unused variable and added comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14783
diff changeset
100 // Set the empty widget to have our layout.
20570
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
101 widget ()->setLayout (ws_layout);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
102
14874
5d74d8b982a5 Forgot to have a fallback lexer when the file suffix is unknown. Removed unused variable and added comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14783
diff changeset
103 // Initialize collapse/expand state of the workspace subcategories.
15164
bc801a44bb1f follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents: 14997
diff changeset
104
20388
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
105 //enable sorting (setting column and order after model was set)
19982
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
106 view->setSortingEnabled (true);
20388
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
107 // Initialize column order and width of the workspace
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
108 view->horizontalHeader ()->restoreState (
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
109 settings->value ("workspaceview/column_state").toByteArray ());
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
110 // Set header properties for sorting
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
111 view->horizontalHeader ()->setClickable (true);
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
112 view->horizontalHeader ()->setMovable (true);
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
113 view->horizontalHeader ()->setSortIndicator (
19982
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
114 settings->value ("workspaceview/sort_by_column",0).toInt (),
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
115 static_cast<Qt::SortOrder>
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
116 (settings->value ("workspaceview/sort_order", Qt::AscendingOrder).toUInt ())
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
117 );
20388
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
118 view->horizontalHeader ()->setSortIndicatorShown (true);
19982
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
119
20641
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
120 view->horizontalHeader ()->setContextMenuPolicy (Qt::CustomContextMenu);
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
121 connect (view->horizontalHeader (),
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
122 SIGNAL (customContextMenuRequested (const QPoint &)),
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
123 this, SLOT (header_contextmenu_requested (const QPoint &)));
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
124
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
125 // Init state of the filter
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
126 _filter->addItems (settings->value ("workspaceview/mru_list").toStringList ());
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
127
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
128 bool filter_state =
19861
19755f4fc851 maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19846
diff changeset
129 settings->value ("workspaceview/filter_active", false).toBool ();
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
130 _filter_checkbox->setChecked (filter_state);
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
131 filter_activate (filter_state);
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
132
16502
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16478
diff changeset
133 // Connect signals and slots.
14874
5d74d8b982a5 Forgot to have a fallback lexer when the file suffix is unknown. Removed unused variable and added comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14783
diff changeset
134
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
135 connect (_filter, SIGNAL (editTextChanged (const QString&)),
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
136 this, SLOT (filter_update (const QString&)));
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
137 connect (_filter_checkbox, SIGNAL (toggled (bool)),
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
138 this, SLOT (filter_activate (bool)));
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
139 connect (_filter->lineEdit (), SIGNAL (editingFinished ()),
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
140 this, SLOT (update_filter_history ()));
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
141
16478
079ec7ce60e0 delete useless connection; style fixes
John W. Eaton <jwe@octave.org>
parents: 16477
diff changeset
142 connect (view, SIGNAL (customContextMenuRequested (const QPoint&)),
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
143 this, SLOT (contextmenu_requested (const QPoint&)));
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
144
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
145 connect (this, SIGNAL (command_requested (const QString&)),
16570
d5ae5aa80d42 preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents: 16521
diff changeset
146 p, SLOT (execute_command_in_terminal (const QString&)));
13541
b48ac9ad8de0 Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
147 }
13577
e440b3f32f02 Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13541
diff changeset
148
16463
8e2a853cdd7d derive workspace_view from octave_dock_widget; style fixes
John W. Eaton <jwe@octave.org>
parents: 16462
diff changeset
149 workspace_view::~workspace_view (void)
14997
2d6766e93f7b The GUI now remembers when categories in the workspace view have been closed. Bug #36885
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14874
diff changeset
150 {
15164
bc801a44bb1f follow Octave pattern for resource_manager singleton
John W. Eaton <jwe@octave.org>
parents: 14997
diff changeset
151 QSettings *settings = resource_manager::get_settings ();
16463
8e2a853cdd7d derive workspace_view from octave_dock_widget; style fixes
John W. Eaton <jwe@octave.org>
parents: 16462
diff changeset
152
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
153 settings->setValue ("workspaceview/column_state",
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
154 view->horizontalHeader ()->saveState ());
19982
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
155
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
156 int sort_column = view->horizontalHeader ()->sortIndicatorSection ();
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
157 Qt::SortOrder sort_order = view->horizontalHeader ()->sortIndicatorOrder ();
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
158 settings->setValue ("workspaceview/sort_by_column", sort_column);
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
159 settings->setValue ("workspaceview/sort_order", sort_order);
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
160
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
161 settings->setValue ("workspaceview/filter_active",
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
162 _filter_checkbox->isChecked ());
20570
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
163 settings->setValue ("workspaceview/filter_shown", _filter_shown);
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
164
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
165 QStringList mru;
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
166 for (int i = 0; i < _filter->count (); i++)
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
167 mru.append (_filter->itemText (i));
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
168 settings->setValue ("workspaceview/mru_list", mru);
16463
8e2a853cdd7d derive workspace_view from octave_dock_widget; style fixes
John W. Eaton <jwe@octave.org>
parents: 16462
diff changeset
169
16175
6f83158c714c gui: make sure settings are really written into the settings file
Torsten <ttl@justmail.de>
parents: 15552
diff changeset
170 settings->sync ();
20641
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
171
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
172 if (_sig_mapper)
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
173 delete _sig_mapper;
14874
5d74d8b982a5 Forgot to have a fallback lexer when the file suffix is unknown. Removed unused variable and added comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14783
diff changeset
174 }
5d74d8b982a5 Forgot to have a fallback lexer when the file suffix is unknown. Removed unused variable and added comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14783
diff changeset
175
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
176 void workspace_view::setModel (workspace_model *model)
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
177 {
19562
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
178 _filter_model.setSourceModel (model);
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
179 _filter_model.setFilterKeyColumn(0);
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
180
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
181 view->setModel (&_filter_model);
19982
9a8be23d2c05 extend sorting of workspave view widget
Torsten <ttl@justmail.de>
parents: 19981
diff changeset
182
20388
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
183 // set the sorting after a model was set, it would be ignored otherwise
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
184 QSettings *settings = resource_manager::get_settings ();
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
185 view->sortByColumn (
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
186 settings->value ("workspaceview/sort_by_column",0).toInt (),
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
187 static_cast<Qt::SortOrder>
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
188 (settings->value ("workspaceview/sort_order", Qt::AscendingOrder).toUInt ())
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
189 );
2b28f509b645 Fix missing sorting of the workspace view directly after start-up
Torsten <ttl@justmail.de>
parents: 20387
diff changeset
190
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
191 _model = model;
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
192 }
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
193
14874
5d74d8b982a5 Forgot to have a fallback lexer when the file suffix is unknown. Removed unused variable and added comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14783
diff changeset
194 void
15368
36ececf69385 avoid some GCC warnings in the libgui code
John W. Eaton <jwe@octave.org>
parents: 15367
diff changeset
195 workspace_view::closeEvent (QCloseEvent *e)
13577
e440b3f32f02 Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13541
diff changeset
196 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
197 emit active_changed (false);
15368
36ececf69385 avoid some GCC warnings in the libgui code
John W. Eaton <jwe@octave.org>
parents: 15367
diff changeset
198 QDockWidget::closeEvent (e);
13577
e440b3f32f02 Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13541
diff changeset
199 }
15552
bbbb89cc338f make a floating widget behave like a normal window (bug #37190)
Torsten <ttl@justmail.de>
parents: 15460
diff changeset
200
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
201 void
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
202 workspace_view::filter_update (const QString& expression)
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
203 {
19562
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
204 _filter_model.setFilterWildcard (expression);
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
205 handle_model_changed ();
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
206 }
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
207
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
208 void
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
209 workspace_view::filter_activate (bool state)
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
210 {
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
211 _filter->setEnabled (state);
19562
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
212 _filter_model.setDynamicSortFilter (state);
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
213
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
214 if (state)
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
215 filter_update (_filter->currentText ());
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
216 else
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
217 filter_update (QString ());
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
218 }
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
219
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
220 void
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
221 workspace_view::update_filter_history ()
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
222 {
19562
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
223 QString text = _filter->currentText (); // get current text
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
224 int index = _filter->findText (text); // and its actual index
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
225
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
226 if (index > -1)
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
227 _filter->removeItem (index); // remove if already existing
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
228
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
229 _filter->insertItem (0, text); // (re)insert at beginning
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
230 _filter->setCurrentIndex (0);
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
231 }
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
232
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
233 QString
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
234 workspace_view::get_var_name (QModelIndex index)
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
235 {
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
236 index = index.sibling (index.row (), 0);
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
237 QAbstractItemModel *m = view->model ();
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
238 QMap<int, QVariant> item_data = m->itemData (index);
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
239
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
240 return item_data[0].toString ();
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
241 }
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
242
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
243 void
20641
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
244 workspace_view::header_contextmenu_requested (const QPoint& mpos)
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
245 {
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
246 QMenu menu (this);
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
247
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
248 if (_sig_mapper)
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
249 delete _sig_mapper;
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
250 _sig_mapper = new QSignalMapper (this);
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
251
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
252 QSettings *settings = resource_manager::get_settings ();
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
253
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
254 for (int i = 0; i < _columns_shown.size (); i++)
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
255 {
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
256 QAction *action = menu.addAction (_columns_shown.at (i),
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
257 _sig_mapper, SLOT (map ()));
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
258 _sig_mapper->setMapping(action, i);
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
259 action->setCheckable (true);
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
260 action->setChecked (
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
261 settings->value (_columns_shown_keys.at (i),true).toBool ());
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
262 }
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
263
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
264 connect (_sig_mapper, SIGNAL (mapped (int)), this, SLOT (toggle_header (int)));
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
265
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
266 menu.exec (view->mapToGlobal (mpos));
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
267 }
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
268
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
269 void
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
270 workspace_view::toggle_header (int col)
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
271 {
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
272 QSettings *settings = resource_manager::get_settings ();
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
273
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
274 QString key = _columns_shown_keys.at (col);
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
275 bool shown = settings->value (key,true).toBool ();
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
276
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
277 view->setColumnHidden (col + 1, shown);
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
278
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
279 settings->setValue (key, ! shown);
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
280 settings->sync ();
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
281 }
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
282
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
283 void
16572
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
284 workspace_view::contextmenu_requested (const QPoint& qpos)
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
285 {
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
286 QMenu menu (this);
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
287
16572
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
288 QModelIndex index = view->indexAt (qpos);
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
289
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
290 // if it isnt Local, Glocal etc, allow the ctx menu
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
291 if (index.isValid () && index.column () == 0)
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
292 {
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
293 QString var_name = get_var_name (index);
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
294
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
295 menu.addAction (tr ("Copy name"), this,
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
296 SLOT (handle_contextmenu_copy ()));
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
297
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
298 menu.addAction (tr ("Copy value"), this,
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
299 SLOT (handle_contextmenu_copy_value ()));
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
300
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
301 QAction *rename = menu.addAction (tr ("Rename"), this,
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
302 SLOT (handle_contextmenu_rename ()));
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
303
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
304 QAbstractItemModel *m = view->model ();
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
305 const workspace_model *wm = static_cast<const workspace_model *> (m);
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
306
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
307 if (! wm->is_top_level ())
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
308 {
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
309 rename->setDisabled (true);
20763
28eae9b7aa30 Tweak GUI ToolTip strings for consistency.
Armin Müller <arm.in@web.de>
parents: 20388
diff changeset
310 rename->setToolTip (tr ("Only top-level symbols may be renamed"));
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
311 }
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
312
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
313 menu.addSeparator ();
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
314
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
315 menu.addAction ("disp (" + var_name + ")", this,
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
316 SLOT (handle_contextmenu_disp ()));
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
317
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
318 menu.addAction ("plot (" + var_name + ")", this,
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
319 SLOT (handle_contextmenu_plot ()));
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
320
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
321 menu.addAction ("stem (" + var_name + ")", this,
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
322 SLOT (handle_contextmenu_stem ()));
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
323
20570
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
324 menu.addSeparator ();
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
325
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
326 }
20570
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
327
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
328 if (_filter_shown)
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
329 menu.addAction (tr ("Hide filter"), this,
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
330 SLOT (handle_contextmenu_filter ()));
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
331 else
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
332 menu.addAction (tr ("Show filter"), this,
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
333 SLOT (handle_contextmenu_filter ()));
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
334
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
335 menu.exec (view->mapToGlobal (qpos));
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
336 }
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
337
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
338 void
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
339 workspace_view::handle_contextmenu_copy (void)
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
340 {
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
341 QModelIndex index = view->currentIndex ();
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
342
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
343 if (index.isValid ())
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
344 {
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
345 QString var_name = get_var_name (index);
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
346
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
347 QClipboard *clipboard = QApplication::clipboard ();
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
348
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
349 clipboard->setText (var_name);
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
350 }
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
351 }
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
352
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
353 void
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
354 workspace_view::handle_contextmenu_copy_value (void)
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
355 {
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
356 QModelIndex index = view->currentIndex ();
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
357
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
358 if (index.isValid ())
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
359 {
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
360 QString var_name = get_var_name (index);
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
361
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
362 octave_value val = symbol_table::varval (var_name.toStdString ());
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
363 std::ostringstream buf;
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
364 val.print_raw (buf, true);
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
365
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
366 QClipboard *clipboard = QApplication::clipboard ();
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
367 clipboard->setText (QString::fromStdString (buf.str ()));
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
368 }
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
369 }
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
370
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
371 void
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
372 workspace_view::handle_contextmenu_rename (void)
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
373 {
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
374 QModelIndex index = view->currentIndex ();
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
375
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
376 if (index.isValid ())
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
377 {
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
378 QString var_name = get_var_name (index);
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
379
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
380 QInputDialog* inputDialog = new QInputDialog ();
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
381
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
382 inputDialog->setOptions (QInputDialog::NoButtons);
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
383
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
384 bool ok = false;
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
385
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
386 QString new_name
21568
3d60ed163b70 maint: Eliminate bad spacing around '='.
Rik <rik@octave.org>
parents: 21301
diff changeset
387 = inputDialog->getText (0, "Rename Variable", "New name:",
3d60ed163b70 maint: Eliminate bad spacing around '='.
Rik <rik@octave.org>
parents: 21301
diff changeset
388 QLineEdit::Normal, var_name, &ok);
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
389
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
390 if (ok && ! new_name.isEmpty ())
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
391 {
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
392 QAbstractItemModel *m = view->model ();
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
393 m->setData (index, new_name, Qt::EditRole);
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
394 }
16521
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
395 }
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
396 }
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
397
dbc7018be4be use context menu for workspace viewer rename and copy to clipboard operations
John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
398 void
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
399 workspace_view::handle_contextmenu_disp (void)
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
400 {
16575
1a1f8199b5bb generate single-line commands from workspace view context menu
John W. Eaton <jwe@octave.org>
parents: 16572
diff changeset
401 relay_contextmenu_command ("disp");
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
402 }
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
403
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
404 void
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
405 workspace_view::handle_contextmenu_plot (void)
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
406 {
16575
1a1f8199b5bb generate single-line commands from workspace view context menu
John W. Eaton <jwe@octave.org>
parents: 16572
diff changeset
407 relay_contextmenu_command ("figure (); plot");
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
408 }
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
409
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
410 void
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
411 workspace_view::handle_contextmenu_stem (void)
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
412 {
16575
1a1f8199b5bb generate single-line commands from workspace view context menu
John W. Eaton <jwe@octave.org>
parents: 16572
diff changeset
413 relay_contextmenu_command ("figure (); stem");
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
414 }
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
415
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
416 void
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
417 workspace_view::relay_contextmenu_command (const QString& cmdname)
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
418 {
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
419 QModelIndex index = view->currentIndex ();
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
420
16477
64727ed135cb use QTableView instead of QTreeView to display workspace
John Donoghue <john.donoghue@ieee.org>
parents: 16468
diff changeset
421 if (index.isValid ())
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
422 {
19433
2f0c21339e9d values of variables in workspace view copyable (bug #43674)
Torsten <ttl@justmail.de>
parents: 19162
diff changeset
423 QString var_name = get_var_name (index);
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
424
16575
1a1f8199b5bb generate single-line commands from workspace view context menu
John W. Eaton <jwe@octave.org>
parents: 16572
diff changeset
425 emit command_requested (cmdname + " (" + var_name + ");");
16462
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
426 }
8c666c7b0e5d Added context menu to workspace variable display
John Donoghue <john.donoghue@ieee.org>
parents: 16459
diff changeset
427 }
16572
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
428
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
429 void
20570
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
430 workspace_view::handle_contextmenu_filter (void)
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
431 {
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
432 _filter_shown = not _filter_shown;
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
433 _filter_widget->setVisible (_filter_shown);
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
434 }
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
435
734d446560a8 possibility to hide filters in history and workspace view (bug#45428)
Torsten <ttl@justmail.de>
parents: 20388
diff changeset
436 void
16572
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
437 workspace_view::handle_model_changed (void)
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
438 {
19538
e4b25475ef3d provide a filter for the workspace view (bug #41222)
Torsten <ttl@justmail.de>
parents: 19433
diff changeset
439 // view->resizeRowsToContents ();
16572
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
440 // Just modify those rows that have been added rather than go through
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
441 // the whole list. For-loop test will handle when number of rows reduced.
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
442 QFontMetrics fm = view->fontMetrics ();
21568
3d60ed163b70 maint: Eliminate bad spacing around '='.
Rik <rik@octave.org>
parents: 21301
diff changeset
443 int row_height = fm.height ();
19562
010cef260698 improve filter of workspace view
Torsten <ttl@justmail.de>
parents: 19539
diff changeset
444 int new_row_count = _filter_model.rowCount ();
16572
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
445 for (int i = view_previous_row_count; i < new_row_count; i++)
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
446 view->setRowHeight (i, row_height);
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
447 view_previous_row_count = new_row_count;
17941fedd4ce Change workspace row height to font height.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16570
diff changeset
448 }
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
449
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
450 void
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
451 workspace_view::notice_settings (const QSettings *settings)
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
452 {
20641
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
453 int i;
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
454
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
455 _model->notice_settings (settings); // update colors of model first
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
456
20641
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
457 for (i = 0; i < _columns_shown_keys.size (); i++)
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
458 {
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
459 view->setColumnHidden ( i + 1,
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
460 ! settings->value (_columns_shown_keys.at (i),true).toBool ());
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
461 }
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
462
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
463 QString tool_tip;
19042
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
464
20955
77f5591878bf maint: Use '! expr' rather than '!expr' to conform to coding guidelines.
Rik <rik@octave.org>
parents: 20773
diff changeset
465 if (! settings->value ("workspaceview/hide_tool_tips",false).toBool ())
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
466 {
19042
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
467 tool_tip = QString (tr ("View the variables in the active workspace.<br>"));
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
468 tool_tip += QString (tr ("Colors for variable attributes:"));
20641
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
469 for (i = 0; i < resource_manager::storage_class_chars ().length (); i++)
19042
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
470 {
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
471 tool_tip +=
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
472 QString ("<div style=\"background-color:%1;color:#000000\">%2</div>")
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
473 .arg (_model->storage_class_color (i).name ())
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
474 .arg (resource_manager::storage_class_names ().at (i));
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
475 }
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
476 }
19042
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
477
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
478 setToolTip (tool_tip);
19042
110702c507e3 user setting for hiding the tool tip in the workspace view (part of bug #42306)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
479
20641
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
480 _columns_shown = QStringList ();
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
481 _columns_shown.append (tr ("Class"));
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
482 _columns_shown.append (tr ("Dimension"));
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
483 _columns_shown.append (tr ("Value"));
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
484 _columns_shown.append (tr ("Attribute"));
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
485
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
486 _columns_shown_keys = QStringList ();
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
487 _columns_shown_keys.append ("workspaceview/show_class");
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
488 _columns_shown_keys.append ("workspaceview/show_dimension");
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
489 _columns_shown_keys.append ("workspaceview/show_value");
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
490 _columns_shown_keys.append ("workspaceview/show_attribute");
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
491
2b0886f2c186 add possibility to hide columns of workspace view
Torsten <ttl@justmail.de>
parents: 20570
diff changeset
492 _sig_mapper = 0;
16610
a1f613e5066d workspace view colors based upon variable scope (derived from Dan's patch #8013)
Torsten <ttl@justmail.de>
parents: 16575
diff changeset
493 }
16881
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16798
diff changeset
494
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16798
diff changeset
495 void
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16798
diff changeset
496 workspace_view::copyClipboard ()
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16798
diff changeset
497 {
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16798
diff changeset
498 if (view->hasFocus ())
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16798
diff changeset
499 handle_contextmenu_copy ();
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16798
diff changeset
500 }
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16798
diff changeset
501
18555
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 18345
diff changeset
502 void
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 18345
diff changeset
503 workspace_view::selectAll ()
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 18345
diff changeset
504 {
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 18345
diff changeset
505 if (view->hasFocus ())
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 18345
diff changeset
506 view->selectAll ();
19595
be7ac98fab43 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19562
diff changeset
507 }
18555
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 18345
diff changeset
508