Commit e4eaded2 authored by Murray Cumming's avatar Murray Cumming

Remove registering of new (deprecated) stock item for save-all.

The icon doesn't seem to be used anyway.
parent 16ed75dc
...@@ -67,8 +67,7 @@ src_regexxer_SOURCES = \ ...@@ -67,8 +67,7 @@ src_regexxer_SOURCES = \
src/undostack.h \ src/undostack.h \
src/settings.h src/settings.h
nodist_src_regexxer_SOURCES = \ nodist_src_regexxer_SOURCES =
ui/stockimages.h
# The location of the gettext catalogs as defined by intltool. # The location of the gettext catalogs as defined by intltool.
rxlocaledir = $(prefix)/$(DATADIRNAME)/locale rxlocaledir = $(prefix)/$(DATADIRNAME)/locale
...@@ -93,9 +92,8 @@ desktopdir = $(datadir)/applications ...@@ -93,9 +92,8 @@ desktopdir = $(datadir)/applications
desktop_DATA = ui/regexxer.desktop desktop_DATA = ui/regexxer.desktop
dist_intltool = intltool-extract.in intltool-merge.in intltool-update.in dist_intltool = intltool-extract.in intltool-merge.in intltool-update.in
stockimages = ui/stock_save_all_16.png ui/stock_save_all_24.png
dist_noinst_DATA = $(stockimages) $(dist_intltool) $(desktop_in_files) $(gsettingsschema_in_files) dist_noinst_DATA = $(dist_intltool) $(desktop_in_files) $(gsettingsschema_in_files)
dist_noinst_SCRIPTS = autogen.sh dist_noinst_SCRIPTS = autogen.sh
BUILT_SOURCES = $(nodist_src_regexxer_SOURCES) BUILT_SOURCES = $(nodist_src_regexxer_SOURCES)
...@@ -116,21 +114,6 @@ uninstall-hook: uninstall-update-icon-cache ...@@ -116,21 +114,6 @@ uninstall-hook: uninstall-update-icon-cache
dist-hook: dist-changelog dist-hook: dist-changelog
# Note that this rule creates the ui/ build directory as a side effect.
# This works just fine because the target is in BUILT_SOURCES and thus
# built before everything else. Otherwise a special ui/.dirstamp rule
# would be necessary.
ui/stockimages.h: $(stockimages)
@mkdir ui >/dev/null 2>&1 || test -d ui
@build_list='--build-list'; \
list='$(stockimages)'; for file in $$list; do \
name=`expr "X/$$file" : '.*[\\/]\([^.]*\)' | sed 'y/-/_/'`; \
dir=; test -f "$$file" || dir='$(srcdir)/'; \
build_list="$$build_list $$name $$dir$$file"; \
done; \
echo " $(pixbuf_csource) $$build_list >$@"; \
$(pixbuf_csource) $$build_list >$@
dist-changelog: dist-changelog:
@if test -r "$(top_srcdir)/.git"; then \ @if test -r "$(top_srcdir)/.git"; then \
if git --git-dir="$(top_srcdir)/.git" --work-tree="$(top_srcdir)" \ if git --git-dir="$(top_srcdir)/.git" --work-tree="$(top_srcdir)" \
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <glib.h> #include <glib.h>
#include <gtk/gtk.h> /* for gtk_window_set_default_icon_name() */ #include <gtk/gtk.h> /* for gtk_window_set_default_icon_name() */
#include <glibmm.h> #include <glibmm.h>
#include <gtkmm/iconfactory.h>
#include <gtkmm/iconset.h> #include <gtkmm/iconset.h>
#include <gtkmm/iconsource.h> #include <gtkmm/iconsource.h>
#include <gtkmm/main.h> #include <gtkmm/main.h>
...@@ -45,39 +44,6 @@ ...@@ -45,39 +44,6 @@
namespace namespace
{ {
/*
* Include inlined raw pixbuf data generated by gdk-pixbuf-csource.
*/
#include <ui/stockimages.h>
struct StockIconData
{
const guint8* data;
int length;
Gtk::BuiltinIconSize size;
};
struct StockItemData
{
const char* id;
const StockIconData* icons;
int n_icons;
const char* label;
};
static
const StockIconData stock_icon_save_all[] =
{
{ stock_save_all_16, sizeof(stock_save_all_16), Gtk::ICON_SIZE_MENU },
{ stock_save_all_24, sizeof(stock_save_all_24), Gtk::ICON_SIZE_SMALL_TOOLBAR }
};
static
const StockItemData regexxer_stock_items[] =
{
{ "regexxer-save-all", stock_icon_save_all, G_N_ELEMENTS(stock_icon_save_all), N_("Save _all") }
};
class RegexxerOptions class RegexxerOptions
{ {
private: private:
...@@ -159,40 +125,6 @@ std::unique_ptr<RegexxerOptions> RegexxerOptions::create() ...@@ -159,40 +125,6 @@ std::unique_ptr<RegexxerOptions> RegexxerOptions::create()
return options; return options;
} }
static
void register_stock_items()
{
const Glib::RefPtr<Gtk::IconFactory> factory = Gtk::IconFactory::create();
const Glib::ustring domain = PACKAGE_TARNAME;
for (unsigned int item = 0; item < G_N_ELEMENTS(regexxer_stock_items); ++item)
{
const StockItemData& stock = regexxer_stock_items[item];
Glib::RefPtr<Gtk::IconSet> icon_set = Gtk::IconSet::create();
for (int icon = 0; icon < stock.n_icons; ++icon)
{
const StockIconData& icon_data = stock.icons[icon];
Gtk::IconSource source;
source.set_pixbuf(Gdk::Pixbuf::create_from_inline(icon_data.length, icon_data.data));
source.set_size(icon_data.size);
// Unset wildcarded for all but the the last icon.
source.set_size_wildcarded(icon == stock.n_icons - 1);
icon_set->add_source(source);
}
const Gtk::StockID stock_id (stock.id);
factory->add(stock_id, icon_set);
Gtk::Stock::add(Gtk::StockItem(stock_id, stock.label, Gdk::ModifierType(0), 0, domain));
}
factory->add_default();
}
} // anonymous namespace } // anonymous namespace
int main(int argc, char** argv) int main(int argc, char** argv)
...@@ -210,7 +142,6 @@ int main(int argc, char** argv) ...@@ -210,7 +142,6 @@ int main(int argc, char** argv)
Gio::init(); Gio::init();
Glib::set_application_name(PACKAGE_NAME); Glib::set_application_name(PACKAGE_NAME);
register_stock_items();
gtk_window_set_default_icon_name(PACKAGE_TARNAME); gtk_window_set_default_icon_name(PACKAGE_TARNAME);
Regexxer::MainWindow window; Regexxer::MainWindow window;
......
...@@ -430,7 +430,7 @@ void MainWindow::init_actions() ...@@ -430,7 +430,7 @@ void MainWindow::init_actions()
match_action_group_->insert(action); match_action_group_->insert(action);
action_to_group_[match_actions[i].name] = match_action_group_; action_to_group_[match_actions[i].name] = match_action_group_;
if (match_actions[i].accelerator) if (match_actions[i].accelerator)
application_->add_accelerator(match_actions[i].accelerator, application_->set_accel_for_action(match_actions[i].accelerator,
Glib::ustring("match.") + match_actions[i].name); Glib::ustring("match.") + match_actions[i].name);
} }
...@@ -451,7 +451,7 @@ void MainWindow::init_actions() ...@@ -451,7 +451,7 @@ void MainWindow::init_actions()
edit_action_group_->insert(action); edit_action_group_->insert(action);
action_to_group_[edit_actions[i].name] = edit_action_group_; action_to_group_[edit_actions[i].name] = edit_action_group_;
if (edit_actions[i].accelerator) if (edit_actions[i].accelerator)
application_->add_accelerator(edit_actions[i].accelerator, application_->set_accel_for_action(edit_actions[i].accelerator,
Glib::ustring("edit.") + edit_actions[i].name); Glib::ustring("edit.") + edit_actions[i].name);
} }
...@@ -470,7 +470,7 @@ void MainWindow::init_actions() ...@@ -470,7 +470,7 @@ void MainWindow::init_actions()
save_action_group_->insert(action); save_action_group_->insert(action);
action_to_group_[save_actions[i].name] = save_action_group_; action_to_group_[save_actions[i].name] = save_action_group_;
if (save_actions[i].accelerator) if (save_actions[i].accelerator)
application_->add_accelerator(save_actions[i].accelerator, application_->set_accel_for_action(save_actions[i].accelerator,
Glib::ustring("save.") + save_actions[i].name); Glib::ustring("save.") + save_actions[i].name);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment