Skip to content

Commit

Permalink
adds compatibility code for Gtk 3.10
Browse files Browse the repository at this point in the history
adds better debian packaging
does not disable plugins when app crashes
removed header bar from preferences dialog
fixed a bug when external khayyam was being imported
dialog window is used instead of popovers in gtk 3.10
fixes a bug when toolbar was not showing the today button
  • Loading branch information
183amir committed Jan 21, 2015
1 parent e989f6a commit 288bbdb
Show file tree
Hide file tree
Showing 22 changed files with 125 additions and 160 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ docs/_build/
# package and install script
package_install.sh
gahshomar/khayyam
push-to-virtual.sh
33 changes: 17 additions & 16 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ dist_doc_DATA = \
NEWS


INTLTOOL_FILES = intltool-extract.in \
intltool-merge.in \
intltool-update.in

DEBIAN_FILES = \
debian/changelog \
debian/compat \
debian/control \
debian/copyright \
debian/rules \
debian/source/format


EXTRA_DIST = \
$(INTLTOOL_FILES) \
$(DEBIAN_FILES)
# INTLTOOL_FILES = intltool-extract.in
# intltool-merge.in
# intltool-update.in

# DEBIAN_FILES =
# debian/changelog
# debian/compat
# debian/control
# debian/copyright
# debian/rules
# debian/docs
# debian/source/format


# EXTRA_DIST =
# $(DEBIAN_FILES)
# $(INTLTOOL_FILES)

DISTCLEANFILES = intltool-extract \
intltool-merge \
Expand Down
9 changes: 4 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.

AC_INIT(gahshomar, 4.1.0)
AC_INIT(gahshomar, 4.2.6)

AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
Expand All @@ -19,13 +19,12 @@ dnl AC_CONFIG_MACRO_DIRS([m4])
dnl ***************************************************************************
dnl Internationalization
dnl ***************************************************************************
IT_PROG_INTLTOOL([0.35.0])
IT_PROG_INTLTOOL([0.35])

GETTEXT_PACKAGE=gahshomar
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
[The prefix for our gettext translation domains.])
dnl IT_PROG_INTLTOOL(0.26)

YELP_HELP_INIT

Expand Down Expand Up @@ -59,7 +58,7 @@ AM_CONDITIONAL(NATIVE_WIN32, test x"$native_win32" = "xyes")
LT_INIT([win32-dll])


PKG_CHECK_MODULES(GAHSHOMAR, [gtk+-3.0, glib-2.0, libpeas-1.0, libpeas-gtk-1.0])
PKG_CHECK_MODULES(GAHSHOMAR, [gtk+-3.0 >= 3.10.0, glib-2.0 >= 2.34, libpeas-1.0, libpeas-gtk-1.0])

dnl ***************************************************************************
dnl GLIB_GSETTINGS and GLIB_COMPILE_RESOURCES
Expand All @@ -72,7 +71,7 @@ GLIB_GSETTINGS
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
AC_SUBST(GLIB_COMPILE_RESOURCES)

AM_PATH_PYTHON([3])
AM_PATH_PYTHON([3.3])

dnl GTK_DOC_CHECK([1.0])

Expand Down
1 change: 0 additions & 1 deletion data/prefs.ui
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkNotebook" id="PreferencesNotebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
Expand Down
6 changes: 3 additions & 3 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
gahshomar (4.1.0-1) UNRELEASED; urgency=medium
gahshomar (4.2.6-1~trusty) trusty; urgency=low

* Initial release.
* Initial release

-- Amir Mohammadi <[email protected]> Tue, 13 Jan 2015 23:54:52 +0200
-- Amir Mohammadi <[email protected]> Mon, 19 Jan 2015 18:28:01 +0200
9 changes: 6 additions & 3 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
Source: gahshomar
Maintainer: Amir Mohammadi <[email protected]>
Section: misc
Priority: optional
Maintainer: Amir Mohammadi <[email protected]>
Build-Depends: debhelper (>= 9.0.0), autotools-dev, dh-python, intltool, itstool, libxml2-utils, libjalali-dev, libgtk-3-dev, libpeas-dev, libglib2.0-dev (>= 2.34), yelp, yelp-tools, libtool, libgirepository1.0-dev
Standards-Version: 3.9.5
Build-Depends: debhelper (>= 9)
Homepage: http://gahshomar.github.io/gahshomar
#Vcs-Git: git://git.debian.org/collab-maint/gahshomar.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/gahshomar.git;a=summary

Package: gahshomar
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: A Persian/Jalali/Farsi Calendar
Provides a calendar interface which can be used to easily convert the dates.
Provides a calendar interface which can be used to easily convert the dates.
23 changes: 22 additions & 1 deletion debian/copyright
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
GPL3
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: gahshomar
Source: <https://gahshomar.github.io/gahshomar>

