[regexxer/murrayc-update: 11/12] Remove registering of new (deprecated) stock item for save-all.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [regexxer/murrayc-update: 11/12] Remove registering of new (deprecated) stock item for save-all.
- Date: Tue, 1 Mar 2016 08:29:07 +0000 (UTC)
commit e4eaded260768dae652e04637c8ba7e89be91fc7
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Mar 1 09:16:02 2016 +0100
Remove registering of new (deprecated) stock item for save-all.
The icon doesn't seem to be used anyway.
Makefile.am | 21 +------------
src/main.cc | 69 ----------------------------------------------
src/mainwindow.cc | 6 ++--
ui/stock_save_all_16.png | Bin 734 -> 0 bytes
ui/stock_save_all_24.png | Bin 958 -> 0 bytes
5 files changed, 5 insertions(+), 91 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 5729337..18b9ae4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -67,8 +67,7 @@ src_regexxer_SOURCES = \
src/undostack.h \
src/settings.h
-nodist_src_regexxer_SOURCES = \
- ui/stockimages.h
+nodist_src_regexxer_SOURCES =
# The location of the gettext catalogs as defined by intltool.
rxlocaledir = $(prefix)/$(DATADIRNAME)/locale
@@ -93,9 +92,8 @@ desktopdir = $(datadir)/applications
desktop_DATA = ui/regexxer.desktop
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
BUILT_SOURCES = $(nodist_src_regexxer_SOURCES)
@@ -116,21 +114,6 @@ uninstall-hook: uninstall-update-icon-cache
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:
@if test -r "$(top_srcdir)/.git"; then \
if git --git-dir="$(top_srcdir)/.git" --work-tree="$(top_srcdir)" \
diff --git a/src/main.cc b/src/main.cc
index 4900fef..0dcbd6a 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -26,7 +26,6 @@
#include <glib.h>
#include <gtk/gtk.h> /* for gtk_window_set_default_icon_name() */
#include <glibmm.h>
-#include <gtkmm/iconfactory.h>
#include <gtkmm/iconset.h>
#include <gtkmm/iconsource.h>
#include <gtkmm/main.h>
@@ -45,39 +44,6 @@
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
{
private:
@@ -159,40 +125,6 @@ std::unique_ptr<RegexxerOptions> RegexxerOptions::create()
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
int main(int argc, char** argv)
@@ -210,7 +142,6 @@ int main(int argc, char** argv)
Gio::init();
Glib::set_application_name(PACKAGE_NAME);
- register_stock_items();
gtk_window_set_default_icon_name(PACKAGE_TARNAME);
Regexxer::MainWindow window;
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 09ac303..ebe1f63 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -430,7 +430,7 @@ void MainWindow::init_actions()
match_action_group_->insert(action);
action_to_group_[match_actions[i].name] = match_action_group_;
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);
}
@@ -451,7 +451,7 @@ void MainWindow::init_actions()
edit_action_group_->insert(action);
action_to_group_[edit_actions[i].name] = edit_action_group_;
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);
}
@@ -470,7 +470,7 @@ void MainWindow::init_actions()
save_action_group_->insert(action);
action_to_group_[save_actions[i].name] = save_action_group_;
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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]