[QGIS Commit] r8948 - in trunk/qgis/src/plugins/grass: . themes/default

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Jul 29 13:36:49 EDT 2008


Author: timlinux
Date: 2008-07-29 13:36:48 -0400 (Tue, 29 Jul 2008)
New Revision: 8948

Removed:
   trunk/qgis/src/plugins/grass/add_raster.png
   trunk/qgis/src/plugins/grass/add_vector.png
   trunk/qgis/src/plugins/grass/clearInput.png
   trunk/qgis/src/plugins/grass/grass_close_mapset.png
   trunk/qgis/src/plugins/grass/grass_edit.png
   trunk/qgis/src/plugins/grass/grass_new_mapset.png
   trunk/qgis/src/plugins/grass/grass_new_vector_layer.png
   trunk/qgis/src/plugins/grass/grass_open_mapset.png
   trunk/qgis/src/plugins/grass/grass_region.png
   trunk/qgis/src/plugins/grass/grass_region_edit.png
   trunk/qgis/src/plugins/grass/grass_tools.png
   trunk/qgis/src/plugins/grass/world.png
Modified:
   trunk/qgis/src/plugins/grass/qgsgrass_plugin.qrc
   trunk/qgis/src/plugins/grass/qgsgrassplugin.cpp
   trunk/qgis/src/plugins/grass/themes/default/grass_add_vector.png
Log:
Final fixes for ticket #1054. Grass plugin uses Qt4 resource bundle for all icon resources.

Deleted: trunk/qgis/src/plugins/grass/add_raster.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/add_vector.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/clearInput.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/grass_close_mapset.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/grass_edit.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/grass_new_mapset.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/grass_new_vector_layer.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/grass_open_mapset.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/grass_region.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/grass_region_edit.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/grass_tools.png
===================================================================
(Binary files differ)

Modified: trunk/qgis/src/plugins/grass/qgsgrass_plugin.qrc
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrass_plugin.qrc	2008-07-29 16:17:47 UTC (rev 8947)
+++ trunk/qgis/src/plugins/grass/qgsgrass_plugin.qrc	2008-07-29 17:36:48 UTC (rev 8948)
@@ -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>
 

Modified: trunk/qgis/src/plugins/grass/qgsgrassplugin.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassplugin.cpp	2008-07-29 16:17:47 UTC (rev 8947)
+++ trunk/qgis/src/plugins/grass/qgsgrassplugin.cpp	2008-07-29 17:36:48 UTC (rev 8948)
@@ -144,26 +144,26 @@
   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"));
@@ -814,18 +814,21 @@
 }
 // 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);
   }
 }
 

Modified: trunk/qgis/src/plugins/grass/themes/default/grass_add_vector.png
===================================================================
(Binary files differ)

Deleted: trunk/qgis/src/plugins/grass/world.png
===================================================================
(Binary files differ)



More information about the QGIS-commit mailing list