12
12
#include < QCoreApplication>
13
13
#include < QStatusBar>
14
14
#include < QLabel>
15
+ #include < QFileDialog>
15
16
16
17
extern String s_serenity_resource_root;
17
18
extern Browser::Settings* s_settings;
@@ -74,7 +75,6 @@ Tab::Tab(QMainWindow* window)
74
75
m_break_cache_action = make<QAction>(QIcon (break_cache_icon_path), " Break cache" );
75
76
m_break_cache_action->setFont (button_text_font);
76
77
m_open_action = make<QAction>(QIcon (open_icon_path), " Open" );
77
- m_open_action->setEnabled (false );
78
78
m_open_action->setFont (button_text_font);
79
79
m_print_action = make<QAction>(QIcon (print_icon_path), " Print" );
80
80
m_print_action->setEnabled (false );
@@ -138,6 +138,7 @@ Tab::Tab(QMainWindow* window)
138
138
QObject::connect (m_home_action, &QAction::triggered, this , &Tab::home);
139
139
QObject::connect (m_reload_action, &QAction::triggered, this , &Tab::reload);
140
140
QObject::connect (m_break_cache_action, &QAction::triggered, this , &Tab::break_cache);
141
+ QObject::connect (m_open_action, &QAction::triggered, this , &Tab::open );
141
142
QObject::connect (focus_location_edit_action, &QAction::triggered, m_location_edit, qOverload<>(&QWidget::setFocus));
142
143
QObject::connect (focus_location_edit_action, &QAction::triggered, m_location_edit, &QLineEdit::selectAll);
143
144
QObject::connect (focus_search_edit_action, &QAction::triggered, m_search_edit, qOverload<>(&QWidget::setFocus));
@@ -153,6 +154,14 @@ void Tab::navigate(QString url)
153
154
view ().load (url.toUtf8 ().data ());
154
155
}
155
156
157
+ void Tab::open ()
158
+ {
159
+
160
+ m_open_file = QFileDialog::getOpenFileName (this ,
161
+ tr (" Open file in Coccinellidae" ), " /" , tr (" All Files (*.*)" ));
162
+ navigate (" file://" +m_open_file);
163
+ }
164
+
156
165
void Tab::back ()
157
166
{
158
167
if (!m_history.can_go_back ())
0 commit comments