summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2007-11-15 07:24:46 -0800
committerDaniel Burrows <dburrows@debian.org>2007-11-15 07:24:46 -0800
commit34c3078707cdf73826cd4ad6f5530a1dc99c4d4e (patch)
tree2bd365773c61e48323fadd35a506baa239dc49eb
parent42c43a7aad495c021372415111510c09c46e6e7d (diff)
downloadaptitude-34c3078707cdf73826cd4ad6f5530a1dc99c4d4e.tar.gz
Pass over the source with sed to put global_bindings in config::.
-rw-r--r--src/cmdline/cmdline_prompt.cc2
-rw-r--r--src/cmdline/cmdline_search.cc1
-rw-r--r--src/cmdline/cmdline_show.cc2
-rw-r--r--src/cmdline/cmdline_why.cc8
-rw-r--r--src/desc_parse.cc2
-rw-r--r--src/download_screen.cc4
-rw-r--r--src/edit_pkg_hier.cc14
-rw-r--r--src/generic/apt/matchers.cc2
-rw-r--r--src/load_config.cc2
-rw-r--r--src/load_pkgview.cc2
-rw-r--r--src/menu_text_layout.cc8
-rw-r--r--src/mine/cmine.cc56
-rw-r--r--src/pkg_grouppolicy.cc4
-rw-r--r--src/pkg_item.cc26
-rw-r--r--src/pkg_node.cc2
-rw-r--r--src/pkg_ver_item.cc12
-rw-r--r--src/pkg_view.cc14
-rw-r--r--src/reason_fragment.cc8
-rw-r--r--src/solution_dialog.cc2
-rw-r--r--src/solution_item.cc10
-rw-r--r--src/solution_screen.cc6
-rw-r--r--src/trust.cc2
-rw-r--r--src/ui.cc90
-rw-r--r--src/view_changelog.cc10
24 files changed, 145 insertions, 144 deletions
diff --git a/src/cmdline/cmdline_prompt.cc b/src/cmdline/cmdline_prompt.cc
index 4c1afbef..a119197e 100644
--- a/src/cmdline/cmdline_prompt.cc
+++ b/src/cmdline/cmdline_prompt.cc
@@ -31,9 +31,9 @@
#include <apt-pkg/strutl.h>
using namespace std;
+namespace cw = cwidget;
using cwidget::fragment;
using cwidget::fragf;
-using cwidget::util::transcode;
string StdinEOFException::errmsg() const
{
diff --git a/src/cmdline/cmdline_search.cc b/src/cmdline/cmdline_search.cc
index 15a936cd..b4ff98b1 100644
--- a/src/cmdline/cmdline_search.cc
+++ b/src/cmdline/cmdline_search.cc
@@ -24,6 +24,7 @@
#include <algorithm>
using namespace std;
+namespace cw = cwidget;
using cwidget::util::transcode;
class search_result_parameters : public cwidget::config::column_parameters
diff --git a/src/cmdline/cmdline_show.cc b/src/cmdline/cmdline_show.cc
index 5030883e..56b66210 100644
--- a/src/cmdline/cmdline_show.cc
+++ b/src/cmdline/cmdline_show.cc
@@ -27,9 +27,9 @@
#include <iostream>
+namespace cw = cwidget;
using cwidget::fragf;
using cwidget::fragment;
-using cwidget::util::transcode;
using namespace std;
ostream &operator<<(ostream &out, const cwidget::fragment_contents &contents)
diff --git a/src/cmdline/cmdline_why.cc b/src/cmdline/cmdline_why.cc
index 4cd011fa..3b875778 100644
--- a/src/cmdline/cmdline_why.cc
+++ b/src/cmdline/cmdline_why.cc
@@ -88,7 +88,7 @@ namespace
{
}
- cwidget::style get_style() const
+ cwidget::style cw::get_style() const
{
pkgCache::PkgIterator pkg;
if(!dep.end())
@@ -1059,11 +1059,11 @@ fragment *do_why(const std::vector<pkg_matcher *> &leaves,
it != results.end(); ++it)
{
col1_entries.push_back(hardwrapbox(style_fragment(fragf("%F\n", it->description_column1_fragment()),
- it->get_style())));
+ it->cw::get_style())));
col2_entries.push_back(hardwrapbox(style_fragment(fragf("%F\n", it->description_column2_fragment()),
- it->get_style())));
+ it->cw::get_style())));
col3_entries.push_back(hardwrapbox(style_fragment(fragf("%F\n", it->description_column3_fragment()),
- it->get_style())));
+ it->cw::get_style())));
}
using cwidget::fragment_column_entry;
diff --git a/src/desc_parse.cc b/src/desc_parse.cc
index 04e7e885..2594e4ce 100644
--- a/src/desc_parse.cc
+++ b/src/desc_parse.cc
@@ -292,7 +292,7 @@ cw::fragment *make_tags_fragment(const pkgCache::PkgIterator &pkg)
for(set<tag>::const_iterator i = s->begin(); i != s->end(); ++i)
tags.push_back(cw::text_fragment(i->str(), cw::style_attrs_on(A_BOLD)));
- wstring tagstitle = cwidget::util::transcode(_("Tags"));
+ wstring tagstitle = W_("Tags");
return fragf("%ls: %F",
tagstitle.c_str(),
diff --git a/src/download_screen.cc b/src/download_screen.cc
index 783210fe..af8d0f94 100644
--- a/src/download_screen.cc
+++ b/src/download_screen.cc
@@ -65,7 +65,7 @@ bool download_screen::MediaChange(string Media, string Drive)
arg(sigc::bind(sigc::ptr_fun(set_and_exit),
rval, false)),
W_("Abort"),
- get_style("MediaChange")));
+ cw::get_style("MediaChange")));
toplevel::mainloop(); // Eeeeeek! Recursive mainloop! I'm afraid..
@@ -234,7 +234,7 @@ bool download_screen::handle_key(const cwi::key &k)
{
widgets::widget_ref tmpref(this);
- if(cw::global_bindings.key_matches(k, "Quit"))
+ if(cw::config::global_bindings.key_matches(k, "Quit"))
cancelled=true;
else
return widgets::tree::handle_key(k);
diff --git a/src/edit_pkg_hier.cc b/src/edit_pkg_hier.cc
index f0f13cc8..3c5b20ab 100644
--- a/src/edit_pkg_hier.cc
+++ b/src/edit_pkg_hier.cc
@@ -57,8 +57,8 @@ public:
bool dispatch_key(const cwi::key &k, widgets::tree *owner)
{
- if(cw::global_bindings.key_matches(k, "PushButton") ||
- cw::global_bindings.key_matches(k, "Confirm"))
+ if(cw::config::global_bindings.key_matches(k, "PushButton") ||
+ cw::config::global_bindings.key_matches(k, "Confirm"))
{
selected=!selected;
toplevel::update();
@@ -321,7 +321,7 @@ void widgets::hier_editor::save_hier(string file)
bool widgets::hier_editor::handle_key(const cwi::key &k)
{
- if(cw::global_bindings.key_matches(k, "SaveHier"))
+ if(cw::config::global_bindings.key_matches(k, "SaveHier"))
{
string homedir = get_homedir();
string cfgfile;
@@ -330,14 +330,14 @@ bool widgets::hier_editor::handle_key(const cwi::key &k)
{
show_message(_("Unable to look up your home directory, saving to /tmp/function_pkgs!"),
NULL,
- get_style("Error"));
+ cw::get_style("Error"));
cfgfile = "/tmp/function_pkgs";
}
else
cfgfile = homedir + "/.aptitude/function_pkgs";
save_hier(cfgfile);
}
- else if(cw::global_bindings.key_matches(k, "Quit"))
+ else if(cw::config::global_bindings.key_matches(k, "Quit"))
{
if(item)
{
@@ -350,7 +350,7 @@ bool widgets::hier_editor::handle_key(const cwi::key &k)
hide();
}
- else if(cw::global_bindings.key_matches(k, "Commit"))
+ else if(cw::config::global_bindings.key_matches(k, "Commit"))
{
if(item)
{
@@ -363,7 +363,7 @@ bool widgets::hier_editor::handle_key(const cwi::key &k)
commit_changes();
}
- else if(cw::global_bindings.key_matches(k, "Abort"))
+ else if(cw::config::global_bindings.key_matches(k, "Abort"))
hide();
else
return widgets::tree::handle_key(k);
diff --git a/src/generic/apt/matchers.cc b/src/generic/apt/matchers.cc
index 8027643c..1d8a4ad7 100644
--- a/src/generic/apt/matchers.cc
+++ b/src/generic/apt/matchers.cc
@@ -60,7 +60,7 @@
#include <sys/types.h>
using namespace std;
-using cwidget::util::transcode;
+namespace cw = cwidget;
/** Used to cleanly abort without having to contort the code. */
class CompilationException
diff --git a/src/load_config.cc b/src/load_config.cc
index 03c1a53f..c7856107 100644
--- a/src/load_config.cc
+++ b/src/load_config.cc
@@ -182,7 +182,7 @@ void load_bindings(std::string group, keybindings *toload, bool use_theme)
_error->Error(_("Ignoring invalid keybinding \"%s\" -> \"%s\""), i->Tag.c_str(), currval.c_str());
split=newsplit+1;
} while(newsplit!=string::npos);
- cw::global_bindings.set(i->Tag, newbinding);
+ cw::config::global_bindings.set(i->Tag, newbinding);
}
}
}
diff --git a/src/load_pkgview.cc b/src/load_pkgview.cc
index 6ad5de41..2d37204a 100644
--- a/src/load_pkgview.cc
+++ b/src/load_pkgview.cc
@@ -197,7 +197,7 @@ std::list<package_view_item> *load_pkgview(std::string cfggroup)
if(subtree.Exists("Style"))
{
- tmp.st=get_style(subtree.Find("Style"));
+ tmp.st=cw::get_style(subtree.Find("Style"));
}
tmp.visible=subtree.FindB("Visible", true);
diff --git a/src/menu_text_layout.cc b/src/menu_text_layout.cc
index baee643c..1f076666 100644
--- a/src/menu_text_layout.cc
+++ b/src/menu_text_layout.cc
@@ -125,13 +125,13 @@ bool menu_text_layout::find_repeat_search_back()
bool menu_text_layout::handle_key(const cwi::key &k)
{
- if(cw::global_bindings.key_matches(k, "Search"))
+ if(cw::config::global_bindings.key_matches(k, "Search"))
find_search();
- else if(cw::global_bindings.key_matches(k, "SearchBack"))
+ else if(cw::config::global_bindings.key_matches(k, "SearchBack"))
find_search_back();
- else if(cw::global_bindings.key_matches(k, "ReSearch"))
+ else if(cw::config::global_bindings.key_matches(k, "ReSearch"))
find_research();
- else if(cw::global_bindings.key_matches(k, "RepeatSearchBack"))
+ else if(cw::config::global_bindings.key_matches(k, "RepeatSearchBack"))
find_repeat_search_back();
else
return widgets::text_layout::handle_key(k);
diff --git a/src/mine/cmine.cc b/src/mine/cmine.cc
index 8eff075e..83393665 100644
--- a/src/mine/cmine.cc
+++ b/src/mine/cmine.cc
@@ -146,11 +146,11 @@ void cmine::paint_header(const cwidget::style &st)
++loc;
}
- display_header(header, st+get_style("Header"));
+ display_header(header, st + cw::get_style("Header"));
}
else
display_header(W_("Minesweeper"),
- st+get_style("Header"));
+ st+cw::get_style("Header"));
}
void cmine::do_load_game(wstring ws)
@@ -169,7 +169,7 @@ void cmine::do_load_game(wstring ws)
snprintf(buf, 512, _("Could not open file \"%s\""), s.c_str());
popup_widget(dialogs::ok(cw::util::transcode(buf), NULL,
- get_style("Error")));
+ cw::get_style("Error")));
}
else
{
@@ -185,7 +185,7 @@ void cmine::do_load_game(wstring ws)
s.c_str());
popup_widget(dialogs::ok(cw::util::transcode(buf), NULL,
- get_style("Error")));
+ cw::get_style("Error")));
delete brd;
}
else
@@ -213,7 +213,7 @@ void cmine::do_save_game(wstring ws)
snprintf(buf, 512, _("Could not open file \"%s\""), s.c_str());
popup_widget(dialogs::ok(cw::util::transcode(buf), NULL,
- get_style("Error")));
+ cw::get_style("Error")));
}
else
{
@@ -250,7 +250,7 @@ void cmine::do_start_custom_game(widgets::widget &w_bare,
// That's ok, they'll do that anyway in a couple releases ;-)
popup_widget(dialogs::ok(W_("The board height must be a positive integer"),
NULL,
- get_style("Error")));
+ cw::get_style("Error")));
return;
}
@@ -262,7 +262,7 @@ void cmine::do_start_custom_game(widgets::widget &w_bare,
{
popup_widget(dialogs::ok(W_("The board width must be a positive integer"),
NULL,
- get_style("Error")));
+ cw::get_style("Error")));
return;
}
@@ -274,7 +274,7 @@ void cmine::do_start_custom_game(widgets::widget &w_bare,
{
popup_widget(dialogs::ok(W_("Invalid mine count; please enter a positive integer"),
NULL,
- get_style("Error")));
+ cw::get_style("Error")));
return;
}
@@ -373,12 +373,12 @@ void cmine::do_new_game()
using cwidget::config::global_bindings;
- table->connect_key_post("Confirm", &cw::global_bindings, okbutton->pressed.make_slot());
+ table->connect_key_post("Confirm", &cw::config::global_bindings, okbutton->pressed.make_slot());
- easybutton->connect_key("Confirm", &cw::global_bindings, okbutton->pressed.make_slot());
- mediumbutton->connect_key("Confirm", &cw::global_bindings, okbutton->pressed.make_slot());
- hardbutton->connect_key("Confirm", &cw::global_bindings, okbutton->pressed.make_slot());
- custombutton->connect_key("Confirm", &cw::global_bindings, okbutton->pressed.make_slot());
+ easybutton->connect_key("Confirm", &cw::config::global_bindings, okbutton->pressed.make_slot());
+ mediumbutton->connect_key("Confirm", &cw::config::global_bindings, okbutton->pressed.make_slot());
+ hardbutton->connect_key("Confirm", &cw::config::global_bindings, okbutton->pressed.make_slot());
+ custombutton->connect_key("Confirm", &cw::config::global_bindings, okbutton->pressed.make_slot());
widgets::radiogroup *grp = new widgets::radiogroup;
grp->add_button(easybutton, 0);
@@ -438,7 +438,7 @@ void cmine::do_continue_new_game(bool start,
default:
popup_widget(dialogs::ok(cw::util::transcode("Internal error: execution reached an impossible point"),
NULL,
- get_style("Error")));
+ cw::get_style("Error")));
break;
}
@@ -728,18 +728,18 @@ void cmine::paint_square(int x, int y, const cwidget::style &st)
if(entry.flagged)
{
ch=L'F';
- cur_st=get_style("MineFlag");
+ cur_st=cw::get_style("MineFlag");
}
else
{
ch=L' ';
- cur_st=get_style("DefaultWidgetBackground");
+ cur_st=cw::get_style("DefaultWidgetBackground");
}
}
else if(entry.contains_mine)
{
ch=L'^';
- cur_st=get_style("MineBombColor");
+ cur_st=cw::get_style("MineBombColor");
}
else if(entry.adjacent_mines==0)
ch=L'.';
@@ -748,7 +748,7 @@ void cmine::paint_square(int x, int y, const cwidget::style &st)
ch=(L'0'+entry.adjacent_mines);
string stname("MineNumber");
stname+=(char) '0'+entry.adjacent_mines;
- cur_st=get_style(string("MineNumber")+char('0'+entry.adjacent_mines));
+ cur_st=cw::get_style(string("MineNumber")+char('0'+entry.adjacent_mines));
}
}
else
@@ -759,12 +759,12 @@ void cmine::paint_square(int x, int y, const cwidget::style &st)
x==board->get_minex() && y==board->get_miney())
{
ch=L'*';
- cur_st=get_style("MineDetonated");
+ cur_st=cw::get_style("MineDetonated");
}
else
{
ch=L'^';
- cur_st=get_style("MineBomb");
+ cur_st=cw::get_style("MineBomb");
}
}
else if(entry.uncovered || true)
@@ -776,7 +776,7 @@ void cmine::paint_square(int x, int y, const cwidget::style &st)
ch=(L'0'+entry.adjacent_mines);
string stname("MineNumber");
stname+=(char) '0'+entry.adjacent_mines;
- cur_st=get_style(string("MineNumber")+char('0'+entry.adjacent_mines));
+ cur_st=cw::get_style(string("MineNumber")+char('0'+entry.adjacent_mines));
}
}
else
@@ -821,7 +821,7 @@ void cmine::paint(const cwidget::style &st)
if(board)
{
- apply_style(st+get_style("MineBorder"));
+ apply_style(st+cw::get_style("MineBorder"));
int right=basex+board->get_width()+1, down=basey+1+board->get_height()+1;
// x and y coordinates, respectively, of the right and lower
@@ -950,11 +950,11 @@ void cmine::init_bindings()
using cwidget::config::key;
using cwidget::config::keybindings;
- cw::global_bindings.set("MineUncoverSweepSquare", key(KEY_ENTER, true));
- cw::global_bindings.set("MineFlagSquare", key(L'f', false));
- cw::global_bindings.set("MineNewGame", key(L'n', false));
- cw::global_bindings.set("MineSaveGame", key(L'S', false));
- cw::global_bindings.set("MineLoadGame", key(L'L', false));
+ cw::config::global_bindings.set("MineUncoverSweepSquare", key(KEY_ENTER, true));
+ cw::config::global_bindings.set("MineFlagSquare", key(L'f', false));
+ cw::config::global_bindings.set("MineNewGame", key(L'n', false));
+ cw::config::global_bindings.set("MineSaveGame", key(L'S', false));
+ cw::config::global_bindings.set("MineLoadGame", key(L'L', false));
- bindings = new keybindings(&cw::global_bindings);
+ bindings = new keybindings(&cw::config::global_bindings);
}
diff --git a/src/pkg_grouppolicy.cc b/src/pkg_grouppolicy.cc
index a2fcc5d6..a7aae8c2 100644
--- a/src/pkg_grouppolicy.cc
+++ b/src/pkg_grouppolicy.cc
@@ -386,7 +386,7 @@ void pkg_grouppolicy_status::add_package(const pkgCache::PkgIterator &pkg,
if(!children[section].second)
{
- wstring desc=cw::util::transcode(_(state_titles[section]));
+ wstring desc = W_(state_titles[section]);
wstring shortdesc(desc, 0, desc.find('\n'));
pkg_subtree *newtree=new pkg_subtree_with_order(shortdesc, desc,
@@ -463,7 +463,7 @@ public:
{
if(!children[group].second)
{
- wstring desc=cw::util::transcode(_(child_names[group]));
+ wstring desc = W_(child_names[group]);
wstring shortdesc(desc, 0, desc.find('\n'));
pkg_subtree *newtree=new pkg_subtree_with_order(shortdesc,
diff --git a/src/pkg_item.cc b/src/pkg_item.cc
index c74e1fca..76bc544f 100644
--- a/src/pkg_item.cc
+++ b/src/pkg_item.cc
@@ -266,13 +266,13 @@ style pkg_item::pkg_style(pkgCache::PkgIterator package, bool highlighted)
}
if(present_now && present_inst)
- return get_style(MAYBE_HIGHLIGHTED("PkgIsInstalled"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgIsInstalled"));
else if(present_now)
- return get_style(MAYBE_HIGHLIGHTED("PkgToRemove"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgToRemove"));
else if(present_inst)
- return get_style(MAYBE_HIGHLIGHTED("PkgToInstall"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgToInstall"));
else
- return get_style(MAYBE_HIGHLIGHTED("PkgNotInstalled"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgNotInstalled"));
}
else
{
@@ -280,23 +280,23 @@ style pkg_item::pkg_style(pkgCache::PkgIterator package, bool highlighted)
if(!state.InstBroken() &&
(state.NewInstall() || (state.iFlags&pkgDepCache::ReInstall)))
- return get_style(MAYBE_HIGHLIGHTED("PkgToInstall"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgToInstall"));
else if(state.Status!=2 && // Not being upgraded
(*apt_cache_file)->get_ext_state(package).selection_state==pkgCache::State::Hold // Flagged for hold
&& !state.InstBroken()) // Not currently broken.
- return get_style(MAYBE_HIGHLIGHTED("PkgToHold"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgToHold"));
else if(state.Delete())
- return get_style(MAYBE_HIGHLIGHTED("PkgToRemove"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgToRemove"));
else if(state.InstBroken())
- return get_style(MAYBE_HIGHLIGHTED("PkgBroken"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgBroken"));
else if(state.Upgrade())
- return get_style(MAYBE_HIGHLIGHTED("PkgToUpgrade"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgToUpgrade"));
else if(state.Downgrade())
- return get_style(MAYBE_HIGHLIGHTED("PkgToDowngrade"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgToDowngrade"));
else if(package.CurrentVer().end())
- return get_style(MAYBE_HIGHLIGHTED("PkgNotInstalled"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgNotInstalled"));
else
- return get_style(MAYBE_HIGHLIGHTED("PkgIsInstalled"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgIsInstalled"));
}
}
@@ -455,7 +455,7 @@ bool pkg_item::dispatch_key(const cwi::key &k, widgets::tree *owner)
// FIXME: better title
add_main_widget(e, _("Hierarchy editor"), "", _("Hierarchy Editor"));
- e->connect_key("Quit", &cw::global_bindings,
+ e->connect_key("Quit", &cw::config::global_bindings,
sigc::mem_fun(*e.unsafe_get_ref(), &cwidget::widgets::widget::destroy));
}
else
diff --git a/src/pkg_node.cc b/src/pkg_node.cc
index e9aaa0d1..8f474ebe 100644
--- a/src/pkg_node.cc
+++ b/src/pkg_node.cc
@@ -37,7 +37,7 @@ keybindings *pkg_tree_node::bindings=NULL;
void pkg_tree_node::init_bindings()
{
- bindings=new keybindings(&cw::global_bindings);
+ bindings=new keybindings(&cw::config::global_bindings);
}
// FIXME: add a do_action() command that takes a function pointer and does all
diff --git a/src/pkg_ver_item.cc b/src/pkg_ver_item.cc
index 402ebfe8..6d3dd453 100644
--- a/src/pkg_ver_item.cc
+++ b/src/pkg_ver_item.cc
@@ -502,26 +502,26 @@ style pkg_ver_item::ver_style(pkgCache::VerIterator version,
(state.Install() &&
!state.InstBroken() &&
state.InstVerIter(*apt_cache_file)!=version)))
- return get_style(MAYBE_HIGHLIGHTED("PkgToRemove"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgToRemove"));
else if(((state.NewInstall() || state.Install()) &&
!state.InstBroken() &&
state.InstVerIter(*apt_cache_file)==version) ||
(version==version.ParentPkg().CurrentVer() &&
state.iFlags&pkgDepCache::ReInstall))
- return get_style(MAYBE_HIGHLIGHTED("PkgToInstall"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgToInstall"));
else if(state.InstBroken() && state.InstVerIter(*apt_cache_file)==version)
- return get_style(MAYBE_HIGHLIGHTED("PkgBroken"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgBroken"));
else if(pkg.CurrentVer()!=version)
- return get_style(MAYBE_HIGHLIGHTED("PkgNotInstalled"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgNotInstalled"));
else if(state.NowBroken())
- return get_style(MAYBE_HIGHLIGHTED("PkgBroken"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgBroken"));
else
- return get_style(MAYBE_HIGHLIGHTED("PkgIsInstalled"));
+ return cw::get_style(MAYBE_HIGHLIGHTED("PkgIsInstalled"));
}
void pkg_ver_item::paint(widgets::tree *win, int y, bool hierarchical,
diff --git a/src/pkg_view.cc b/src/pkg_view.cc
index fc8ae445..6fe979e9 100644
--- a/src/pkg_view.cc
+++ b/src/pkg_view.cc
@@ -557,22 +557,22 @@ widgets::widget_ref make_package_view(list<package_view_item> &format,
if(desc_sig)
desc_sig->connect(sigc::mem_fun(*m.unsafe_get_ref(), &info_area_multiplex::set_description));
- mainwidget->connect_key("DescriptionDown", &cw::global_bindings,
+ mainwidget->connect_key("DescriptionDown", &cw::config::global_bindings,
sigc::mem_fun(*m.unsafe_get_ref(),
&info_area_multiplex::line_down));
- mainwidget->connect_key("DescriptionUp", &cw::global_bindings,
+ mainwidget->connect_key("DescriptionUp", &cw::config::global_bindings,
sigc::mem_fun(*m.unsafe_get_ref(),
&info_area_multiplex::line_up));
- mainwidget->connect_key("DescriptionCycle", &cw::global_bindings,
+ mainwidget->connect_key("DescriptionCycle", &cw::config::global_bindings,
sigc::mem_fun(*m.unsafe_get_ref(),
&info_area_multiplex::cycle));
- mainwidget->connect_key("EditHier", &cw::global_bindings,
+ mainwidget->connect_key("EditHier", &cw::config::global_bindings,
sigc::mem_fun(*e.unsafe_get_ref(),
&cwidget::widgets::widget::show));
- mainwidget->connect_key("EditHier", &cw::global_bindings,
+ mainwidget->connect_key("EditHier", &cw::config::global_bindings,
sigc::mem_fun(*m.unsafe_get_ref(),
&cwidget::widgets::widget::show));
- mainwidget->connect_key("EditHier", &cw::global_bindings,
+ mainwidget->connect_key("EditHier", &cw::config::global_bindings,
sigc::bind(sigc::mem_fun(*rval.unsafe_get_ref(), &widgets::table::focus_widget_bare),
m.weak_ref()));
@@ -622,7 +622,7 @@ widgets::widget_ref make_package_view(list<package_view_item> &format,
if(i->popupdownkey.size()>0)
rval->connect_key(i->popupdownkey,
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::mem_fun(*i->widget.unsafe_get_ref(),
&cwidget::widgets::widget::toggle_visible));
diff --git a/src/reason_fragment.cc b/src/reason_fragment.cc
index bccd50b8..5ac4ca0d 100644
--- a/src/reason_fragment.cc
+++ b/src/reason_fragment.cc
@@ -45,7 +45,7 @@ fragment *depname_frag(pkgCache::DepIterator dep)
// Untranslated (internal error that will only happen if things go
// entirely wonky, and I want to be able to understand it if it
// appears)
- return text_fragment("has an invalid dependency type!", get_style("Error"));
+ return text_fragment("has an invalid dependency type!", cw::get_style("Error"));
}
/** Compare two packages by name */
@@ -204,12 +204,12 @@ fragment *dep_singlefrag(pkgCache::PkgIterator pkg,
if(matches_inst)
verstyle=style_attrs_on(A_BOLD);
else
- verstyle=get_style("PkgToRemove");
+ verstyle=cw::get_style("PkgToRemove");
}
else
{
if(matches_inst)
- verstyle=get_style("PkgToInstall");
+ verstyle=cw::get_style("PkgToInstall");
}
verfrag=fragf(" (%s %F)",
@@ -311,7 +311,7 @@ fragment *reasonsfrag(pkgCache::PkgIterator pkg, set<reason> &reasons)
fragment *itemtext=dep_or_frag(pkg, i->dep);
fragments.push_back(sequence_fragment(text_fragment(" * ",
- get_style("Bullet")),
+ cw::get_style("Bullet")),
indentbox(0, 4, flowbox(itemtext)),
NULL));
}
diff --git a/src/solution_dialog.cc b/src/solution_dialog.cc
index f0bc5b13..3de5c07a 100644
--- a/src/solution_dialog.cc
+++ b/src/solution_dialog.cc
@@ -186,7 +186,7 @@ widgets::widget_ref make_solution_dialog()
bclose->pressed.connect(sigc::mem_fun(rval.unsafe_get_ref(),
&cwidget::widgets::widget::destroy));
- rval->connect_key("ApplySolution", &cw::global_bindings,
+ rval->connect_key("ApplySolution", &cw::config::global_bindings,
sigc::bind(sigc::ptr_fun(do_apply),
rval.weak_ref()));
diff --git a/src/solution_item.cc b/src/solution_item.cc
index 33a30de6..36c3c4e8 100644
--- a/src/solution_item.cc
+++ b/src/solution_item.cc
@@ -153,21 +153,21 @@ const wchar_t *solution_item::label()
style solution_item::get_normal_style()
{
if(is_rejected())
- return get_style("SolutionActionRejected");
+ return cw::get_style("SolutionActionRejected");
else if(is_mandatory())
- return get_style("SolutionActionApproved");
+ return cw::get_style("SolutionActionApproved");
else
return style();
}
bool solution_item::dispatch_key(const cwi::key &k, widgets::tree *owner)
{
- if(cw::global_bindings.key_matches(k, "SolutionActionReject"))
+ if(cw::config::global_bindings.key_matches(k, "SolutionActionReject"))
{
toggle_rejected();
owner->line_down();
}
- else if(cw::global_bindings.key_matches(k, "SolutionActionApprove"))
+ else if(cw::config::global_bindings.key_matches(k, "SolutionActionApprove"))
{
toggle_mandated();
owner->line_down();
@@ -295,7 +295,7 @@ void solution_act_item::show_target_info()
bool solution_act_item::dispatch_key(const cwi::key &k, widgets::tree *owner)
{
- if(cw::global_bindings.key_matches(k, "InfoScreen"))
+ if(cw::config::global_bindings.key_matches(k, "InfoScreen"))
{
show_target_info();
return true;
diff --git a/src/solution_screen.cc b/src/solution_screen.cc
index d871fd85..f58ad352 100644
--- a/src/solution_screen.cc
+++ b/src/solution_screen.cc
@@ -425,7 +425,7 @@ protected:
{
widgets::widget_ref tmpref(this);
- if(cw::global_bindings.key_matches(k, "CycleOrder"))
+ if(cw::config::global_bindings.key_matches(k, "CycleOrder"))
cycle_forward();
else
return widgets::multiplex::handle_key(k);
@@ -577,11 +577,11 @@ widgets::widget_ref make_solution_screen()
create_menu_bindings(info_tree.unsafe_get_ref(), info_tree);
- info_tree->connect_key("ShowHideDescription", &cw::global_bindings,
+ info_tree->connect_key("ShowHideDescription", &cw::config::global_bindings,
sigc::mem_fun(info_tree.unsafe_get_ref(),
&cwidget::widgets::widget::toggle_visible));
- l->set_bg_style(get_style("Status"));
+ l->set_bg_style(cw::get_style("Status"));
rval->add_widget_opts(examiner,
0, 0, 1, 1, widgets::table::EXPAND | widgets::table::FILL,
diff --git a/src/trust.cc b/src/trust.cc
index 944ffbb7..60be6f26 100644
--- a/src/trust.cc
+++ b/src/trust.cc
@@ -17,6 +17,6 @@ fragment *make_untrusted_warning(const pkgCache::VerIterator &ver)
strlen(_("WARNING"))+2,
flowbox(fragf(_("%F: This version of %s is from an %Buntrusted source%b! Installing this package could allow a malicious individual to damage or take control of your system."),
text_fragment(_("WARNING"),
- get_style("TrustWarning")),
+ cw::get_style("TrustWarning")),
ver.ParentPkg().Name())));
}
diff --git a/src/ui.cc b/src/ui.cc
index baa7e24b..844d37b5 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -272,7 +272,7 @@ static widgets::widget_ref make_error_dialog(const widgets::text_layout_ref &lay
layout->location_changed.connect(sigc::mem_fun(s.unsafe_get_ref(), &widgets::scrollbar::set_slider));
s->scrollbar_interaction.connect(sigc::mem_fun(layout.unsafe_get_ref(), &widgets::text_layout::scroll));
- return widgets::dialog_ok(t, NULL, W_("Ok"), get_style("Error"));
+ return widgets::dialog_ok(t, NULL, W_("Ok"), cw::get_style("Error"));
}
// blah, I hate C++
@@ -761,7 +761,7 @@ static widgets::widget_ref make_default_view(const menu_tree_ref &mainwidget,
0, 0, 1, 1,
widgets::table::ALIGN_CENTER | widgets::table::EXPAND | widgets::table::FILL | widgets::table::SHRINK,
widgets::table::ALIGN_CENTER,
- get_style("Header"),
+ cw::get_style("Header"),
"",
"",
true));
@@ -780,7 +780,7 @@ static widgets::widget_ref make_default_view(const menu_tree_ref &mainwidget,
2, 0, 1, 1,
widgets::table::ALIGN_CENTER | widgets::table::EXPAND | widgets::table::FILL | widgets::table::SHRINK,
widgets::table::ALIGN_CENTER,
- get_style("Status"),
+ cw::get_style("Status"),
"", "",
true));
@@ -984,11 +984,11 @@ static widgets::widget_ref setup_fileview(const std::string &filename,
s->scrollbar_interaction.connect(sigc::mem_fun(p.unsafe_get_ref(), &widgets::pager::scroll_page));
p->scroll_top(); // Force a scrollbar update.
- p->connect_key("Search", &cw::global_bindings,
+ p->connect_key("Search", &cw::config::global_bindings,
sigc::bind(sigc::ptr_fun(&pager_search), p.weak_ref()));
- p->connect_key("ReSearch", &cw::global_bindings,
+ p->connect_key("ReSearch", &cw::config::global_bindings,
sigc::bind(sigc::ptr_fun(&pager_repeat_search), p.weak_ref()));
- p->connect_key("RepeatSearchBack", &cw::global_bindings,
+ p->connect_key("RepeatSearchBack", &cw::config::global_bindings,
sigc::bind(sigc::ptr_fun(&pager_repeat_search_back), p.weak_ref()));
t->add_widget_opts(p, 0, 0, 1, 1,
@@ -1260,7 +1260,7 @@ static void check_package_trust()
W_("Really Continue"),
NULL,
W_("Abort Installation"),
- get_style("TrustWarning"),
+ cw::get_style("TrustWarning"),
true,
false),
true);
@@ -1319,7 +1319,7 @@ static void do_show_preview()
active_preview->destroyed.connect(sigc::ptr_fun(reset_preview));
active_preview->connect_key("DoInstallRun",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(actually_do_package_run));
add_main_widget(active_preview, _("Preview of package installation"),
_("View and/or adjust the actions that will be performed"),
@@ -1389,14 +1389,14 @@ static void auto_fix_broken()
{
show_message(_("No solution to these dependency problems exists!"),
NULL,
- get_style("Error"));
+ cw::get_style("Error"));
}
catch(NoMoreTime)
{
show_message(fragf(_("Ran out of time while trying to resolve dependencies (press \"%s\" to try harder)"),
- cw::global_bindings.readable_keyname("NextSolution").c_str()),
+ cw::config::global_bindings.readable_keyname("NextSolution").c_str()),
NULL,
- get_style("Error"));
+ cw::get_style("Error"));
}
if(!undo->empty())
@@ -1445,11 +1445,11 @@ static void actually_do_package_run()
W_("Become root"),
arg(sigc::ptr_fun(&check_package_trust)),
W_("Don't become root"),
- get_style("Error")));
+ cw::get_style("Error")));
}
}
else
- show_message(_("A package-list update or install run is already taking place."), NULL, get_style("Error"));
+ show_message(_("A package-list update or install run is already taking place."), NULL, cw::get_style("Error"));
}
}
@@ -1574,11 +1574,11 @@ void do_update_lists()
W_("Become root"),
arg(sigc::ptr_fun(&really_do_update_lists)),
W_("Don't become root"),
- get_style("Error")));
+ cw::get_style("Error")));
}
}
else
- show_message(_("A package-list update or install run is already taking place."), NULL, get_style("Error"));
+ show_message(_("A package-list update or install run is already taking place."), NULL, cw::get_style("Error"));
}
static void do_sweep()
@@ -1995,13 +1995,13 @@ void do_apply_solution()
{
show_message(_("Unable to find a solution to apply."),
NULL,
- get_style("Error"));
+ cw::get_style("Error"));
}
catch(NoMoreTime)
{
show_message(_("Ran out of time while trying to find a solution."),
NULL,
- get_style("Error"));
+ cw::get_style("Error"));
}
if(!undo->empty())
@@ -2423,7 +2423,7 @@ static void do_setup_columns()
static void load_options(string base, bool usetheme)
{
load_styles(base+"::Styles", usetheme);
- load_bindings(base+"::Keybindings", &cw::global_bindings, usetheme);
+ load_bindings(base+"::Keybindings", &cw::config::global_bindings, usetheme);
load_bindings(base+"::Keybindings::EditLine", widgets::editline::bindings, usetheme);
load_bindings(base+"::Keybindings::Menu", widgets::menu::bindings, usetheme);
load_bindings(base+"::Keybindings::Menubar", widgets::menubar::bindings, usetheme);
@@ -2533,52 +2533,52 @@ void ui_init()
main_menu->set_subwidget(main_stacked);
main_stacked->show();
- main_stacked->connect_key_post("QuitProgram", &cw::global_bindings, sigc::ptr_fun(do_quit));
- main_stacked->connect_key_post("Quit", &cw::global_bindings, sigc::ptr_fun(do_destroy_visible));
+ main_stacked->connect_key_post("QuitProgram", &cw::config::global_bindings, sigc::ptr_fun(do_quit));
+ main_stacked->connect_key_post("Quit", &cw::config::global_bindings, sigc::ptr_fun(do_destroy_visible));
main_stacked->connect_key_post("CycleNext",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_view_next));
main_stacked->connect_key_post("CyclePrev",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_view_prev));
main_stacked->connect_key_post("DoInstallRun",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_package_run));
main_stacked->connect_key_post("UpdatePackageList",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_update_lists));
main_stacked->connect_key_post("MarkUpgradable",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_mark_upgradable));
main_stacked->connect_key_post("ForgetNewPackages",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_forget_new));
main_stacked->connect_key_post("Help",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_help_help));
main_stacked->connect_key_post("Undo",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::hide_return(undo_undo.make_slot()));
main_stacked->connect_key_post("NextSolution",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_next_solution));
main_stacked->connect_key_post("PrevSolution",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_previous_solution));
main_stacked->connect_key_post("FirstSolution",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_first_solution));
main_stacked->connect_key_post("LastSolution",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_last_solution));
main_stacked->connect_key_post("ApplySolution",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_apply_solution));
main_stacked->connect_key_post("ExamineSolution",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_examine_solution));
main_stacked->connect_key_post("DumpResolver",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::ptr_fun(do_dump_resolver));
main_table=widgets::table::create();
@@ -2586,11 +2586,11 @@ void ui_init()
main_table->show();
// FIXME: highlight the keys.
- wstring menu_key=cw::global_bindings.readable_keyname("ToggleMenuActive"),
- help_key=cw::global_bindings.readable_keyname("Help"),
- quit_key=cw::global_bindings.readable_keyname("Quit"),
- update_key=cw::global_bindings.readable_keyname("UpdatePackageList"),
- install_key=cw::global_bindings.readable_keyname("DoInstallRun");
+ wstring menu_key=cw::config::global_bindings.readable_keyname("ToggleMenuActive"),
+ help_key=cw::config::global_bindings.readable_keyname("Help"),
+ quit_key=cw::config::global_bindings.readable_keyname("Quit"),
+ update_key=cw::config::global_bindings.readable_keyname("UpdatePackageList"),
+ install_key=cw::config::global_bindings.readable_keyname("DoInstallRun");
wstring helptext = swsprintf(W_("%ls: Menu %ls: Help %ls: Quit %ls: Update %ls: Download/Install/Remove Pkgs").c_str(),
menu_key.c_str(),
@@ -2599,7 +2599,7 @@ void ui_init()
update_key.c_str(),
install_key.c_str());
- help_bar_ref help_label(help_bar::create(helptext, get_style("Header")));
+ help_bar_ref help_label(help_bar::create(helptext, cw::get_style("Header")));
main_table->add_widget_opts(help_label, 0, 0, 1, 1,
widgets::table::EXPAND | widgets::table::FILL | widgets::table::SHRINK,
widgets::table::ALIGN_CENTER);
@@ -2620,7 +2620,7 @@ void ui_init()
widgets::table::ALIGN_CENTER);
main_status_multiplex=widgets::multiplex::create();
- main_status_multiplex->set_bg_style(get_style("Status"));
+ main_status_multiplex->set_bg_style(cw::get_style("Status"));
main_table->add_widget_opts(main_status_multiplex, 3, 0, 1, 1,
widgets::table::EXPAND | widgets::table::FILL | widgets::table::SHRINK,
widgets::table::ALIGN_CENTER);
@@ -2874,12 +2874,12 @@ void prompt_string(const std::wstring &prompt,
e->text_changed.connect(*changed_slot);
e->connect_key("Cancel",
- &cw::global_bindings,
+ &cw::config::global_bindings,
sigc::mem_fun(e.unsafe_get_ref(), &cwidget::widgets::widget::destroy));
if(cancel_slot)
e->connect_key("Cancel",
- &cw::global_bindings,
+ &cw::config::global_bindings,
*cancel_slot);
main_status_multiplex->add_visible_widget(e, true);
@@ -3031,7 +3031,7 @@ void show_message(fragment *msg,
if(aptcfg->FindB(PACKAGE "::UI::Minibuf-Prompts"))
{
widgets::text_layout_ref l = self_destructing_layout::create(msg);
- l->set_bg_style(get_style("Status")+st);
+ l->set_bg_style(cw::get_style("Status")+st);
if(okslot)
l->destroyed.connect(*okslot);
diff --git a/src/view_changelog.cc b/src/view_changelog.cc
index 27b1e1d1..99272a60 100644
--- a/src/view_changelog.cc
+++ b/src/view_changelog.cc
@@ -94,13 +94,13 @@ protected:
int width = 0, int height = 0):
widgets::file_pager(filename.get_name()), last_search_forwards(true)
{
- connect_key("Search", &cw::global_bindings,
+ connect_key("Search", &cw::config::global_bindings,
sigc::mem_fun(*this, &pkg_changelog_screen::do_search));
- connect_key("SearchBack", &cw::global_bindings,
+ connect_key("SearchBack", &cw::config::global_bindings,
sigc::mem_fun(*this, &pkg_changelog_screen::do_search_back));
- connect_key("ReSearch", &cw::global_bindings,
+ connect_key("ReSearch", &cw::config::global_bindings,
sigc::mem_fun(*this, &pkg_changelog_screen::do_repeat_search));
- connect_key("RepeatSearchBack", &cw::global_bindings,
+ connect_key("RepeatSearchBack", &cw::config::global_bindings,
sigc::mem_fun(*this, &pkg_changelog_screen::do_repeat_search_back));
}
@@ -223,7 +223,7 @@ void view_changelog(pkgCache::VerIterator ver)
if(!in_debian)
{
show_message(_("You can only view changelogs of official Debian packages."),
- NULL, get_style("Error"));
+ NULL, cw::get_style("Error"));
return;
}