comparison libgui/src/files-dockwidget.h @ 16057:c3057d80cf91

Created common octave_dock_widget class * octave_dock_widget.h : New class octave_dock_widget with common dock widget methods, slots and signals * file_editor_interface.h: Now inherit from octave_dock_widget, removed common dock widget code * file_editor.h: Now inherit from octave_dock_widget, removed common dock widget code * file_editor.cc: Now inherit from octave_dock_widget, removed common dock widget code * files_dockwidget.h: Now inherit from octave_dock_widget, removed common dock widget code * files_dockwidget.cc: Now inherit from octave_dock_widget, removed common dock widget code * history_dockwidget.h: Now inherit from octave_dock_widget, removed common dock widget code * history_dockwidget.cc: Now inherit from octave_dock_widget, removed common dock widget methods * terminal_dockwidget.h: Now inherit from octave_dock_widget, removed common dock widget code * terminal_dockwidget.cc: Now inherit from octave_dock_widget, removed common dock widget code * module.mk: Added octave_dock_widget
author Richard Crozier <richard.crozier@yahoo.co.uk>
date Wed, 06 Feb 2013 21:45:04 +0000
parents bbbb89cc338f
children 28136851099a
comparison
equal deleted inserted replaced
16056:f4f0aea29b21 16057:c3057d80cf91
33 #include <QToolButton> 33 #include <QToolButton>
34 #include <QVBoxLayout> 34 #include <QVBoxLayout>
35 #include <QAction> 35 #include <QAction>
36 #include <QTreeView> 36 #include <QTreeView>
37 37
38 #include <QDockWidget>
39 #include <QLineEdit> 38 #include <QLineEdit>
39 #include "octave-dock-widget.h"
40 40
41 /** 41 /**
42 \class files_dock_widget 42 \class files_dock_widget
43 \brief Dock widget to display files in the current directory. 43 \brief Dock widget to display files in the current directory.
44 */ 44 */
45 class files_dock_widget : public QDockWidget 45 class files_dock_widget : public octave_dock_widget
46 { 46 {
47 Q_OBJECT 47 Q_OBJECT
48 public: 48 public:
49 /** Constructs a new files_dock_widget. */ 49 /** Constructs a new files_dock_widget. */
50 files_dock_widget (QWidget *parent = 0); 50 files_dock_widget (QWidget *parent = 0);
51 ~files_dock_widget (); 51 ~files_dock_widget ();
52 52
53 public slots: 53 public slots:
54
54 /** Slot for handling a change in directory via double click. */ 55 /** Slot for handling a change in directory via double click. */
55 void item_double_clicked (const QModelIndex & index); 56 void item_double_clicked (const QModelIndex & index);
56 57
57 /** Slot for handling the up-directory button in the toolbar. */ 58 /** Slot for handling the up-directory button in the toolbar. */
58 void do_up_directory (); 59 void do_up_directory ();
66 void display_directory (const QString& directory); 67 void display_directory (const QString& directory);
67 68
68 /** Tells the widget to react on changed settings. */ 69 /** Tells the widget to react on changed settings. */
69 void notice_settings (); 70 void notice_settings ();
70 71
71 /** Slot to steer changing visibility from outside. */
72 void handle_visibility_changed (bool visible);
73
74 /** Slot when floating property changes */
75 void top_level_changed (bool floating);
76
77 signals: 72 signals:
78 /** Emitted, whenever the user requested to open a file. */ 73 /** Emitted, whenever the user requested to open a file. */
79 void open_file (const QString& fileName); 74 void open_file (const QString& fileName);
80 75
81 /** Emitted, whenever the currently displayed directory changed. */ 76 /** Emitted, whenever the currently displayed directory changed. */
82 void displayed_directory_changed (const QString& directory); 77 void displayed_directory_changed (const QString& directory);
83 78
84 /** Custom signal that tells if a user has clicke away that dock widget. */
85 void active_changed (bool active);
86
87 protected: 79 protected:
88 void closeEvent (QCloseEvent *event);
89 80
90 private: 81 private:
91 // TODO: Add toolbar with buttons for navigating the path, creating dirs, etc 82 // TODO: Add toolbar with buttons for navigating the path, creating dirs, etc
92 83
93 QString _last_current_directory; 84 QString _last_current_directory;