[Xfce4-commits] <orage:master> 4.7.6.0: part 1 of Xfce 4.8 compatibility changes. Work in progress! do not use.
Juha Kautto
noreply at xfce.org
Fri Nov 5 15:12:01 CET 2010
Updating branch refs/heads/master
to 730ddce330ecebe59747a849195339f41701d738 (commit)
from 77a14623d6b25c4ab8b19068be92dc6d8bd95a7a (commit)
commit 730ddce330ecebe59747a849195339f41701d738
Author: Juha Kautto <juha at xfce.org>
Date: Fri Nov 5 16:07:12 2010 +0200
4.7.6.0: part 1 of Xfce 4.8 compatibility changes. Work in progress! do not use.
Making Orage compatible with Xfce 4.8 and keeping it compatible with Xfce 4.6.
Do not use this version!
It is work in progress save only as I have to change computer...
INSTALL | 97 ++++++++++++++++++++++-----
configure.in.in | 2 +-
globaltime/Makefile.am | 4 +-
globaltime/globaltime.c | 10 ++-
globaltime/gt_parfile.c | 94 ++++++++++++--------------
globaltime/gt_prefs.c | 2 +-
globaltime/timezone_selection.c | 4 +-
src/about-xfcalendar.c | 35 +++++++++-
src/appointment.c | 16 ++---
src/event-list.c | 2 +-
src/functions.c | 140 +++++++++++++++++++++++++++------------
src/functions.h | 10 ++-
src/interface.c | 7 ++-
src/main.c | 16 ++++-
src/parameters.c | 19 +++--
src/parameters.h | 3 -
src/reminder.c | 2 +-
src/timezone_selection.c | 1 -
18 files changed, 314 insertions(+), 150 deletions(-)
diff --git a/INSTALL b/INSTALL
index 2550dab..7d1c323 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,8 +4,10 @@ Installation Instructions
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007, 2008, 2009 Free Software Foundation, Inc.
- This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
Basic Installation
==================
@@ -13,7 +15,11 @@ Basic Installation
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+instructions specific to this package. Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
@@ -42,7 +48,7 @@ may remove or edit it.
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
-The simplest way to compile this package is:
+ The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
@@ -53,12 +59,22 @@ The simplest way to compile this package is:
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
- the package.
+ the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the `make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior `make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
@@ -67,8 +83,15 @@ The simplest way to compile this package is:
all sorts of other programs in order to regenerate files that came
with the distribution.
- 6. Often, you can also type `make uninstall' to remove the installed
- files again.
+ 7. Often, you can also type `make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide `make
+ distcheck', which can by used by developers to test that all other
+ targets like `make install' and `make uninstall' work correctly.
+ This target is generally not run by end users.
Compilers and Options
=====================
@@ -93,7 +116,8 @@ same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
+source code in the directory that `configure' is in and in `..'. This
+is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
@@ -120,7 +144,8 @@ Installation Names
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
@@ -131,15 +156,46 @@ Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
+you can set and what kinds of files go in them. In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'. Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated. The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the `DESTDIR' variable. For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names. The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-Optional Features
-=================
-
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
@@ -152,6 +208,13 @@ find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
+ Some packages offer the ability to configure how verbose the
+execution of `make' will be. For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
Particular systems
==================
@@ -288,7 +351,7 @@ operates.
`configure' can determine that directory automatically.
`--prefix=DIR'
- Use DIR as the installation prefix. *Note Installation Names::
+ Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
diff --git a/configure.in.in b/configure.in.in
index 0f7980b..de5870d 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <juha at xfce.org>
dnl
dnl Version information
-m4_define([orage_version], [4.7.5.23-git])
+m4_define([orage_version], [4.7.6.0-git])
m4_define([gtk_minimum_version], [2.10.0])
m4_define([xfce_minimum_version], [4.6.0])
diff --git a/globaltime/Makefile.am b/globaltime/Makefile.am
index c9467f3..c5e144c 100644
--- a/globaltime/Makefile.am
+++ b/globaltime/Makefile.am
@@ -8,7 +8,9 @@ globaltime_SOURCES = \
timezone_selection.c \
timezone_selection.h \
tz_zoneinfo_read.c \
- tz_zoneinfo_read.h
+ tz_zoneinfo_read.h \
+ ../src/functions.c \
+ ../src/functions.h
man_MANS = \
globaltime.1
diff --git a/globaltime/globaltime.c b/globaltime/globaltime.c
index e731185..8218d19 100644
--- a/globaltime/globaltime.c
+++ b/globaltime/globaltime.c
@@ -45,8 +45,8 @@
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
-#include <libxfce4util/libxfce4util.h>
#include "globaltime.h"
+#include "../src/orage-i18n.h"
#define NAME_VERSION "Global Time (2.1)"
@@ -614,7 +614,13 @@ static void create_global_time(void)
int main(int argc, char *argv[])
{
- xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+ /* init i18n = nls to use gettext */
+ bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+#endif
+ textdomain(GETTEXT_PACKAGE);
+
gtk_init(&argc, &argv);
create_global_time();
gtk_main();
diff --git a/globaltime/gt_parfile.c b/globaltime/gt_parfile.c
index 203e615..7e20de1 100644
--- a/globaltime/gt_parfile.c
+++ b/globaltime/gt_parfile.c
@@ -26,34 +26,35 @@
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
-#include <libxfce4util/libxfce4util.h>
#include "globaltime.h"
+#include "../src/functions.h"
-#define CONFIG_DATA_DIR_NAME "globaltime" G_DIR_SEPARATOR_S
-#define CONFIG_DATA_FILE_NAME "globaltimerc"
+#define CONFIG_DIR_NAME "globaltime" G_DIR_SEPARATOR_S
+#define CONFIG_FILE_NAME "globaltimerc"
+#define CONFIG_DIR_FILE_NAME CONFIG_DIR_NAME CONFIG_FILE_NAME
#define WIN_HEADING_SIZE 30
extern global_times_struct clocks;
-static void write_string(XfceRc *rc, gchar *prop, GString *string)
+static void write_string(OrageRc *rc, gchar *prop, GString *string)
{
if (string && string->len)
- xfce_rc_write_entry(rc, prop, string->str);
+ orage_rc_put_str(rc, prop, string->str);
}
-static void write_color(XfceRc *rc, gchar *prop, GdkColor *color)
+static void write_color(OrageRc *rc, gchar *prop, GdkColor *color)
{
gchar tmp[100];
if (color) {
sprintf(tmp, "%uR %uG %uB", color->red, color->green, color->blue);
- xfce_rc_write_entry(rc, prop, tmp);
+ orage_rc_put_str(rc, prop, tmp);
}
}
-static void write_attr(XfceRc *rc, text_attr_struct *attr)
+static void write_attr(OrageRc *rc, text_attr_struct *attr)
{
if (attr->clock_fg_modified)
write_color(rc, "fg", attr->clock_fg);
@@ -71,9 +72,9 @@ static void write_attr(XfceRc *rc, text_attr_struct *attr)
write_string(rc, "time_underline", attr->time_underline);
}
-static void write_clock(clock_struct *clockp, XfceRc *rc)
+static void write_clock(clock_struct *clockp, OrageRc *rc)
{
- xfce_rc_set_group(rc, clockp->name->str);
+ orage_rc_set_group(rc, clockp->name->str);
write_string(rc, "name", clockp->name);
write_string(rc, "tz", clockp->tz);
write_attr(rc, &clockp->clock_attr);
@@ -82,48 +83,47 @@ static void write_clock(clock_struct *clockp, XfceRc *rc)
void write_file(void)
{
gchar *fpath;
- XfceRc *rc;
+ OrageRc *rc;
- fpath = xfce_resource_save_location(XFCE_RESOURCE_CONFIG
- , CONFIG_DATA_DIR_NAME CONFIG_DATA_FILE_NAME, TRUE);
+ fpath = orage_config_file_location(CONFIG_DIR_FILE_NAME);
unlink(fpath);
- if ((rc = xfce_rc_simple_open(fpath, FALSE)) == NULL) {
+ if ((rc = orage_rc_file_open(fpath, FALSE)) == NULL) {
g_warning("Unable to open RC file.");
return;
}
g_free(fpath);
gtk_window_get_position(GTK_WINDOW(clocks.window), &clocks.x, &clocks.y);
- xfce_rc_set_group(rc, "Default Values");
- xfce_rc_write_int_entry(rc, "X-pos", clocks.x);
- xfce_rc_write_int_entry(rc, "Y-pos", clocks.y);
- xfce_rc_write_int_entry(rc, "Decorations", clocks.decorations);
- xfce_rc_write_int_entry(rc, "Expand", clocks.expand);
+ orage_rc_set_group(rc, "Default Values");
+ orage_rc_put_int(rc, "X-pos", clocks.x);
+ orage_rc_put_int(rc, "Y-pos", clocks.y);
+ orage_rc_put_int(rc, "Decorations", clocks.decorations);
+ orage_rc_put_int(rc, "Expand", clocks.expand);
write_string(rc, "tz", clocks.local_tz);
write_attr(rc, &clocks.clock_default_attr);
g_list_foreach(clocks.clock_list, (GFunc) write_clock, rc);
- xfce_rc_close(rc);
+ orage_rc_file_close(rc);
}
-static gboolean read_string(XfceRc *rc, gchar *prop, GString *result)
+static gboolean read_string(OrageRc *rc, gchar *prop, GString *result)
{
gboolean found = FALSE;
- if (xfce_rc_has_entry(rc, prop)) {
- result = g_string_assign(result, xfce_rc_read_entry(rc, prop, ""));
+ if (orage_rc_exists_item(rc, prop)) {
+ result = g_string_assign(result, orage_rc_get_str(rc, prop, ""));
found = TRUE;
}
return(found);
}
-static gboolean read_color(XfceRc *rc, gchar *prop, GdkColor **result)
+static gboolean read_color(OrageRc *rc, gchar *prop, GdkColor **result)
{
gchar *tmp;
gboolean found = FALSE;
unsigned int red, green, blue;
- if (xfce_rc_has_entry(rc, prop)) {
- tmp = (gchar *)xfce_rc_read_entry(rc, prop, "");
+ if (orage_rc_exists_item(rc, prop)) {
+ tmp = (gchar *)orage_rc_get_str(rc, prop, "");
/*
sscanf(tmp, "%uR %uG %uB", &(*result)->red, &(*result)->green
, &(*result)->blue);
@@ -138,7 +138,7 @@ static gboolean read_color(XfceRc *rc, gchar *prop, GdkColor **result)
return(found);
}
-static void read_attr(XfceRc *rc, text_attr_struct *attr)
+static void read_attr(OrageRc *rc, text_attr_struct *attr)
{
attr->clock_fg_modified = read_color(rc, "fg", &attr->clock_fg);
attr->clock_bg_modified = read_color(rc, "bg", &attr->clock_bg);
@@ -152,15 +152,15 @@ static void read_attr(XfceRc *rc, text_attr_struct *attr)
read_string(rc, "time_underline", attr->time_underline);
}
-static void read_clock(XfceRc *rc)
+static void read_clock(OrageRc *rc)
{
clock_struct *clockp;
clockp = g_new0(clock_struct, 1);
clockp->name = g_string_new(
- xfce_rc_read_entry(rc, "name", "no name"));
+ orage_rc_get_str(rc, "name", "no name"));
clockp->tz = g_string_new(
- xfce_rc_read_entry(rc, "tz", "/etc/localtime"));
+ orage_rc_get_str(rc, "tz", "/etc/localtime"));
clockp->modified = FALSE;
init_attr(&clockp->clock_attr);
@@ -173,44 +173,38 @@ void read_file(void)
{
gchar *fpath;
gchar **groups;
- XfceRc *rc;
+ OrageRc *rc;
gint i;
- fpath = xfce_resource_save_location(XFCE_RESOURCE_CONFIG
- , CONFIG_DATA_DIR_NAME CONFIG_DATA_FILE_NAME, TRUE);
+ fpath = orage_config_file_location(CONFIG_DIR_FILE_NAME);
- if ((rc = xfce_rc_simple_open(fpath, TRUE)) == NULL) {
- g_warning("Unable to open (read) RC file.");
- /* let's try to build it */
- if ((rc = xfce_rc_simple_open(fpath, FALSE)) == NULL) {
- /* still failed, can't do more */
- g_warning("Unable to open (write) RC file.");
- return;
- }
+ if ((rc = orage_rc_file_open(fpath, TRUE)) == NULL) {
+ g_warning("Unable to open RC file.");
+ return;
}
g_free(fpath);
/* read first default values without group name */
- xfce_rc_set_group(rc, "Default Values");
- clocks.x = xfce_rc_read_int_entry(rc, "X-pos", 0);
- clocks.y = xfce_rc_read_int_entry(rc, "Y-pos", 0);
- clocks.decorations = xfce_rc_read_int_entry(rc, "Decorations", 1);
- clocks.expand = xfce_rc_read_int_entry(rc, "Expand", 0);
+ orage_rc_set_group(rc, "Default Values");
+ clocks.x = orage_rc_get_int(rc, "X-pos", 0);
+ clocks.y = orage_rc_get_int(rc, "Y-pos", 0);
+ clocks.decorations = orage_rc_get_int(rc, "Decorations", 1);
+ clocks.expand = orage_rc_get_int(rc, "Expand", 0);
clocks.local_tz = g_string_new(
- xfce_rc_read_entry(rc, "tz", "/etc/localtime"));
+ orage_rc_get_str(rc, "tz", "/etc/localtime"));
read_attr(rc, &clocks.clock_default_attr);
/* then clocks */
- groups = xfce_rc_get_groups(rc);
+ groups = orage_rc_get_groups(rc);
for (i = 0; groups[i] != NULL; i++) {
if ((strcmp(groups[i], "[NULL]") != 0)
&& (strcmp(groups[i], "Default Values") != 0)) {
- xfce_rc_set_group(rc, groups[i]);
+ orage_rc_set_group(rc, groups[i]);
read_clock(rc);
}
}
g_strfreev(groups);
- xfce_rc_close(rc);
+ orage_rc_file_close(rc);
}
diff --git a/globaltime/gt_prefs.c b/globaltime/gt_prefs.c
index a95dac8..6c83559 100644
--- a/globaltime/gt_prefs.c
+++ b/globaltime/gt_prefs.c
@@ -29,9 +29,9 @@
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
-#include <libxfce4util/libxfce4util.h>
#include "globaltime.h"
+#include "../src/orage-i18n.h"
#include "timezone_selection.h"
diff --git a/globaltime/timezone_selection.c b/globaltime/timezone_selection.c
index 86b998a..5b9022e 100644
--- a/globaltime/timezone_selection.c
+++ b/globaltime/timezone_selection.c
@@ -51,8 +51,8 @@
#include <glib/gprintf.h>
#include <glib/gstdio.h>
-#include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include "../src/orage-i18n.h"
+#include "../src/functions.h"
#include "tz_zoneinfo_read.h"
#include "timezone_selection.h"
diff --git a/src/about-xfcalendar.c b/src/about-xfcalendar.c
index c1147df..58a36e1 100644
--- a/src/about-xfcalendar.c
+++ b/src/about-xfcalendar.c
@@ -25,8 +25,9 @@
# include <config.h>
#endif
-#include <libxfcegui4/libxfcegui4.h>
+#include <gtk/gtk.h>
+#include "orage-i18n.h"
#include "mainbox.h"
#include "tray_icon.h"
@@ -36,6 +37,36 @@ void create_wAbout(GtkWidget *widget, gpointer user_data)
CalWin *xfcal = (CalWin *)user_data;
GtkWidget *dialog;
GdkPixbuf *orage_logo;
+ GtkAboutDialog *about;
+ const gchar *authors[] = {"Juha Kautto <juha at xfce.org>", _("Maintainer"), NULL};
+
+ dialog = gtk_about_dialog_new();
+ about = (GtkAboutDialog *) dialog;
+ gtk_about_dialog_set_program_name(about, "Orage");
+ gtk_about_dialog_set_version(about, VERSION);
+ gtk_about_dialog_set_copyright(about, "Copyright © 2003-2010 Juha Kautto");
+ gtk_about_dialog_set_comments(about, _("Manage your time with Orage"));
+ /*
+ gtk_about_dialog_set_license(about, XFCE_LICENSE_GPL);
+ */
+ gtk_about_dialog_set_website(about, "http://www.xfce.org");
+ gtk_about_dialog_set_authors(about, authors);
+ gtk_about_dialog_set_documenters(about, authors);
+ orage_logo = orage_create_icon(FALSE, 48);
+ gtk_about_dialog_set_logo(about, orage_logo);
+
+ gtk_window_set_default_size(GTK_WINDOW(dialog), 520, 440);
+
+ gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy(dialog);
+ g_object_unref(orage_logo);
+}
+/*
+void create_wAbout_old(GtkWidget *widget, gpointer user_data)
+{
+ CalWin *xfcal = (CalWin *)user_data;
+ GtkWidget *dialog;
+ GdkPixbuf *orage_logo;
XfceAboutInfo *about;
about = xfce_about_info_new("Orage", VERSION
@@ -45,7 +76,6 @@ void create_wAbout(GtkWidget *widget, gpointer user_data)
orage_logo = orage_create_icon(FALSE, 48);
xfce_about_info_set_homepage(about, "http://www.xfce.org");
- /* Credits */
xfce_about_info_add_credit(about,
"Juha Kautto",
"juha at xfce.org",
@@ -71,3 +101,4 @@ void create_wAbout(GtkWidget *widget, gpointer user_data)
xfce_about_info_free(about);
g_object_unref(orage_logo);
}
+*/
diff --git a/src/appointment.c b/src/appointment.c
index 34e7c1c..4254e2b 100644
--- a/src/appointment.c
+++ b/src/appointment.c
@@ -717,7 +717,7 @@ static gboolean appWindow_check_and_close(appt_win *apptw)
, _("The appointment information has been modified.")
, _("Do you want to continue?"));
- if (result == GTK_RESPONSE_ACCEPT) {
+ if (result == GTK_RESPONSE_YES) {
app_free_memory(apptw);
}
}
@@ -735,17 +735,15 @@ static gboolean on_appWindow_delete_event_cb(GtkWidget *widget, GdkEvent *event
static gboolean orage_validate_datetime(appt_win *apptw, xfical_appt *appt)
{
- gint result;
-
/* Journal does not have end time so no need to check */
if (appt->type == XFICAL_TYPE_JOURNAL
|| (appt->type == XFICAL_TYPE_TODO && !appt->use_due_time))
return(TRUE);
if (xfical_compare_times(appt) > 0) {
- result = orage_error_dialog(GTK_WINDOW(apptw->Window)
- , _("The end of this appointment is earlier than the beginning.")
- , NULL);
+ orage_error_dialog(GTK_WINDOW(apptw->Window)
+ , _("The end of this appointment is earlier than the beginning.")
+ , NULL);
return(FALSE);
}
else {
@@ -1166,7 +1164,7 @@ static void delete_xfical_from_appt_win(appt_win *apptw)
, _("This appointment will be permanently removed.")
, _("Do you want to continue?"));
- if (result == GTK_RESPONSE_ACCEPT) {
+ if (result == GTK_RESPONSE_YES) {
if (!apptw->appointment_add) {
if (!xfical_file_open(TRUE))
return;
@@ -1671,7 +1669,7 @@ static OrageRc *orage_category_file_open(gboolean read_only)
gchar *fpath;
OrageRc *orc;
- fpath = orage_data_file_location(ORAGE_CATEGORIES_FILE);
+ fpath = orage_data_file_location(ORAGE_CATEGORIES_DIR_FILE);
if ((orc = (OrageRc *)orage_rc_file_open(fpath, read_only)) == NULL) {
orage_message(150, "orage_category_file_open: category file open failed.");
}
@@ -2384,7 +2382,7 @@ static OrageRc *orage_alarm_file_open(gboolean read_only)
gchar *fpath;
OrageRc *orc;
- fpath = orage_config_file_location(ORAGE_DEFAULT_ALARM_FILE);
+ fpath = orage_config_file_location(ORAGE_DEFAULT_ALARM_DIR_FILE);
if (!read_only) /* we need to empty it before each write */
g_remove(fpath);
if ((orc = (OrageRc *)orage_rc_file_open(fpath, read_only)) == NULL) {
diff --git a/src/event-list.c b/src/event-list.c
index 6f52f4d..9e66df2 100644
--- a/src/event-list.c
+++ b/src/event-list.c
@@ -915,7 +915,7 @@ static void delete_appointment(el_win *el)
result = orage_warning_dialog(GTK_WINDOW(el->Window)
, _("You will permanently remove all\nselected appointments.")
, _("Do you want to continue?"));
- if (result == GTK_RESPONSE_ACCEPT) {
+ if (result == GTK_RESPONSE_YES) {
if (!xfical_file_open(TRUE))
return;
sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(el->TreeView));
diff --git a/src/functions.c b/src/functions.c
index fd6a720..ddb84e0 100644
--- a/src/functions.c
+++ b/src/functions.c
@@ -43,10 +43,12 @@
#include "functions.h"
#include "parameters.h"
+/* message logging level */
+int g_log_level=0;
+
/**************************************
- * General purpose helper functions *
+ * Debugging helping functions *
**************************************/
-
/* this is for testing only. it can be used to see where time is spent.
* Add call program_log("dbus started") in the code and run orage like:
* strace -ttt -f -o /tmp/logfile.strace ./orage
@@ -77,14 +79,14 @@ void program_log (const char *format, ...)
* 100-199 = Warning
* 200-299 = Critical warning
* 300- = Error
- * variable g_par.log_level can be used to control how much data is printed
+ * variable g_log_level can be used to control how much data is printed
*/
void orage_message(gint level, const char *format, ...)
{
va_list args;
char *formatted;
- if (level < g_par.log_level)
+ if (level < g_log_level)
return;
va_start(args, format);
formatted = g_strdup_vprintf(format, args);
@@ -103,6 +105,10 @@ void orage_message(gint level, const char *format, ...)
g_free(formatted);
}
+/**************************************
+ * General purpose helper functions *
+ **************************************/
+
GtkWidget *orage_create_combo_box_with_content(char *text[], int size)
{
register int i;
@@ -427,6 +433,38 @@ GtkWidget *orage_period_hbox_new(gboolean head_space, gboolean tail_space
return hbox;
}
+GtkWidget *orage_create_framebox_with_content(const gchar *title
+ , GtkWidget *content)
+{
+ GtkWidget *framebox;
+ GtkWidget *frame_bin;
+ gchar *tmp;
+ GtkWidget *label;
+
+ framebox = gtk_frame_new(NULL);
+ gtk_frame_set_shadow_type(GTK_FRAME(framebox), GTK_SHADOW_NONE);
+ gtk_frame_set_label_align(GTK_FRAME(framebox), 0.0, 1.0);
+ gtk_widget_show(framebox);
+
+ if (title) {
+ tmp = g_strdup_printf("<b>%s</b>", title);
+ label = gtk_label_new(tmp);
+ gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_widget_show(label);
+ gtk_frame_set_label_widget(GTK_FRAME(framebox), label);
+ g_free(tmp);
+ }
+
+ frame_bin = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
+ gtk_alignment_set_padding(GTK_ALIGNMENT(frame_bin), 5, 5, 21, 5);
+ gtk_widget_show(frame_bin);
+ gtk_container_add(GTK_CONTAINER(framebox), frame_bin);
+ gtk_container_add(GTK_CONTAINER(frame_bin), content);
+
+ return(framebox);
+}
+
/*******************************************************
* time convert and manipulation functions
*******************************************************/
@@ -706,31 +744,33 @@ void orage_select_today(GtkCalendar *cal)
}
/*******************************************************
- * rc file interface
+ * cata and config file locations
*******************************************************/
-gchar *orage_data_file_location(char *name)
+gchar *orage_data_file_location(char *dir_name)
{
- char *file_name, *dir_name;
+ char *file_name;
- dir_name = g_strconcat(ORAGE_DIR, name, NULL);
- file_name = xfce_resource_save_location(XFCE_RESOURCE_DATA, dir_name
- , TRUE);
- g_free(dir_name);
+ file_name = xfce_resource_save_location(XFCE_RESOURCE_DATA, dir_name, TRUE);
+ g_print("orage_data_file_location (%s) (%s)\n", file_name, g_get_user_data_dir());
return(file_name);
}
-gchar *orage_config_file_location(char *name)
+gchar *orage_config_file_location(char *dir_name)
{
- char *file_name, *dir_name;
+ /* g_get_system_config_dirs */
+ char *file_name;
- dir_name = g_strconcat(ORAGE_DIR, name, NULL);
file_name = xfce_resource_save_location(XFCE_RESOURCE_CONFIG, dir_name
, TRUE);
- g_free(dir_name);
+ g_print("orage_config_file_location (%s) (%s)\n", file_name, g_get_user_config_dir());
return(file_name);
}
+/*******************************************************
+ * rc file interface
+ *******************************************************/
+
OrageRc *orage_rc_file_open(char *fpath, gboolean read_only)
{
XfceRc *rc;
@@ -822,48 +862,62 @@ void orage_rc_del_item(OrageRc *orc, char *key)
}
/*******************************************************
- * xfce functions
+ * dialog functions
*******************************************************/
gint orage_info_dialog(GtkWindow *parent
, char *primary_text, char *secondary_text)
{
- return(xfce_message_dialog(parent
- , _("Info")
- , GTK_STOCK_DIALOG_INFO
- , primary_text
- , secondary_text
- , GTK_STOCK_OK, GTK_RESPONSE_ACCEPT
- , NULL));
+ GtkWidget *dialog;
+ gint result;
+
+ dialog = gtk_message_dialog_new(parent
+ , GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT
+ , GTK_MESSAGE_INFO
+ , GTK_BUTTONS_OK
+ , "%s", primary_text);
+ if (secondary_text)
+ gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog)
+ , "%s", secondary_text);
+ result = gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy(dialog);
+ return(result);
}
gint orage_warning_dialog(GtkWindow *parent
, char *primary_text, char *secondary_text)
{
- return(xfce_message_dialog(parent
- , _("Warning")
- , GTK_STOCK_DIALOG_WARNING
- , primary_text
- , secondary_text
- , GTK_STOCK_NO, GTK_RESPONSE_CANCEL
- , GTK_STOCK_YES, GTK_RESPONSE_ACCEPT
- , NULL));
+ GtkWidget *dialog;
+ gint result;
+
+ dialog = gtk_message_dialog_new(parent
+ , GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT
+ , GTK_MESSAGE_WARNING
+ , GTK_BUTTONS_YES_NO
+ , "%s", primary_text);
+ if (secondary_text)
+ gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog)
+ , "%s", secondary_text);
+ result = gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy(dialog);
+ return(result);
}
gint orage_error_dialog(GtkWindow *parent
, char *primary_text, char *secondary_text)
{
- return(xfce_message_dialog(parent
- , _("Error")
- , GTK_STOCK_DIALOG_ERROR
- , primary_text
- , secondary_text
- , GTK_STOCK_OK, GTK_RESPONSE_ACCEPT
- , NULL));
-}
+ GtkWidget *dialog;
+ gint result;
-GtkWidget *orage_create_framebox_with_content(const gchar *title
- , GtkWidget *content)
-{
- return(xfce_create_framebox_with_content (title, content));
+ dialog = gtk_message_dialog_new(parent
+ , GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT
+ , GTK_MESSAGE_ERROR
+ , GTK_BUTTONS_OK
+ , "%s", primary_text);
+ if (secondary_text)
+ gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog)
+ , "%s", secondary_text);
+ result = gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy(dialog);
+ return(result);
}
diff --git a/src/functions.h b/src/functions.h
index 01261d6..eb4dfa7 100644
--- a/src/functions.h
+++ b/src/functions.h
@@ -32,11 +32,17 @@
#define ORAGE_DIR "orage" G_DIR_SEPARATOR_S
#define ORAGE_PAR_FILE "oragerc"
+#define ORAGE_PAR_DIR_FILE ORAGE_DIR ORAGE_PAR_FILE
#define ORAGE_APP_FILE "orage.ics"
+#define ORAGE_APP_DIR_FILE ORAGE_DIR ORAGE_APP_FILE
#define ORAGE_ARC_FILE "orage_archive.ics"
+#define ORAGE_ARC_DIR_FILE ORAGE_DIR ORAGE_ARC_FILE
#define ORAGE_CATEGORIES_FILE "orage_categories.txt"
+#define ORAGE_CATEGORIES_DIR_FILE ORAGE_DIR ORAGE_CATEGORIES_FILE
#define ORAGE_PERSISTENT_ALARMS_FILE "orage_persistent_alarms.txt"
+#define ORAGE_PERSISTENT_ALARMS_DIR_FILE ORAGE_DIR ORAGE_PERSISTENT_ALARMS_FILE
#define ORAGE_DEFAULT_ALARM_FILE "orage_default_alarm.txt"
+#define ORAGE_DEFAULT_ALARM_DIR_FILE ORAGE_DIR ORAGE_DEFAULT_ALARM_FILE
#define ORAGE_STR_EXISTS(str) ((str != NULL) && (str[0] != 0))
@@ -104,8 +110,8 @@ gint orage_days_between(struct tm *t1, struct tm *t2);
void orage_select_date(GtkCalendar *cal, guint year, guint month, guint day);
void orage_select_today(GtkCalendar *cal);
-gchar *orage_data_file_location(char *name);
-gchar *orage_config_file_location(char *name);
+gchar *orage_data_file_location(char *dir_name);
+gchar *orage_config_file_location(char *dir_name);
OrageRc *orage_rc_file_open(char *fpath, gboolean read_only);
void orage_rc_file_close(OrageRc *orc);
gchar **orage_rc_get_groups(OrageRc *orc);
diff --git a/src/interface.c b/src/interface.c
index d5bae81..7014826 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -320,7 +320,7 @@ static void orage_file_open_button_clicked(GtkButton *button
gchar *rcfile;
gchar *s;
- rcfile = orage_data_file_location(NULL);
+ rcfile = orage_data_file_location(ORAGE_DIR);
f_chooser = orage_file_chooser(intf_w->main_window, TRUE
, g_par.orage_file, rcfile, ORAGE_APP_FILE);
g_free(rcfile);
@@ -347,7 +347,7 @@ static void archive_file_open_button_clicked(GtkButton *button
gchar *rcfile;
gchar *s;
- rcfile = orage_data_file_location(NULL);
+ rcfile = orage_data_file_location(ORAGE_DIR);
f_chooser = orage_file_chooser(intf_w->main_window, TRUE
, g_par.archive_file, rcfile, ORAGE_ARC_FILE);
g_free(rcfile);
@@ -964,6 +964,7 @@ void create_import_export_tab(intf_win *intf_w)
gchar *str;
m_vbox = gtk_vbox_new(FALSE, 0);
+ /* FIXME: this could be simpler than framebox */
intf_w->iea_notebook_page = orage_create_framebox_with_content(NULL, m_vbox);
intf_w->iea_tab_label = gtk_label_new(_("Import/export"));
gtk_notebook_append_page(GTK_NOTEBOOK(intf_w->notebook)
@@ -1107,6 +1108,7 @@ void create_orage_file_tab(intf_win *intf_w)
GtkWidget *label, *hbox, *vbox, *m_vbox;
m_vbox = gtk_vbox_new(FALSE, 0);
+ /* FIXME: this could be simpler than framebox */
intf_w->fil_notebook_page = orage_create_framebox_with_content(NULL, m_vbox);
intf_w->fil_tab_label = gtk_label_new(_("Orage files"));
gtk_notebook_append_page(GTK_NOTEBOOK(intf_w->notebook)
@@ -1241,6 +1243,7 @@ static void create_foreign_file_tab(intf_win *intf_w)
GtkWidget *label, *hbox, *vbox;
intf_w->for_tab_main_vbox = gtk_vbox_new(FALSE, 0);
+ /* FIXME: this could be simpler than framebox */
intf_w->for_notebook_page = orage_create_framebox_with_content(NULL
, intf_w->for_tab_main_vbox);
intf_w->for_tab_label = gtk_label_new(_("Foreign files"));
diff --git a/src/main.c b/src/main.c
index c7cb46b..ff8eaca 100644
--- a/src/main.c
+++ b/src/main.c
@@ -39,14 +39,14 @@
#endif
#include <time.h>
-#include <libxfcegui4/libxfcegui4.h>
-
#include <glib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
#define ORAGE_MAIN "orage"
+#include "orage-i18n.h"
#include "functions.h"
#include "mainbox.h"
#include "reminder.h"
@@ -59,7 +59,9 @@
#endif
/* session client handler */
+/*
static SessionClient *session_client = NULL;
+*/
static GdkAtom atom_alive;
@@ -172,26 +174,30 @@ gboolean keep_tidy(void)
* This is called when the session manager requests the client to save its
* state.
*/
+/*
void save_yourself_cb(gpointer data, int save_style, gboolean shutdown
, int interact_style, gboolean fast)
{
write_parameters();
}
+*/
/*
* Die callback
*
* This is called when the session manager requests the client to go down.
*/
+/*
void die_cb(gpointer data)
{
gtk_main_quit();
}
+*/
static void print_version(void)
{
- g_print(_("\tThis is %s version %s for Xfce %s\n\n")
- , PACKAGE, VERSION, xfce_version_string());
+ g_print(_("\tThis is %s version %s\n\n")
+ , PACKAGE, VERSION);
g_print(_("\tReleased under the terms of the GNU General Public License.\n"));
g_print(_("\tCompiled against GTK+-%d.%d.%d, ")
, GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
@@ -450,11 +456,13 @@ int main(int argc, char *argv[])
/*
* try to connect to the session manager
*/
+ /*
session_client = client_session_new(argc, argv, NULL
, SESSION_RESTART_IF_RUNNING, 50);
session_client->save_yourself = save_yourself_cb;
session_client->die = die_cb;
(void)session_init(session_client);
+ */
/*
* Now it's serious, the application is running, so we create the RC
diff --git a/src/parameters.c b/src/parameters.c
index c6f9308..5dd45ca 100644
--- a/src/parameters.c
+++ b/src/parameters.c
@@ -41,8 +41,7 @@
#include <gtk/gtk.h>
#include <gdk/gdk.h>
-#include <libxfcegui4/libxfcegui4.h>
-
+#include "orage-i18n.h"
#include "functions.h"
#include "tray_icon.h"
#include "ical-code.h"
@@ -50,6 +49,7 @@
#include "parameters.h"
#include "mainbox.h"
+extern g_log_level;
static gboolean is_running = FALSE;
@@ -480,6 +480,7 @@ static void create_parameter_dialog_main_setup_tab(Itf *dialog)
GtkWidget *hbox, *vbox, *label;
dialog->setup_vbox = gtk_vbox_new(FALSE, 0);
+ /* FIXME: this could be something simpler than framebox */
dialog->setup_tab =
orage_create_framebox_with_content(NULL, dialog->setup_vbox);
dialog->setup_tab_label = gtk_label_new(_("Main setups"));
@@ -566,6 +567,7 @@ static void create_parameter_dialog_display_tab(Itf *dialog)
GtkWidget *hbox, *vbox, *label;
dialog->display_vbox = gtk_vbox_new(FALSE, 0);
+ /* FIXME: this could be something simpler than framebox */
dialog->display_tab =
orage_create_framebox_with_content(NULL, dialog->display_vbox);
dialog->display_tab_label = gtk_label_new(_("Display"));
@@ -753,6 +755,7 @@ static void create_parameter_dialog_extra_setup_tab(Itf *dialog)
GtkWidget *hbox, *vbox, *label;
dialog->extra_vbox = gtk_vbox_new(FALSE, 0);
+ /* FIXME: this could be something simpler than framebox */
dialog->extra_tab =
orage_create_framebox_with_content(NULL, dialog->extra_vbox);
dialog->extra_tab_label = gtk_label_new(_("Extra setups"));
@@ -865,7 +868,7 @@ Itf *create_parameter_dialog()
dialog = g_new(Itf, 1);
dialog->Tooltips = gtk_tooltips_new();
- dialog->orage_dialog = xfce_titled_dialog_new();
+ dialog->orage_dialog = gtk_dialog_new();
gtk_window_set_default_size(GTK_WINDOW(dialog->orage_dialog), 300, 350);
gtk_window_set_title(GTK_WINDOW(dialog->orage_dialog)
, _("Orage Preferences"));
@@ -918,7 +921,7 @@ OrageRc *orage_parameters_file_open(gboolean read_only)
gchar *fpath;
OrageRc *orc;
- fpath = orage_config_file_location(ORAGE_PAR_FILE);
+ fpath = orage_config_file_location(ORAGE_PAR_DIR_FILE);
if ((orc = (OrageRc *)orage_rc_file_open(fpath, read_only)) == NULL) {
orage_message(150, "orage_category_file_open: Parameter file open failed.");
}
@@ -993,7 +996,7 @@ void write_parameters()
g_sprintf(f_par, "Foreign file %02d read-only", i);
orage_rc_del_item(orc, f_par);
}
- orage_rc_put_int(orc, "Logging level", g_par.log_level);
+ orage_rc_put_int(orc, "Logging level", g_log_level);
orage_rc_put_int(orc, "Priority list limit", g_par.priority_list_limit);
orage_rc_file_close(orc);
@@ -1096,11 +1099,11 @@ void read_parameters(void)
}
#ifdef HAVE_ARCHIVE
g_par.archive_limit = orage_rc_get_int(orc, "Archive limit", 0);
- fpath = orage_data_file_location(ORAGE_ARC_FILE);
+ fpath = orage_data_file_location(ORAGE_ARC_DIR_FILE);
g_par.archive_file = orage_rc_get_str(orc, "Archive file", fpath);
g_free(fpath);
#endif
- fpath = orage_data_file_location(ORAGE_APP_FILE);
+ fpath = orage_data_file_location(ORAGE_APP_DIR_FILE);
g_par.orage_file = orage_rc_get_str(orc, "Orage file", fpath);
g_free(fpath);
g_par.sound_application=orage_rc_get_str(orc, "Sound application", "play");
@@ -1141,7 +1144,7 @@ void read_parameters(void)
g_sprintf(f_par, "Foreign file %02d read-only", i);
g_par.foreign_data[i].read_only = orage_rc_get_bool(orc, f_par, TRUE);
}
- g_par.log_level = orage_rc_get_int(orc, "Logging level", 0);
+ g_log_level = orage_rc_get_int(orc, "Logging level", 0);
g_par.priority_list_limit = orage_rc_get_int(orc, "Priority list limit", 8);
orage_rc_file_close(orc);
diff --git a/src/parameters.h b/src/parameters.h
index 0d4bfab..952cede 100644
--- a/src/parameters.h
+++ b/src/parameters.h
@@ -94,9 +94,6 @@ typedef struct _parameters
/* show days window from main calendar */
gboolean show_days; /* true=show days false=show events */
- /* Controls which messages are printed */
- gint log_level;
-
/* Controls which appointment priorities are shown in daylist */
gint priority_list_limit;
} global_parameters; /* global parameters */
diff --git a/src/reminder.c b/src/reminder.c
index a3109a2..dc18510 100644
--- a/src/reminder.c
+++ b/src/reminder.c
@@ -255,7 +255,7 @@ static OrageRc *orage_persistent_file_open(gboolean read_only)
#ifdef ORAGE_DEBUG
orage_message(-100, P_N);
#endif
- fpath = orage_data_file_location(ORAGE_PERSISTENT_ALARMS_FILE);
+ fpath = orage_data_file_location(ORAGE_PERSISTENT_ALARMS_DIR_FILE);
if (!read_only) /* we need to empty it before each write */
g_remove(fpath);
if ((orc = (OrageRc *)orage_rc_file_open(fpath, read_only)) == NULL) {
diff --git a/src/timezone_selection.c b/src/timezone_selection.c
index 297769f..c35256e 100644
--- a/src/timezone_selection.c
+++ b/src/timezone_selection.c
@@ -53,7 +53,6 @@
#include "orage-i18n.h"
#include "functions.h"
-#include "parameters.h"
#include "tz_zoneinfo_read.h"
#include "timezone_selection.h"
More information about the Xfce4-commits
mailing list