Mercurial > hg > octave-jordi
comparison libgui/src/files-dockwidget.h @ 16437:919796a440c6
use signal for changing directory
* files-dockwidget.cc (files_dock_widget::files_dock_widget):
Set title to "File Browser", not "Current Directory".
* files-dockwidget.h, files-dockwidget.cc
(files_dock_widget::change_directory_up): Rename from
files_dock_widget::do_up_directory. Change all uses.
(files_dock_widget::_last_current_directory): Delete variable and all
uses.
(files_dock_widget::accept_directory_line_edit): Rename from
handle_directory_entered. Change all uses.
(files_dock_widget::item_double_clicked): Call set_current_directory
instead of display_directory.
(files_dock_widget::set_current_directory): Also emit
displayed_directory_changed signal.
(files_dock_widget::display_directory): Sort list. Don't emit
displayed_directory_changed.
private:
* file-editor-tab.cc (file_editor_tab::run_file): Delete unused local
variable current_path.
* main-window.h, main-window.cc
(main_window::current_working_directory_has_changed): Delete function
and all uses.
(main_window::browse_for_directory): Rename from
main_window::change_current_working_directory. Change all uses.
(main_window::change_directory): Rename from
main_window::set_current_working_directory. Change all uses. Update
display.
(main_window::change_directory_up): Rename from
main_window::current_working_directory_up. Change all uses. Use
absolute path for ".." directory.
(main_window::accept_directory_line_edit): Rename from
main_window::current_working_directory_entered. Change all uses.
(main_window::construct): Set initial working directory to current
directory at startup.
* octave-qt-link.h, octave-qt-link.cc
(octave_qt_link::do_change_directory): New function.
(octave_qt_link::change_directory_signal): New signal.
* octave-event-listener.h
(octave_event_listener::current_directory_has_changed): Delete.
* dirfns.cc (octave_change_to_directory): Also call
octave_link::change_directory.
* octave-link.h, octave-link.cc (octave_link::last_cwd): Delete
variable and all uses.
(octave_link::do_generate_events): Don't track current directory or
post directory changed event.
(octave_link::last_working_directory,
octave_link::do_last_working_directory): Delete.
(octave_link::do_change_directory): Rename from
octave_link::do_last_working_directory.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 05 Apr 2013 00:40:12 -0400 |
parents | 28136851099a |
children | 3207f1d62e74 |
comparison
equal
deleted
inserted
replaced
16436:39847dcd2568 | 16437:919796a440c6 |
---|---|
55 | 55 |
56 /** Slot for handling a change in directory via double click. */ | 56 /** Slot for handling a change in directory via double click. */ |
57 void item_double_clicked (const QModelIndex & index); | 57 void item_double_clicked (const QModelIndex & index); |
58 | 58 |
59 /** Slot for handling the up-directory button in the toolbar. */ | 59 /** Slot for handling the up-directory button in the toolbar. */ |
60 void do_up_directory (); | 60 void change_directory_up (); |
61 | 61 |
62 /** Sets the current directory being displayed. */ | 62 /** Sets the current directory being displayed. */ |
63 void set_current_directory (const QString& currentDirectory); | 63 void set_current_directory (const QString& dir); |
64 | 64 |
65 /** Accepts user input a the line edit for the current directory. */ | 65 /** Accepts user input a the line edit for the current directory. */ |
66 void handle_directory_entered (); | 66 void accept_directory_line_edit (); |
67 | 67 |
68 void display_directory (const QString& directory); | 68 void display_directory (const QString& dir); |
69 | 69 |
70 /** Tells the widget to react on changed settings. */ | 70 /** Tells the widget to react on changed settings. */ |
71 void notice_settings (const QSettings *settings); | 71 void notice_settings (const QSettings *settings); |
72 | 72 |
73 signals: | 73 signals: |
74 /** Emitted, whenever the user requested to open a file. */ | 74 /** Emitted, whenever the user requested to open a file. */ |
75 void open_file (const QString& fileName); | 75 void open_file (const QString& fileName); |
76 | 76 |
77 /** Emitted, whenever the currently displayed directory changed. */ | 77 /** Emitted, whenever the currently displayed directory changed. */ |
78 void displayed_directory_changed (const QString& directory); | 78 void displayed_directory_changed (const QString& dir); |
79 | 79 |
80 protected: | 80 protected: |
81 | 81 |
82 private: | 82 private: |
83 // TODO: Add toolbar with buttons for navigating the path, creating dirs, etc | 83 // TODO: Add toolbar with buttons for navigating the path, creating dirs, etc |
84 | |
85 QString _last_current_directory; | |
86 | 84 |
87 /** Toolbar for file and directory manipulation. */ | 85 /** Toolbar for file and directory manipulation. */ |
88 QToolBar * _navigation_tool_bar; | 86 QToolBar * _navigation_tool_bar; |
89 | 87 |
90 /** Variables for the up-directory action. */ | 88 /** Variables for the up-directory action. */ |