Skip to content

Commit

Permalink
Final fixes for ticket #1054. Grass plugin uses Qt4 resource bundle f…
Browse files Browse the repository at this point in the history
…or all icon resources.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8948 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jul 29, 2008
1 parent 004d47e commit 8ba7dca
Show file tree
Hide file tree
Showing 15 changed files with 108 additions and 26 deletions.
Binary file removed src/plugins/grass/add_raster.png
Binary file not shown.
Binary file removed src/plugins/grass/add_vector.png
Binary file not shown.
Binary file removed src/plugins/grass/clearInput.png
Binary file not shown.
Binary file removed src/plugins/grass/grass_close_mapset.png
Binary file not shown.
Binary file removed src/plugins/grass/grass_edit.png
Binary file not shown.
Binary file removed src/plugins/grass/grass_new_mapset.png
Binary file not shown.
Binary file removed src/plugins/grass/grass_new_vector_layer.png
Binary file not shown.
Binary file removed src/plugins/grass/grass_open_mapset.png
Binary file not shown.
Binary file removed src/plugins/grass/grass_region.png
Binary file not shown.
Binary file removed src/plugins/grass/grass_region_edit.png
Binary file not shown.
Binary file removed src/plugins/grass/grass_tools.png
Binary file not shown.
103 changes: 91 additions & 12 deletions src/plugins/grass/qgsgrass_plugin.qrc
@@ -1,16 +1,95 @@
<RCC>
<qresource prefix="/grass" >
<file>add_raster.png</file>
<file>grass_new_mapset.png</file>
<file>grass_region_edit.png</file>
<file>add_vector.png</file>
<file>grass_new_vector_layer.png</file>
<file>grass_tools.png</file>
<file>grass_close_mapset.png</file>
<file>grass_open_mapset.png</file>
<file>world.png</file>
<file>grass_edit.png</file>
<file>grass_region.png</file>
<qresource prefix="/default/grass" >
<file alias="grass_add_map.png">themes/default/grass_add_map.png</file>
<file alias="grass_add_raster.png">themes/default/grass_add_raster.png</file>
<file alias="grass_add_vector.png">themes/default/grass_add_vector.png</file>
<file alias="grass_add_vertex.png">themes/default/grass_add_vertex.png</file>
<file alias="grass_browser_raster_layer.png">themes/default/grass_browser_raster_layer.png</file>
<file alias="grass_browser_vector_layer.png">themes/default/grass_browser_vector_layer.png</file>
<file alias="grass_clear_input.png">themes/default/grass_clear_input.png</file>
<file alias="grass_close_edit.png">themes/default/grass_close_edit.png</file>
<file alias="grass_close_mapset.png">themes/default/grass_close_mapset.png</file>
<file alias="grass_copy_map.png">themes/default/grass_copy_map.png</file>
<file alias="grass_delete_line.png">themes/default/grass_delete_line.png</file>
<file alias="grass_delete_map.png">themes/default/grass_delete_map.png</file>
<file alias="grass_delete_vertex.png">themes/default/grass_delete_vertex.png</file>
<file alias="grass_edit_attributes.png">themes/default/grass_edit_attributes.png</file>
<file alias="grass_edit.png">themes/default/grass_edit.png</file>
<file alias="grass_module_error.png">themes/default/grass_module_error.png</file>
<file alias="grass_module_warning.png">themes/default/grass_module_warning.png</file>
<file alias="grass_move_line.png">themes/default/grass_move_line.png</file>
<file alias="grass_move_vertex.png">themes/default/grass_move_vertex.png</file>
<file alias="grass_new_boundary.png">themes/default/grass_new_boundary.png</file>
<file alias="grass_new_centroid.png">themes/default/grass_new_centroid.png</file>
<file alias="grass_new_line.png">themes/default/grass_new_line.png</file>
<file alias="grass_new_mapset.png">themes/default/grass_new_mapset.png</file>
<file alias="grass_new_point.png">themes/default/grass_new_point.png</file>
<file alias="grass_new_vector_layer.png">themes/default/grass_new_vector_layer.png</file>
<file alias="grass_open_mapset.png">themes/default/grass_open_mapset.png</file>
<file alias="grass_refresh.png">themes/default/grass_refresh.png</file>
<file alias="grass_region_edit.png">themes/default/grass_region_edit.png</file>
<file alias="grass_region.png">themes/default/grass_region.png</file>
<file alias="grass_rename_map.png">themes/default/grass_rename_map.png</file>
<file alias="grass_set_region.png">themes/default/grass_set_region.png</file>
<file alias="grass_shell.png">themes/default/grass_shell.png</file>
<file alias="grass_split_line.png">themes/default/grass_split_line.png</file>
<file alias="grass_tools.png">themes/default/grass_tools.png</file>
<file alias="mapcalc_add_connection.png">themes/default/mapcalc_add_connection.png</file>
<file alias="mapcalc_add_constant.png">themes/default/mapcalc_add_constant.png</file>
<file alias="mapcalc_add_function.png">themes/default/mapcalc_add_function.png</file>
<file alias="mapcalc_add_map.png">themes/default/mapcalc_add_map.png</file>
<file alias="mapcalc_delete.png">themes/default/mapcalc_delete.png</file>
<file alias="mapcalc_open.png">themes/default/mapcalc_open.png</file>
<file alias="mapcalc_save_as.png">themes/default/mapcalc_save_as.png</file>
<file alias="mapcalc_save.png">themes/default/mapcalc_save.png</file>
<file alias="mapcalc_select.png">themes/default/mapcalc_select.png</file>
<file alias="world.png">themes/default/world.png</file>
</qresource>
<qresource prefix="/classic/grass" >
<file alias="grass_add_map.png">themes/classic/grass_add_map.png</file>
<file alias="grass_add_raster.png">themes/classic/grass_add_raster.png</file>
<file alias="grass_add_vector.png">themes/classic/grass_add_vector.png</file>
<file alias="grass_add_vertex.png">themes/classic/grass_add_vertex.png</file>
<file alias="grass_browser_raster_layer.png">themes/classic/grass_browser_raster_layer.png</file>
<file alias="grass_browser_vector_layer.png">themes/classic/grass_browser_vector_layer.png</file>
<file alias="grass_clear_input.png">themes/classic/grass_clear_input.png</file>
<file alias="grass_close_edit.png">themes/classic/grass_close_edit.png</file>
<file alias="grass_close_mapset.png">themes/classic/grass_close_mapset.png</file>
<file alias="grass_copy_map.png">themes/classic/grass_copy_map.png</file>
<file alias="grass_delete_line.png">themes/classic/grass_delete_line.png</file>
<file alias="grass_delete_map.png">themes/classic/grass_delete_map.png</file>
<file alias="grass_delete_vertex.png">themes/classic/grass_delete_vertex.png</file>
<file alias="grass_edit_attributes.png">themes/classic/grass_edit_attributes.png</file>
<file alias="grass_edit.png">themes/classic/grass_edit.png</file>
<file alias="grass_module_error.png">themes/classic/grass_module_error.png</file>
<file alias="grass_module_warning.png">themes/classic/grass_module_warning.png</file>
<file alias="grass_move_line.png">themes/classic/grass_move_line.png</file>
<file alias="grass_move_vertex.png">themes/classic/grass_move_vertex.png</file>
<file alias="grass_new_boundary.png">themes/classic/grass_new_boundary.png</file>
<file alias="grass_new_centroid.png">themes/classic/grass_new_centroid.png</file>
<file alias="grass_new_line.png">themes/classic/grass_new_line.png</file>
<file alias="grass_new_mapset.png">themes/classic/grass_new_mapset.png</file>
<file alias="grass_new_point.png">themes/classic/grass_new_point.png</file>
<file alias="grass_new_vector_layer.png">themes/classic/grass_new_vector_layer.png</file>
<file alias="grass_open_mapset.png">themes/classic/grass_open_mapset.png</file>
<file alias="grass_refresh.png">themes/classic/grass_refresh.png</file>
<file alias="grass_region_edit.png">themes/classic/grass_region_edit.png</file>
<file alias="grass_region.png">themes/classic/grass_region.png</file>
<file alias="grass_rename_map.png">themes/classic/grass_rename_map.png</file>
<file alias="grass_set_region.png">themes/classic/grass_set_region.png</file>
<file alias="grass_shell.png">themes/classic/grass_shell.png</file>
<file alias="grass_split_line.png">themes/classic/grass_split_line.png</file>
<file alias="grass_tools.png">themes/classic/grass_tools.png</file>
<file alias="mapcalc_add_connection.png">themes/classic/mapcalc_add_connection.png</file>
<file alias="mapcalc_add_constant.png">themes/classic/mapcalc_add_constant.png</file>
<file alias="mapcalc_add_function.png">themes/classic/mapcalc_add_function.png</file>
<file alias="mapcalc_add_map.png">themes/classic/mapcalc_add_map.png</file>
<file alias="mapcalc_delete.png">themes/classic/mapcalc_delete.png</file>
<file alias="mapcalc_open.png">themes/classic/mapcalc_open.png</file>
<file alias="mapcalc_save_as.png">themes/classic/mapcalc_save_as.png</file>
<file alias="mapcalc_save.png">themes/classic/mapcalc_save.png</file>
<file alias="mapcalc_select.png">themes/classic/mapcalc_select.png</file>
<file alias="world.png">themes/classic/world.png</file>
</qresource>
</RCC>

