Skip to content

Commit

Permalink
changed the icons to a combination of Tango Desktop Project and Silk …
Browse files Browse the repository at this point in the history
…icons
  • Loading branch information
vslavik committed Aug 31, 2006
1 parent 8f4bdf0 commit 5d81c28
Show file tree
Hide file tree
Showing 53 changed files with 161 additions and 1,031 deletions.
3 changes: 2 additions & 1 deletion AUTHORS
Expand Up @@ -112,5 +112,6 @@ Translations:
Thai: Pun <dhanawat9@gmail.com>

Icons:
Dean S. Jones <dean@gallant.com>
Tango Desktop Project [http://tango.freedesktop.org]
Mark James, Silk icons [http://www.famfamfam.com/lab/icons/silk]
Lucas 'Basurero' Vieites <lucas@asixinformatica.com> (app icon)
2 changes: 1 addition & 1 deletion COPYING
@@ -1,4 +1,4 @@
Copyright (c) 1999-2005 Vaclav Slavik
Copyright (c) 1999-2006 Vaclav Slavik

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -10,6 +10,7 @@ Version 1.3.5
- fixed crash when loading some invalid PO files (#1495970)
- fixed the Find window to not be on top of other apps' windows
- install .desktop files and icons according to freedesktop.org standards
- changed the icons to a combination of Tango Desktop Project and Silk icons
- added more translations:
Macedonian (Jovan Kostovski)
Arabic (Mohammed al zaid)
Expand Down
7 changes: 6 additions & 1 deletion README
Expand Up @@ -40,7 +40,12 @@ way of building the library.

poEdit is released under the MIT license and you're free to do
whatever you want with it and its source code (well, almost :-).
See LICENSE file for details.

Icons are from the Tango Desktop Project [http://tango.freedesktop.org]
and Mark James's Silk icons set [http://www.famfamfam.com/lab/icons/silk].

See the COPYING file for details on program's licensing and the
src/icons/README file for details on the icons.

Win32 version contains GNU Gettext binaries as compiled by Franco Bez.
They are distributed under the GNU General Public License.
Expand Down
3 changes: 2 additions & 1 deletion install/poedit.iss
Expand Up @@ -43,7 +43,7 @@ Source: docs\chm\gettext.chm; DestDir: {app}\share\poedit\help\en\gettext\gettex
Source: docs\chm\poedit-hr.chm; DestDir: {app}\share\poedit\help\hr\poedit.chm; Components: i18n
Source: COPYING; DestDir: {app}\doc; DestName: copying.txt; Components: docs
Source: NEWS; DestDir: {app}\doc; DestName: news.txt; Components: docs
Source: BUILD-mingw\src\resources\resources.zip; DestDir: {app}\share\poedit; DestName: resources.zip; Components: core
Source: src\icons\*.png; DestDir: {app}\share\poedit\icons; Components: core
Source: extras\win32-gettext\iconv.dll; DestDir: {app}\bin; Components: core
Source: extras\win32-gettext\intl.dll; DestDir: {app}\bin; Components: core
Source: extras\win32-gettext\gettextsrc.dll; DestDir: {app}\bin; Components: core
Expand Down Expand Up @@ -89,6 +89,7 @@ Name: {app}\doc; Components: docs
Name: {app}\share; Components: core
Name: {app}\share\locale; Components: core
Name: {app}\share\poedit; Components: core
Name: {app}\share\poedit\icons; Components: core
Name: {app}\share\poedit\help; Components: docs
Name: {app}\share\poedit\help\en; Components: docs
Name: {app}\share\poedit\help\en\gettext; Components: docs
Expand Down
10 changes: 6 additions & 4 deletions src/edapp.cpp
@@ -1,7 +1,7 @@
/*
* This file is part of poEdit (http://www.poedit.org)
*
* Copyright (C) 1999-2005 Vaclav Slavik
* Copyright (C) 1999-2006 Vaclav Slavik
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -129,14 +129,16 @@ bool poEditApp::OnInit()
m_locale.AddCatalog(_T("poedit-wxstd")); // for semistatic builds

wxImage::AddHandler(new wxGIFHandler);
wxImage::AddHandler(new wxPNGHandler);
wxXmlResource::Get()->InitAllHandlers();
InitXmlResource();

SetDefaultCfg(wxConfig::Get());

wxArtProvider::PushProvider(new wxPoeditStdArtProvider);
#ifdef HAS_THEMES_SUPPORT
wxArtProvider::PushProvider(new wxPoeditThemeArtProvider);
#ifdef HAS_INSERT_PROVIDER
wxArtProvider::InsertProvider(new PoeditArtProvider);
#else
wxArtProvider::PushProvider(new PoeditArtProvider);
#endif

if (wxConfig::Get()->Read(_T("translator_name"), _T("nothing")) == _T("nothing"))
Expand Down
2 changes: 1 addition & 1 deletion src/edframe.cpp
Expand Up @@ -383,7 +383,7 @@ poEditFrame::poEditFrame() :
gs_shadedList = (bool)cfg->Read(_T("shaded_list"), (long)true);

#ifdef __UNIX__
SetIcon(wxArtProvider::GetIcon(_T("poedit-appicon")));
SetIcon(wxArtProvider::GetIcon(_T("poedit")));
#else
SetIcon(wxICON(appicon));
#endif
Expand Down
163 changes: 82 additions & 81 deletions src/icons.cpp
@@ -1,7 +1,7 @@
/*
* This file is part of poEdit (http://www.poedit.org)
*
* Copyright (C) 2004-2005 Vaclav Slavik
* Copyright (C) 2004-2006 Vaclav Slavik
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -30,96 +30,97 @@
#include <wx/log.h>

#include "icons.h"
#include "edapp.h"

#ifdef __UNIX__
#include "icons/appicon/poedit.xpm"
#endif

#include "icons/poedit-comment.xpm"
#include "icons/poedit-fileopen.xpm"
#include "icons/poedit-filesave.xpm"
#include "icons/poedit-fullscreen.xpm"
#include "icons/poedit-fuzzy.xpm"
#include "icons/poedit-help.xpm"
#include "icons/poedit-prj-delete.xpm"
#include "icons/poedit-prj-edit.xpm"
#include "icons/poedit-prj-new.xpm"
#include "icons/poedit-quotes.xpm"
#include "icons/poedit-update.xpm"

#include "icons/poedit-status-automatic.xpm"
#include "icons/poedit-status-cat-mid.xpm"
#include "icons/poedit-status-cat-no.xpm"
#include "icons/poedit-status-cat-ok.xpm"
#include "icons/poedit-status-comment-modif.xpm"
#include "icons/poedit-status-comment.xpm"
#include "icons/poedit-status-modified.xpm"
#include "icons/poedit-status-nothing.xpm"


wxBitmap wxPoeditStdArtProvider::CreateBitmap(const wxArtID& id,
const wxArtClient& client,
const wxSize& size)
#ifdef __WXGTK20__
// translates poedit item id or Tango stock item id to "legacy" GNOME id:
static wxString GetGnomeStockId(const wxString& id)
{
#define MAP(poedit, gnome) if ( id == _T(poedit) ) return _T(gnome)

MAP("document-open", "gtk-open");
MAP("document-save", "gtk-save");
MAP("view-fullscreen", "stock_fullscreen");
MAP("help-browser", "gtk-help");

MAP("document-new", "gtk-new");
MAP("document-properties", "stock_edit");
MAP("edit-delete", "gtk-delete");

#undef MAP

return wxEmptyString; // no match found
}
#endif // __WXGTK20__


// wxWidgets prior to 2.7.1 didn't have wxArtProvider::InsertProvider() and
// so it wasn't possibly to add a provider that would be used as the last
// resort. Unfortunately that's exactly what we need: use the stock (GTK2)
// provider to try to look up poedit icons in the theme (so that themes
// may override them) and only if that fails, use the Tango icons shipped
// with poedit. So we use a hack instead: temporarily disable this provider
// and re-run the lookup from its CreateBitmap, thus getting the bitmap from
// providers lower on the stack:
#if defined(HAS_THEMES_SUPPORT) && !defined(HAS_INSERT_PROVIDER)
#define USE_THEME_HACK
#endif

#ifdef USE_THEME_HACK
static bool gs_disablePoeditProvider = false;
#endif


wxBitmap PoeditArtProvider::CreateBitmap(const wxArtID& id,
const wxArtClient& client,
const wxSize& size)
{
#ifdef USE_THEME_HACK
if ( gs_disablePoeditProvider )
return wxNullBitmap;

// try to get the icon from theme provider:
gs_disablePoeditProvider = true;
wxBitmap hackbmp = wxArtProvider::GetBitmap(id, client, size);
gs_disablePoeditProvider = false;
if ( hackbmp.Ok() )
return hackbmp;
#endif // USE_THEME_HACK

wxLogTrace(_T("poedit.icons"), _T("getting icon '%s'"), id.c_str());

#ifdef __UNIX__
if (id == _T("poedit-appicon"))
if (id == _T("poedit"))
return wxBitmap(appicon_xpm);
#endif

#define ICON(name, data) if (id == _T(name)) return wxBitmap(data);

ICON("poedit-comment", poedit_comment_xpm)
ICON("poedit-fileopen", poedit_fileopen_xpm)
ICON("poedit-filesave", poedit_filesave_xpm)
ICON("poedit-fullscreen", poedit_fullscreen_xpm)
ICON("poedit-fuzzy", poedit_fuzzy_xpm)
ICON("poedit-help", poedit_help_xpm)
ICON("poedit-quotes", poedit_quotes_xpm)
ICON("poedit-update", poedit_update_xpm)
ICON("poedit-prj-delete", poedit_prj_delete_xpm)
ICON("poedit-prj-edit", poedit_prj_edit_xpm)
ICON("poedit-prj-new", poedit_prj_new_xpm)

ICON("poedit-status-automatic", poedit_status_automatic_xpm)
ICON("poedit-status-comment", poedit_status_comment_xpm)
ICON("poedit-status-comment-modif", poedit_status_comment_modif_xpm)
ICON("poedit-status-modified", poedit_status_modified_xpm)
ICON("poedit-status-nothing", poedit_status_nothing_xpm)
ICON("poedit-status-cat-mid", poedit_status_cat_mid_xpm)
ICON("poedit-status-cat-no", poedit_status_cat_no_xpm)
ICON("poedit-status-cat-ok", poedit_status_cat_ok_xpm)

#undef ICON

return wxNullBitmap;
}
#ifdef __WXGTK20__
// try legacy GNOME icons:
wxString gnomeId = GetGnomeStockId(id);
if ( !gnomeId.empty() )
{
wxLogTrace(_T("poedit.icons"), _T("-> legacy '%s'"), gnomeId.c_str());
wxBitmap gbmp(wxArtProvider::GetBitmap(gnomeId, client, size));
if ( gbmp.Ok() )
return gbmp;
}
#endif // __WXGTK20__

wxString iconsdir = wxGetApp().GetAppPath() + _T("/share/poedit/icons");
if ( !wxDirExists(iconsdir) )
return wxNullBitmap;

#ifdef HAS_THEMES_SUPPORT
wxBitmap wxPoeditThemeArtProvider::CreateBitmap(const wxArtID& id,
const wxArtClient& client,
const wxSize& size)
{
wxLogTrace(_T("poedit"), _T("icon '%s' cli '%s'"),
id.c_str(), client.c_str());
#define ICON(poedit, theme) \
if (id == _T(poedit)) \
return wxArtProvider::GetBitmap(theme, client, size);

ICON("poedit-appicon", _T("poedit"))
ICON("poedit-update", _T("stock_update-data"))
ICON("poedit-fullscreen", _T("stock_fullscreen"))
ICON("poedit-fileopen", wxART_FILE_OPEN)
ICON("poedit-filesave", _T("gtk-save"))
ICON("poedit-help", wxART_HELP)
ICON("poedit-comment", _T("stock_notes"))
ICON("poedit-fuzzy", _T("stock_unknown"))
ICON("poedit-quotes", _T("stock_nonprinting-chars"))
ICON("poedit-prj-new", _T("gtk-new"))
ICON("poedit-prj-edit", _T("stock_edit"))
ICON("poedit-prj-delete", _T("gtk-delete"))

#undef ICON
return wxNullBitmap;
wxString icon;
icon.Printf(_T("%s/%s.png"), iconsdir.c_str(), id.c_str());
if ( !wxFileExists(icon) )
return wxNullBitmap;

wxLogTrace(_T("poedit.icons"), _T("loading from %s"), icon.c_str());
wxBitmap bmp;
bmp.LoadFile(icon, wxBITMAP_TYPE_ANY);
return bmp;
}
#endif // HAS_THEMES_SUPPORT
18 changes: 6 additions & 12 deletions src/icons.h
@@ -1,7 +1,7 @@
/*
* This file is part of poEdit (http://www.poedit.org)
*
* Copyright (C) 2004-2005 Vaclav Slavik
* Copyright (C) 2004-2006 Vaclav Slavik
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -36,23 +36,17 @@
#define HAS_THEMES_SUPPORT
#endif

class wxPoeditStdArtProvider : public wxArtProvider
{
protected:
virtual wxBitmap CreateBitmap(const wxArtID& id,
const wxArtClient& client,
const wxSize& size);
};

// see icons.cpp for explanation
#if wxCHECK_VERSION(2,7,1)
#define HAS_INSERT_PROVIDER
#endif

#ifdef HAS_THEMES_SUPPORT
class wxPoeditThemeArtProvider : public wxArtProvider
class PoeditArtProvider : public wxArtProvider
{
protected:
virtual wxBitmap CreateBitmap(const wxArtID& id,
const wxArtClient& client,
const wxSize& size);
};
#endif

#endif // _ICONS_H_
24 changes: 24 additions & 0 deletions src/icons/Makefile.am
Expand Up @@ -5,9 +5,33 @@ icons32dir=$(iconsdir)/32x32/apps
icons48dir=$(iconsdir)/48x48/apps
iconsscalabledir=$(iconsdir)/scalable/apps
pixmapsdir=$(datadir)/pixmaps
poediticonsdir=$(datadir)/poedit/icons

icons16_DATA = appicon/16x16/poedit.png
icons32_DATA = appicon/32x32/poedit.png
icons48_DATA = appicon/48x48/poedit.png
pixmaps_DATA = appicon/48x48/poedit.png
iconsscalable_DATA = appicon/poedit.svg


poediticons_DATA = \
README \
document-open.png \
document-save.png \
help-browser.png \
poedit-comment.png \
poedit-fuzzy.png \
edit-delete.png \
document-properties.png \
document-new.png \
poedit-quotes.png \
poedit-status-automatic.png \
poedit-status-cat-mid.png \
poedit-status-cat-no.png \
poedit-status-cat-ok.png \
poedit-status-comment-modif.png \
poedit-status-comment.png \
poedit-status-modified.png \
poedit-status-nothing.png \
poedit-update.png \
view-fullscreen.png
15 changes: 15 additions & 0 deletions src/icons/README
@@ -0,0 +1,15 @@

This directory holds some poedit icons. Their authorship and licensing is as
follows:

The application icon was done by Lucas 'Basurero' Vieites
<lucas@asixinformatica.com> and is under the same license as poedit itself.

Toolbar icons are from the Tango Desktop Project [http://tango.freedesktop.org]
and are under the Creative Commons Attribution Share-Alike License
[http://creativecommons.org/licenses/by-sa/2.5/].

Status icons are from Mark James's Silk icons set
[http://www.famfamfam.com/lab/icons/silk] and are under the
Creative Commons Attribution 2.5 License
[http://creativecommons.org/licenses/by/2.5/].
Binary file added src/icons/document-new.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/document-open.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/document-properties.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/document-save.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/edit-delete.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/help-browser.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/icons/poedit-comment.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5d81c28

Please sign in to comment.