Skip to content

Commit

Permalink
icon: merge icon dirs #118, start to remove stock icon deprecations #145
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed May 31, 2017
1 parent ee18f52 commit 30e7803
Show file tree
Hide file tree
Showing 37 changed files with 56 additions and 84 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions data/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def build(bld):
bld.install_files (bld.env.path_examples, bld.path.ant_glob('examples/*.oregano'))
bld.install_files (bld.env.path_partslib, bld.path.ant_glob('libraries/*.oreglib'))
bld.install_files (bld.env.path_ui, bld.path.ant_glob('xml/*.ui'))
bld.install_files (bld.env.path_icons, bld.path.ant_glob('icons/*.png'))
bld.install_files (bld.env.path_icons, bld.path.ant_glob('icons/*.svg'))
bld.install_files (bld.env.path_icons, bld.path.ant_glob('icons/*.jpg'))

try:
bld.exec_command(['update-desktop-database', utils.subst_vars('${DATADIR}/applications', bld.env)])
Expand Down
10 changes: 5 additions & 5 deletions src/dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
#include "dialogs.h"
#include "oregano.h"

#include "pixmaps/logo.xpm"

void oregano_error (gchar *msg) { oregano_error_with_title (msg, NULL); }

void oregano_error_with_title (gchar *title, gchar *desc)
Expand Down Expand Up @@ -117,7 +115,8 @@ void dialog_about (void)

const char *docs[] = {"Ricardo Markiewicz <[email protected]> (es)",
"Jordi Mallach <[email protected]> (ca)",
"Marc Lorber <[email protected]> (en)", NULL};
"Marc Lorber <[email protected]> (en)",
"Bernhard Schuster <[email protected]> (de,en,sv)", NULL};

const gchar *copy = _ ("(c) 2012-2013 Bernhard Schuster\n"
"(c) 2009-2012 Marc Lorber\n"
Expand All @@ -130,7 +129,6 @@ void dialog_about (void)
return;
}

logo = gdk_pixbuf_new_from_xpm_data ((const char **)logo_xpm);
about = gtk_about_dialog_new ();
gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (about), "Oregano");
gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (about), VERSION);
Expand All @@ -141,8 +139,10 @@ void dialog_about (void)
gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (about), "https://ahoi.io/project/oregano");
gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (about), authors);
gtk_about_dialog_set_documenters (GTK_ABOUT_DIALOG (about), docs);
gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (about), logo);
gtk_about_dialog_set_logo (GTK_ABOUT_DIALOG (about), oregano_get_icon("oregano-logo"));

gtk_dialog_run (GTK_DIALOG (about));

gtk_widget_destroy (about);
about = NULL;
}
42 changes: 42 additions & 0 deletions src/icons.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#ifndef OREGANO_ICONS_H
#define OREGANO_ICONS_H

#include <gtk/gtk.h>


void oregano_icon_theme_changed(GtkIconTheme *iconteme, gpointer user_data)
{

}

void oregano_icon_init()
{
GtkIconTheme* icon_theme = gtk_icon_theme_get_default();
g_assert (icon_theme != NULL);
gtk_icon_theme_append_search_path (icon_theme, OREGANO_ICONDIR);
g_signal_connect (icon_theme, "changed", G_CALLBACK(oregano_icon_theme_changed), NULL);
}


GdkPixbuf * oregano_get_icon(const gchar *icon_name)
{
GtkIconTheme* icon_theme = gtk_icon_theme_get_default();
g_assert (icon_theme != NULL);
GError *e = NULL;

GtkIconInfo *icon_info = gtk_icon_theme_lookup_icon (icon_theme,
icon_name,
64,
0);
g_assert (icon_info);

GdkPixbuf* pixbuf = gtk_icon_info_load_icon (icon_info, &e);
if (e) {
g_message("Failed to get %s %s %i", icon_name, e->message, e->code);
g_clear_error(&e);
return NULL;
}
return pixbuf;
}

#endif
7 changes: 4 additions & 3 deletions src/oregano.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
#include "load-schematic.h"
#include "load-common.h"
#include "oregano-config.h"
#include "stock.h"
#include "oregano.h"
#include "splash.h"
#include "icons.h"

#include <libintl.h>

Expand Down Expand Up @@ -87,14 +87,15 @@ static void oregano_class_init (OreganoClass *klass)
static void oregano_init (Oregano *object)
{
cursors_init ();
stock_init ();

oregano_icon_init();

oregano_config_load ();
}

Oregano *oregano_new (void)
{
return g_object_new (oregano_get_type (), "application-id", "org.gnome.oregano", "flags",
return g_object_new (oregano_get_type (), "application-id", "io.ahoi.oregano", "flags",
G_APPLICATION_HANDLES_OPEN, NULL);
}

Expand Down
2 changes: 0 additions & 2 deletions src/pixmaps/README

This file was deleted.

72 changes: 0 additions & 72 deletions src/pixmaps/plot.xpm

This file was deleted.

4 changes: 2 additions & 2 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ def configure(conf):

#things the applications needs to know about, for easier re-use in subdir wscript(s)
conf.env.path_ui = utils.subst_vars('${DATADIR}/oregano/ui/', conf.env)
conf.env.path_examples = utils.subst_vars('${DATADIR}/oregano/icons/', conf.env)
conf.env.path_model = utils.subst_vars('${DATADIR}/oregano/models/', conf.env)
conf.env.path_partslib = utils.subst_vars('${DATADIR}/oregano/library/', conf.env)
conf.env.path_lang = utils.subst_vars('${DATADIR}/oregano/language-specs/', conf.env)
conf.env.path_examples = utils.subst_vars('${DATADIR}/oregano/examples/', conf.env)
# conf.env.path_icons = '${DATADIR}/oregano/icons/'
# conf.env.path_mime = '${DATADIR}/oregano/mime/'
# conf.env.path_locale = '${DATADIR}/oregano/locale/'
# conf.env.path_schemas = utils.subst_vars('${DATADIR}/glib-2.0/schemas/', conf.env)


#define the above paths so the application does know about files locations
conf.define('OREGANO_UIDIR', conf.env.path_ui)
conf.define('OREGANO_ICONDIR', conf.env.path_icons)
conf.define('OREGANO_MODELDIR', conf.env.path_model)
conf.define('OREGANO_LIBRARYDIR', conf.env.path_partslib)
conf.define('OREGANO_LANGDIR', conf.env.path_lang)
conf.define('OREGANO_EXAMPLEDIR', conf.env.path_examples)
# conf.define('OREGANO_ICONDIR', conf.env.path_icons)
# conf.define('OREGANO_MIMEDIR', conf.env.path_mime)
# conf.define('OREGANO_LOCALEDIR', conf.env.path_locale)
# conf.define('OREGANO_SCHEMASDIR', conf.env.path_schemas)
Expand Down

0 comments on commit 30e7803

Please sign in to comment.