Skip to content

Commit

Permalink
prefs.js (adapted from canek-pelaez version) Neroth#21 Neroth#59 Nero…
Browse files Browse the repository at this point in the history
…th#69, many update
  • Loading branch information
Neroth committed Jan 10, 2013
1 parent 8f34b87 commit d46b13d
Show file tree
Hide file tree
Showing 16 changed files with 581 additions and 370 deletions.
8 changes: 8 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Elad Alfassa <[email protected]>,
Mark Benjamin <[email protected]>,
Simon Claessens <[email protected]>,
Ecyrbe <[email protected]>,
Timur Kristóf <[email protected]>,
Simon Legner <[email protected]>,
Mattia Meneguzzo <[email protected]>,
Christian Metzler <[email protected]>
39 changes: 38 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}

SUBDIRS = src po
SUBDIRS = src data po

zip-file: all
if LOCAL_INSTALL
-rm -fR $(builddir)/_build
$(MKDIR_P) $(builddir)/_build; \
$(MAKE) install DESTDIR="$(abs_builddir)/_build"; \
$(GLIB_COMPILE_SCHEMAS) "$(abs_builddir)/_build/$(prefix)/share/gnome-shell/extensions/[email protected]/schemas"; \
(cd "$(abs_builddir)/_build/$(prefix)/share/gnome-shell/extensions/[email protected]" ; \
zip -qr "$(abs_builddir)/gnome-shell-extension-weather.zip" .; \
); \
rm -fR $(builddir)/_build ; \
echo "===================================================================" ; \
echo "zip-file ready for distribution:" ; \
echo "gnome-shell-extension-weather.zip" ; \
echo "==================================================================="
else
@echo "*"
@echo "* You need to configure the package --with-local-install=yes to create a zip-file."
@echo "*"
endif

clean-local:
rm -f "$(abs_builddir)/gnome-shell-extension-weather.zip"

dist-hook: dist-changelog

.PHONY: dist-changelog

dist-changelog:
$(AM_V_at)if git --git-dir=$(top_srcdir)/.git --work-tree=$(top_srcdir) \
log --no-merges --pretty='tformat:%cd %an <%ae>%n%n%s%n%n%b' --date=short 2b58327bf183c94c788a13d746373efc22a3f3c1.. | \
$(SED) -e '/^[12]...-[01].-[0123]. [^<>]* <[^<>]*>$$/,/^$$/ b' \
-e '/[^ ]/,/^[ ]*$$/ !d' \
-e 's/^[ ]*/ /' \
-e 's/^[ ]*$$//' >.ChangeLog.tmp; \
then mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \
else rm -f .ChangeLog.tmp; exit 1; fi
Empty file added NEWS
Empty file.
File renamed without changes.
2 changes: 2 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ test -z "$srcdir" && srcdir=.

PKG_NAME="gnome-shell-extension-weather"

touch ChangeLog