31 changes: 17 additions & 14 deletions src/plugins/grass/qgsgrassplugin.cpp
Expand Up @@ -144,26 +144,26 @@ void QgsGrassPlugin::initGui()
mRegionBand->setZValue(20);

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

mAddVectorAction = new QAction(QIcon(":/grass/add_vector.png"),
mAddVectorAction = new QAction(getThemeIcon("grass_add_vector.png"),
tr("Add GRASS vector layer"), this);
mAddRasterAction = new QAction(QIcon(":/grass/add_raster.png"),
mAddRasterAction = new QAction(getThemeIcon("grass_add_raster.png"),
tr("Add GRASS raster layer"), this);
mOpenToolsAction = new QAction(QIcon(":/grass/grass_tools.png"),
mOpenToolsAction = new QAction(getThemeIcon("grass_tools.png"),
tr("Open GRASS tools"), this);

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

mEditRegionAction = new QAction(QIcon(":/grass/grass_region_edit.png"),
mEditRegionAction = new QAction(getThemeIcon("grass_region_edit.png"),
tr("Edit Current Grass Region"), this);
mEditAction = new QAction(QIcon(":/grass/grass_edit.png"),
mEditAction = new QAction(getThemeIcon("grass_edit.png"),
tr("Edit Grass Vector layer"), this);
mNewVectorAction = new QAction(QIcon(":/grass/grass_new_vector_layer.png"),tr("Create new Grass Vector"), this);
mNewVectorAction = new QAction(getThemeIcon("grass_new_vector_layer.png"),tr("Create new Grass Vector"), this);

mAddVectorAction->setWhatsThis(tr("Adds a GRASS vector layer to the map canvas"));
mAddRasterAction->setWhatsThis(tr("Adds a GRASS raster layer to the map canvas"));
Expand Down Expand Up @@ -814,18 +814,21 @@ void QgsGrassPlugin::unload()
}
// Note this code is duplicated from qgisapp.cpp because
// I didnt want to make plugins dependent on qgsapplication
// and because it needs grass specific path [TS]
// and because it needs grass specific path into
// the GRASS plugin resource bundle [TS]
QIcon QgsGrassPlugin::getThemeIcon(const QString theName)
{
if (QFile::exists(QgsApplication::activeThemePath() + "/grass/" + theName))
QString myPath = ":/" + QgsApplication::themeName() + "/grass/" + theName;
QString myDefaultPath = ":/default/grass/" + theName;
if (QFile::exists(myPath))
{
return QIcon(QgsApplication::activeThemePath() + theName);
return QIcon(myPath);
}
else
{
//could still return an empty icon if it
//doesnt exist in the default theme either!
return QIcon(QgsApplication::defaultThemePath() + "/grass/" + theName);
return QIcon(myDefaultPath);
}
}

Expand Down
Binary file modified src/plugins/grass/themes/default/grass_add_vector.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/plugins/grass/world.png
Binary file not shown.

0 comments on commit 8ba7dca

Please sign in to comment.