annotate libgui/src/files-dock-widget.h @ 22177:6e9f5408c0db

Save settings in Qt convention, delete all children in destructors (bug #45366) * QUnixTerminalImpl.cpp (QUnixTerminalImpl::~QUnixTerminalImpl): Delete dynamic objects pointed to by m_terminal (TerminalModel), m_kpty (KPty) and m_terminalView (TerminalView). (bug fix) * files-dock-widget.cc: (files_dock_widget::~files_dock_widget): Rename to save_settings. Return if variable 'settings' is not valid object pointer. (files_dock_widget::save_settings): Added. Similar code as destructor was. Call base class octave_dock_widget::save_settings at end of routine. * files-dock-widget.h: (files_dock_widget::~files_dock_widget): Provide empty destructor. (files_dock_widget::save_settings): Added, public slot. * find-files-dialog.cc: (find_files_dialog::~find_files_dialog): Moved most of the code, except the statement deleting the directory iterator, to new routine save_settings. (find_files_dialog::save_settings): Added. Large portion of the code that was in the destructor. Return immediately if variable 'settings' is not valid object pointer. * find-files-dialog.h: (find_files_dialog::save_settings): Added, public slot. * history-dock-widget.cc: (history_dock_widget::~history_dock_widget): Rename to save_settings. Return if variable 'settings' is not valid object pointer. (history_dock_widget::save_settings): Similar code as destructor was. Call base class octave_dock_widget::save_settings at end of routine. * history-dock-widget.h: (history_dock_widget::~history_dock_widget): Provide empty destructor. (history_dock_widget::save_settings): Added, public slot. * main-window.cc (main_window::prepare_to_exit): If find_files_dlg is valid, call the object's save_settings routine. (main_window::construct): Connect appropriate slot of all objects that must save_settings information to the qApp aboutToQuit signal. (Except for find_files_dlg, see above.) At end of this sequence, connect aboutToQuit to the shortcut_manager and resource_manager function that deletes instance. * octave-dock-widget.cc: (octave_dock_widget::~octave_dock_widget): Rename to save_settings. Return if variable 'settings' is not valid object pointer. (octave_dock_widget::save_settings): Similar code as destructor was. * octave-dock-widget.h: (octave_dock_widget::~octave_dock_widget): Provide empty destructor. (octave_dock_widget::save_settings): Added, public slot. * octave-qt-link.cc (octave_qt_link::do_prompt_new_edit_file): Check that 'settings' pointer is valid before using. * resource-manager.cc: Remove "singleton-cleanup.h" header reference. (resource_manager::instance_ok): Do not add cleanup_instance to worker thread's exit cleanup procedure. * resource-manager.h (resource_manager::instance) Change variable to public for connecting. (resource_manager::cleanup_instance) Change to a public slot for connecting to qApp aboutToQuit signal. (resource_manager::resource_manager): Remove an unused variation of the constructor. (resource_manager::operator =) Removed. * settings-dialog.cc: Add QMessageBox to header file list. (settings_dialog::settings_dialog): If QSettings pointer settings is not valid return immediately. (settings_dialog::show_tab): Condition setting the current index on pointer 'settings' being valid. (settings_dialog::write_changed_settings): Remove FIXME comment. If the settings are not valid, display a dialog about missing file and return. * shortcut-manager.cc: Remove "singleton-cleanup.h" header reference. (shortcut_manager::instance_ok): Do not add cleanup_instance to worker thread's exit cleanup procedure. * shortcut-manager.h (shortcut_manager::instance) Change variable to public for connecting. (shortcut_manager::cleanup_instance) Change to a public slot for connecting to qApp aboutToQuit signal. (shortcut_manager::shortcut_manager): Remove an unused variation of the constructor. (shortcut_manager::operator =) Removed. * terminal-dock-widget.cc (terminal_dock_widget::~terminal_dock_widget): Added. Delete QTerminal terminal. (bug fix) * terminal-dock-widget.h (terminal_dock_widget::~terminal_dock_widget): Added. * workspace-view.cc: (workspace_view::workspace_view): Place code hunk using QSettings pointer 'settings' within a conditional block. (workspace_view::~workspace_view): Rename to save_settings. Return if variable 'settings' is not valid object pointer. (workspace_view::save_settings): Almost same code as destructor was. Call base class octave_dock_widget::save_settings at end of routine. * workspace-view.h: (workspace_view::~workspace_view): Provide empty destructor. (workspace_view::save_settings): Added, public slot.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Mon, 25 Jul 2016 17:44:02 -0400
parents 710e700cdd7f
children bac0d6f07a3e
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: 19006
diff changeset
3 Copyright (C) 2011-2015 Jacob Dawid
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
4
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
5 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
6
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
7 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
8 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
9 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
10 option) any later version.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
11
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
12 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
13 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
14 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
15 for more details.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
16
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
17 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
18 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
19 <http://www.gnu.org/licenses/>.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
20
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
21 */
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
22
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 20945
diff changeset
23 #if ! defined (octave_files_dock_widget_h)
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 20945
diff changeset
24 #define octave_files_dock_widget_h 1
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
26 #include <QListView>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
27 #include <QDate>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
28 #include <QObject>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
29 #include <QWidget>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
30 #include <QListWidget>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
31 #include <QFileSystemModel>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32 #include <QToolBar>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
33 #include <QToolButton>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
34 #include <QVBoxLayout>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
35 #include <QAction>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
36 #include <QTreeView>
16622
38fef1e833ea handle copying names file browser to clipboard; allow multiple selections
John W. Eaton <jwe@octave.org>
parents: 16613
diff changeset
37 #include <QMouseEvent>
20642
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
38 #include <QSignalMapper>
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39
16498
605d7f0ee0d8 Added Filesdockwidget recently viewed directory pulldownlist
John Donoghue <john.donoghue@ieee.org>
parents: 16461
diff changeset
40 #include <QComboBox>
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15552
diff changeset
41 #include "octave-dock-widget.h"
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
42
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
43 /**
19006
96751a74bbbb Start doxygenising sources
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 18555
diff changeset
44 @class files_dock_widget
96751a74bbbb Start doxygenising sources
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 18555
diff changeset
45 @brief Dock widget to display files in the current directory.
15367
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15300
diff changeset
46 */
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15552
diff changeset
47 class files_dock_widget : public octave_dock_widget
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
48 {
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
49 Q_OBJECT
16450
3207f1d62e74 improve encapsulation of file browser window object
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
50
3207f1d62e74 improve encapsulation of file browser window object
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
51 public:
3207f1d62e74 improve encapsulation of file browser window object
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
52
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
53 files_dock_widget (QWidget *parent = 0);
16450
3207f1d62e74 improve encapsulation of file browser window object
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
54
22177
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 21203
diff changeset
55 ~files_dock_widget (void) { }
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
56
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
57 public slots:
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15552
diff changeset
58
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
59 /** Slot for handling a change in directory via double click. */
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
60 void item_double_clicked (const QModelIndex & index);
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
61
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
62 /** Slot for handling the up-directory button in the toolbar. */
16437
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
63 void change_directory_up ();
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
64
16499
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
65 /** Slot for handling the sync octave directory button in the toolbar. */
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
66 void do_sync_octave_directory ();
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
67
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
68 /** Slot for handling the sync browser directory button in the toolbar. */
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
69 void do_sync_browser_directory ();
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
70
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
71 /** Sets the current directory being displayed. */
16437
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
72 void set_current_directory (const QString& dir);
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
73
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
74 /** Accepts user input a the line edit for the current directory. */
16437
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
75 void accept_directory_line_edit ();
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
76
16499
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
77 /** set the internal variable that holds the actual octave variable **/
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
78 void update_octave_directory (const QString& dir);
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
79
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
80 /** Tells the widget to react on changed settings. */
16413
28136851099a remove _terminal pointer from main_window, it is contained by other Qt object
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16057
diff changeset
81 void notice_settings (const QSettings *settings);
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
82
22177
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 21203
diff changeset
83 void save_settings (void);
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 21203
diff changeset
84
16503
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
85 private slots:
20642
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
86
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
87 void headercontextmenu_requested (const QPoint& pos);
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
88 void toggle_header (int col);
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
89
16503
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
90 /** context menu wanted */
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
91 void contextmenu_requested (const QPoint& pos);
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
92 /* context menu actions */
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
93 void contextmenu_open (bool);
20706
fec7cc73507b Make the file browser open files more consistently (bug #45844)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 20642
diff changeset
94 void contextmenu_open_in_editor (bool);
16594
3ce0c312a40b contextmenu for opening files in default applications
John W. Eaton <jwe@octave.org>
parents: 16542
diff changeset
95 void contextmenu_open_in_app (bool);
16622
38fef1e833ea handle copying names file browser to clipboard; allow multiple selections
John W. Eaton <jwe@octave.org>
parents: 16613
diff changeset
96 void contextmenu_copy_selection (bool);
16506
8a4960f2c7c3 gui: allow running files from the file browser
Torsten <ttl@justmail.de>
parents: 16504
diff changeset
97 void contextmenu_run (bool);
16504
49b059bf27c7 allow loading files from file browser
John W. Eaton <jwe@octave.org>
parents: 16503
diff changeset
98 void contextmenu_load (bool);
16503
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
99 void contextmenu_rename (bool);
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
100 void contextmenu_delete (bool);
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
101 void contextmenu_newfile (bool);
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
102 void contextmenu_newdir (bool);
16509
14045b872a3d Add set current directory context menu to file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16506
diff changeset
103 void contextmenu_setcurrentdir (bool);
16699
d4bcb38ad056 Added find files context menu to files-dock-widget
John Donoghue <john.donoghue@ieee.org>
parents: 16635
diff changeset
104 void contextmenu_findfiles (bool);
16503
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
105
16542
016073c0cb94 Add popdown toolbutton to files-dock-window toolbar.
John Donoghue <john.donoghue@ieee.org>
parents: 16525
diff changeset
106 /* popdown menu options */
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
107 void popdownmenu_newfile (bool);
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
108 void popdownmenu_newdir (bool);
16613
99a57611d58a add menu for searching the next directory shown by the file browser
Torsten <ttl@justmail.de>
parents: 16611
diff changeset
109 void popdownmenu_search_dir (bool);
16699
d4bcb38ad056 Added find files context menu to files-dock-widget
John Donoghue <john.donoghue@ieee.org>
parents: 16635
diff changeset
110 void popdownmenu_findfiles (bool);
16762
42555422e326 Add Show home directory to files window popdown.
John Donoghue <john.donoghue@ieee.org>
parents: 16699
diff changeset
111 void popdownmenu_home (bool);
16542
016073c0cb94 Add popdown toolbutton to files-dock-window toolbar.
John Donoghue <john.donoghue@ieee.org>
parents: 16525
diff changeset
112
16881
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16762
diff changeset
113 /* from octave_doc_widget */
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16762
diff changeset
114 void copyClipboard ();
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16762
diff changeset
115 void pasteClipboard ();
18555
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17960
diff changeset
116 void selectAll ();
16881
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16762
diff changeset
117
16461
094bd3627ead move common functionality to octave_dock_widget base class
John W. Eaton <jwe@octave.org>
parents: 16460
diff changeset
118 signals:
16450
3207f1d62e74 improve encapsulation of file browser window object
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
119
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
120 /** Emitted, whenever the user requested to open a file. */
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15204
diff changeset
121 void open_file (const QString& fileName);
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
122
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
123 /** Emitted, whenever the currently displayed directory changed. */
16437
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
124 void displayed_directory_changed (const QString& dir);
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
125
16504
49b059bf27c7 allow loading files from file browser
John W. Eaton <jwe@octave.org>
parents: 16503
diff changeset
126 /** Emitted, whenever the user requested to load a file. */
49b059bf27c7 allow loading files from file browser
John W. Eaton <jwe@octave.org>
parents: 16503
diff changeset
127 void load_file_signal (const QString& fileName);
49b059bf27c7 allow loading files from file browser
John W. Eaton <jwe@octave.org>
parents: 16503
diff changeset
128
16506
8a4960f2c7c3 gui: allow running files from the file browser
Torsten <ttl@justmail.de>
parents: 16504
diff changeset
129 /** Emitted, whenever the user requested to run a file. */
16635
25e418d23a4b fix running files from file browser's context menu
Torsten <ttl@justmail.de>
parents: 16622
diff changeset
130 void run_file_signal (const QFileInfo& info);
16506
8a4960f2c7c3 gui: allow running files from the file browser
Torsten <ttl@justmail.de>
parents: 16504
diff changeset
131
16699
d4bcb38ad056 Added find files context menu to files-dock-widget
John Donoghue <john.donoghue@ieee.org>
parents: 16635
diff changeset
132 /** Emitted, whenever wants to search for a file . */
d4bcb38ad056 Added find files context menu to files-dock-widget
John Donoghue <john.donoghue@ieee.org>
parents: 16635
diff changeset
133 void find_files_signal (const QString &startdir);
d4bcb38ad056 Added find files context menu to files-dock-widget
John Donoghue <john.donoghue@ieee.org>
parents: 16635
diff changeset
134
16461
094bd3627ead move common functionality to octave_dock_widget base class
John W. Eaton <jwe@octave.org>
parents: 16460
diff changeset
135 private:
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
136 void process_new_file (const QString &parent_name);
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
137 void process_new_dir (const QString &parent_name);
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
138 void process_set_current_dir (const QString &parent_name);
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
139 void process_find_files (const QString &dir_name);
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
140
16499
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
141 /** set a new directory or open a file **/
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
142 void display_directory (const QString& dir, bool set_octave_dir = true);
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
143
16594
3ce0c312a40b contextmenu for opening files in default applications
John W. Eaton <jwe@octave.org>
parents: 16542
diff changeset
144 void open_item_in_app (const QModelIndex& index);
3ce0c312a40b contextmenu for opening files in default applications
John W. Eaton <jwe@octave.org>
parents: 16542
diff changeset
145
16499
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
146 /** Variables for the actions **/
16525
e192525236ad configurable size of toolbar icons
Torsten <ttl@justmail.de>
parents: 16509
diff changeset
147 QToolBar * _navigation_tool_bar;
16499
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
148 QAction * _sync_octave_directory_action;
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
149 QAction * _sync_browser_directory_action;
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
150
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
151 /** The file system model. */
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
152 QFileSystemModel *_file_system_model;
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
153
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
154 /** The file system view. */
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
155 QTreeView * _file_tree_view;
16498
605d7f0ee0d8 Added Filesdockwidget recently viewed directory pulldownlist
John Donoghue <john.donoghue@ieee.org>
parents: 16461
diff changeset
156 QComboBox * _current_directory;
605d7f0ee0d8 Added Filesdockwidget recently viewed directory pulldownlist
John Donoghue <john.donoghue@ieee.org>
parents: 16461
diff changeset
157
16499
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
158 /** Internal variables **/
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
159 bool _sync_octave_dir; // flag if syncing with octave
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
160 QString _octave_dir; // the actual octave dir
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
161
16498
605d7f0ee0d8 Added Filesdockwidget recently viewed directory pulldownlist
John Donoghue <john.donoghue@ieee.org>
parents: 16461
diff changeset
162 enum { MaxMRUDirs = 10 };
20642
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
163
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
164 QStringList _columns_shown;
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
165 QStringList _columns_shown_keys;
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
166 QSignalMapper *_sig_mapper;
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
167 };
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
168
20945
9d9270e2f98f eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents: 20706
diff changeset
169 #endif