test -f $srcdir/configure.ac || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level gnome-shell-extensions directory"
Expand Down
45 changes: 39 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
AC_PREREQ(2.63)
dnl be carefull, the version needs to be in sync with your gnome shell version
AC_INIT([gnome-shell-extension-weather],[1.0],[https://github.com/Neroth/gnome-shell-extension-weather/issues])
AC_INIT([gnome-shell-extension-weather],[1.1],[https://github.com/Neroth/gnome-shell-extension-weather/issues])

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([config])

AM_INIT_AUTOMAKE([1.10 dist-bzip2 no-dist-gzip foreign tar-ustar])
AM_INIT_AUTOMAKE([1.10 dist-xz])

m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

AC_PROG_SED

GETTEXT_PACKAGE=gnome-shell-extension-weather
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
[The prefix for our gettext translation domains.])
IT_PROG_INTLTOOL(0.26)

PKG_PROG_PKG_CONFIG([0.22])

GLIB_GSETTINGS

AC_ARG_WITH(desktop-dir, [ --with-desktop-dir=PATH where to install desktop files (default=PREFIX/share)])

Expand All @@ -25,16 +32,42 @@ fi
AM_CONDITIONAL(DESKTOP_DATADIR, test "x$with_desktop_dir" != xno)
AC_SUBST(DESKTOP_DATADIR)

IT_PROG_INTLTOOL(0.26)
AC_ARG_WITH([local-install],
[AS_HELP_STRING([--with-local-install],
[install schemas and translations in a subdir of the extension (default is no)])],
[use_local_install=$withval],
[use_local_install=no])

PKG_PROG_PKG_CONFIG([0.22])
AC_SUBST(use_local_install)
AM_CONDITIONAL(LOCAL_INSTALL, test "x${use_local_install}" == "xyes")

GLIB_GSETTINGS
extensiontopdir=${datadir}/gnome-shell/extensions/[email protected]

dnl This is beyond ugly. Suggestions accepted.
if test "x${use_local_install}" == "xyes"; then
AC_SUBST(gsettingsschemadir, [${extensiontopdir}/schemas])
AC_SUBST(LOCALEDIR, [${extensiontopdir}/locale])
else
AC_SUBST(LOCALEDIR, [${datadir}/locale])
fi

dnl Please keep this sorted alphabetically
dnl Please keep this sorted alphabetically.
AC_CONFIG_FILES([
Makefile
data/Makefile
po/Makefile.in
src/Makefile
])
AC_OUTPUT

dnl 'Fugly hack' doesn't get close to describe this. I don't know how else
dnl to change the directory for translations.
if test "x${use_local_install}" == "xyes"; then
${SED} -i -e "s%itlocaledir = .*%itlocaledir = ${extensiontopdir}/locale%g" po/Makefile
fi

if test "x$use_local_install" == "xyes"; then
echo
echo "The schemas and translations will be installed in subdirectories of the extension."
echo
fi
42 changes: 42 additions & 0 deletions data/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
extensionurl = https://github.com/Neroth/gnome-shell-extension-weather

# Change these to modify how installation is performed
topextensiondir = $(datadir)/gnome-shell/extensions

uuid = [email protected]

extensiondir = $(topextensiondir)/$(uuid)

if DESKTOP_DATADIR

applicationsdir = $(DESKTOP_DATADIR)/applications
applications_DATA = weather-settings.desktop

endif

dist_extension_DATA = stylesheet.css weather-settings.ui

nodist_extension_DATA = metadata.json $(EXTRA_EXTENSION)

EXTRA_DIST = metadata.json.in weather-settings.desktop.in

metadata.json: metadata.json.in $(top_builddir)/config.status
$(AM_V_GEN) sed -e "s|[@]LOCALEDIR@|$(datadir)/locale|" \
-e "s|[@]uuid@|$(uuid)|" \
-e "s|[@]url@|$(extensionurl)|" $< > $@

weather-settings.desktop: weather-settings.desktop.in $(top_builddir)/config.status
$(AM_V_GEN) sed -e "s|[@]EXTENSIONDIR@|$(extensiondir)|" $< > $@

CLEANFILES = metadata.json weather-settings.desktop

gschemas_in = org.gnome.shell.extensions.weather.gschema.xml.in

@INTLTOOL_XML_NOMERGE_RULE@

gsettings_SCHEMAS = $(gschemas_in:.xml.in=.xml)

@GSETTINGS_RULES@

EXTRA_DIST += $(gschemas_in)
CLEANFILES += $(gschemas_in:.xml.in=.valid) $(gsettings_SCHEMAS)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Version=1.0
Type=Application
Name=Weather Settings
Comment=Weather preferences panel
Exec=@EXTENSIONDIR@/weather-settings
Exec=gnome-shell-extension-prefs
Icon=preferences-system
Terminal=false
Categories=Settings;System;DesktopSettings;
Expand Down
46 changes: 25 additions & 21 deletions src/weather-settings.ui → data/weather-settings.ui
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="main-window">
<property name="can_focus">False</property>
<property name="resizable">False</property>
<child>
<object class="GtkListStore" id="liststore">
<columns>
<!-- column-name text -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0"></col>
</row>
</data>
</object>
<object class="GtkBox" id="main-widget">
<property name="border-width">14</property>
<child>
Expand All @@ -30,8 +37,9 @@
<property name="level_indentation">12</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection">
<signal name="changed" handler="selection_changed"/>
</object>
</object>
<object class="GtkTreeViewColumn" id="tree-treeviewcolumn">
</object>
</child>
</object>
</child>
Expand All @@ -55,7 +63,6 @@
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="icon_name">list-add-symbolic</property>
<signal name="clicked" handler="add_button_clicked"/>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -68,7 +75,6 @@
<property name="can_focus">False</property>
<property name="use_action_appearance">False</property>
<property name="icon_name">list-remove-symbolic</property>
<signal name="clicked" handler="remove_button_clicked"/>
</object>
<packing>
<property name="expand">False</property>
Expand All @@ -90,24 +96,22 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkTable" id="right-widget-table">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">6</property>
<property name="n_columns">2</property>
<property name="column_spacing">36</property>
<property name="row_spacing">20</property>
<property name="margin_left">36</property>
</object>
</child>
<child>
<object class="GtkTable" id="right-widget-table">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="n_rows">6</property>
<property name="n_columns">2</property>
<property name="column_spacing">36</property>
<property name="row_spacing">20</property>
<property name="margin_left">36</property>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
2 changes: 1 addition & 1 deletion po/POTFILES.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
../src/extension.js
../src/weather-settings.js.in
../src/prefs.js
41 changes: 2 additions & 39 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,47 +1,10 @@
url = https://github.com/Neroth/gnome-shell-extension-weather

# Change these to modify how installation is performed
topextensiondir = $(datadir)/gnome-shell/extensions

uuid = [email protected]

extensiondir = $(topextensiondir)/$(uuid)

if DESKTOP_DATADIR

applicationsdir = $(DESKTOP_DATADIR)/applications
applications_DATA = weather-settings.desktop

endif

dist_extension_DATA = extension.js stylesheet.css weather-settings.ui

nodist_extension_DATA = metadata.json $(EXTRA_EXTENSION)

nodist_extension_SCRIPTS = weather-settings

EXTRA_DIST = metadata.json.in weather-settings.js.in weather-settings.desktop.in

metadata.json: metadata.json.in $(top_builddir)/config.status
$(AM_V_GEN) sed -e "s|[@]LOCALEDIR@|$(datadir)/locale|" \
-e "s|[@]uuid@|$(uuid)|" \
-e "s|[@]url@|$(url)|" $< > $@

weather-settings: weather-settings.js.in $(top_builddir)/config.status
$(AM_V_GEN) sed -e "s|[@]EXTENSIONDIR@|$(extensiondir)|" $< > $@

weather-settings.desktop: weather-settings.desktop.in $(top_builddir)/config.status
$(AM_V_GEN) sed -e "s|[@]EXTENSIONDIR@|$(extensiondir)|" $< > $@

CLEANFILES = metadata.json weather-settings weather-settings.desktop

gschemas_in = org.gnome.shell.extensions.weather.gschema.xml.in

@INTLTOOL_XML_NOMERGE_RULE@

gsettings_SCHEMAS = $(gschemas_in:.xml.in=.xml)

@GSETTINGS_RULES@
dist_extension_DATA = extension.js convenience.js prefs.js

CLEANFILES += $(gschemas_in:.xml.in=.valid) $(gsettings_SCHEMAS)
EXTRA_DIST += $(gschemas_in)
nodist_extension_DATA = $(EXTRA_EXTENSION)
Loading

0 comments on commit d46b13d

Please sign in to comment.