Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
GNOME
regexxer
Commits
e4eaded2
Commit
e4eaded2
authored
Mar 01, 2016
by
Murray Cumming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove registering of new (deprecated) stock item for save-all.
The icon doesn't seem to be used anyway.
parent
16ed75dc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
91 deletions
+5
-91
Makefile.am
Makefile.am
+2
-19
src/main.cc
src/main.cc
+0
-69
src/mainwindow.cc
src/mainwindow.cc
+3
-3
ui/stock_save_all_16.png
ui/stock_save_all_16.png
+0
-0
ui/stock_save_all_24.png
ui/stock_save_all_24.png
+0
-0
No files found.
Makefile.am
View file @
e4eaded2
...
...
@@ -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)
"
\
...
...
src/main.cc
View file @
e4eaded2
...
...
@@ -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
;
...
...
src/mainwindow.cc
View file @
e4eaded2
...
...
@@ -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
_accel
erator
(
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
_accel
erator
(
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
_accel
erator
(
save_actions
[
i
].
accelerator
,
application_
->
set
_accel
_for_action
(
save_actions
[
i
].
accelerator
,
Glib
::
ustring
(
"save."
)
+
save_actions
[
i
].
name
);
}
...
...
ui/stock_save_all_16.png
deleted
100644 → 0
View file @
16ed75dc
734 Bytes
ui/stock_save_all_24.png
deleted
100644 → 0
View file @
16ed75dc
958 Bytes
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment