Skip to content

Commit a25211d

Browse files
author
timlinux
committedJul 29, 2008
Final fixes for ticket #1054. Grass plugin uses Qt4 resource bundle for all icon resources.
git-svn-id: http://svn.osgeo.org/qgis/trunk@8948 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4e6636a commit a25211d

15 files changed

+108
-26
lines changed
 

‎src/plugins/grass/add_raster.png

-2.23 KB
Binary file not shown.

‎src/plugins/grass/add_vector.png

-2.33 KB
Binary file not shown.

‎src/plugins/grass/clearInput.png

-2.08 KB
Binary file not shown.
-2.05 KB
Binary file not shown.

‎src/plugins/grass/grass_edit.png

-1.87 KB
Binary file not shown.
-1.77 KB
Binary file not shown.
-2.05 KB
Binary file not shown.
-1.49 KB
Binary file not shown.

‎src/plugins/grass/grass_region.png

-1.2 KB
Binary file not shown.
-1.47 KB
Binary file not shown.

‎src/plugins/grass/grass_tools.png

-2.47 KB
Binary file not shown.

‎src/plugins/grass/qgsgrass_plugin.qrc

Lines changed: 91 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,95 @@
11
<RCC>
2-
<qresource prefix="/grass" >
3-
<file>add_raster.png</file>
4-
<file>grass_new_mapset.png</file>
5-
<file>grass_region_edit.png</file>
6-
<file>add_vector.png</file>
7-
<file>grass_new_vector_layer.png</file>
8-
<file>grass_tools.png</file>
9-
<file>grass_close_mapset.png</file>
10-
<file>grass_open_mapset.png</file>
11-
<file>world.png</file>
12-
<file>grass_edit.png</file>
13-
<file>grass_region.png</file>
2+
<qresource prefix="/default/grass" >
3+
<file alias="grass_add_map.png">themes/default/grass_add_map.png</file>
4+
<file alias="grass_add_raster.png">themes/default/grass_add_raster.png</file>
5+
<file alias="grass_add_vector.png">themes/default/grass_add_vector.png</file>
6+
<file alias="grass_add_vertex.png">themes/default/grass_add_vertex.png</file>
7+
<file alias="grass_browser_raster_layer.png">themes/default/grass_browser_raster_layer.png</file>
8+
<file alias="grass_browser_vector_layer.png">themes/default/grass_browser_vector_layer.png</file>
9+
<file alias="grass_clear_input.png">themes/default/grass_clear_input.png</file>
10+
<file alias="grass_close_edit.png">themes/default/grass_close_edit.png</file>
11+
<file alias="grass_close_mapset.png">themes/default/grass_close_mapset.png</file>
12+
<file alias="grass_copy_map.png">themes/default/grass_copy_map.png</file>
13+
<file alias="grass_delete_line.png">themes/default/grass_delete_line.png</file>
14+
<file alias="grass_delete_map.png">themes/default/grass_delete_map.png</file>
15+
<file alias="grass_delete_vertex.png">themes/default/grass_delete_vertex.png</file>
16+
<file alias="grass_edit_attributes.png">themes/default/grass_edit_attributes.png</file>
17+
<file alias="grass_edit.png">themes/default/grass_edit.png</file>
18+
<file alias="grass_module_error.png">themes/default/grass_module_error.png</file>
19+
<file alias="grass_module_warning.png">themes/default/grass_module_warning.png</file>
20+
<file alias="grass_move_line.png">themes/default/grass_move_line.png</file>
21+
<file alias="grass_move_vertex.png">themes/default/grass_move_vertex.png</file>
22+
<file alias="grass_new_boundary.png">themes/default/grass_new_boundary.png</file>
23+
<file alias="grass_new_centroid.png">themes/default/grass_new_centroid.png</file>
24+
<file alias="grass_new_line.png">themes/default/grass_new_line.png</file>
25+
<file alias="grass_new_mapset.png">themes/default/grass_new_mapset.png</file>
26+
<file alias="grass_new_point.png">themes/default/grass_new_point.png</file>
27+
<file alias="grass_new_vector_layer.png">themes/default/grass_new_vector_layer.png</file>
28+
<file alias="grass_open_mapset.png">themes/default/grass_open_mapset.png</file>
29+
<file alias="grass_refresh.png">themes/default/grass_refresh.png</file>
30+
<file alias="grass_region_edit.png">themes/default/grass_region_edit.png</file>
31+
<file alias="grass_region.png">themes/default/grass_region.png</file>
32+
<file alias="grass_rename_map.png">themes/default/grass_rename_map.png</file>
33+
<file alias="grass_set_region.png">themes/default/grass_set_region.png</file>
34+
<file alias="grass_shell.png">themes/default/grass_shell.png</file>
35+
<file alias="grass_split_line.png">themes/default/grass_split_line.png</file>
36+
<file alias="grass_tools.png">themes/default/grass_tools.png</file>
37+
<file alias="mapcalc_add_connection.png">themes/default/mapcalc_add_connection.png</file>
38+
<file alias="mapcalc_add_constant.png">themes/default/mapcalc_add_constant.png</file>
39+
<file alias="mapcalc_add_function.png">themes/default/mapcalc_add_function.png</file>
40+
<file alias="mapcalc_add_map.png">themes/default/mapcalc_add_map.png</file>
41+
<file alias="mapcalc_delete.png">themes/default/mapcalc_delete.png</file>
42+
<file alias="mapcalc_open.png">themes/default/mapcalc_open.png</file>
43+
<file alias="mapcalc_save_as.png">themes/default/mapcalc_save_as.png</file>
44+
<file alias="mapcalc_save.png">themes/default/mapcalc_save.png</file>
45+
<file alias="mapcalc_select.png">themes/default/mapcalc_select.png</file>
46+
<file alias="world.png">themes/default/world.png</file>
47+
</qresource>
48+
<qresource prefix="/classic/grass" >
49+
<file alias="grass_add_map.png">themes/classic/grass_add_map.png</file>
50+
<file alias="grass_add_raster.png">themes/classic/grass_add_raster.png</file>
51+
<file alias="grass_add_vector.png">themes/classic/grass_add_vector.png</file>
52+
<file alias="grass_add_vertex.png">themes/classic/grass_add_vertex.png</file>
53+
<file alias="grass_browser_raster_layer.png">themes/classic/grass_browser_raster_layer.png</file>
54+
<file alias="grass_browser_vector_layer.png">themes/classic/grass_browser_vector_layer.png</file>
55+
<file alias="grass_clear_input.png">themes/classic/grass_clear_input.png</file>
56+
<file alias="grass_close_edit.png">themes/classic/grass_close_edit.png</file>
57+
<file alias="grass_close_mapset.png">themes/classic/grass_close_mapset.png</file>
58+
<file alias="grass_copy_map.png">themes/classic/grass_copy_map.png</file>
59+
<file alias="grass_delete_line.png">themes/classic/grass_delete_line.png</file>
60+
<file alias="grass_delete_map.png">themes/classic/grass_delete_map.png</file>
61+
<file alias="grass_delete_vertex.png">themes/classic/grass_delete_vertex.png</file>
62+
<file alias="grass_edit_attributes.png">themes/classic/grass_edit_attributes.png</file>
63+
<file alias="grass_edit.png">themes/classic/grass_edit.png</file>
64+
<file alias="grass_module_error.png">themes/classic/grass_module_error.png</file>
65+
<file alias="grass_module_warning.png">themes/classic/grass_module_warning.png</file>
66+
<file alias="grass_move_line.png">themes/classic/grass_move_line.png</file>
67+
<file alias="grass_move_vertex.png">themes/classic/grass_move_vertex.png</file>
68+
<file alias="grass_new_boundary.png">themes/classic/grass_new_boundary.png</file>
69+
<file alias="grass_new_centroid.png">themes/classic/grass_new_centroid.png</file>
70+
<file alias="grass_new_line.png">themes/classic/grass_new_line.png</file>
71+
<file alias="grass_new_mapset.png">themes/classic/grass_new_mapset.png</file>
72+
<file alias="grass_new_point.png">themes/classic/grass_new_point.png</file>
73+
<file alias="grass_new_vector_layer.png">themes/classic/grass_new_vector_layer.png</file>
74+
<file alias="grass_open_mapset.png">themes/classic/grass_open_mapset.png</file>
75+
<file alias="grass_refresh.png">themes/classic/grass_refresh.png</file>
76+
<file alias="grass_region_edit.png">themes/classic/grass_region_edit.png</file>
77+
<file alias="grass_region.png">themes/classic/grass_region.png</file>
78+
<file alias="grass_rename_map.png">themes/classic/grass_rename_map.png</file>
79+
<file alias="grass_set_region.png">themes/classic/grass_set_region.png</file>
80+
<file alias="grass_shell.png">themes/classic/grass_shell.png</file>
81+
<file alias="grass_split_line.png">themes/classic/grass_split_line.png</file>
82+
<file alias="grass_tools.png">themes/classic/grass_tools.png</file>
83+
<file alias="mapcalc_add_connection.png">themes/classic/mapcalc_add_connection.png</file>
84+
<file alias="mapcalc_add_constant.png">themes/classic/mapcalc_add_constant.png</file>
85+
<file alias="mapcalc_add_function.png">themes/classic/mapcalc_add_function.png</file>
86+
<file alias="mapcalc_add_map.png">themes/classic/mapcalc_add_map.png</file>
87+
<file alias="mapcalc_delete.png">themes/classic/mapcalc_delete.png</file>
88+
<file alias="mapcalc_open.png">themes/classic/mapcalc_open.png</file>
89+
<file alias="mapcalc_save_as.png">themes/classic/mapcalc_save_as.png</file>
90+
<file alias="mapcalc_save.png">themes/classic/mapcalc_save.png</file>
91+
<file alias="mapcalc_select.png">themes/classic/mapcalc_select.png</file>
92+
<file alias="world.png">themes/classic/world.png</file>
1493
</qresource>
1594
</RCC>
1695

‎src/plugins/grass/qgsgrassplugin.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,26 +144,26 @@ void QgsGrassPlugin::initGui()
144144
mRegionBand->setZValue(20);
145145

146146
// Create the action for tool
147-
mOpenMapsetAction = new QAction(QIcon(":/grass/grass_open_mapset.png"), tr("Open mapset"), this );
148-
mNewMapsetAction = new QAction(QIcon(":/grass/grass_new_mapset.png"), tr("New mapset"), this );
149-
mCloseMapsetAction = new QAction(QIcon(":/grass/grass_close_mapset.png"), tr("Close mapset"), this );
147+
mOpenMapsetAction = new QAction(getThemeIcon("grass_open_mapset.png"), tr("Open mapset"), this );
148+
mNewMapsetAction = new QAction(getThemeIcon("grass_new_mapset.png"), tr("New mapset"), this );
149+
mCloseMapsetAction = new QAction(getThemeIcon("grass_close_mapset.png"), tr("Close mapset"), this );
150150

151-
mAddVectorAction = new QAction(QIcon(":/grass/add_vector.png"),
151+
mAddVectorAction = new QAction(getThemeIcon("grass_add_vector.png"),
152152
tr("Add GRASS vector layer"), this);
153-
mAddRasterAction = new QAction(QIcon(":/grass/add_raster.png"),
153+
mAddRasterAction = new QAction(getThemeIcon("grass_add_raster.png"),
154154
tr("Add GRASS raster layer"), this);
155-
mOpenToolsAction = new QAction(QIcon(":/grass/grass_tools.png"),
155+
mOpenToolsAction = new QAction(getThemeIcon("grass_tools.png"),
156156
tr("Open GRASS tools"), this);
157157

158-
mRegionAction = new QAction(QIcon(":/grass/grass_region.png"),
158+
mRegionAction = new QAction(getThemeIcon("grass_region.png"),
159159
tr("Display Current Grass Region"), this);
160160
mRegionAction->setCheckable(true);
161161

162-
mEditRegionAction = new QAction(QIcon(":/grass/grass_region_edit.png"),
162+
mEditRegionAction = new QAction(getThemeIcon("grass_region_edit.png"),
163163
tr("Edit Current Grass Region"), this);
164-
mEditAction = new QAction(QIcon(":/grass/grass_edit.png"),
164+
mEditAction = new QAction(getThemeIcon("grass_edit.png"),
165165
tr("Edit Grass Vector layer"), this);
166-
mNewVectorAction = new QAction(QIcon(":/grass/grass_new_vector_layer.png"),tr("Create new Grass Vector"), this);
166+
mNewVectorAction = new QAction(getThemeIcon("grass_new_vector_layer.png"),tr("Create new Grass Vector"), this);
167167

168168
mAddVectorAction->setWhatsThis(tr("Adds a GRASS vector layer to the map canvas"));
169169
mAddRasterAction->setWhatsThis(tr("Adds a GRASS raster layer to the map canvas"));
@@ -814,18 +814,21 @@ void QgsGrassPlugin::unload()
814814
}
815815
// Note this code is duplicated from qgisapp.cpp because
816816
// I didnt want to make plugins dependent on qgsapplication
817-
// and because it needs grass specific path [TS]
817+
// and because it needs grass specific path into
818+
// the GRASS plugin resource bundle [TS]
818819
QIcon QgsGrassPlugin::getThemeIcon(const QString theName)
819820
{
820-
if (QFile::exists(QgsApplication::activeThemePath() + "/grass/" + theName))
821+
QString myPath = ":/" + QgsApplication::themeName() + "/grass/" + theName;
822+
QString myDefaultPath = ":/default/grass/" + theName;
823+
if (QFile::exists(myPath))
821824
{
822-
return QIcon(QgsApplication::activeThemePath() + theName);
825+
return QIcon(myPath);
823826
}
824827
else
825828
{
826829
//could still return an empty icon if it
827830
//doesnt exist in the default theme either!
828-
return QIcon(QgsApplication::defaultThemePath() + "/grass/" + theName);
831+
return QIcon(myDefaultPath);
829832
}
830833
}
831834

Loading

‎src/plugins/grass/world.png

-158 KB
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.