Files: *
Copyright: 2015 Amir Mohammadi <[email protected]>
License: GPL-3+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
2 changes: 2 additions & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEWS
README
7 changes: 6 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
dh $@
dh $@ --with autotools-dev
2 changes: 1 addition & 1 deletion frontend/applet/gnome-shell/metadata.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Gahshomar's Gnome Shell Applet.",
"original-authors": "Amir Mohammadi",
"name": "Gahshomar",
"shell-version": ["3.12", "3.14"],
"shell-version": ["3.10", "3.12", "3.14"],
"localedir": "@LOCALEDIR@",
"url": "@url@",
"version": 1
Expand Down
Empty file removed intltool-extract.in
Empty file.
Empty file removed intltool-merge.in
Empty file.
Empty file removed intltool-update.in
Empty file.
2 changes: 1 addition & 1 deletion plugins/appindicator/appindicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from gi.repository import GObject, Peas, Gtk, Gio, GLib

from gahshomar import log
from gahshomar import khayyam
import gahshomar.khayyam as khayyam


class AppindicatorPlugin(GObject.Object, Peas.Activatable):
Expand Down
39 changes: 20 additions & 19 deletions plugins/main/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from os.path import abspath, join
import sys
from gettext import gettext as _
import gettext
gettext.install('gahshomar')

from gi.repository import GObject, Peas, Gtk, Gio, GLib, Gdk

Expand Down Expand Up @@ -114,28 +115,28 @@ def about_response(self, dialog, response):
@log
def load_plugins(self):
engine = Peas.Engine.get_default()
crashed = bool(self.settings.get_value('app-crashed'))
# crashed = bool(self.settings.get_value('app-crashed'))
names = str(self.settings.get_value('enabled-plugins')).replace("'", "")
names = names.split(';')
if '' in names:
names.remove('')
if crashed:
if names:
logging.warn(_('Disabling all the plugins since '
'the app crashed last time!'))
warnmsg = Gtk.MessageDialog(
text=_('Disabling all the plugins since the app crashed '
'last time!'),
message_type=Gtk.MessageType.WARNING,
buttons=Gtk.ButtonsType.CLOSE,
transient_for=self.object._window)
warnmsg.run()
warnmsg.destroy()
self.settings.set_value('enabled-plugins',
GLib.Variant('s', ''))
self.settings.set_value('app-crashed',
GLib.Variant.new_boolean(False))
return
# if crashed:
# if names:
# logging.warn(_('Disabling all the plugins since '
# 'the app crashed last time!'))
# warnmsg = Gtk.MessageDialog(
# text=_('Disabling all the plugins since the app crashed '
# 'last time!'),
# message_type=Gtk.MessageType.WARNING,
# buttons=Gtk.ButtonsType.CLOSE,
# transient_for=self.object._window)
# warnmsg.run()
# warnmsg.destroy()
# self.settings.set_value('enabled-plugins',
# GLib.Variant('s', ''))
# self.settings.set_value('app-crashed',
# GLib.Variant.new_boolean(False))
# return

self.settings.set_value('app-crashed',
GLib.Variant.new_boolean(True))
Expand Down
1 change: 0 additions & 1 deletion po/POTFILES.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# List of source files containing translatable strings.

src/c/main.c
src/python/gahshomar/indicator.py
src/python/gahshomar/settings_page.py
src/python/gahshomar/widgets.py
src/python/gahshomar/window.py
Expand Down
5 changes: 4 additions & 1 deletion src/c/gahshomar.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ gah_shomar_startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *app_menu;
#if (GTK_MINOR_VERSION > 10)
const gchar *quit_accels[2] = { "<Ctrl>Q", NULL };
const gchar *today_accels[2] = { "<Ctrl>T", NULL };
#endif
PeasExtensionSet *exten_set;

G_APPLICATION_CLASS (gah_shomar_parent_class)->startup (app);
Expand All @@ -169,14 +171,15 @@ gah_shomar_startup (GApplication *app)
g_action_map_add_action_entries (G_ACTION_MAP (app),
app_entries, G_N_ELEMENTS (app_entries),
app);
#if (GTK_MINOR_VERSION > 10)
gtk_application_set_accels_for_action (GTK_APPLICATION (app),
"app.quit",
quit_accels);

gtk_application_set_accels_for_action (GTK_APPLICATION (app),
"win.today",
today_accels);

#endif
builder = gtk_builder_new_from_resource ("/org/gahshomar/Gahshomar/app-menu.ui");
app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
gtk_application_set_app_menu (GTK_APPLICATION (app), app_menu);
Expand Down
1 change: 0 additions & 1 deletion src/python/gahshomar/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ appdir = $(pythondir)/gahshomar/

app_PYTHON = \
calendar.py \
indicator.py \
__init__.py \
settings_page.py \
widgets.py \
Expand Down
91 changes: 0 additions & 91 deletions src/python/gahshomar/indicator.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/python/gahshomar/settings_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class SettingsWindow(Gtk.Dialog):
"""docstring for SettingsWindow"""
@log
def __init__(self, app):
super().__init__(title=_('Gahshomar Preferences'), use_header_bar=True)
super().__init__(title=_('Gahshomar Preferences'))
self.app = app
self.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
self.resize(600, 480)
Expand Down
Loading

0 comments on commit 288bbdb

Please sign in to comment.