mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
add update action support, remove request value from construction
This commit is contained in:
parent
fac8c14cbd
commit
55f1680f8b
9 changed files with 14 additions and 26 deletions
|
|
@ -46,7 +46,6 @@ void Main::tab_append()
|
||||||
mainTab->append(
|
mainTab->append(
|
||||||
_("New page"),
|
_("New page"),
|
||||||
"", // @TODO
|
"", // @TODO
|
||||||
"",
|
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,11 @@ void Tab::refresh(
|
||||||
void Tab::append(
|
void Tab::append(
|
||||||
const Glib::ustring & TITLE,
|
const Glib::ustring & TITLE,
|
||||||
const Glib::ustring & SUBTITLE,
|
const Glib::ustring & SUBTITLE,
|
||||||
const Glib::ustring & REQUEST,
|
|
||||||
const bool & FOCUS
|
const bool & FOCUS
|
||||||
) {
|
) {
|
||||||
auto tabPage = new tab::Page(
|
auto tabPage = new tab::Page(
|
||||||
TITLE,
|
TITLE,
|
||||||
SUBTITLE,
|
SUBTITLE,
|
||||||
REQUEST,
|
|
||||||
action__tab_page_navigation_history_back,
|
action__tab_page_navigation_history_back,
|
||||||
action__tab_page_navigation_history_forward,
|
action__tab_page_navigation_history_forward,
|
||||||
action__tab_page_navigation_update
|
action__tab_page_navigation_update
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ namespace app::browser::main
|
||||||
void append(
|
void append(
|
||||||
const Glib::ustring & TITLE,
|
const Glib::ustring & TITLE,
|
||||||
const Glib::ustring & SUBTITLE,
|
const Glib::ustring & SUBTITLE,
|
||||||
const Glib::ustring & REQUEST,
|
|
||||||
const bool & FOCUS
|
const bool & FOCUS
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ using namespace app::browser::main::tab;
|
||||||
Page::Page(
|
Page::Page(
|
||||||
const Glib::ustring & TITLE,
|
const Glib::ustring & TITLE,
|
||||||
const Glib::ustring & SUBTITLE,
|
const Glib::ustring & SUBTITLE,
|
||||||
const Glib::ustring & REQUEST,
|
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_BACK,
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_BACK,
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_UPDATE
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_UPDATE
|
||||||
|
|
@ -19,7 +18,6 @@ Page::Page(
|
||||||
|
|
||||||
// Init components
|
// Init components
|
||||||
pageNavigation = Gtk::make_managed<page::Navigation>(
|
pageNavigation = Gtk::make_managed<page::Navigation>(
|
||||||
REQUEST,
|
|
||||||
ACTION__PAGE_NAVIGATION_HISTORY_BACK,
|
ACTION__PAGE_NAVIGATION_HISTORY_BACK,
|
||||||
ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
|
ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||||
ACTION__PAGE_NAVIGATION_UPDATE
|
ACTION__PAGE_NAVIGATION_UPDATE
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ namespace app::browser::main::tab
|
||||||
Page(
|
Page(
|
||||||
const Glib::ustring & TITLE,
|
const Glib::ustring & TITLE,
|
||||||
const Glib::ustring & SUBTITLE,
|
const Glib::ustring & SUBTITLE,
|
||||||
const Glib::ustring & REQUEST,
|
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_BACK,
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_BACK,
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_UPDATE
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__PAGE_NAVIGATION_UPDATE
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
using namespace app::browser::main::tab::page;
|
using namespace app::browser::main::tab::page;
|
||||||
|
|
||||||
Navigation::Navigation(
|
Navigation::Navigation(
|
||||||
const Glib::ustring & REQUEST,
|
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK,
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK,
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_FORWARD,
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_FORWARD,
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_UPDATE
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_UPDATE
|
||||||
|
|
@ -63,7 +62,7 @@ Navigation::Navigation(
|
||||||
);
|
);
|
||||||
|
|
||||||
navigationRequest = Gtk::make_managed<navigation::Request>(
|
navigationRequest = Gtk::make_managed<navigation::Request>(
|
||||||
REQUEST
|
ACTION__NAVIGATION_UPDATE
|
||||||
);
|
);
|
||||||
|
|
||||||
append(
|
append(
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ namespace app::browser::main::tab::page
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Navigation(
|
Navigation(
|
||||||
const Glib::ustring & REQUEST,
|
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK,
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK,
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_FORWARD,
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_FORWARD,
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_UPDATE
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_UPDATE
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,12 @@ using namespace app::browser::main::tab::page::navigation;
|
||||||
|
|
||||||
// Construct
|
// Construct
|
||||||
Request::Request(
|
Request::Request(
|
||||||
const Glib::ustring & TEXT
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE
|
||||||
) {
|
) {
|
||||||
// Init entry
|
// Init actions
|
||||||
|
action__update = ACTION__UPDATE;
|
||||||
|
|
||||||
|
// Init widget
|
||||||
set_placeholder_text(
|
set_placeholder_text(
|
||||||
_("URL or search term...")
|
_("URL or search term...")
|
||||||
);
|
);
|
||||||
|
|
@ -19,15 +22,6 @@ Request::Request(
|
||||||
PROGRESS_PULSE_STEP
|
PROGRESS_PULSE_STEP
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!TEXT.empty())
|
|
||||||
{
|
|
||||||
set_text(
|
|
||||||
TEXT
|
|
||||||
);
|
|
||||||
|
|
||||||
parse();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Connect events
|
// Connect events
|
||||||
signal_changed().connect(
|
signal_changed().connect(
|
||||||
[this]
|
[this]
|
||||||
|
|
@ -35,7 +29,7 @@ Request::Request(
|
||||||
parse();
|
parse();
|
||||||
|
|
||||||
activate_action(
|
activate_action(
|
||||||
"navigation.refresh"
|
"navigation.refresh" // @TODO
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -45,9 +39,7 @@ Request::Request(
|
||||||
{
|
{
|
||||||
parse();
|
parse();
|
||||||
|
|
||||||
activate_action(
|
action__update->activate();
|
||||||
"win.main_tab_page_navigation_update"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP
|
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP
|
||||||
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP
|
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP
|
||||||
|
|
||||||
|
#include <giomm/simpleaction.h>
|
||||||
#include <glibmm/i18n.h>
|
#include <glibmm/i18n.h>
|
||||||
#include <glibmm/main.h>
|
#include <glibmm/main.h>
|
||||||
|
#include <glibmm/refptr.h>
|
||||||
#include <glibmm/regex.h>
|
#include <glibmm/regex.h>
|
||||||
#include <glibmm/ustring.h>
|
#include <glibmm/ustring.h>
|
||||||
#include <gtkmm/entry.h>
|
#include <gtkmm/entry.h>
|
||||||
|
|
@ -11,6 +13,9 @@ namespace app::browser::main::tab::page::navigation
|
||||||
{
|
{
|
||||||
class Request : public Gtk::Entry
|
class Request : public Gtk::Entry
|
||||||
{
|
{
|
||||||
|
// Actions
|
||||||
|
Glib::RefPtr<Gio::SimpleAction> action__update;
|
||||||
|
|
||||||
// Extras
|
// Extras
|
||||||
double progress_fraction;
|
double progress_fraction;
|
||||||
|
|
||||||
|
|
@ -31,7 +36,7 @@ namespace app::browser::main::tab::page::navigation
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Request(
|
Request(
|
||||||
const Glib::ustring & VALUE = "" // @TODO remove default value
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE
|
||||||
);
|
);
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue