You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(61) |
Nov
(101) |
Dec
(80) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(63) |
Feb
(50) |
Mar
(30) |
Apr
(14) |
May
(39) |
Jun
(56) |
Jul
(37) |
Aug
(17) |
Sep
(36) |
Oct
(10) |
Nov
(19) |
Dec
(25) |
2009 |
Jan
(20) |
Feb
(12) |
Mar
(34) |
Apr
(11) |
May
|
Jun
(5) |
Jul
(27) |
Aug
(40) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
2010 |
Jan
(18) |
Feb
(5) |
Mar
(17) |
Apr
(11) |
May
(3) |
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
2011 |
Jan
(1) |
Feb
(1) |
Mar
(9) |
Apr
(2) |
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(8) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(13) |
Aug
(4) |
Sep
(10) |
Oct
(4) |
Nov
(1) |
Dec
(1) |
2015 |
Jan
(1) |
Feb
(2) |
Mar
(13) |
Apr
(4) |
May
(12) |
Jun
(5) |
Jul
(10) |
Aug
(9) |
Sep
(9) |
Oct
(9) |
Nov
(1) |
Dec
|
2016 |
Jan
(3) |
Feb
(9) |
Mar
|
Apr
(6) |
May
(9) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
|
Oct
(4) |
Nov
(11) |
Dec
|
2017 |
Jan
|
Feb
(2) |
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mgo...@us...> - 2017-03-26 17:03:13
|
Revision: 1120 http://sourceforge.net/p/osmo-pim/code/1120 Author: mgordienko Date: 2017-03-26 17:03:11 +0000 (Sun, 26 Mar 2017) Log Message: ----------- Explicitly set the signal action flags Modified Paths: -------------- trunk/src/gui.c Modified: trunk/src/gui.c =================================================================== --- trunk/src/gui.c 2017-03-26 17:03:05 UTC (rev 1119) +++ trunk/src/gui.c 2017-03-26 17:03:11 UTC (rev 1120) @@ -1493,6 +1493,7 @@ sigemptyset(&sa.sa_mask); sa.sa_handler = pipe_signals; + sa.sa_flags = 0; if (sigaction(SIGINT, &sa, NULL)) { close(pipefd[0]); close(pipefd[1]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2017-03-26 17:03:07
|
Revision: 1119 http://sourceforge.net/p/osmo-pim/code/1119 Author: mgordienko Date: 2017-03-26 17:03:05 +0000 (Sun, 26 Mar 2017) Log Message: ----------- Refactor the contact export for better extensibility Modified Paths: -------------- trunk/src/contacts_export.c trunk/src/contacts_export.h Modified: trunk/src/contacts_export.c =================================================================== --- trunk/src/contacts_export.c 2017-03-24 19:33:35 UTC (rev 1118) +++ trunk/src/contacts_export.c 2017-03-26 17:03:05 UTC (rev 1119) @@ -32,8 +32,9 @@ #ifdef CONTACTS_ENABLED +static gint export_contacts_to_file(gchar *filename, gboolean header, GUI *appGUI); /*-------------------------------------------------------------------------------------*/ -gboolean +static gboolean is_export_column(gint column) { if(config.export_fields[column] == '+') { return TRUE; @@ -42,7 +43,7 @@ } /*-------------------------------------------------------------------------------------*/ -void +static void export_check (GUI *appGUI) { gint i, k; @@ -69,7 +70,7 @@ /*-------------------------------------------------------------------------------------*/ -void +static void export_window_close_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) { GUI *appGUI = (GUI *)user_data; @@ -86,12 +87,12 @@ /*-------------------------------------------------------------------------------------*/ -void -export_cb (GtkWidget *widget, gpointer data) { +static void +export_cb(GtkWidget *widget, gpointer data) { -gint n; -gboolean header; -gchar tmpbuf[BUFFER_SIZE]; + gint n; + gboolean header; + gchar tmpbuf[BUFFER_SIZE]; GUI *appGUI = (GUI *)data; @@ -115,7 +116,7 @@ /*------------------------------------------------------------------------------*/ -void +static void button_export_window_close_cb (GtkWidget *widget, gpointer data) { GUI *appGUI = (GUI *)data; @@ -124,48 +125,47 @@ } /*------------------------------------------------------------------------------*/ - struct contact_export_strategy { - void (*begin_file)(FILE * filehandle, GUI * appGUI); - void (*begin_contact)(gint number, FILE * filehandle, GUI * appGUI); - void (*handle_contact_value)(gint column, gchar const * value, FILE * filehandle, GtkTreeIter *iter, GUI * appGUI); - void (*end_contact)(gint number, FILE * filehandle, GUI * appGUI); - void (*end_file)(FILE * filehandle, GUI * appGUI); + void (*begin_file)(GUI * appGUI, export_writer *writer, void *writer_user_data); + void (*begin_contact)(gint number, GUI * appGUI, export_writer *writer, void *writer_user_data); + void (*handle_contact_value)(gint column, gchar const * value, GtkTreeIter *iter, GUI * appGUI, export_writer *writer, void *writer_user_data); + void (*end_contact)(gint number, GUI * appGUI, export_writer *writer, void *writer_user_data); + void (*end_file)(GUI * appGUI, export_writer *writer, void *writer_user_data); }; /*------------------------------------------------------------------------------*/ -void -xhtml_begin_file(FILE * filehandle, GUI * appGUI) { +static void +xhtml_begin_file(GUI * appGUI, export_writer *writer, void *writer_user_data) { gchar tmpbuf[BUFFER_SIZE]; gint i, a, b; - fprintf(filehandle, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"); - fprintf(filehandle, "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"); - fprintf(filehandle, "<head>\n"); - fprintf(filehandle, "\t<title>Contact List</title>\n"); - fprintf(filehandle, "\t<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n"); - fprintf(filehandle, "\t<meta name=\"generator\" content=\"OSMO - http://clay.ll.pl/osmo\" />\n"); - fprintf(filehandle, "\t<style type=\"text/css\">\n"); - fprintf(filehandle, "\t\tbody { color:black; background-color:white; }\n"); - fprintf(filehandle, "\t\ta { color:#0000ff; }\n"); - fprintf(filehandle, "\t\ta:visited { color:#000055; }\n"); - fprintf(filehandle, "\t\ttable { border-collapse:collapse; }\n"); - fprintf(filehandle, "\t\ttr.header { background-color:#c0c0c0; }\n"); - fprintf(filehandle, "\t\ttr.evenrow { background-color:#f0f0f0; }\n"); - fprintf(filehandle, "\t\ttr.oddrow { background-color:#fafafa; }\n"); - fprintf(filehandle, "\t\tth, td { border:1px solid #555555; padding:3px; }\n"); - fprintf(filehandle, "\t</style>\n"); - fprintf(filehandle, "</head>\n\n"); - fprintf(filehandle, "<body>\n\n"); - fprintf(filehandle, "<h1>Contact List</h1>\n\n"); + writer(writer_user_data, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"); + writer(writer_user_data, "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n"); + writer(writer_user_data, "<head>\n"); + writer(writer_user_data, "\t<title>Contact List</title>\n"); + writer(writer_user_data, "\t<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n"); + writer(writer_user_data, "\t<meta name=\"generator\" content=\"OSMO - http://clay.ll.pl/osmo\" />\n"); + writer(writer_user_data, "\t<style type=\"text/css\">\n"); + writer(writer_user_data, "\t\tbody { color:black; background-color:white; }\n"); + writer(writer_user_data, "\t\ta { color:#0000ff; }\n"); + writer(writer_user_data, "\t\ta:visited { color:#000055; }\n"); + writer(writer_user_data, "\t\ttable { border-collapse:collapse; }\n"); + writer(writer_user_data, "\t\ttr.header { background-color:#c0c0c0; }\n"); + writer(writer_user_data, "\t\ttr.evenrow { background-color:#f0f0f0; }\n"); + writer(writer_user_data, "\t\ttr.oddrow { background-color:#fafafa; }\n"); + writer(writer_user_data, "\t\tth, td { border:1px solid #555555; padding:3px; }\n"); + writer(writer_user_data, "\t</style>\n"); + writer(writer_user_data, "</head>\n\n"); + writer(writer_user_data, "<body>\n\n"); + writer(writer_user_data, "<h1>Contact List</h1>\n\n"); - fprintf(filehandle, "<table>\n"); + writer(writer_user_data, "<table>\n"); - fprintf(filehandle, "<tr class=\"header\">\n"); + writer(writer_user_data, "<tr class=\"header\">\n"); for (i = 0; i < CONTACTS_NUM_COLUMNS; i++) { if (is_export_column(i)) { - fprintf(filehandle, "\t<th>"); + writer(writer_user_data, "\t<th>"); if (appGUI->cnt->contact_fields_tags_name[i * 2] != NULL) { for (a = b = 0; a < strlen(appGUI->cnt->contact_fields_tags_name[i * 2]); a++) { @@ -178,37 +178,37 @@ } } tmpbuf[b] = '\0'; - fprintf(filehandle, "%s", tmpbuf); + writer(writer_user_data, "%s", tmpbuf); } - fprintf(filehandle, "</th>\n"); + writer(writer_user_data, "</th>\n"); } } - fprintf(filehandle, "</tr>\n\n"); + writer(writer_user_data, "</tr>\n\n"); } -void -xhtml_begin_contact(gint number, FILE * filehandle, GUI * appGUI) { +static void +xhtml_begin_contact(gint number, GUI * appGUI, export_writer *writer, void *writer_user_data) { if (number & 1) { - fprintf(filehandle, "<tr class=\"evenrow\">\n"); + writer(writer_user_data, "<tr class=\"evenrow\">\n"); } else { - fprintf(filehandle, "<tr class=\"oddrow\">\n"); + writer(writer_user_data, "<tr class=\"oddrow\">\n"); } } -void -xhtml_end_contact(gint number, FILE * filehandle, GUI * appGUI) { - fprintf(filehandle, "</tr>\n\n"); +static void +xhtml_end_contact(gint number, GUI * appGUI, export_writer *writer, void *writer_user_data) { + writer(writer_user_data, "</tr>\n\n"); } -void -xhtml_handle_contact_value(gint column, gchar const * value, FILE * filehandle, GtkTreeIter *iter, GUI * appGUI) { +static void +xhtml_handle_contact_value(gint column, gchar const * value, GtkTreeIter *iter, GUI * appGUI, export_writer *writer, void *writer_user_data) { gint a, b; gchar tmpbuf[BUFFER_SIZE]; - - fprintf(filehandle, "\t<td>"); + writer(writer_user_data, "\t<td>"); + if (value != NULL) { for (a = b = 0; a < strlen(value); a++) { @@ -227,7 +227,7 @@ case COLUMN_EMAIL_2: case COLUMN_EMAIL_3: case COLUMN_EMAIL_4: - fprintf(filehandle, "<a href=\"mailto:%s\">%s</a>", tmpbuf, tmpbuf); + writer(writer_user_data, "<a href=\"mailto:%s\">%s</a>", tmpbuf, tmpbuf); break; case COLUMN_WWW_1: case COLUMN_WWW_2: @@ -234,35 +234,37 @@ case COLUMN_WWW_3: case COLUMN_WWW_4: case COLUMN_BLOG: - fprintf(filehandle, "<a href=\"%s\">%s</a>", tmpbuf, tmpbuf); + writer(writer_user_data, "<a href=\"%s\">%s</a>", tmpbuf, tmpbuf); break; default: - fprintf(filehandle, "%s", tmpbuf); + writer(writer_user_data, "%s", tmpbuf); } - } + } - fprintf(filehandle, "</td>\n"); + writer(writer_user_data, "</td>\n"); } -void xhtml_end_file(FILE * filehandle, GUI * appGUI) { - fprintf(filehandle, "</table>\n"); - fprintf(filehandle, "</body>\n"); - fprintf(filehandle, "</html>\n"); +static void +xhtml_end_file(GUI * appGUI, export_writer *writer, void *writer_user_data) { + writer(writer_user_data, "</table>\n"); + writer(writer_user_data, "</body>\n"); + writer(writer_user_data, "</html>\n"); } /*------------------------------------------------------------------------------*/ -void csv_begin_file(FILE * filehandle, GUI * appGUI) { +static void +csv_begin_file(GUI * appGUI, export_writer *writer, void *writer_user_data) { } -void -csv_no_header_begin_contact(gint number, FILE * filehandle, GUI * appGUI) { +static void +csv_no_header_begin_contact(gint number, GUI * appGUI, export_writer *writer, void *writer_user_data) { } static gboolean csv_add_coma; -void -csv_header_begin_contact(gint number, FILE * filehandle, GUI * appGUI) { +static void +csv_header_begin_contact(gint number, GUI * appGUI, export_writer *writer, void *writer_user_data) { if (number == 0) { gint i; gboolean add_coma = FALSE; @@ -270,25 +272,26 @@ for (i = 0; i < CONTACTS_NUM_COLUMNS; i++) { if (is_export_column(i)) { if (add_coma) { - fprintf(filehandle, ","); + writer(writer_user_data, ","); } add_coma = TRUE; - fprintf(filehandle, "%s", appGUI->cnt->contact_fields_tags_name[i * 2]); + writer(writer_user_data, "%s", appGUI->cnt->contact_fields_tags_name[i * 2]); } } - fprintf(filehandle, "\r\n"); + writer(writer_user_data, "\r\n"); } csv_add_coma = FALSE; } -void -csv_end_contact(gint number, FILE * filehandle, GUI * appGUI) { - fprintf(filehandle, "\r\n"); + +static void +csv_end_contact(gint number, GUI * appGUI, export_writer *writer, void *writer_user_data) { + writer(writer_user_data, "\r\n"); } -void -csv_handle_contact_value(gint column, gchar const * value, FILE * filehandle, GtkTreeIter *iter, GUI * appGUI) { +static void +csv_handle_contact_value(gint column, gchar const * value, GtkTreeIter *iter, GUI * appGUI, export_writer *writer, void *writer_user_data) { if (csv_add_coma) { - fprintf(filehandle, ","); + writer(writer_user_data, ","); } csv_add_coma = TRUE; if (value != NULL) { @@ -331,31 +334,42 @@ buffer[j++] = value[i]; } buffer[j] = '\0'; - fprintf(filehandle, "\"%s\"", buffer); + writer(writer_user_data, "\"%s\"", buffer); g_free(buffer); } else { - fprintf(filehandle, "%s", value); + writer(writer_user_data, "%s", value); } } } -void csv_end_file(FILE * filehandle, GUI * appGUI) { - +static void +csv_end_file(GUI * appGUI, export_writer *writer, void *writer_user_data) { + } /*------------------------------------------------------------------------------*/ static vcf_writer *vcf; -void +static struct { + export_writer *writer; + void *data; +} vcf_writer_data; + +static void vcf_write_cb(gchar const *buffer, gsize buffer_size, void *user_data) { - FILE *filehandle = user_data; - - fwrite(buffer, sizeof(gchar), buffer_size, filehandle); + export_writer *writer = vcf_writer_data.writer; + void *data = vcf_writer_data.data; + gchar *tmp = g_strndup(buffer, buffer_size); /* NULL terminated for writer */ + + writer(data, tmp); + g_free(tmp); } -void -vcf_begin_file(FILE *filehandle, GUI *appGUI) { - vcf = vcf_create_writer(vcf_write_cb, filehandle); +static void +vcf_begin_file(GUI * appGUI, export_writer *writer, void *writer_user_data) { + vcf_writer_data.writer = writer; + vcf_writer_data.data = writer_user_data; + vcf = vcf_create_writer(vcf_write_cb, NULL); } static gboolean vcf_write_required_properties; @@ -363,8 +377,8 @@ static gboolean vcf_write_work_address; static gboolean vcf_write_org; -void -vcf_begin_contact(gint number, FILE * filehandle, GUI * appGUI) { +static void +vcf_begin_contact(gint number, GUI * appGUI, export_writer *writer, void *writer_user_data) { vcf_write_begin(vcf); vcf_write_required_properties = TRUE; vcf_write_home_address = TRUE; @@ -372,8 +386,8 @@ vcf_write_org = TRUE; } -void static -write_address(gchar const* type, gint address_column, gint city_column, gint state_column, gint post_code_column, gint country_column, +static void +vcf_export_address(gchar const* type, gint address_column, gint city_column, gint state_column, gint post_code_column, gint country_column, GtkTreeIter *iter, GUI * appGUI) { gchar *address, *city, *state, *post_code, *country; gtk_tree_model_get(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), iter, @@ -384,7 +398,7 @@ country_column, &country, -1); vcf_write_ADR(vcf, type, - is_export_column(address_column)? address : NULL, + is_export_column(address_column) ? address : NULL, is_export_column(city_column) ? city : NULL, is_export_column(state_column) ? state : NULL, is_export_column(post_code_column) ? post_code : NULL, @@ -398,8 +412,8 @@ g_free(country); } -void -vcf_handle_contact_value(gint column, gchar const * value, FILE * filehandle, GtkTreeIter *iter, GUI * appGUI) { +static void +vcf_handle_contact_value(gint column, gchar const * value, GtkTreeIter *iter, GUI * appGUI, export_writer *writer, void *writer_user_data) { if (vcf_write_required_properties == TRUE) { gchar *first_name, *last_name, *second_name; gtk_tree_model_get(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), iter, @@ -435,7 +449,7 @@ case COLUMN_HOME_POST_CODE: case COLUMN_HOME_COUNTRY: if (vcf_write_home_address) { - write_address(VCF_TYPE_HOME, COLUMN_HOME_ADDRESS, COLUMN_HOME_CITY, COLUMN_HOME_STATE, COLUMN_HOME_POST_CODE, COLUMN_HOME_COUNTRY, iter, appGUI); + vcf_export_address(VCF_TYPE_HOME, COLUMN_HOME_ADDRESS, COLUMN_HOME_CITY, COLUMN_HOME_STATE, COLUMN_HOME_POST_CODE, COLUMN_HOME_COUNTRY, iter, appGUI); vcf_write_home_address = FALSE; } break; @@ -445,7 +459,7 @@ case COLUMN_WORK_POST_CODE: case COLUMN_WORK_COUNTRY: if (vcf_write_work_address) { - write_address(VCF_TYPE_WORK, COLUMN_WORK_ADDRESS, COLUMN_WORK_CITY, COLUMN_WORK_STATE, COLUMN_WORK_POST_CODE, COLUMN_WORK_COUNTRY, iter, appGUI); + vcf_export_address(VCF_TYPE_WORK, COLUMN_WORK_ADDRESS, COLUMN_WORK_CITY, COLUMN_WORK_STATE, COLUMN_WORK_POST_CODE, COLUMN_WORK_COUNTRY, iter, appGUI); vcf_write_work_address = FALSE; } break; @@ -550,83 +564,120 @@ } } -void -vcf_end_contact(gint number, FILE * filehandle, GUI * appGUI) { +static void +vcf_end_contact(gint number, GUI * appGUI, export_writer *writer, void *writer_user_data) { vcf_write_end(vcf); } -void -vcf_end_file(FILE * filehandle, GUI * appGUI) { +static void +vcf_end_file(GUI * appGUI, export_writer *writer, void *writer_user_data) { vcf_close_writer(vcf); vcf = NULL; + vcf_writer_data.writer = NULL; + vcf_writer_data.data = NULL; } + /*------------------------------------------------------------------------------*/ +static void +export_to_file(void *user_data, gchar const *format, ...) { + FILE *filehandle = user_data; + va_list arguments; + va_start(arguments, format); + vfprintf(filehandle, format, arguments); + va_end(arguments); +} + +static struct contact_export_strategy * +choose_strategy(gint type, gboolean header) { + if (type == EXPORT_TO_XHTML) { + struct contact_export_strategy *strategy = g_new0(struct contact_export_strategy, 1); + strategy->begin_file = xhtml_begin_file; + strategy->begin_contact = xhtml_begin_contact; + strategy->handle_contact_value = xhtml_handle_contact_value; + strategy->end_contact = xhtml_end_contact; + strategy->end_file = xhtml_end_file; + return strategy; + } else if (type == EXPORT_TO_CSV) { + struct contact_export_strategy *strategy = g_new0(struct contact_export_strategy, 1); + strategy->begin_file = csv_begin_file; + strategy->begin_contact = header ? csv_header_begin_contact : csv_no_header_begin_contact; + strategy->handle_contact_value = csv_handle_contact_value; + strategy->end_contact = csv_end_contact; + strategy->end_file = csv_end_file; + return strategy; + } else if (type == EXPORT_TO_VCF) { + struct contact_export_strategy *strategy = g_new0(struct contact_export_strategy, 1); + strategy->begin_file = vcf_begin_file; + strategy->begin_contact = vcf_begin_contact; + strategy->handle_contact_value = vcf_handle_contact_value; + strategy->end_contact = vcf_end_contact; + strategy->end_file = vcf_end_file; + return strategy; + } + return NULL; +} + gint -export_contacts_to_file_with_strategy(gchar *filename, struct contact_export_strategy strategy, GUI *appGUI) { +export_contacts(gint type, gboolean header, GUI *appGUI, export_writer *writer, void *writer_user_data) { + GtkTreePath *sort_path, *filter_path, *path; + gint i, exported; + gchar *text; + GtkTreeIter iter; + guint32 date; + struct contact_export_strategy *strategy; -GtkTreePath *sort_path, *filter_path, *path; -gint i, exported; -gchar *text; -GtkTreeIter iter; -FILE *filehandle; -guint32 date; - exported = 0; - if (utl_gui_check_overwrite_file (filename, appGUI->cnt->export_window, appGUI) != 0) { - return -1; - } + strategy = choose_strategy(type, header); + if (strategy) { + strategy->begin_file(appGUI, writer, writer_user_data); - filehandle = g_fopen (filename, "w"); - if(filehandle) { - strategy.begin_file(filehandle, appGUI); + sort_path = gtk_tree_path_new_first(); - sort_path = gtk_tree_path_new_first (); + while (gtk_tree_model_get_iter(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, sort_path) == TRUE) { - while (gtk_tree_model_get_iter (GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, sort_path) == TRUE) { - if (sort_path != NULL) { - filter_path = gtk_tree_model_sort_convert_path_to_child_path (GTK_TREE_MODEL_SORT(appGUI->cnt->contacts_sort), sort_path); + filter_path = gtk_tree_model_sort_convert_path_to_child_path(GTK_TREE_MODEL_SORT(appGUI->cnt->contacts_sort), sort_path); if (filter_path != NULL) { - path = gtk_tree_model_filter_convert_path_to_child_path (GTK_TREE_MODEL_FILTER(appGUI->cnt->contacts_filter), filter_path); + path = gtk_tree_model_filter_convert_path_to_child_path(GTK_TREE_MODEL_FILTER(appGUI->cnt->contacts_filter), filter_path); if (path != NULL) { - gtk_tree_model_get_iter (GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, path); - - strategy.begin_contact(exported, filehandle, appGUI); + gtk_tree_model_get_iter(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, path); - for(i=0; i < CONTACTS_NUM_COLUMNS; i++) { + strategy->begin_contact(exported, appGUI, writer, writer_user_data); - if(is_export_column(i)) { + for (i = 0; i < CONTACTS_NUM_COLUMNS; i++) { + if (is_export_column(i)) { + if (i == COLUMN_BIRTH_DAY_DATE || i == COLUMN_NAME_DAY_DATE) { - gtk_tree_model_get (GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, i, &date, -1); + gtk_tree_model_get(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, i, &date, -1); if (date == 0) { text = NULL; } else { if (i == COLUMN_BIRTH_DAY_DATE) { - text = g_strdup((const gchar *)julian_to_str(date, DATE_DD_MM_YYYY, TRUE)); + text = g_strdup((const gchar *) julian_to_str(date, DATE_DD_MM_YYYY, TRUE)); } else { - text = g_strdup((const gchar *)julian_to_str(date, DATE_DD_MM_YYYY, TRUE)); + text = g_strdup((const gchar *) julian_to_str(date, DATE_DD_MM_YYYY, TRUE)); } } } else { - gtk_tree_model_get (GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, i, &text, -1); + gtk_tree_model_get(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, i, &text, -1); } - strategy.handle_contact_value(i, text, filehandle, &iter, appGUI); + strategy->handle_contact_value(i, text, &iter, appGUI, writer, writer_user_data); g_free(text); } } - - strategy.end_contact(exported, filehandle, appGUI); + strategy->end_contact(exported, appGUI, writer, writer_user_data); + exported++; gtk_tree_path_free(path); @@ -637,12 +688,12 @@ } - gtk_tree_path_next (sort_path); + gtk_tree_path_next(sort_path); } - strategy.end_file(filehandle, appGUI); + strategy->end_file(appGUI, writer, writer_user_data); - fclose(filehandle); + g_free(strategy); return exported; } else { utl_gui_create_dialog(GTK_MESSAGE_ERROR, _("Cannot create file."), GTK_WINDOW(appGUI->cnt->export_window)); @@ -650,62 +701,52 @@ } } -/*------------------------------------------------------------------------------*/ - -gint +static gint export_contacts_to_file(gchar *filename, gboolean header, GUI *appGUI) { - if (config.export_format == EXPORT_TO_XHTML) { - struct contact_export_strategy strategy = {.begin_file=xhtml_begin_file, - .begin_contact=xhtml_begin_contact, - .handle_contact_value=xhtml_handle_contact_value, - .end_contact=xhtml_end_contact, - .end_file=xhtml_end_file}; - return export_contacts_to_file_with_strategy(filename, strategy, appGUI); - } else if(config.export_format == EXPORT_TO_CSV) { - struct contact_export_strategy strategy = {.begin_file=csv_begin_file, - .begin_contact=header ? csv_header_begin_contact : csv_no_header_begin_contact, - .handle_contact_value=csv_handle_contact_value, - .end_contact=csv_end_contact, - .end_file=csv_end_file}; - return export_contacts_to_file_with_strategy(filename, strategy, appGUI); - } else if(config.export_format == EXPORT_TO_VCF) { - struct contact_export_strategy strategy = {.begin_file=vcf_begin_file, - .begin_contact=vcf_begin_contact, - .handle_contact_value=vcf_handle_contact_value, - .end_contact=vcf_end_contact, - .end_file=vcf_end_file}; - return export_contacts_to_file_with_strategy(filename, strategy, appGUI); + FILE *filehandle; + if (utl_gui_check_overwrite_file(filename, appGUI->cnt->export_window, appGUI) != 0) { + return -1; } - return -1; + + + filehandle = g_fopen(filename, "w"); + if (filehandle) { + gint exported = export_contacts(config.export_format, header, appGUI, export_to_file, filehandle); + fclose(filehandle); + return exported; + } else { + utl_gui_create_dialog(GTK_MESSAGE_ERROR, _("Cannot create file."), GTK_WINDOW(appGUI->cnt->export_window)); + return -1; + } } /*------------------------------------------------------------------------------*/ -void +static void browse_dir_cb (GtkWidget *widget, gpointer data) { -GtkWidget *dialog; -gchar f_filename[PATH_MAX]; + GtkWidget *dialog; + gchar f_filename[PATH_MAX]; GUI *appGUI = (GUI *)data; - dialog = utl_gui_create_save_file_dialog(_("Select output file"), - GTK_WINDOW(appGUI->cnt->export_window)); + dialog = utl_gui_create_save_file_dialog(_("Select output file"), + GTK_WINDOW(appGUI->cnt->export_window)); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { g_strlcpy (f_filename, gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)), PATH_MAX-1); - if (config.export_format == EXPORT_TO_XHTML) { + if (config.export_format == EXPORT_TO_XHTML) { if (g_str_has_suffix (f_filename, ".html") == FALSE && g_str_has_suffix (f_filename, ".HTML") == FALSE) { g_strlcat(f_filename, ".html", PATH_MAX-1); - } + } } else if(config.export_format == EXPORT_TO_CSV) { if (g_str_has_suffix (f_filename, ".csv") == FALSE && g_str_has_suffix (f_filename, ".CSV") == FALSE) { g_strlcat(f_filename, ".csv", PATH_MAX-1); - } + } } else if(config.export_format == EXPORT_TO_VCF) { if (g_str_has_suffix (f_filename, ".vcf") == FALSE && g_str_has_suffix (f_filename, ".VCF") == FALSE && @@ -712,19 +753,18 @@ g_str_has_suffix (f_filename, ".vcard") == FALSE && g_str_has_suffix (f_filename, ".VCARD") == FALSE) { g_strlcat(f_filename, ".vcf", PATH_MAX-1); - } } + } gtk_entry_set_text (GTK_ENTRY(appGUI->cnt->output_file_entry), f_filename); - } + } - export_check(appGUI); - gtk_widget_destroy(dialog); + export_check(appGUI); + gtk_widget_destroy(dialog); } - /*------------------------------------------------------------------------------*/ -gint +static gint export_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer data) { GUI *appGUI = (GUI *)data; @@ -740,10 +780,10 @@ /*------------------------------------------------------------------------------*/ -void +static void export_field_selected_cb (GtkToggleButton *button, gpointer user_data) { -gint i; + gint i; MESSAGE *msg = (MESSAGE *)user_data; @@ -760,7 +800,7 @@ /*------------------------------------------------------------------------------*/ -void +static void format_changed_cb(GtkToggleButton *button, gpointer user_data) { gint format = GPOINTER_TO_INT(user_data); if (gtk_toggle_button_get_active(button)) { @@ -770,7 +810,7 @@ /*------------------------------------------------------------------------------*/ -void +static void select_action_cb (GtkWidget *widget, gpointer user_data) { gint i; @@ -783,22 +823,22 @@ if (i != COLUMN_PHOTO && i != COLUMN_ID) { switch((size_t) msg->data) { - case SELECT_ALL: + case SELECT_ALL: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(msg->appGUI->cnt->check_buttons[i]), TRUE); - break; + break; - case SELECT_NONE: + case SELECT_NONE: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(msg->appGUI->cnt->check_buttons[i]), FALSE); - break; + break; - case SELECT_INVERT: + case SELECT_INVERT: state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(msg->appGUI->cnt->check_buttons[i])); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(msg->appGUI->cnt->check_buttons[i]), !state); - break; + break; - default: - break; - }; + default: + break; + }; } } } @@ -805,7 +845,7 @@ /*--------------------------------------------------------------------*/ -GSList * +static GSList * create_format_radiobutton(gchar * const label, gint format, GtkBox *parent, GSList *group) { GtkWidget* radiobutton; radiobutton = gtk_radio_button_new_with_mnemonic(NULL, label); @@ -825,33 +865,33 @@ void contacts_create_export_window(GUI *appGUI) { -GtkWidget *vbox1; -GtkWidget *hbox1; -GtkWidget *vbox2; -GtkWidget *hbox2; -GtkWidget *vbox3; -GtkWidget *frame; -GtkWidget *vbox4; -GtkWidget *vbox5; + GtkWidget *vbox1; + GtkWidget *hbox1; + GtkWidget *vbox2; + GtkWidget *hbox2; + GtkWidget *vbox3; + GtkWidget *frame; + GtkWidget *vbox4; + GtkWidget *vbox5; GSList *format_radiobutton_group = NULL; -GtkWidget *label; -GtkWidget *vseparator; -GtkWidget *scrolledwindow; -GtkWidget *viewport; -GtkWidget *fields_table; -GtkWidget *hbox3; -GtkWidget *browse_dir_button; -GtkWidget *hseparator; -GtkWidget *hbuttonbox; -GtkWidget *hbuttonbox_s; -GtkWidget *cancel_button; -GtkWidget *select_all_button; -GtkWidget *select_none_button; -GtkWidget *invert_selection_button; -gint i; -gchar tmpbuf[BUFFER_SIZE]; -static MESSAGE msg_export_field[CONTACTS_NUM_COLUMNS]; -static MESSAGE msg_select[3]; /* select all, select none, select invert */ + GtkWidget *label; + GtkWidget *vseparator; + GtkWidget *scrolledwindow; + GtkWidget *viewport; + GtkWidget *fields_table; + GtkWidget *hbox3; + GtkWidget *browse_dir_button; + GtkWidget *hseparator; + GtkWidget *hbuttonbox; + GtkWidget *hbuttonbox_s; + GtkWidget *cancel_button; + GtkWidget *select_all_button; + GtkWidget *select_none_button; + GtkWidget *invert_selection_button; + gint i; + gchar tmpbuf[BUFFER_SIZE]; + static MESSAGE msg_export_field[CONTACTS_NUM_COLUMNS]; + static MESSAGE msg_select[3]; /* select all, select none, select invert */ appGUI->cnt->export_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (appGUI->cnt->export_window), _("Export contacts")); @@ -858,13 +898,13 @@ gtk_container_set_border_width (GTK_CONTAINER (appGUI->cnt->export_window), 6); gtk_window_move (GTK_WINDOW (appGUI->cnt->export_window), - config.contacts_export_win_x, config.contacts_export_win_y); + config.contacts_export_win_x, config.contacts_export_win_y); gtk_window_set_default_size (GTK_WINDOW(appGUI->cnt->export_window), - config.contacts_export_win_w, config.contacts_export_win_h); + config.contacts_export_win_w, config.contacts_export_win_h); - if (config.fullscreen == FALSE) { + if (config.fullscreen == FALSE) { gtk_window_set_transient_for(GTK_WINDOW(appGUI->cnt->export_window), GTK_WINDOW(appGUI->main_window)); - } + } gtk_window_set_modal(GTK_WINDOW(appGUI->cnt->export_window), TRUE); g_signal_connect (G_OBJECT (appGUI->cnt->export_window), "key_press_event", @@ -871,7 +911,7 @@ G_CALLBACK (export_key_press_cb), appGUI); g_signal_connect (G_OBJECT (appGUI->cnt->export_window), "delete_event", - G_CALLBACK(export_window_close_cb), appGUI); + G_CALLBACK(export_window_close_cb), appGUI); vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox1); Modified: trunk/src/contacts_export.h =================================================================== --- trunk/src/contacts_export.h 2017-03-24 19:33:35 UTC (rev 1118) +++ trunk/src/contacts_export.h 2017-03-26 17:03:05 UTC (rev 1119) @@ -35,9 +35,10 @@ SELECT_NONE, SELECT_INVERT }; +typedef void(export_writer) (void *user_data, gchar const *format, ...); -gboolean export_contacts_to_file (gchar *filename, gboolean header, GUI *appGUI); -void contacts_create_export_window (GUI *appGUI); +gint export_contacts(gint type, gboolean header, GUI *appGUI, export_writer *writer, void *writer_user_data); +void contacts_create_export_window(GUI *appGUI); #endif /* _CONTACTS_EXPORT_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2017-03-24 19:33:38
|
Revision: 1118 http://sourceforge.net/p/osmo-pim/code/1118 Author: mgordienko Date: 2017-03-24 19:33:35 +0000 (Fri, 24 Mar 2017) Log Message: ----------- Do not delete the old config directory after the migration Modified Paths: -------------- trunk/src/backup.c trunk/src/main.c trunk/src/options_prefs.c Modified: trunk/src/backup.c =================================================================== --- trunk/src/backup.c 2017-03-20 22:13:34 UTC (rev 1117) +++ trunk/src/backup.c 2017-03-24 19:33:35 UTC (rev 1118) @@ -522,6 +522,24 @@ } /*------------------------------------------------------------------------------*/ +static void +delete_dir(gchar *dir) { + GDir *dir_fd = g_dir_open(dir, 0, NULL); + if (dir_fd) { + const gchar *child = g_dir_read_name(dir_fd); + for (; child; child = g_dir_read_name(dir_fd)) { + gchar *child_fullname = g_build_filename(dir, child, NULL); + if (g_file_test(child_fullname, G_FILE_TEST_IS_DIR)) { + delete_dir(child_fullname); + } else { + g_remove(child_fullname); + } + g_free(child_fullname); + } + g_remove(dir); + } +} + void backup_restore_run (GUI *appGUI) { @@ -548,6 +566,7 @@ /* copy to the correct directories */ prefs_restore(tmp_dirname, appGUI); + delete_dir(tmp_dirname); /* clean up */ Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2017-03-20 22:13:34 UTC (rev 1117) +++ trunk/src/main.c 2017-03-24 19:33:35 UTC (rev 1118) @@ -375,11 +375,16 @@ static gboolean migrate_to_xdg_dirs(gchar *user_config, GUI *appGUI) { - gchar *old_dirname = get_old_config_dir(user_config, appGUI); - if (!g_access(old_dirname, F_OK)) { - g_warning(_("The old Osmo config directory %s is detected. The config files and data will be moved to XDG compatible directories."), - old_dirname); - return prefs_restore(old_dirname, appGUI); + gchar *config = prefs_get_config_filename(CONFIG_FILENAME, appGUI); + if (!g_file_test(config, G_FILE_TEST_EXISTS)) { + gchar *old_dirname = get_old_config_dir(user_config, appGUI); + if (g_file_test(old_dirname, G_FILE_TEST_EXISTS)) { + g_warning(_("The old Osmo config directory %s is found. " + "The config files and data will be copied to XDG compatible directories. " + "Delete the old config directory after a successful migration."), + old_dirname); + return prefs_restore(old_dirname, appGUI); + } } return TRUE; } Modified: trunk/src/options_prefs.c =================================================================== --- trunk/src/options_prefs.c 2017-03-20 22:13:34 UTC (rev 1117) +++ trunk/src/options_prefs.c 2017-03-24 19:33:35 UTC (rev 1118) @@ -898,45 +898,39 @@ xmlSaveFormatFile (prefs_get_config_filename (CONFIG_FILENAME, appGUI), doc, 1); xmlFreeDoc (doc); } - /*------------------------------------------------------------------------------*/ static int -move(gchar *source, gchar *target) { - int rc = g_rename(source, target); - if (rc && errno == EXDEV) { - // cross device move - int source_fd, target_fd; - ssize_t len; - gchar buff[8192]; - struct stat st; - mode_t perm; +copy(gchar *source, gchar *target) { + int source_fd, target_fd; + ssize_t len; + gchar buff[8192]; + struct stat st; + mode_t perm; - if (stat(source, &st)) { - return -1; - } - perm = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); - source_fd = open(source, O_RDONLY); - if (source_fd == -1) { - return -1; - } - g_remove(target); - target_fd = open(target, O_WRONLY | O_CREAT | O_EXCL, perm); - if (target_fd == -1) { - close(source_fd); - return -1; - } + if (stat(source, &st)) { + return -1; + } + perm = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + source_fd = open(source, O_RDONLY); + if (source_fd == -1) { + return -1; + } + g_remove(target); + target_fd = open(target, O_WRONLY | O_CREAT | O_EXCL, perm); + if (target_fd == -1) { + close(source_fd); + return -1; + } + len = read(source_fd, buff, sizeof (buff)); + while (len > 0) { + write(target_fd, buff, len); len = read(source_fd, buff, sizeof (buff)); - while (len > 0) { - write(target_fd, buff, len); - len = read(source_fd, buff, sizeof (buff)); - } - close(source_fd); - close(target_fd); - g_remove(source); - return 0; } - return rc; + close(source_fd); + close(target_fd); + + return 0; } static gboolean @@ -951,7 +945,7 @@ gchar *new_name = g_build_filename(target_name, old_name, NULL); gboolean is_config = utl_text_strcmp(CONFIG_FILENAME, new_name) == 0; gchar *new_fullname = is_config ? prefs_get_config_filename(new_name, appGUI) : prefs_get_data_filename(new_name, appGUI); - int rc = move(old_fullname, new_fullname); + int rc = copy(old_fullname, new_fullname); g_free(new_name); if (rc == -1) { g_warning("Failed to move the old file %s to the new location %s. Aborting migration.", old_fullname, new_fullname); @@ -975,7 +969,6 @@ } g_dir_close(source_dir); - g_remove(source_dirname); } return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2017-03-20 22:13:37
|
Revision: 1117 http://sourceforge.net/p/osmo-pim/code/1117 Author: mgordienko Date: 2017-03-20 22:13:34 +0000 (Mon, 20 Mar 2017) Log Message: ----------- Implemented the feature request #133 Use the XDG directory structure for the config and data files. Migrate(move) the existing .osmo directory if found. Modified Paths: -------------- trunk/configure.ac trunk/src/backup.c trunk/src/calendar_ical.c trunk/src/calendar_notes.c trunk/src/contacts_items.c trunk/src/gui.h trunk/src/main.c trunk/src/notes_items.c trunk/src/options_prefs.c trunk/src/options_prefs.h trunk/src/tasks_items.c Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/configure.ac 2017-03-20 22:13:34 UTC (rev 1117) @@ -222,11 +222,11 @@ fi AC_ARG_WITH([config-path], - AS_HELP_STRING([--with-config-path=PATH], [use a non-default config path]), + AS_HELP_STRING([--with-config-path=PATH], [use a non-default config path. Deprecated, used for the configuration migration only]), [configpath=$withval AC_SUBST([configpath])]) AM_CONDITIONAL([CONFIGPATH], [test x$configpath != x]) AC_ARG_WITH([config-dir], - AS_HELP_STRING([--with-config-dir=DIR], [use a non-default config directory]), + AS_HELP_STRING([--with-config-dir=DIR], [use a non-default config directory. Deprecated, used for the configuration migration only]), [configdir=$withval AC_SUBST([configdir])]) AM_CONDITIONAL([CONFIGDIR], [test x$configdir != x]) Modified: trunk/src/backup.c =================================================================== --- trunk/src/backup.c 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/src/backup.c 2017-03-20 22:13:34 UTC (rev 1117) @@ -43,53 +43,76 @@ /*------------------------------------------------------------------------------*/ -int -tar_archive (const gchar *outname, GUI *appGUI) -{ - struct archive *archive; - struct archive_entry *entry; - struct stat st; - gchar buff[8192]; - gint len; - gint fd; - gint i = 0; - gchar *filename = NULL; +static struct archive * +create_archive(const gchar *filename) { + struct archive *archive; + archive = archive_write_new(); + archive_write_set_format_ustar(archive); + if (archive_write_open_filename(archive, filename) != ARCHIVE_OK) { + g_warning(archive_error_string(archive)); + archive_write_free (archive); + return NULL; + } + return archive; +} - archive = archive_write_new (); - archive_write_set_format_ustar (archive); - if (archive_write_open_filename (archive, outname) != ARCHIVE_OK) - { - g_printf ("%s\n", archive_error_string (archive)); - return archive_errno (archive); - } +static void +close_archive(struct archive *archive) { + archive_write_free (archive); +} - while ((filename = g_slist_nth_data (appGUI->file_list, i)) != NULL) - { - stat (filename, &st); - entry = archive_entry_new (); - archive_entry_copy_stat (entry, &st); - archive_entry_set_pathname (entry, filename); - archive_write_header (archive, entry); - fd = open (filename, O_RDONLY); - len = read (fd, buff, sizeof (buff)); - while (len > 0) - { - archive_write_data (archive, buff, len); - len = read (fd, buff, sizeof (buff)); - } - close (fd); - archive_entry_free (entry); - i++; - } +static void +add_entry_to_archive(struct archive *archive, gchar *filename, gchar *archive_entry_name) { + struct archive_entry *entry; + struct stat st; + gchar buff[8192]; + gint fd; + gint len; - archive_write_free (archive); + stat(filename, &st); + entry = archive_entry_new(); + archive_entry_copy_stat(entry, &st); + archive_entry_set_pathname(entry, archive_entry_name); + archive_write_header(archive, entry); + fd = open(filename, O_RDONLY); + len = read(fd, buff, sizeof (buff)); + while (len > 0) { + archive_write_data(archive, buff, len); + len = read(fd, buff, sizeof (buff)); + } + close(fd); + archive_entry_free(entry); +} - return ARCHIVE_OK; +static void +add_to_archive(gchar *from_dir, gchar *extension, gchar *prefix, struct archive *archive) { + const gchar *item_name; + GDir *dir_path = g_dir_open(from_dir, 0, NULL); + g_return_if_fail(dir_path != NULL); + + while ((item_name = g_dir_read_name(dir_path)) != NULL) { + gchar *source_filename = g_build_filename(from_dir, item_name, NULL); + gchar *target_filename; + if (!g_file_test(source_filename, G_FILE_TEST_IS_REGULAR)) { + g_free(source_filename); + continue; + } + + if (!g_str_has_suffix(item_name, extension)) { + g_free(source_filename); + continue; + } + target_filename = g_build_filename(prefix, item_name, NULL); + add_entry_to_archive(archive, source_filename, target_filename); + + g_free(source_filename); + g_free(target_filename); + } + g_dir_close(dir_path); } - /*------------------------------------------------------------------------------*/ -int +static gint untar_archive (gchar *filename) { struct archive_entry *entry; @@ -102,7 +125,7 @@ (archive_read_open_filename (archive, filename, 8192) != ARCHIVE_OK)) { archive_read_free (archive); - g_printf ("%s\n", archive_error_string (archive)); + g_warning (archive_error_string (archive)); return archive_errno (archive); } @@ -114,110 +137,75 @@ return ARCHIVE_OK; } -/*------------------------------------------------------------------------------*/ -void -add_all_files_to_list (gchar *directory, gboolean subdir, GUI *appGUI) { - -GDir *dir_path = NULL; -const gchar *item_name = NULL; -gchar *full_filename = NULL, *fitem = NULL, *sdir = NULL; -gchar separator[2] = { G_DIR_SEPARATOR, '\0' }; - - dir_path = g_dir_open (directory, 0, NULL); - g_return_if_fail (dir_path != NULL); - - while ((item_name = g_dir_read_name (dir_path)) != NULL) { - - full_filename = g_strconcat (directory, separator, item_name, NULL); - - if (g_utf8_collate (item_name, BACKUP_TEMPLATE) == 0) { /* don't include backup file! */ - g_free (full_filename); - continue; - } - - if (g_file_test (full_filename, G_FILE_TEST_IS_SYMLINK)) { /* ignore symlinks */ - g_free (full_filename); - continue; - } - - if (g_file_test (full_filename, G_FILE_TEST_IS_DIR)) { - add_all_files_to_list (full_filename, TRUE, appGUI); - g_free (full_filename); - continue; - } - - if (subdir) { - sdir = g_path_get_basename (directory); - fitem = g_strconcat (sdir, separator, item_name, NULL); - g_free (sdir); - } else { - fitem = g_strdup (item_name); - } - g_free (full_filename); - - appGUI->file_list = g_slist_append (appGUI->file_list, fitem); - } - - g_dir_close (dir_path); -} - /*------------------------------------------------------------------------------*/ +static void +create_backup_file(const gchar *filename, const gchar *password, GUI *appGUI) { + gchar *backup_filename; + GRG_CTX context; + GRG_KEY keyholder; + gchar *contents; + gchar *notes; + gsize len; + struct archive *archive; -void -add_files_to_list (gchar *directory, gchar *extension, GUI *appGUI) { + /* create backup file */ + backup_filename = g_strdup(prefs_get_cache_filename("backup.dat")); + archive = create_archive(backup_filename); + if (!archive) { + utl_gui_create_dialog(GTK_MESSAGE_ERROR, _("Cannot create backup!"), GTK_WINDOW(appGUI->main_window)); + g_unlink(backup_filename); + g_free(backup_filename); + return; + } -GDir *dir_path = NULL; -const gchar *item_name = NULL; -gchar *full_filename = NULL, *fitem = NULL; -gchar separator[2] = { G_DIR_SEPARATOR, '\0' }; + /* add files to archive */ + add_to_archive(prefs_get_config_dir(appGUI), CONFIG_FILENAME, "", archive); + add_to_archive(prefs_get_data_dir(appGUI), "xml", "", archive); + notes = g_build_filename(prefs_get_data_dir(appGUI), "notes", NULL); + add_to_archive(notes, "osm", "notes", archive); + g_free(notes); - dir_path = g_dir_open (directory, 0, NULL); - g_return_if_fail (dir_path != NULL); + /* done writing backup */ + close_archive(archive); - while ((item_name = g_dir_read_name (dir_path)) != NULL) { + if (g_file_get_contents(backup_filename, &contents, &len, NULL) == FALSE) { + utl_gui_create_dialog(GTK_MESSAGE_ERROR, _("Cannot create backup!"), GTK_WINDOW(appGUI->main_window)); + g_unlink(backup_filename); + g_free(backup_filename); + return; + } - full_filename = g_strconcat (directory, separator, item_name, NULL); + context = grg_context_initialize_defaults((unsigned char*) "BCK"); + keyholder = grg_key_gen((unsigned char*) password, -1); - if (!g_file_test (full_filename, G_FILE_TEST_IS_REGULAR)) { - g_free (full_filename); - continue; - } + if (keyholder == NULL || context == NULL) { + utl_gui_create_dialog(GTK_MESSAGE_ERROR, _("Cannot create backup!"), GTK_WINDOW(appGUI->main_window)); + g_unlink(backup_filename); + g_free(backup_filename); + return; + } - if (!g_str_has_suffix (item_name, extension)) { - g_free (full_filename); - continue; - } + grg_ctx_set_crypt_algo(context, get_enc_algorithm_value()); + grg_ctx_set_hash_algo(context, get_enc_hashing_value()); + grg_ctx_set_comp_algo(context, get_comp_algorithm_value()); + grg_ctx_set_comp_ratio(context, get_comp_ratio_value()); + grg_encrypt_file(context, keyholder, (unsigned char*) filename, (guchar *) contents, len); + grg_free(context, contents, len); + grg_key_free(context, keyholder); + grg_context_free(context); - if (g_str_has_suffix (item_name, "osm")) { - g_free (full_filename); - full_filename = g_strconcat ("notes", separator, item_name, NULL); - fitem = g_strdup (full_filename); - } else { - fitem = g_strdup (item_name); - } - - g_free (full_filename); - - appGUI->file_list = g_slist_append (appGUI->file_list, fitem); - } - - g_dir_close (dir_path); + /* clean up*/ + g_unlink(backup_filename); + g_free(backup_filename); } -/*------------------------------------------------------------------------------*/ - void backup_create (GUI *appGUI) { -gchar *home_dirname = NULL; -gint ret, p1len, p2len, tErr; -GRG_CTX context; -GRG_KEY keyholder; -gchar *filename, *password, *bpass1, *bpass2, *tmp_filename; +gint ret, p1len, p2len; +gchar *filename, *password, *bpass1, *bpass2; gchar tmpbuf[BUFFER_SIZE]; -gchar *contents; -gsize len; GtkWidget *dialog, *passwd_dialog; GtkWidget *passwd_content, *vbox1, *frame, *label; GtkWidget *bck_p1_entry, *bck_p2_entry; @@ -347,70 +335,11 @@ password = g_strdup(gtk_entry_get_text(GTK_ENTRY(bck_p1_entry))); gtk_widget_destroy(passwd_dialog); - /* generate file list */ - appGUI->file_list = NULL; - - home_dirname = g_strdup (prefs_get_config_dir(appGUI)); - add_all_files_to_list (home_dirname, FALSE, appGUI); - g_free (home_dirname); - - /* create backup file */ - - tmp_filename = g_strdup (prefs_get_config_filename ("backup.dat", appGUI)); - - home_dirname = g_get_current_dir(); - g_chdir (prefs_get_config_dir(appGUI)); /* change directory to cfg home */ - g_unlink (tmp_filename); - - tErr = tar_archive (tmp_filename, appGUI); - - g_chdir (home_dirname); - g_free (home_dirname); - - if (tErr != ARCHIVE_OK) { - utl_gui_create_dialog (GTK_MESSAGE_ERROR, _("Cannot create backup!"), GTK_WINDOW(appGUI->main_window)); - return; - } - - if (g_file_get_contents (tmp_filename, &contents, &len, NULL) == FALSE) { - utl_gui_create_dialog (GTK_MESSAGE_ERROR, _("Cannot create backup!"), GTK_WINDOW(appGUI->main_window)); - return; - } - - context = grg_context_initialize_defaults ((unsigned char*) "BCK"); - keyholder = grg_key_gen ((unsigned char*) password, -1); - - if (keyholder == NULL || context == NULL) { - utl_gui_create_dialog (GTK_MESSAGE_ERROR, _("Cannot create backup!"), GTK_WINDOW(appGUI->main_window)); - return; - } - - grg_ctx_set_crypt_algo (context, get_enc_algorithm_value()); - grg_ctx_set_hash_algo (context, get_enc_hashing_value()); - grg_ctx_set_comp_algo (context, get_comp_algorithm_value()); - grg_ctx_set_comp_ratio (context, get_comp_ratio_value()); - grg_encrypt_file (context, keyholder, (unsigned char*) filename, (guchar *) contents, len); - grg_free (context, contents, len); - grg_key_free (context, keyholder); - grg_context_free (context); - - g_unlink (tmp_filename); - - /* free strings */ - - g_free (tmp_filename); - - g_free(filename); + create_backup_file(filename, password, appGUI); + + g_free(filename); g_free(password); - - /* free list */ - - if (appGUI->file_list != NULL) { - g_slist_foreach (appGUI->file_list, (GFunc) g_free, NULL); - g_slist_free (appGUI->file_list); - appGUI->file_list = NULL; - } utl_gui_create_dialog (GTK_MESSAGE_INFO, _("Backup file saved successfully!"), GTK_WINDOW(appGUI->main_window)); } @@ -533,7 +462,7 @@ /* extracting encrypted data */ - tmp_filename = g_strdup (prefs_get_config_filename (BACKUP_TEMPLATE, appGUI)); + tmp_filename = g_strdup (prefs_get_cache_filename (BACKUP_TEMPLATE)); g_unlink (tmp_filename); context = grg_context_initialize_defaults ((unsigned char*) "BCK"); @@ -593,54 +522,32 @@ } /*------------------------------------------------------------------------------*/ - void backup_restore_run (GUI *appGUI) { -gint i; -gchar *tmp_filename, *home_dirname; -const gchar *item_name = NULL; -gchar *fitem = NULL, separator[2] = { G_DIR_SEPARATOR, '\0' }; +gchar *tmp_filename, *tmp_dirname, *home_dirname; /* is backup file available? */ - - tmp_filename = g_strdup (prefs_get_config_filename (BACKUP_TEMPLATE, appGUI)); - + tmp_filename = g_strdup (prefs_get_cache_filename (BACKUP_TEMPLATE)); if (g_file_test (tmp_filename, G_FILE_TEST_IS_REGULAR) == FALSE) { g_free (tmp_filename); return; } - /* removing old files */ - - appGUI->file_list = NULL; - - home_dirname = g_strdup (prefs_get_config_dir(appGUI)); - add_files_to_list (home_dirname, ".xml", appGUI); - - item_name = g_strconcat (home_dirname, separator, "notes", NULL); - g_free (home_dirname); - home_dirname = g_strdup (item_name); - - add_files_to_list (home_dirname, ".osm", appGUI); - - g_free (home_dirname); - - /* change directory to cfg home */ - + /* prepare and change to a temporary directory */ home_dirname = g_get_current_dir(); - g_chdir (prefs_get_config_dir(appGUI)); + tmp_dirname = g_dir_make_tmp(NULL, NULL); + if(!tmp_dirname) { + g_free (tmp_filename); + g_return_if_fail(tmp_dirname != NULL); + } + g_chdir (tmp_dirname); - i = 0; - - while ((fitem = g_slist_nth_data (appGUI->file_list, i)) != NULL) { - g_unlink (fitem); - i++; - } - /* untar files */ - untar_archive (tmp_filename); + + /* copy to the correct directories */ + prefs_restore(tmp_dirname, appGUI); /* clean up */ @@ -647,11 +554,7 @@ g_chdir (home_dirname); g_free (home_dirname); - if (appGUI->file_list != NULL) { - g_slist_foreach (appGUI->file_list, (GFunc) g_free, NULL); - g_slist_free (appGUI->file_list); - appGUI->file_list = NULL; - } + g_free (tmp_dirname); g_unlink (tmp_filename); g_free (tmp_filename); Modified: trunk/src/calendar_ical.c =================================================================== --- trunk/src/calendar_ical.c 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/src/calendar_ical.c 2017-03-20 22:13:34 UTC (rev 1117) @@ -565,10 +565,10 @@ gchar item_name[BUFFER_SIZE], item_filename[BUFFER_SIZE]; GtkTreeIter iter; - if (g_file_test (prefs_get_config_filename(ICAL_ENTRIES_FILENAME, appGUI), G_FILE_TEST_IS_REGULAR) == FALSE) + if (g_file_test (prefs_get_data_filename(ICAL_ENTRIES_FILENAME, appGUI), G_FILE_TEST_IS_REGULAR) == FALSE) return; - if((doc = xmlParseFile(prefs_get_config_filename(ICAL_ENTRIES_FILENAME, appGUI)))) { + if((doc = xmlParseFile(prefs_get_data_filename(ICAL_ENTRIES_FILENAME, appGUI)))) { if(!(node = xmlDocGetRootElement(doc))) { xmlFreeDoc(doc); @@ -699,7 +699,7 @@ xmlNewChild (entry_node, NULL, (const xmlChar *) "use_year", (xmlChar *) tmpbuf); } - xmlSaveFormatFileEnc (prefs_get_config_filename(ICAL_ENTRIES_FILENAME, appGUI), doc, "utf-8", 1); + xmlSaveFormatFileEnc (prefs_get_data_filename(ICAL_ENTRIES_FILENAME, appGUI), doc, "utf-8", 1); xmlFreeProp (attr); xmlFreeDoc (doc); Modified: trunk/src/calendar_notes.c =================================================================== --- trunk/src/calendar_notes.c 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/src/calendar_notes.c 2017-03-20 22:13:34 UTC (rev 1117) @@ -209,10 +209,10 @@ appGUI->cal->notes_list = NULL; - if (g_file_test (prefs_get_config_filename (CALENDAR_NOTES_FILENAME, appGUI), G_FILE_TEST_IS_REGULAR) == FALSE) + if (g_file_test (prefs_get_data_filename (CALENDAR_NOTES_FILENAME, appGUI), G_FILE_TEST_IS_REGULAR) == FALSE) return; - if ((doc = xmlParseFile (prefs_get_config_filename (CALENDAR_NOTES_FILENAME, appGUI)))) { + if ((doc = xmlParseFile (prefs_get_data_filename (CALENDAR_NOTES_FILENAME, appGUI)))) { if (!(node = xmlDocGetRootElement (doc))) return; @@ -333,7 +333,7 @@ utl_xml_put_str ("message", a->note, note_node); } - xmlSaveFormatFileEnc (prefs_get_config_filename (CALENDAR_NOTES_FILENAME, appGUI), doc, "utf-8", 1); + xmlSaveFormatFileEnc (prefs_get_data_filename (CALENDAR_NOTES_FILENAME, appGUI), doc, "utf-8", 1); xmlFreeProp (attr); xmlFreeDoc (doc); Modified: trunk/src/contacts_items.c =================================================================== --- trunk/src/contacts_items.c 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/src/contacts_items.c 2017-03-20 22:13:34 UTC (rev 1117) @@ -1110,10 +1110,10 @@ guint32 date; gchar tmpbuf[BUFFER_SIZE]; - if (g_file_test (prefs_get_config_filename(CONTACTS_ENTRIES_FILENAME, appGUI), G_FILE_TEST_IS_REGULAR) == FALSE) + if (g_file_test (prefs_get_data_filename(CONTACTS_ENTRIES_FILENAME, appGUI), G_FILE_TEST_IS_REGULAR) == FALSE) return; - if((doc = xmlParseFile(prefs_get_config_filename(CONTACTS_ENTRIES_FILENAME, appGUI)))) { + if((doc = xmlParseFile(prefs_get_data_filename(CONTACTS_ENTRIES_FILENAME, appGUI)))) { if(!(node = xmlDocGetRootElement(doc))) { xmlFreeDoc(doc); @@ -1218,7 +1218,7 @@ /* FIXME: add translation here */ g_snprintf(tmpbuf, BUFFER_SIZE, "Contacts file is malformed. Please edit\n<b>%s</b>\nfile manually to fix its structure and restart the Osmo.", - prefs_get_config_filename(CONTACTS_ENTRIES_FILENAME, appGUI)); + prefs_get_data_filename(CONTACTS_ENTRIES_FILENAME, appGUI)); utl_gui_create_dialog (GTK_MESSAGE_ERROR, tmpbuf, NULL); } @@ -1292,7 +1292,7 @@ } } - xmlSaveFormatFileEnc (prefs_get_config_filename(CONTACTS_ENTRIES_FILENAME, appGUI), doc, "utf-8", 1); + xmlSaveFormatFileEnc (prefs_get_data_filename(CONTACTS_ENTRIES_FILENAME, appGUI), doc, "utf-8", 1); xmlFreeProp (attr); xmlFreeDoc (doc); Modified: trunk/src/gui.h =================================================================== --- trunk/src/gui.h 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/src/gui.h 2017-03-20 22:13:34 UTC (rev 1117) @@ -898,14 +898,8 @@ gboolean calendar_only; gboolean check_events; gint check_ndays_events; - gchar *config_path; gboolean tiny_gui; -#if defined(BACKUP_SUPPORT) && defined(HAVE_LIBGRINGOTTS) - /* backup */ - GSList *file_list; -#endif /* BACKUP_SUPPORT && HAVE_LIBGRINGOTTS */ - /* links handling */ gboolean hovering_over_link; GdkCursor *hand_cursor; Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/src/main.c 2017-03-20 22:13:34 UTC (rev 1117) @@ -35,7 +35,9 @@ #endif /* BACKUP_SUPPORT */ #define RUN_FLAG_FILE "lock" +#define OLD_CONFIG_DIRNAME ".osmo" +static gboolean migrate_to_xdg_dirs(gchar *user_config, GUI *appGUI); /*------------------------------------------------------------------------------*/ int main(int argc, char **argv) { @@ -200,10 +202,15 @@ appGUI->calendar_only = cmd_calendar; appGUI->check_events = cmd_check_events; appGUI->check_ndays_events = cmd_check_ndays_events; - appGUI->config_path = cmd_cfg_path; + if(cmd_cfg_path) { + g_warning(_("The user config path option is deprecated. Use XDG environment variables instead.")); + } /* FIXME: temporary disabled appGUI->tiny_gui = cmd_tiny_gui; */ + if(migrate_to_xdg_dirs(cmd_cfg_path, appGUI) == FALSE) { + goto finish; + } if (prefs_get_config_filename (CONFIG_FILENAME, appGUI) == NULL) { fprintf(stderr, "%s\n", _("ERROR: Cannot create config files")); goto finish; @@ -235,9 +242,9 @@ if (appGUI->calendar_only == FALSE) { - close(creat(prefs_get_config_filename (RUN_FLAG_FILE, appGUI), S_IRUSR | S_IWUSR)); /* create lock file */ + close(creat(prefs_get_runtime_filename (RUN_FLAG_FILE), S_IRUSR | S_IWUSR)); /* create lock file */ - fhandle = open(prefs_get_config_filename (RUN_FLAG_FILE, appGUI), O_RDWR); + fhandle = open(prefs_get_runtime_filename (RUN_FLAG_FILE), O_RDWR); #ifndef WIN32 if (fhandle) { if (fcntl(fhandle, F_SETLK, s_lock) == -1) { @@ -339,4 +346,42 @@ } /*------------------------------------------------------------------------------*/ +/* This is a temporary migration from the old Osmo .osmo directory to */ +/* XDG directories. DELETE IT after the migration support is no longer needed. */ +/*------------------------------------------------------------------------------*/ + +gchar* +get_old_config_dir (gchar *user_config, GUI *appGUI) { + +static gchar dirname[PATH_MAX]; + + if (user_config == NULL) { +#if defined(CONFIG_PATH) && defined(CONFIG_DIR) + g_snprintf (dirname, PATH_MAX, "%s%c%s", CONFIG_PATH, G_DIR_SEPARATOR, CONFIG_DIR); +#elif defined(CONFIG_DIR) + g_snprintf (dirname, PATH_MAX, "%s%c%s", g_get_home_dir(), G_DIR_SEPARATOR, CONFIG_DIR); +#elif defined(CONFIG_PATH) + g_snprintf (dirname, PATH_MAX, "%s%c%s", CONFIG_PATH, G_DIR_SEPARATOR, OLD_CONFIG_DIRNAME); +#else + g_snprintf (dirname, PATH_MAX, "%s%c%s", g_get_home_dir(), G_DIR_SEPARATOR, OLD_CONFIG_DIRNAME); +#endif + } else { + g_strlcpy (dirname, user_config, PATH_MAX); + } + + return dirname; +} + +static gboolean +migrate_to_xdg_dirs(gchar *user_config, GUI *appGUI) { + gchar *old_dirname = get_old_config_dir(user_config, appGUI); + if (!g_access(old_dirname, F_OK)) { + g_warning(_("The old Osmo config directory %s is detected. The config files and data will be moved to XDG compatible directories."), + old_dirname); + return prefs_restore(old_dirname, appGUI); + } + return TRUE; +} +/*------------------------------------------------------------------------------*/ + Modified: trunk/src/notes_items.c =================================================================== --- trunk/src/notes_items.c 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/src/notes_items.c 2017-03-20 22:13:34 UTC (rev 1117) @@ -1063,16 +1063,16 @@ guint32 last_changes_date_julian, create_date_julian; gboolean remember_editor_line, editor_readonly; - notes_dir = g_strdup(prefs_get_config_filename(NOTES_DIRNAME, appGUI)); + notes_dir = g_strdup(prefs_get_data_filename(NOTES_DIRNAME, appGUI)); if (g_file_test (notes_dir, G_FILE_TEST_IS_DIR | G_FILE_TEST_EXISTS) == FALSE) { g_mkdir (notes_dir, 0755); } g_free(notes_dir); - if (g_file_test (prefs_get_config_filename(NOTES_ENTRIES_FILENAME, appGUI), G_FILE_TEST_IS_REGULAR) == FALSE) + if (g_file_test (prefs_get_data_filename(NOTES_ENTRIES_FILENAME, appGUI), G_FILE_TEST_IS_REGULAR) == FALSE) return; - if((doc = xmlParseFile(prefs_get_config_filename(NOTES_ENTRIES_FILENAME, appGUI)))) { + if((doc = xmlParseFile(prefs_get_data_filename(NOTES_ENTRIES_FILENAME, appGUI)))) { if(!(node = xmlDocGetRootElement(doc))) { xmlFreeDoc(doc); @@ -1299,7 +1299,7 @@ g_free (note_filename); } - xmlSaveFormatFileEnc (prefs_get_config_filename (NOTES_ENTRIES_FILENAME, appGUI), doc, "utf-8", 1); + xmlSaveFormatFileEnc (prefs_get_data_filename (NOTES_ENTRIES_FILENAME, appGUI), doc, "utf-8", 1); xmlFreeProp (attr); xmlFreeDoc (doc); @@ -1316,7 +1316,7 @@ for(i=0; i < 99999999; i++) { g_snprintf(fullpath, PATH_MAX-1, "%s%c%08d.osm", - prefs_get_config_filename(NOTES_DIRNAME, appGUI), G_DIR_SEPARATOR, i); + prefs_get_data_filename(NOTES_DIRNAME, appGUI), G_DIR_SEPARATOR, i); if (g_file_test (fullpath, G_FILE_TEST_EXISTS) == FALSE) break; } @@ -1338,7 +1338,7 @@ gchar *note_filename; GtkTreeIter iter; - g_snprintf(fullpath, PATH_MAX-1, "%s", prefs_get_config_filename(NOTES_DIRNAME, appGUI)); + g_snprintf(fullpath, PATH_MAX-1, "%s", prefs_get_data_filename(NOTES_DIRNAME, appGUI)); dpath = g_dir_open (fullpath, 0, NULL); if (dpath != NULL) { @@ -1348,7 +1348,7 @@ found = FALSE; g_snprintf(fullpath, PATH_MAX-1, "%s%c%s", - prefs_get_config_filename(NOTES_DIRNAME, appGUI), G_DIR_SEPARATOR, item_name); + prefs_get_data_filename(NOTES_DIRNAME, appGUI), G_DIR_SEPARATOR, item_name); i = 0; @@ -1386,7 +1386,7 @@ gchar *str; g_snprintf (fullname, PATH_MAX-1, "%s%c%s", - prefs_get_config_filename(NOTES_DIRNAME, appGUI), G_DIR_SEPARATOR, filename); + prefs_get_data_filename(NOTES_DIRNAME, appGUI), G_DIR_SEPARATOR, filename); if (g_file_test (fullname, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_EXISTS) == FALSE) { @@ -1394,7 +1394,7 @@ if (str) { g_snprintf (fullname, PATH_MAX-1, "%s%c%s", - prefs_get_config_filename(NOTES_DIRNAME, appGUI), G_DIR_SEPARATOR, str); + prefs_get_data_filename(NOTES_DIRNAME, appGUI), G_DIR_SEPARATOR, str); g_free (str); } } Modified: trunk/src/options_prefs.c =================================================================== --- trunk/src/options_prefs.c 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/src/options_prefs.c 2017-03-20 22:13:34 UTC (rev 1117) @@ -19,6 +19,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include <errno.h> + #include "options_prefs.h" #include "i18n.h" #include "utils.h" @@ -32,54 +34,78 @@ #include "calendar_utils.h" /*------------------------------------------------------------------------------*/ +static gchar * +build_app_specific_dir(const gchar *basedir) { + static gchar result[PATH_MAX]; + gchar *dirname = g_build_filename(basedir, CONFIG_SUBDIR, NULL); + g_strlcpy(result, dirname, PATH_MAX); + g_free(dirname); + return result; +} -gchar* -prefs_get_config_dir (GUI *appGUI) { +gchar * +prefs_get_config_dir(GUI *appGUI) { + return (build_app_specific_dir(g_get_user_config_dir())); +} -static gchar dirname[PATH_MAX]; - - if (appGUI->config_path == NULL) { -#if defined(CONFIG_PATH) && defined(CONFIG_DIR) - g_snprintf (dirname, PATH_MAX, "%s%c%s", CONFIG_PATH, G_DIR_SEPARATOR, CONFIG_DIR); -#elif defined(CONFIG_DIR) - g_snprintf (dirname, PATH_MAX, "%s%c%s", g_get_home_dir(), G_DIR_SEPARATOR, CONFIG_DIR); -#elif defined(CONFIG_PATH) - g_snprintf (dirname, PATH_MAX, "%s%c%s", CONFIG_PATH, G_DIR_SEPARATOR, CONFIG_DIRNAME); -#else - g_snprintf (dirname, PATH_MAX, "%s%c%s", g_get_home_dir(), G_DIR_SEPARATOR, CONFIG_DIRNAME); -#endif - } else { - g_strlcpy (dirname, appGUI->config_path, PATH_MAX); - } - - return dirname; +gchar * +prefs_get_data_dir(GUI *appGUI) { + return (build_app_specific_dir(g_get_user_data_dir())); } - /*------------------------------------------------------------------------------*/ -gchar* -prefs_get_config_filename (gchar *config_filename, GUI *appGUI) { +static gchar * +get_filename(const gchar *filename, const gchar *basedir) { + static gchar result[PATH_MAX]; + gchar *file, *dir; + struct stat st; -static gchar filename[PATH_MAX]; -gchar *dirname = NULL; -struct stat cfg; + g_return_val_if_fail(basedir != NULL, NULL); + file = g_build_filename(basedir, filename, NULL); + dir = g_path_get_dirname(file); - dirname = g_strdup (prefs_get_config_dir(appGUI)); - g_return_val_if_fail (dirname != NULL, NULL); + if (g_stat(dir, &st) < 0) { + gint rc = g_mkdir_with_parents(dir, S_IRUSR | S_IWUSR | S_IXUSR); + if (rc) { + g_free(dir); + g_free(file); + return NULL; + } + } - if(g_stat (dirname, &cfg) < 0) - g_mkdir (dirname, S_IRUSR | S_IWUSR | S_IXUSR); - - if (g_access (dirname, R_OK | W_OK) == -1) { + if (g_access(dir, R_OK | W_OK) == -1) { + g_free(dir); + g_free(file); return NULL; } - g_snprintf (filename, PATH_MAX, "%s%c%s", dirname, G_DIR_SEPARATOR, config_filename); - g_free (dirname); + g_strlcpy(result, file, PATH_MAX); + g_free(dir); + g_free(file); - return filename; + return result; } +gchar * +prefs_get_config_filename(gchar *filename, GUI *appGUI) { + return get_filename(filename, prefs_get_config_dir(appGUI)); +} + +gchar * +prefs_get_data_filename(gchar *filename, GUI *appGUI) { + return get_filename(filename, prefs_get_data_dir(appGUI)); +} + +gchar* +prefs_get_cache_filename(gchar *filename) { + return get_filename(filename, build_app_specific_dir(g_get_user_cache_dir())); +} + +gchar* +prefs_get_runtime_filename(gchar *filename) { + return get_filename(filename, build_app_specific_dir(g_get_user_runtime_dir())); +} + /*------------------------------------------------------------------------------*/ void @@ -874,5 +900,90 @@ } /*------------------------------------------------------------------------------*/ +static int +move(gchar *source, gchar *target) { + int rc = g_rename(source, target); + if (rc && errno == EXDEV) { + // cross device move + int source_fd, target_fd; + ssize_t len; + gchar buff[8192]; + struct stat st; + mode_t perm; + if (stat(source, &st)) { + return -1; + } + perm = st.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); + source_fd = open(source, O_RDONLY); + if (source_fd == -1) { + return -1; + } + g_remove(target); + target_fd = open(target, O_WRONLY | O_CREAT | O_EXCL, perm); + if (target_fd == -1) { + close(source_fd); + return -1; + } + len = read(source_fd, buff, sizeof (buff)); + while (len > 0) { + write(target_fd, buff, len); + len = read(source_fd, buff, sizeof (buff)); + } + close(source_fd); + close(target_fd); + g_remove(source); + return 0; + } + return rc; +} + +static gboolean +restore_from_dir(gchar *source_dirname, gchar *target_name, GUI *appGUI) { + GDir *source_dir = g_dir_open(source_dirname, 0, NULL); + if (source_dir) { + const gchar *old_name = g_dir_read_name(source_dir); + for (; old_name; old_name = g_dir_read_name(source_dir)) { + gchar *old_fullname = g_build_filename(source_dirname, old_name, NULL); + + if (g_file_test(old_fullname, G_FILE_TEST_IS_REGULAR)) { + gchar *new_name = g_build_filename(target_name, old_name, NULL); + gboolean is_config = utl_text_strcmp(CONFIG_FILENAME, new_name) == 0; + gchar *new_fullname = is_config ? prefs_get_config_filename(new_name, appGUI) : prefs_get_data_filename(new_name, appGUI); + int rc = move(old_fullname, new_fullname); + g_free(new_name); + if (rc == -1) { + g_warning("Failed to move the old file %s to the new location %s. Aborting migration.", old_fullname, new_fullname); + g_free(old_fullname); + return FALSE; + } + } else if (g_file_test(old_fullname, G_FILE_TEST_IS_DIR)) { + gchar *new_target_name = g_build_filename(target_name, old_name, NULL); + gboolean rc = restore_from_dir(old_fullname, new_target_name, appGUI); + g_free(new_target_name); + if (rc == FALSE) { + return FALSE; + } + } else { + g_warning("Do not know how to handle entry %s. Aborting migration.", old_fullname); + g_free(old_fullname); + return FALSE; + } + + g_free(old_fullname); + } + + g_dir_close(source_dir); + g_remove(source_dirname); + } + return TRUE; +} + +gboolean +prefs_restore (gchar *source_dir, GUI *appGUI) { + return restore_from_dir(source_dir, "", appGUI); +} +/*------------------------------------------------------------------------------*/ + + Modified: trunk/src/options_prefs.h =================================================================== --- trunk/src/options_prefs.h 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/src/options_prefs.h 2017-03-20 22:13:34 UTC (rev 1117) @@ -24,7 +24,7 @@ #include "gui.h" -#define CONFIG_DIRNAME ".osmo" +#define CONFIG_SUBDIR "osmo" #define CONFIG_FILENAME "config.xml" #define CONFIG_NAME "osmo_config" @@ -256,9 +256,14 @@ extern struct osmo_prefs config; gchar* prefs_get_config_dir (GUI *appGUI); -gchar* prefs_get_config_filename (gchar *config_filename, GUI *appGUI); +gchar* prefs_get_data_dir (GUI *appGUI); +gchar* prefs_get_config_filename (gchar *filename, GUI *appGUI); +gchar* prefs_get_data_filename (gchar *filename, GUI *appGUI); +gchar* prefs_get_cache_filename (gchar *filename); +gchar* prefs_get_runtime_filename (gchar *filename); void prefs_read_config (GUI *appGUI); void prefs_write_config (GUI *appGUI); +gboolean prefs_restore (gchar *source_dir, GUI *appGUI); #endif /* _OPTIONS_PREFS_H */ Modified: trunk/src/tasks_items.c =================================================================== --- trunk/src/tasks_items.c 2017-03-11 13:41:43 UTC (rev 1116) +++ trunk/src/tasks_items.c 2017-03-20 22:13:34 UTC (rev 1117) @@ -1313,10 +1313,10 @@ gchar *prop; gint tasks_version; - if (g_file_test (prefs_get_config_filename (TASKS_ENTRIES_FILENAME, appGUI), G_FILE_TEST_IS_REGULAR) == FALSE) + if (g_file_test (prefs_get_data_filename (TASKS_ENTRIES_FILENAME, appGUI), G_FILE_TEST_IS_REGULAR) == FALSE) return; - if ((doc = xmlParseFile (prefs_get_config_filename (TASKS_ENTRIES_FILENAME, appGUI)))) { + if ((doc = xmlParseFile (prefs_get_data_filename (TASKS_ENTRIES_FILENAME, appGUI)))) { if (!(node = xmlDocGetRootElement (doc))) { xmlFreeDoc (doc); @@ -1586,7 +1586,7 @@ } } - xmlSaveFormatFileEnc (prefs_get_config_filename (TASKS_ENTRIES_FILENAME, appGUI), doc, "utf-8", 1); + xmlSaveFormatFileEnc (prefs_get_data_filename (TASKS_ENTRIES_FILENAME, appGUI), doc, "utf-8", 1); xmlFreeDoc (doc); appGUI->save_status &= ~WRT_TASKS; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2017-03-11 13:41:45
|
Revision: 1116 http://sourceforge.net/p/osmo-pim/code/1116 Author: pasp Date: 2017-03-11 13:41:43 +0000 (Sat, 11 Mar 2017) Log Message: ----------- * Various fixes Modified Paths: -------------- trunk/FAQ trunk/README trunk/configure.ac trunk/data/osmo.1 trunk/src/backup.c trunk/src/calendar.c trunk/src/calendar_calc.c trunk/src/calendar_fullyear.c trunk/src/calendar_ical.c trunk/src/calendar_jumpto.c trunk/src/calendar_preferences_gui.c trunk/src/calendar_print.c trunk/src/calendar_timeline.c trunk/src/contacts.c trunk/src/contacts_export.c trunk/src/contacts_import.c trunk/src/contacts_items.c trunk/src/gui.c trunk/src/notes.c trunk/src/notes_items.c trunk/src/options_prefs.c trunk/src/tasks.c trunk/src/tasks_items.c trunk/src/utils_gui.c Modified: trunk/FAQ =================================================================== --- trunk/FAQ 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/FAQ 2017-03-11 13:41:43 UTC (rev 1116) @@ -9,26 +9,4 @@ =============================================================================== -Q: I get the following message on console when I run Osmo: - java version "1.7.0_55" - OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1) - OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode - - Does Osmo require Java? - -A: No, this message is generated by Java plugin for Webkit. Because Osmo uses - Webkit for HTML rendering such output is generated during initialization. - -=============================================================================== - -Q: Osmo looks as ugly as Windows 3.x application. What's wrong with the GUI? - -A: Osmo uses Gtk+ v2 Toolkit for the GUI. Currently, many applications use - Gtk+ v3 with dedicated themes ignored by Gtk+ v2 applications. To get - the consistent look of Osmo with other Gtk+ v3 applications you have to - use the theme dedicated for both versions of Gtk+. - For example, try to use the clearlooks-phenix-theme. - -=============================================================================== - Modified: trunk/README =================================================================== --- trunk/README 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/README 2017-03-11 13:41:43 UTC (rev 1116) @@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- ----- O S M O (handy personal organizer) ----- ----- ----- ------ version 0.2.14 ----- +----- version 0.4.0 ----- ----------------------------------------------------------------------------- -----> WHAT ? @@ -72,16 +72,17 @@ Required packages: - * GTK+ - The GIMP Toolkit library, version >= 2.12 + * GTK+ - The GIMP Toolkit library, version >= 3.10.0 * LibXML 2 library Optional packages: - * Libnotify library, version >= 0.4.4 - * Libwebkit library, version >= 1.1.15.0 - * Libical library, version >= 0.33 - * Libarchive library, version >= 3.0.0 - * Libgringotts library, version >= 1.2.1 + * notify library, version >= 0.7.0 + * webkit2gtk library, version >= 2.4.0 + * ical library, version >= 1.0.0 + * archive library, version >= 3.0.0 + * gringotts library, version >= 1.2.1 + * gtkspell3 library, version >= 3.0.0 -----> FEEDBACK ? Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/configure.ac 2017-03-11 13:41:43 UTC (rev 1116) @@ -97,7 +97,7 @@ #AM_CONDITIONAL([HAVE_LIBSQLITE3], test "x$have_libsqlite3" = "xtrue") # Checks for libical -PKG_CHECK_MODULES(LIBICAL, libical >= 0.33, have_libical=true, +PKG_CHECK_MODULES(LIBICAL, libical >= 1.0.0, have_libical=true, have_libical=false) if test "x$have_libical" = "xtrue"; then AC_DEFINE([HAVE_LIBICAL], [1], [Definded to 1 if compile with libical support]) Modified: trunk/data/osmo.1 =================================================================== --- trunk/data/osmo.1 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/data/osmo.1 2017-03-11 13:41:43 UTC (rev 1116) @@ -1,4 +1,4 @@ -.TH "Osmo" "1" "0.2.14" "Tomasz Maka <pa...@us...>" "" +.TH "Osmo" "1" "0.4.0" "Tomasz Maka <pa...@us...>" "" .SH "NAME" .LP Osmo \- a handy personal organizer Modified: trunk/src/backup.c =================================================================== --- trunk/src/backup.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/backup.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -268,8 +268,8 @@ bck_p1_entry = gtk_entry_new (); gtk_widget_show (bck_p1_entry); gtk_container_add (GTK_CONTAINER (frame), bck_p1_entry); - gtk_widget_set_margin_start(bck_p1_entry, 16); - gtk_widget_set_margin_end(bck_p1_entry, 4); + gtk_widget_set_margin_left(bck_p1_entry, 16); + gtk_widget_set_margin_right(bck_p1_entry, 4); gtk_widget_set_margin_top(bck_p1_entry, 4); gtk_widget_set_margin_bottom(bck_p1_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (bck_p1_entry), 8226); @@ -289,8 +289,8 @@ bck_p2_entry = gtk_entry_new (); gtk_widget_show (bck_p2_entry); gtk_container_add (GTK_CONTAINER (frame), bck_p2_entry); - gtk_widget_set_margin_start(bck_p2_entry, 16); - gtk_widget_set_margin_end(bck_p2_entry, 4); + gtk_widget_set_margin_left(bck_p2_entry, 16); + gtk_widget_set_margin_right(bck_p2_entry, 4); gtk_widget_set_margin_top(bck_p2_entry, 4); gtk_widget_set_margin_bottom(bck_p2_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (bck_p2_entry), 8226); @@ -492,8 +492,8 @@ pass_entry = gtk_entry_new (); gtk_widget_show (pass_entry); gtk_container_add (GTK_CONTAINER (frame), pass_entry); - gtk_widget_set_margin_start(pass_entry, 16); - gtk_widget_set_margin_end(pass_entry, 4); + gtk_widget_set_margin_left(pass_entry, 16); + gtk_widget_set_margin_right(pass_entry, 4); gtk_widget_set_margin_top(pass_entry, 4); gtk_widget_set_margin_bottom(pass_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (pass_entry), 8226); Modified: trunk/src/calendar.c =================================================================== --- trunk/src/calendar.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/calendar.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -1927,8 +1927,8 @@ vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_set_hexpand (vbox3, FALSE); - gtk_widget_set_margin_start(vbox3, 8); - gtk_widget_set_margin_end(vbox3, 8); + gtk_widget_set_margin_left(vbox3, 8); + gtk_widget_set_margin_right(vbox3, 8); gtk_widget_set_margin_bottom(vbox3, 8); gtk_widget_show (vbox3); if (appGUI->calendar_only == TRUE) { @@ -2044,7 +2044,7 @@ if (!config.gui_layout) { appGUI->cal->aux_cal_expander = gtk_expander_new (_("Previous and next month")); gtk_widget_set_can_focus (appGUI->cal->aux_cal_expander, FALSE); - gtk_box_pack_start (GTK_BOX (vbox3), appGUI->cal->aux_cal_expander, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), appGUI->cal->aux_cal_expander, FALSE, TRUE, 0); } appGUI->cal->aux_calendars_table = gtk_grid_new (); @@ -2051,7 +2051,7 @@ if (!config.gui_layout) { gtk_container_add (GTK_CONTAINER (appGUI->cal->aux_cal_expander), appGUI->cal->aux_calendars_table); } else { - gtk_box_pack_start (GTK_BOX (vbox3), appGUI->cal->aux_calendars_table, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), appGUI->cal->aux_calendars_table, FALSE, TRUE, 0); } gtk_grid_set_row_spacing (GTK_GRID (appGUI->cal->aux_calendars_table), 4); gtk_grid_set_column_spacing (GTK_GRID (appGUI->cal->aux_calendars_table), 4); @@ -2076,7 +2076,6 @@ appGUI->cal->calendar_prev = gui_calendar_new (); gtk_widget_show (appGUI->cal->calendar_prev); gtk_widget_set_can_focus (appGUI->cal->calendar_prev, FALSE); - gtk_widget_set_vexpand(appGUI->cal->calendar_prev, TRUE); gtk_grid_attach (GTK_GRID (appGUI->cal->aux_calendars_table), appGUI->cal->calendar_prev, 0, 1, 1, 1); gui_calendar_set_display_options (GUI_CALENDAR (appGUI->cal->calendar_prev), (config.display_options & (GUI_CALENDAR_SHOW_DAY_NAMES | GUI_CALENDAR_WEEK_START_MONDAY)) | GUI_CALENDAR_NO_MONTH_CHANGE); @@ -2103,7 +2102,7 @@ appGUI->cal->notes_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (appGUI->cal->notes_vbox); - gtk_widget_set_margin_end(GTK_WIDGET(appGUI->cal->notes_vbox), 8); + gtk_widget_set_margin_right(GTK_WIDGET(appGUI->cal->notes_vbox), 8); gtk_widget_set_margin_bottom(GTK_WIDGET(appGUI->cal->notes_vbox), 8); if (!config.gui_layout) { gtk_box_pack_start (GTK_BOX (vbox3), appGUI->cal->notes_vbox, TRUE, TRUE, 0); @@ -2273,7 +2272,7 @@ frame = gtk_frame_new (NULL); gtk_widget_show (frame); gtk_box_pack_start (GTK_BOX (appGUI->cal->day_info_vbox), frame, TRUE, TRUE, 0); - gtk_widget_set_margin_end(GTK_WIDGET(frame), 8); + gtk_widget_set_margin_right(GTK_WIDGET(frame), 8); gtk_widget_set_margin_bottom(GTK_WIDGET(frame), 8); gtk_frame_set_label_align (GTK_FRAME (frame), 0.98, 0.5); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); Modified: trunk/src/calendar_calc.c =================================================================== --- trunk/src/calendar_calc.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/calendar_calc.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -681,8 +681,8 @@ hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_show (hbox1); - gtk_widget_set_margin_start(hbox1, 16); - gtk_widget_set_margin_end(hbox1, 4); + gtk_widget_set_margin_left(hbox1, 16); + gtk_widget_set_margin_right(hbox1, 4); gtk_widget_set_margin_top(hbox1, 4); gtk_widget_set_margin_bottom(hbox1, 4); gtk_container_add (GTK_CONTAINER (frame), hbox1); @@ -834,8 +834,8 @@ hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_show (hbox2); - gtk_widget_set_margin_start(hbox2, 16); - gtk_widget_set_margin_end(hbox2, 4); + gtk_widget_set_margin_left(hbox2, 16); + gtk_widget_set_margin_right(hbox2, 4); gtk_widget_set_margin_top(hbox2, 4); gtk_widget_set_margin_bottom(hbox2, 4); gtk_container_add (GTK_CONTAINER (frame), hbox2); @@ -991,8 +991,8 @@ vbox_result = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox_result); - gtk_widget_set_margin_start(vbox_result, 20); - gtk_widget_set_margin_end(vbox_result, 8); + gtk_widget_set_margin_left(vbox_result, 20); + gtk_widget_set_margin_right(vbox_result, 8); gtk_widget_set_margin_top(vbox_result, 8); gtk_widget_set_margin_bottom(vbox_result, 8); gtk_container_add (GTK_CONTAINER (frame), vbox_result); @@ -1053,8 +1053,8 @@ vbox22 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox22); - gtk_widget_set_margin_start(vbox22, 16); - gtk_widget_set_margin_end(vbox22, 4); + gtk_widget_set_margin_left(vbox22, 16); + gtk_widget_set_margin_right(vbox22, 4); gtk_widget_set_margin_top(vbox22, 4); gtk_widget_set_margin_bottom(vbox22, 4); gtk_container_add (GTK_CONTAINER (frame), vbox22); @@ -1231,7 +1231,7 @@ vbox10 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox10); - gtk_widget_set_margin_start(vbox10, 12); + gtk_widget_set_margin_left(vbox10, 12); gtk_container_add (GTK_CONTAINER (frame), vbox10); table = gtk_grid_new (); @@ -1373,8 +1373,8 @@ hbox12 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_widget_show (hbox12); - gtk_widget_set_margin_start(hbox12, 20); - gtk_widget_set_margin_end(hbox12, 8); + gtk_widget_set_margin_left(hbox12, 20); + gtk_widget_set_margin_right(hbox12, 8); gtk_widget_set_margin_top(hbox12, 8); gtk_widget_set_margin_bottom(hbox12, 8); gtk_container_add (GTK_CONTAINER (frame), hbox12); Modified: trunk/src/calendar_fullyear.c =================================================================== --- trunk/src/calendar_fullyear.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/calendar_fullyear.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -513,8 +513,8 @@ gtk_widget_show (label); gtk_grid_attach (GTK_GRID (appGUI->cal->fycal_table_1), label, 0, month + 1, 1, 1); - gtk_widget_set_margin_start (label, 8); - gtk_widget_set_margin_end (label, 8); + gtk_widget_set_margin_left (label, 8); + gtk_widget_set_margin_right (label, 8); gtk_label_set_markup (GTK_LABEL (label), tmpbuf); if (config.fy_simple_view == FALSE) { @@ -521,8 +521,8 @@ label = gtk_label_new (NULL); gtk_widget_show (label); gtk_grid_attach (GTK_GRID (appGUI->cal->fycal_table_1), label, FULL_YEAR_COLS + 3, month + 1, 1, 1); - gtk_widget_set_margin_start (label, 8); - gtk_widget_set_margin_end (label, 8); + gtk_widget_set_margin_left (label, 8); + gtk_widget_set_margin_right (label, 8); gtk_label_set_markup (GTK_LABEL (label), tmpbuf); } } @@ -545,8 +545,8 @@ label = gtk_label_new (NULL); gtk_widget_show (label); gtk_grid_attach (GTK_GRID (appGUI->cal->fycal_table_1), label, i + 2, 0, 1, 1); - gtk_widget_set_margin_start (label, 4); - gtk_widget_set_margin_end (label, 4); + gtk_widget_set_margin_left (label, 4); + gtk_widget_set_margin_right (label, 4); if (rotate) gtk_label_set_angle (GTK_LABEL (label), 90); gtk_label_set_markup (GTK_LABEL (label), tmpbuf); @@ -555,8 +555,8 @@ label = gtk_label_new (NULL); gtk_widget_show (label); gtk_grid_attach (GTK_GRID (appGUI->cal->fycal_table_1), label, i + 2, MAX_MONTHS + 3, 1, 1); - gtk_widget_set_margin_start (label, 4); - gtk_widget_set_margin_end (label, 4); + gtk_widget_set_margin_left (label, 4); + gtk_widget_set_margin_right (label, 4); if (rotate) gtk_label_set_angle (GTK_LABEL (label), 90); gtk_label_set_markup (GTK_LABEL (label), tmpbuf); Modified: trunk/src/calendar_ical.c =================================================================== --- trunk/src/calendar_ical.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/calendar_ical.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -1526,7 +1526,7 @@ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_widget_show (vbox2); - gtk_widget_set_margin_start(vbox2, 12); + gtk_widget_set_margin_left(vbox2, 12); gtk_container_add (GTK_CONTAINER (frame), vbox2); hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); @@ -1698,7 +1698,7 @@ hbox3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_widget_show (hbox3); - gtk_widget_set_margin_start(hbox3, 12); + gtk_widget_set_margin_left(hbox3, 12); gtk_container_add (GTK_CONTAINER (frame), hbox3); appGUI->cal->output_file_entry = gtk_entry_new (); Modified: trunk/src/calendar_jumpto.c =================================================================== --- trunk/src/calendar_jumpto.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/calendar_jumpto.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -226,7 +226,7 @@ label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); - gtk_widget_set_margin_end (label, 8); + gtk_widget_set_margin_right (label, 8); appGUI->cal->day_entry = gtk_entry_new (); gtk_widget_show (appGUI->cal->day_entry); @@ -239,8 +239,8 @@ label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); - gtk_widget_set_margin_start (label, 8); - gtk_widget_set_margin_end (label, 8); + gtk_widget_set_margin_left (label, 8); + gtk_widget_set_margin_right (label, 8); appGUI->cal->month_entry = gtk_entry_new (); gtk_widget_show (appGUI->cal->month_entry); @@ -253,8 +253,8 @@ label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); - gtk_widget_set_margin_start (label, 8); - gtk_widget_set_margin_end (label, 8); + gtk_widget_set_margin_left (label, 8); + gtk_widget_set_margin_right (label, 8); appGUI->cal->year_entry = gtk_entry_new (); gtk_widget_show (appGUI->cal->year_entry); Modified: trunk/src/calendar_preferences_gui.c =================================================================== --- trunk/src/calendar_preferences_gui.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/calendar_preferences_gui.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -1728,7 +1728,7 @@ i++; gtk_widget_set_hexpand(checkbutton, TRUE); checkbutton = gtk_check_button_new_with_mnemonic (_("Show seconds")); - gtk_widget_set_margin_start(checkbutton, 16); + gtk_widget_set_margin_left(checkbutton, 16); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_current_time_seconds); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); Modified: trunk/src/calendar_print.c =================================================================== --- trunk/src/calendar_print.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/calendar_print.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -585,7 +585,7 @@ table_fonts = gtk_grid_new (); gtk_widget_show (table_fonts); - gtk_widget_set_margin_start(table_fonts, 12); + gtk_widget_set_margin_left(table_fonts, 12); gtk_container_add (GTK_CONTAINER (frame1), table_fonts); gtk_grid_set_row_spacing (GTK_GRID (table_fonts), 4); gtk_grid_set_column_spacing (GTK_GRID (table_fonts), 4); @@ -704,7 +704,7 @@ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox2); - gtk_widget_set_margin_start(vbox2, 12); + gtk_widget_set_margin_left(vbox2, 12); gtk_container_add (GTK_CONTAINER (frame2), vbox2); appGUI->cal->print_tasks_checkbutton = gtk_check_button_new_with_mnemonic (_("Tasks")); @@ -768,7 +768,7 @@ table5 = gtk_grid_new (); gtk_widget_show (table5); - gtk_widget_set_margin_start(table5, 12); + gtk_widget_set_margin_left(table5, 12); gtk_container_add (GTK_CONTAINER (frame3), table5); gtk_grid_set_row_spacing (GTK_GRID (table5), 4); gtk_grid_set_column_spacing (GTK_GRID (table5), 4); Modified: trunk/src/calendar_timeline.c =================================================================== --- trunk/src/calendar_timeline.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/calendar_timeline.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -182,7 +182,7 @@ gtk_container_set_border_width (GTK_CONTAINER (timeline_table), 4); gtk_grid_set_column_spacing (GTK_GRID (timeline_table), 8); gtk_grid_set_row_spacing (GTK_GRID (timeline_table), 4); - gtk_widget_set_margin_start(timeline_table, 12); + gtk_widget_set_margin_left(timeline_table, 12); gtk_widget_set_margin_bottom(timeline_table, 12); gtk_container_add (GTK_CONTAINER (frame), timeline_table); Modified: trunk/src/contacts.c =================================================================== --- trunk/src/contacts.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/contacts.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -890,8 +890,8 @@ vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1); gtk_widget_show (vbox3); gtk_container_add (GTK_CONTAINER (top_viewport), vbox3); - gtk_widget_set_margin_start (vbox3, 8); - gtk_widget_set_margin_end (vbox3, 8); + gtk_widget_set_margin_left (vbox3, 8); + gtk_widget_set_margin_right (vbox3, 8); gtk_widget_set_margin_bottom (vbox3, 8); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); @@ -1053,8 +1053,8 @@ frame = gtk_frame_new (NULL); gtk_widget_show (frame); gtk_box_pack_start (GTK_BOX (vbox2), frame, TRUE, TRUE, 0); - gtk_widget_set_margin_start(GTK_WIDGET(frame), 8); - gtk_widget_set_margin_end(GTK_WIDGET(frame), 8); + gtk_widget_set_margin_left(GTK_WIDGET(frame), 8); + gtk_widget_set_margin_right(GTK_WIDGET(frame), 8); gtk_widget_set_margin_bottom(GTK_WIDGET(frame), 8); gtk_frame_set_label_align (GTK_FRAME (frame), 0.98, 0.5); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); Modified: trunk/src/contacts_export.c =================================================================== --- trunk/src/contacts_export.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/contacts_export.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -900,7 +900,7 @@ vbox4 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox4); - gtk_widget_set_margin_start(vbox4, 12); + gtk_widget_set_margin_left(vbox4, 12); gtk_container_add (GTK_CONTAINER (frame), vbox4); gtk_container_set_border_width (GTK_CONTAINER (vbox4), 8); @@ -921,7 +921,7 @@ vbox4 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox4); - gtk_widget_set_margin_start(vbox4, 12); + gtk_widget_set_margin_left(vbox4, 12); gtk_container_add (GTK_CONTAINER (frame), vbox4); gtk_container_set_border_width (GTK_CONTAINER (vbox4), 8); @@ -954,7 +954,7 @@ scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow); - gtk_widget_set_margin_start(scrolledwindow, 12); + gtk_widget_set_margin_left(scrolledwindow, 12); gtk_container_add (GTK_CONTAINER (frame), scrolledwindow); gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow), 8); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -1025,7 +1025,7 @@ hbox3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_widget_show (hbox3); - gtk_widget_set_margin_start(hbox3, 12); + gtk_widget_set_margin_left(hbox3, 12); gtk_container_add (GTK_CONTAINER (frame), hbox3); appGUI->cnt->output_file_entry = gtk_entry_new (); Modified: trunk/src/contacts_import.c =================================================================== --- trunk/src/contacts_import.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/contacts_import.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -257,7 +257,7 @@ hbox4 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_show (hbox4); - gtk_widget_set_margin_start(hbox4, 12); + gtk_widget_set_margin_left(hbox4, 12); gtk_container_add (GTK_CONTAINER (frame), hbox4); appGUI->cnt->input_file_entry = gtk_entry_new (); @@ -288,7 +288,7 @@ vbox4 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox4); - gtk_widget_set_margin_start(vbox4, 12); + gtk_widget_set_margin_left(vbox4, 12); gtk_container_add (GTK_CONTAINER (frame), vbox4); hbox6 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); @@ -704,8 +704,8 @@ appGUI->cnt->n_records_label = gtk_label_new (tmpbuf); gtk_widget_show (appGUI->cnt->n_records_label); gtk_box_pack_end (GTK_BOX (hbox1), appGUI->cnt->n_records_label, FALSE, FALSE, 0); - gtk_widget_set_margin_start (appGUI->cnt->n_records_label, 6); - gtk_widget_set_margin_end (appGUI->cnt->n_records_label, 6); + gtk_widget_set_margin_left (appGUI->cnt->n_records_label, 6); + gtk_widget_set_margin_right (appGUI->cnt->n_records_label, 6); g_snprintf(tmpbuf, BUFFER_SIZE, "<b>%s</b>", _("of")); label = gtk_label_new (tmpbuf); @@ -712,8 +712,8 @@ gtk_widget_show (label); gtk_box_pack_end (GTK_BOX (hbox1), label, FALSE, FALSE, 0); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - gtk_widget_set_margin_start (label, 6); - gtk_widget_set_margin_end (label, 6); + gtk_widget_set_margin_left (label, 6); + gtk_widget_set_margin_right (label, 6); appGUI->cnt->current_record_spinbutton_adj = gtk_adjustment_new (1, 1, n_records, 1, 10, 0); appGUI->cnt->current_record_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (appGUI->cnt->current_record_spinbutton_adj), 1, 0); @@ -727,8 +727,8 @@ gtk_widget_show (label); gtk_box_pack_end (GTK_BOX (hbox1), label, FALSE, FALSE, 0); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - gtk_widget_set_margin_start (label, 6); - gtk_widget_set_margin_end (label, 6); + gtk_widget_set_margin_left (label, 6); + gtk_widget_set_margin_right (label, 6); g_snprintf(tmpbuf, BUFFER_SIZE, "<b>%s:</b>", _("Number fields per record")); label = gtk_label_new (tmpbuf); @@ -735,15 +735,15 @@ gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - gtk_widget_set_margin_start (label, 6); - gtk_widget_set_margin_end (label, 6); + gtk_widget_set_margin_left (label, 6); + gtk_widget_set_margin_right (label, 6); g_snprintf(tmpbuf, BUFFER_SIZE, "%d", appGUI->cnt->max_fields); max_fields_label = gtk_label_new (tmpbuf); gtk_widget_show (max_fields_label); gtk_box_pack_start (GTK_BOX (hbox1), max_fields_label, FALSE, FALSE, 0); - gtk_widget_set_margin_start (max_fields_label, 6); - gtk_widget_set_margin_end (max_fields_label, 6); + gtk_widget_set_margin_left (max_fields_label, 6); + gtk_widget_set_margin_right (max_fields_label, 6); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator); @@ -812,8 +812,8 @@ gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_valign(label, GTK_ALIGN_START); gtk_widget_set_halign(label, GTK_ALIGN_CENTER); - gtk_widget_set_margin_start (label, 8); - gtk_widget_set_margin_end (label, 8); + gtk_widget_set_margin_left (label, 8); + gtk_widget_set_margin_right (label, 8); g_snprintf(tmpbuf, BUFFER_SIZE, "<b>%s:</b>", _("Value")); label = gtk_label_new (tmpbuf); @@ -822,8 +822,8 @@ gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_valign(label, GTK_ALIGN_START); gtk_widget_set_halign(label, GTK_ALIGN_CENTER); - gtk_widget_set_margin_start (label, 8); - gtk_widget_set_margin_end (label, 8); + gtk_widget_set_margin_left (label, 8); + gtk_widget_set_margin_right (label, 8); appGUI->cnt->value_labels[i] = gtk_label_new (""); gtk_widget_show (appGUI->cnt->value_labels[i]); @@ -832,8 +832,8 @@ gtk_widget_set_size_request (appGUI->cnt->value_labels[i], 50, -1); gtk_widget_set_valign(appGUI->cnt->value_labels[i], GTK_ALIGN_START); gtk_widget_set_halign(appGUI->cnt->value_labels[i], GTK_ALIGN_CENTER); - gtk_widget_set_margin_start (appGUI->cnt->value_labels[i], 8); - gtk_widget_set_margin_end (appGUI->cnt->value_labels[i], 8); + gtk_widget_set_margin_left (appGUI->cnt->value_labels[i], 8); + gtk_widget_set_margin_right (appGUI->cnt->value_labels[i], 8); appGUI->cnt->field_type_comboboxes[i] = gtk_combo_box_text_new (); gtk_widget_show (appGUI->cnt->field_type_comboboxes[i]); Modified: trunk/src/contacts_items.c =================================================================== --- trunk/src/contacts_items.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/contacts_items.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -426,8 +426,8 @@ msg_selected.appGUI = msg->appGUI; g_signal_connect (G_OBJECT (msg->appGUI->cnt->select_date_calendar), "day_selected_double_click", G_CALLBACK (select_date_selected_cb), &msg_selected); - gtk_widget_set_margin_start(msg->appGUI->cnt->select_date_calendar, 4); - gtk_widget_set_margin_end(msg->appGUI->cnt->select_date_calendar, 4); + gtk_widget_set_margin_left(msg->appGUI->cnt->select_date_calendar, 4); + gtk_widget_set_margin_right(msg->appGUI->cnt->select_date_calendar, 4); gtk_widget_set_margin_top(msg->appGUI->cnt->select_date_calendar, 4); gtk_widget_set_margin_bottom(msg->appGUI->cnt->select_date_calendar, 4); gtk_box_pack_start (GTK_BOX (vbox1), msg->appGUI->cnt->select_date_calendar, TRUE, TRUE, 0); @@ -437,8 +437,8 @@ (config.display_options & GUI_CALENDAR_WEEK_START_MONDAY)); hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); - gtk_widget_set_margin_start(hbox1, 4); - gtk_widget_set_margin_end(hbox1, 4); + gtk_widget_set_margin_left(hbox1, 4); + gtk_widget_set_margin_right(hbox1, 4); gtk_widget_set_margin_top(hbox1, 4); gtk_widget_set_margin_bottom(hbox1, 4); gtk_widget_show (hbox1); @@ -631,8 +631,8 @@ gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_valign(label, GTK_ALIGN_START); gtk_widget_set_halign(label, GTK_ALIGN_CENTER); - gtk_widget_set_margin_start (label, 5); - gtk_widget_set_margin_end (label, 5); + gtk_widget_set_margin_left (label, 5); + gtk_widget_set_margin_right (label, 5); pos++; @@ -639,8 +639,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", _("Group")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_start(label, 4); - gtk_widget_set_margin_end(label, 4); + gtk_widget_set_margin_left(label, 4); + gtk_widget_set_margin_right(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -663,8 +663,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[i*2])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_start(label, 4); - gtk_widget_set_margin_end(label, 4); + gtk_widget_set_margin_left(label, 4); + gtk_widget_set_margin_right(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -687,8 +687,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[COLUMN_BIRTH_DAY_DATE*2])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_start(label, 4); - gtk_widget_set_margin_end(label, 4); + gtk_widget_set_margin_left(label, 4); + gtk_widget_set_margin_right(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -715,8 +715,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[COLUMN_NAME_DAY_DATE*2])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_start(label, 4); - gtk_widget_set_margin_end(label, 4); + gtk_widget_set_margin_left(label, 4); + gtk_widget_set_margin_right(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -743,8 +743,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[COLUMN_PHOTO*2])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_start(label, 4); - gtk_widget_set_margin_end(label, 4); + gtk_widget_set_margin_left(label, 4); + gtk_widget_set_margin_right(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -782,8 +782,8 @@ gtk_grid_attach (GTK_GRID (table), label, 0, pos, 5, 1); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_halign(label, GTK_ALIGN_START); - gtk_widget_set_margin_start (label, 5); - gtk_widget_set_margin_end (label, 5); + gtk_widget_set_margin_left (label, 5); + gtk_widget_set_margin_right (label, 5); pos++; @@ -792,8 +792,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(contact_replace_tags[i-COLUMN_HOME_ADDRESS])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_start(label, 4); - gtk_widget_set_margin_end(label, 4); + gtk_widget_set_margin_left(label, 4); + gtk_widget_set_margin_right(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -817,8 +817,8 @@ gtk_grid_attach (GTK_GRID (table), label, 0, pos, 5, 1); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_halign(label, GTK_ALIGN_START); - gtk_widget_set_margin_start (label, 5); - gtk_widget_set_margin_end (label, 5); + gtk_widget_set_margin_left (label, 5); + gtk_widget_set_margin_right (label, 5); pos++; @@ -831,8 +831,8 @@ } label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_start(label, 4); - gtk_widget_set_margin_end(label, 4); + gtk_widget_set_margin_left(label, 4); + gtk_widget_set_margin_right(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -856,8 +856,8 @@ gtk_grid_attach (GTK_GRID (table), label, 0, pos, 5, 1); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_halign(label, GTK_ALIGN_START); - gtk_widget_set_margin_start (label, 5); - gtk_widget_set_margin_end (label, 5); + gtk_widget_set_margin_left (label, 5); + gtk_widget_set_margin_right (label, 5); pos++; @@ -865,8 +865,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[i*2])); label = gtk_label_new (tmpbuf); - gtk_widget_set_margin_start(label, 4); - gtk_widget_set_margin_end(label, 4); + gtk_widget_set_margin_left(label, 4); + gtk_widget_set_margin_right(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -913,8 +913,8 @@ gtk_grid_attach (GTK_GRID (table), label, 0, pos, 5, 1); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_halign(label, GTK_ALIGN_START); - gtk_widget_set_margin_start (label, 5); - gtk_widget_set_margin_end (label, 5); + gtk_widget_set_margin_left (label, 5); + gtk_widget_set_margin_right (label, 5); pos++; @@ -923,8 +923,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[i*2])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_start(label, 4); - gtk_widget_set_margin_end(label, 4); + gtk_widget_set_margin_left(label, 4); + gtk_widget_set_margin_right(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -983,8 +983,8 @@ gtk_grid_attach (GTK_GRID (table), label, 0, pos, 5, 1); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_halign(label, GTK_ALIGN_START); - gtk_widget_set_margin_start (label, 5); - gtk_widget_set_margin_end (label, 5); + gtk_widget_set_margin_left (label, 5); + gtk_widget_set_margin_right (label, 5); pos++; Modified: trunk/src/gui.c =================================================================== --- trunk/src/gui.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/gui.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -1326,7 +1326,7 @@ GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); GtkWidget *label = gtk_label_new(text); - gtk_widget_set_margin_start(label, 6); + gtk_widget_set_margin_left(label, 6); gtk_widget_set_halign(label, GTK_ALIGN_START); gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0); gtk_box_pack_end(GTK_BOX(box), label, TRUE, TRUE, 0); Modified: trunk/src/notes.c =================================================================== --- trunk/src/notes.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/notes.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -1445,8 +1445,8 @@ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox2); gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_selector), vbox2, TRUE, TRUE, 0); - gtk_widget_set_margin_start(GTK_WIDGET(vbox2), 8); - gtk_widget_set_margin_end(GTK_WIDGET(vbox2), 8); + gtk_widget_set_margin_left(GTK_WIDGET(vbox2), 8); + gtk_widget_set_margin_right(GTK_WIDGET(vbox2), 8); gtk_widget_set_margin_bottom(GTK_WIDGET(vbox2), 8); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); @@ -1760,8 +1760,8 @@ vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox3); gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_editor), vbox3, TRUE, TRUE, 0); - gtk_widget_set_margin_start(GTK_WIDGET(vbox3), 8); - gtk_widget_set_margin_end(GTK_WIDGET(vbox3), 8); + gtk_widget_set_margin_left(GTK_WIDGET(vbox3), 8); + gtk_widget_set_margin_right(GTK_WIDGET(vbox3), 8); gtk_widget_set_margin_bottom(GTK_WIDGET(vbox3), 8); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); Modified: trunk/src/notes_items.c =================================================================== --- trunk/src/notes_items.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/notes_items.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -225,8 +225,8 @@ appGUI->nte->note_name_entry = gtk_entry_new (); gtk_container_add (GTK_CONTAINER (frame), appGUI->nte->note_name_entry); - gtk_widget_set_margin_start(appGUI->nte->note_name_entry, 16); - gtk_widget_set_margin_end(appGUI->nte->note_name_entry, 4); + gtk_widget_set_margin_left(appGUI->nte->note_name_entry, 16); + gtk_widget_set_margin_right(appGUI->nte->note_name_entry, 4); gtk_widget_set_margin_top(appGUI->nte->note_name_entry, 4); gtk_widget_set_margin_bottom(appGUI->nte->note_name_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (appGUI->nte->note_name_entry), 8226); @@ -244,8 +244,8 @@ appGUI->nte->category_combobox = gtk_combo_box_text_new (); gtk_container_add (GTK_CONTAINER (frame), appGUI->nte->category_combobox); - gtk_widget_set_margin_start(appGUI->nte->category_combobox, 16); - gtk_widget_set_margin_end(appGUI->nte->category_combobox, 4); + gtk_widget_set_margin_left(appGUI->nte->category_combobox, 16); + gtk_widget_set_margin_right(appGUI->nte->category_combobox, 4); gtk_widget_set_margin_top(appGUI->nte->category_combobox, 4); gtk_widget_set_margin_bottom(appGUI->nte->category_combobox, 4); gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (appGUI->nte->category_combobox), NULL, _("None")); @@ -262,8 +262,8 @@ appGUI->nte->remember_cursor_checkbutton = gtk_check_button_new_with_mnemonic (_("Remember cursor position")); gtk_container_add (GTK_CONTAINER (frame), appGUI->nte->remember_cursor_checkbutton); gtk_widget_set_can_focus (appGUI->nte->remember_cursor_checkbutton, FALSE); - gtk_widget_set_margin_start(appGUI->nte->remember_cursor_checkbutton, 16); - gtk_widget_set_margin_end(appGUI->nte->remember_cursor_checkbutton, 4); + gtk_widget_set_margin_left(appGUI->nte->remember_cursor_checkbutton, 16); + gtk_widget_set_margin_right(appGUI->nte->remember_cursor_checkbutton, 4); gtk_widget_set_margin_top(appGUI->nte->remember_cursor_checkbutton, 4); gtk_widget_set_margin_bottom(appGUI->nte->remember_cursor_checkbutton, 4); @@ -618,8 +618,8 @@ appGUI->nte->note_name_entry = gtk_entry_new (); gtk_widget_show (appGUI->nte->note_name_entry); gtk_container_add (GTK_CONTAINER (frame), appGUI->nte->note_name_entry); - gtk_widget_set_margin_start(appGUI->nte->note_name_entry, 16); - gtk_widget_set_margin_end(appGUI->nte->note_name_entry, 4); + gtk_widget_set_margin_left(appGUI->nte->note_name_entry, 16); + gtk_widget_set_margin_right(appGUI->nte->note_name_entry, 4); gtk_widget_set_margin_top(appGUI->nte->note_name_entry, 4); gtk_widget_set_margin_bottom(appGUI->nte->note_name_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (appGUI->nte->note_name_entry), 8226); @@ -640,8 +640,8 @@ appGUI->nte->category_combobox = gtk_combo_box_text_new (); gtk_widget_show (appGUI->nte->category_combobox); gtk_container_add (GTK_CONTAINER (frame), appGUI->nte->category_combobox); - gtk_widget_set_margin_start(appGUI->nte->category_combobox, 16); - gtk_widget_set_margin_end(appGUI->nte->category_combobox, 4); + gtk_widget_set_margin_left(appGUI->nte->category_combobox, 16); + gtk_widget_set_margin_right(appGUI->nte->category_combobox, 4); gtk_widget_set_margin_top(appGUI->nte->category_combobox, 4); gtk_widget_set_margin_bottom(appGUI->nte->category_combobox, 4); gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (appGUI->nte->category_combobox), NULL, _("None")); @@ -673,8 +673,8 @@ hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_show (hbox1); gtk_container_add (GTK_CONTAINER (frame), hbox1); - gtk_widget_set_margin_start(hbox1, 16); - gtk_widget_set_margin_end(hbox1, 4); + gtk_widget_set_margin_left(hbox1, 16); + gtk_widget_set_margin_right(hbox1, 4); gtk_widget_set_margin_top(hbox1, 4); gtk_widget_set_margin_bottom(hbox1, 4); @@ -708,8 +708,8 @@ appGUI->nte->password_entry = gtk_entry_new (); gtk_widget_show (appGUI->nte->password_entry); gtk_container_add (GTK_CONTAINER (frame), appGUI->nte->password_entry); - gtk_widget_set_margin_start(appGUI->nte->password_entry, 16); - gtk_widget_set_margin_end(appGUI->nte->password_entry, 4); + gtk_widget_set_margin_left(appGUI->nte->password_entry, 16); + gtk_widget_set_margin_right(appGUI->nte->password_entry, 4); gtk_widget_set_margin_top(appGUI->nte->password_entry, 4); gtk_widget_set_margin_bottom(appGUI->nte->password_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (appGUI->nte->password_entry), 8226); @@ -732,8 +732,8 @@ appGUI->nte->spassword_entry = gtk_entry_new (); gtk_widget_show (appGUI->nte->spassword_entry); gtk_container_add (GTK_CONTAINER (frame), appGUI->nte->spassword_entry); - gtk_widget_set_margin_start(appGUI->nte->spassword_entry, 16); - gtk_widget_set_margin_end(appGUI->nte->spassword_entry, 4); + gtk_widget_set_margin_left(appGUI->nte->spassword_entry, 16); + gtk_widget_set_margin_right(appGUI->nte->spassword_entry, 4); gtk_widget_set_margin_top(appGUI->nte->spassword_entry, 4); gtk_widget_set_margin_bottom(appGUI->nte->spassword_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (appGUI->nte->spassword_entry), 8226); @@ -761,8 +761,8 @@ gtk_widget_set_can_focus(appGUI->nte->remember_cursor_checkbutton, FALSE); gtk_widget_show (appGUI->nte->remember_cursor_checkbutton); gtk_container_add (GTK_CONTAINER (frame), appGUI->nte->remember_cursor_checkbutton); - gtk_widget_set_margin_start(appGUI->nte->remember_cursor_checkbutton, 16); - gtk_widget_set_margin_end(appGUI->nte->remember_cursor_checkbutton, 4); + gtk_widget_set_margin_left(appGUI->nte->remember_cursor_checkbutton, 16); + gtk_widget_set_margin_right(appGUI->nte->remember_cursor_checkbutton, 4); gtk_widget_set_margin_top(appGUI->nte->remember_cursor_checkbutton, 4); gtk_widget_set_margin_bottom(appGUI->nte->remember_cursor_checkbutton, 4); @@ -998,8 +998,8 @@ appGUI->nte->password_entry = gtk_entry_new (); gtk_widget_show (appGUI->nte->password_entry); gtk_container_add (GTK_CONTAINER (frame), appGUI->nte->password_entry); - gtk_widget_set_margin_start(appGUI->nte->password_entry, 16); - gtk_widget_set_margin_end(appGUI->nte->password_entry, 4); + gtk_widget_set_margin_left(appGUI->nte->password_entry, 16); + gtk_widget_set_margin_right(appGUI->nte->password_entry, 4); gtk_widget_set_margin_top(appGUI->nte->password_entry, 4); gtk_widget_set_margin_bottom(appGUI->nte->password_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (appGUI->nte->password_entry), 8226); Modified: trunk/src/options_prefs.c =================================================================== --- trunk/src/options_prefs.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/options_prefs.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -113,7 +113,7 @@ config.hide_contacts = FALSE; config.hide_notes = FALSE; config.override_locale_settings = FALSE; - config.gui_layout = 0; /* 0 - vertical, 1 - horizontal */ + config.gui_layout = 1; /* 0 - vertical, 1 - horizontal */ config.sound_alarm_repeat = 1; g_strlcpy (config.link_color, "blue", MAXCOLORNAME); g_strlcpy (config.spell_lang, g_getenv("LANG"), MAXNAME); Modified: trunk/src/tasks.c =================================================================== --- trunk/src/tasks.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/tasks.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -1301,8 +1301,8 @@ vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1); gtk_widget_show (vbox3); gtk_container_add (GTK_CONTAINER (top_viewport), vbox3); - gtk_widget_set_margin_start (vbox3, 8); - gtk_widget_set_margin_end (vbox3, 8); + gtk_widget_set_margin_left (vbox3, 8); + gtk_widget_set_margin_right (vbox3, 8); gtk_widget_set_margin_bottom (vbox3, 8); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); @@ -1761,17 +1761,17 @@ gtk_tree_view_set_enable_search (GTK_TREE_VIEW (appGUI->tsk->tasks_list), FALSE); /* configure sorting */ - for (i = 0; i < MAX_VISIBLE_TASK_COLUMNS; i++) { - gtk_tree_view_column_set_sort_column_id (appGUI->tsk->tasks_columns[ta_columns[i]], ta_columns[i]); - gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (appGUI->tsk->tasks_sort), ta_columns[i], - tasks_column_sort_function, GINT_TO_POINTER(ta_columns[i]), NULL); - } + for (i = 0; i < MAX_VISIBLE_TASK_COLUMNS; i++) { + gtk_tree_view_column_set_sort_column_id (appGUI->tsk->tasks_columns[ta_columns[i]], ta_columns[i]); + gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (appGUI->tsk->tasks_sort), ta_columns[i], + tasks_column_sort_function, GINT_TO_POINTER(ta_columns[i]), NULL); + } - /* restore sorting */ - gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE (appGUI->tsk->tasks_sort), - config.tasks_sorting_column, config.tasks_sorting_order); + /* restore sorting */ + gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE (appGUI->tsk->tasks_sort), + config.tasks_sorting_column, config.tasks_sorting_order); - g_signal_connect (appGUI->tsk->tasks_sort, "sort-column-changed", G_CALLBACK (tasks_sort_column_changed_cb), appGUI); + g_signal_connect (appGUI->tsk->tasks_sort, "sort-column-changed", G_CALLBACK (tasks_sort_column_changed_cb), appGUI); /*----------------------------------------------------------------------------*/ @@ -1792,8 +1792,8 @@ frame = gtk_frame_new (NULL); gtk_widget_show (frame); gtk_box_pack_start (GTK_BOX (vbox2), frame, TRUE, TRUE, 0); - gtk_widget_set_margin_start(GTK_WIDGET(frame), 8); - gtk_widget_set_margin_end(GTK_WIDGET(frame), 8); + gtk_widget_set_margin_left(GTK_WIDGET(frame), 8); + gtk_widget_set_margin_right(GTK_WIDGET(frame), 8); gtk_widget_set_margin_bottom(GTK_WIDGET(frame), 8); gtk_frame_set_label_align (GTK_FRAME (frame), 0.98, 0.5); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); Modified: trunk/src/tasks_items.c =================================================================== --- trunk/src/tasks_items.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/tasks_items.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -368,8 +368,8 @@ (config.display_options & GUI_CALENDAR_WEEK_START_MONDAY)); gtk_widget_set_valign(appGUI->tsk->td_calendar, GTK_ALIGN_FILL); gtk_widget_set_halign(appGUI->tsk->td_calendar, GTK_ALIGN_FILL); - gtk_widget_set_margin_start(appGUI->tsk->td_calendar, 4); - gtk_widget_set_margin_end(appGUI->tsk->td_calendar, 4); + gtk_widget_set_margin_left(appGUI->tsk->td_calendar, 4); + gtk_widget_set_margin_right(appGUI->tsk->td_calendar, 4); gtk_widget_set_margin_top(appGUI->tsk->td_calendar, 4); gtk_widget_set_margin_bottom(appGUI->tsk->td_calendar, 4); gtk_box_pack_start (GTK_BOX (vbox1), appGUI->tsk->td_calendar, TRUE, TRUE, 0); @@ -711,7 +711,7 @@ gtk_widget_set_sensitive(appGUI->tsk->checkb_sound_enable, FALSE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(appGUI->tsk->checkb_sound_enable), TRUE); gtk_widget_set_halign(appGUI->tsk->checkb_sound_enable, GTK_ALIGN_START); - gtk_widget_set_margin_start(appGUI->tsk->checkb_sound_enable, 6); + gtk_widget_set_margin_left(appGUI->tsk->checkb_sound_enable, 6); gtk_grid_attach(GTK_GRID(grid), appGUI->tsk->checkb_sound_enable, 0, 6, 2, 1); appGUI->tsk->checkb_ndialog_enable = gtk_check_button_new_with_mnemonic(_("Enable notification dialog")); @@ -1001,7 +1001,7 @@ gtk_frame_set_label_widget(GTK_FRAME(frame), label); appGUI->tsk->ignore_alarm_checkbutton = gtk_check_button_new_with_mnemonic(_("Ignore alarm when task expired offline")); - gtk_widget_set_margin_start(appGUI->tsk->ignore_alarm_checkbutton, 6); + gtk_widget_set_margin_left(appGUI->tsk->ignore_alarm_checkbutton, 6); gtk_container_add(GTK_CONTAINER(frame), appGUI->tsk->ignore_alarm_checkbutton); return frame; @@ -1115,8 +1115,8 @@ /* First Tab */ basic_tab = create_basic_tab(appGUI); - gtk_widget_set_margin_start(basic_tab, 6); - gtk_widget_set_margin_end(basic_tab, 6); + gtk_widget_set_margin_left(basic_tab, 6); + gtk_widget_set_margin_right(basic_tab, 6); gtk_widget_set_margin_top(basic_tab, 6); gtk_widget_set_margin_bottom(basic_tab, 6); label = gtk_label_new (_("Basic")); @@ -1126,8 +1126,8 @@ /* Second Tab */ advanced_tab = create_advanced_tab(appGUI); - gtk_widget_set_margin_start(advanced_tab, 6); - gtk_widget_set_margin_end(advanced_tab, 6); + gtk_widget_set_margin_left(advanced_tab, 6); + gtk_widget_set_margin_right(advanced_tab, 6); gtk_widget_set_margin_top(advanced_tab, 6); gtk_widget_set_margin_bottom(advanced_tab, 6); label = gtk_label_new (_("Advanced")); @@ -1139,8 +1139,8 @@ tasks_related_set_state (FALSE, FALSE, appGUI); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_widget_set_margin_start(hseparator, 6); - gtk_widget_set_margin_end(hseparator, 6); + gtk_widget_set_margin_left(hseparator, 6); + gtk_widget_set_margin_right(hseparator, 6); gtk_widget_show (hseparator); gtk_box_pack_start (GTK_BOX (vbox0), hseparator, FALSE, FALSE, 0); Modified: trunk/src/utils_gui.c =================================================================== --- trunk/src/utils_gui.c 2017-03-06 21:06:51 UTC (rev 1115) +++ trunk/src/utils_gui.c 2017-03-11 13:41:43 UTC (rev 1116) @@ -74,8 +74,8 @@ gtk_frame_set_label_widget(GTK_FRAME(frame), label); gtk_container_add(GTK_CONTAINER(frame), widget); - gtk_widget_set_margin_start(widget, ALIGNMENT_PADDING_LEFT); - gtk_widget_set_margin_end(widget, ALIGNMENT_PADDING_RIGHT); + gtk_widget_set_margin_left(widget, ALIGNMENT_PADDING_LEFT); + gtk_widget_set_margin_right(widget, ALIGNMENT_PADDING_RIGHT); gtk_widget_set_margin_top(widget, ALIGNMENT_PADDING_TOP); gtk_widget_set_margin_bottom(widget, ALIGNMENT_PADDING_BOTTOM); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2017-03-06 21:06:55
|
Revision: 1115 http://sourceforge.net/p/osmo-pim/code/1115 Author: pasp Date: 2017-03-06 21:06:51 +0000 (Mon, 06 Mar 2017) Log Message: ----------- * Update strings Modified Paths: -------------- trunk/ChangeLog trunk/po/bg.po trunk/po/ca.po trunk/po/cs.po trunk/po/da.po trunk/po/de.po trunk/po/el.po trunk/po/en_GB.po trunk/po/es.po trunk/po/fi.po trunk/po/fr.po trunk/po/gl.po trunk/po/gl_ES.po trunk/po/he.po trunk/po/hu.po trunk/po/it.po trunk/po/ja.po trunk/po/lt.po trunk/po/nl.po trunk/po/osmo.pot trunk/po/pl.po trunk/po/pt.po trunk/po/pt_BR.po trunk/po/ro.po trunk/po/ru.po trunk/po/sr.po trunk/po/sv.po trunk/po/te.po trunk/po/tr.po trunk/po/uk.po trunk/po/ur.po trunk/po/ur_PK.po trunk/po/zh_CN.po Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2017-03-05 23:22:00 UTC (rev 1114) +++ trunk/ChangeLog 2017-03-06 21:06:51 UTC (rev 1115) @@ -1,4 +1,10 @@ -201x-xx-xx: version 0.x.xx +2017-xx-xx: version 0.4.0 + * Migrated to GTK+-3 and WebKit2Gtk + * Bug fixes (#105, #90, #108, #104) + * More customisable calendar colors + * Moon phase icon is now displayed + * Show hidden files in the file chooser dialogs (#143) + * Saved the Osmo state on SIGINT and SIGTERM * Updated translations: ru, uk 2015-08-08: version 0.2.14 Modified: trunk/po/bg.po =================================================================== --- trunk/po/bg.po 2017-03-05 23:22:00 UTC (rev 1114) +++ trunk/po/bg.po 2017-03-06 21:06:51 UTC (rev 1115) @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: Osmo 0.2.8\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-07-28 02:21+0200\n" +"POT-Creation-Date: 2017-03-06 22:05+0100\n" "PO-Revision-Date: 2010-02-23 19:11+0100\n" "Last-Translator: Borislav Totev <bt...@ho...>\n" "Language-Team: Bulgarian\n" @@ -16,810 +16,481 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -msgid "About" -msgstr "За" +msgid "Colors" +msgstr "Цветове" -msgid "Close" -msgstr "Затвори" +msgid "Color of contact tags" +msgstr "Цвят за тагове на контакти" -msgid "Ctrl+PageUp" -msgstr "Ctrl+PageUp" +msgid "Color of links" +msgstr "Цвят за връзки" -msgid "switch to previous tab" -msgstr "Превключи на предходният таб" +msgid "Font size" +msgstr "Размер на шрифта" -msgid "Ctrl+PageDn" -msgstr "Ctrl+PageDn" +msgid "Name font size" +msgstr "Размер на шрифта име" -msgid "switch to next tab" -msgstr "превключи на следващият таб" +msgid "Item font size" +msgstr "Позиция размера на шрифта" -msgid "switch to selected page" -msgstr "превключи на избраната страница" +msgid "Photo size" +msgstr "Размер на изображението" -msgid "show options window" -msgstr "покажи прозореца с опций" +msgid "Small" +msgstr "Малък" -msgid "show about window" -msgstr "show about window" +msgid "Medium" +msgstr "Среден" -msgid "toggle fullscreen mode" -msgstr "" +msgid "Large" +msgstr "Голям" -msgid "PageUp/PageDn" -msgstr "PageUp/PageDn" +msgid "Hide group column" +msgstr "Скриване колоната за група" -msgid "switch page in options and about tab" -msgstr "включи страницата с опций и за раздела" +msgid "Maps provider" +msgstr "" -msgid "exit" -msgstr "изход" +msgid "Age" +msgstr "Възраст" -msgid "Space" -msgstr "Интервал" +msgid "Birthday date" +msgstr "Роженна дата" -msgid "select current date" -msgstr "изберете текуща дата" +msgid "Zodiac sign" +msgstr "Зодия" -msgid "Ctrl+Space" -msgstr "Ctrl+Интервал" +msgid "Contacts" +msgstr "Контакти" -msgid "toggle personal data visibility" -msgstr "разрешаване видимост на личните данни" +msgid "Appearance" +msgstr "Външен вид" -msgid "Arrows" -msgstr "Стрелки" +msgid "Miscellaneous" +msgstr "Разни" -msgid "change day" -msgstr "промяна на деня" +msgid "Groups" +msgstr "Групи" -msgid "Ctrl+Up/Down" -msgstr "Ctrl+Up/Down" +msgid "Visible columns in birthday browser" +msgstr "Показване колони в браузъра за рожден ден" -msgid "scroll the contents in the day info panel" -msgstr "превъртане съдържанието на панела за дневна информация" +msgid "Algorithm" +msgstr "Алгоритъм" -msgid "change month" -msgstr "промяна на месеца" +msgid "Hashing" +msgstr "Hashing" -msgid "Home/End" -msgstr "Home/End" +msgid "Compression" +msgstr "Свиване" -msgid "change year" -msgstr "Промяна на годината" +msgid "Ratio" +msgstr "Пропорция" -msgid "toggle calendars for the previous and next month" -msgstr "превключване на календарите за предходният и следващ месец" +msgid "Fast" +msgstr "Бързо" -msgid "day notes browser" -msgstr "браузър дневни бележки" +msgid "Good" +msgstr "Добро" -msgid "assign background color to day note" -msgstr "присвояване цвят на фона за дневна бележка" +msgid "Best" +msgstr "Най-добро" -msgid "date calculator" -msgstr "калкулатор на дни" +msgid "Type" +msgstr "Тип" -msgid "show full-year calendar" -msgstr "покажи годишният календар" +msgid "Category" +msgstr "Категория" -msgid "jump to date" -msgstr "скочи на дата" +msgid "Last changes" +msgstr "Последни промени" -msgid "Delete" -msgstr "Изтриване" +msgid "Created" +msgstr "Създаване" -msgid "remove day note" -msgstr "премахване на дневна бележка" +msgid "Remember the last selected category" +msgstr "Запомняне на последната избрана категория" -msgid "Alt+Arrows" -msgstr "Alt+Стрелки" +msgid "Use system format for date and time" +msgstr "Използване на системният формат за дата и време" -msgid "Esc" -msgstr "Esc" - -msgid "close editor" -msgstr "затвори редактора" - -msgid "toggle bold" -msgstr "toggle bold" - -msgid "toggle italic" -msgstr "toggle italic" - -msgid "toggle underline" -msgstr "toggle underline" - -msgid "toggle strikethrough" -msgstr "toggle strikethrough" - -msgid "toggle highlight" -msgstr "toggle highlight" - -msgid "Arrows Up/Down" -msgstr "Стрелки Up/Down" - -msgid "toggle alternative view" -msgstr "превключи на алтернативен изглед" - -msgid "year info" -msgstr "годишна информация" - -msgid "set current year" -msgstr "насройване текуща година" - -msgid "close full-year calendar" -msgstr "затвори годишният календар" - -msgid "Alt+a, Insert" -msgstr "Alt+a, Insert" - -msgid "add task" -msgstr "добавяне на задача" - -msgid "Alt+e, Ctrl+Enter" -msgstr "Alt+e, Ctrl+Enter" - -msgid "edit task" -msgstr "редактиране на задача" - -msgid "Alt+r, Delete" -msgstr "Alt+r, Delete" - -msgid "remove task" -msgstr "премахване на задача" - -msgid "toggle hidden tasks" -msgstr "превключи на скрити задачи" - -msgid "activate search field" -msgstr "активиране полето за търсене" - -msgid "Left, Right" -msgstr "Ляво,Дясно" - -msgid "change category filter" -msgstr "промяна филтъра за категория" - -msgid "close task info panel" -msgstr "затваряне на инфо панела за задачи" - -msgid "Insert" -msgstr "Поставяне" - -msgid "add contact" -msgstr "добавяне на контакт" - -msgid "Ctrl+Enter" -msgstr "Ctrl+Enter" - -msgid "edit contact" -msgstr "Редактиране на контакт" - -msgid "remove contact" -msgstr "премахване на контакт" - -msgid "change search mode" -msgstr "промяна режим търсене" - -msgid "close contact details panel" -msgstr "затваряне панела за детайли на контакта" - -msgid "Enter" -msgstr "Въвеждане" - -msgid "open note" -msgstr "отваряне на бележка" - -msgid "add note" -msgstr "добавяне на бележка" - -msgid "remove note" -msgstr "премахване на бележка" - -msgid "edit note name and category" -msgstr "редактиране име и категория на бележка" - -msgid "close note editor" -msgstr "затваряне редактора на бележки" - -msgid "save note" -msgstr "запазване на бележка" - -msgid "find text" -msgstr "намери текст" - -msgid "clear selection attributes" -msgstr "изчистване избраните атрибути" - -msgid "" -"OSMO was designed keeping in mind the user convenience, so there are many " -"key shortcuts. Here is the full list:" -msgstr "" -"OSMO бе проектиран със цел удобството на потребителя,разполага със " -"функциябързи клавиши.Ето и пълният списък:" - -msgid "General" -msgstr "Главно" - -msgid "Calendar" -msgstr "Календар" - -msgid "Note editor" -msgstr "Редактор на бележки" - -msgid "Full-year calendar" -msgstr "Целогодишен календар" - -msgid "Tasks" -msgstr "Задачи" - -msgid "Contacts" -msgstr "Контакти" - msgid "Notes" msgstr "Бележки" -msgid "Selector" -msgstr "селектор" +msgid "Encryption" +msgstr "Шифроване" -msgid "Editor" -msgstr "Редактор" +msgid "Visible columns" +msgstr "Видими колони" -msgid "A handy personal organizer" -msgstr "Удобен личен органайзер" +msgid "Categories" +msgstr "Категорий" -msgid "compiled on" -msgstr "събран по" +msgid "Notes options" +msgstr "Опций за бележки" -msgid "Programming" -msgstr "Програмиране" +msgid "Jump to date" +msgstr "Скочи до дата" -msgid "Graphics" -msgstr "Графики" +msgid "Day" +msgstr "Ден" -msgid "Contributors" -msgstr "Сътрудници" +msgid "Month" +msgstr "Месец" -msgid "Translators" -msgstr "Преводачи" +msgid "Year" +msgstr "Година" -msgid "Mailing lists" -msgstr "Пощенски списъци" +#, fuzzy +msgid "_Cancel" +msgstr "Отказване" -msgid "Bug tracker" -msgstr "Проследяване на бъгове" +#, fuzzy +msgid "_Jump to" +msgstr "Скочи до" -msgid "Feature requests" -msgstr "Бъдещи запитвания" +msgid "Select a font..." +msgstr "Избиране на шрифт..." -msgid "Available modules" -msgstr "Налични модули" +msgid "None" +msgstr "Нищо" -msgid "Compiled-in features" -msgstr "Compiled-in features" +msgid "All items" +msgstr "Всички елементи" -msgid "iCalendar support" -msgstr "iCalendar подръжка" +msgid "Question" +msgstr "Въпрос" -msgid "Encrypted notes support" -msgstr "Подръжка на шифровани бележки" +msgid "Information" +msgstr "Информация" -msgid "Backup support" -msgstr "Бакъп подръжка" +msgid "Error" +msgstr "Грешка" -msgid "Printing support" -msgstr "Подръжка печат" +msgid "Warning" +msgstr "Внимание" -msgid "Spell checker support" -msgstr "Правописна подръжка" +msgid "Show hidden files" +msgstr "" -msgid "version" -msgstr "Версия" +#, fuzzy +msgid "_Save" +msgstr "Запазване" -msgid "SVN revision" -msgstr "SVN преразглеждане" +msgid "_Open" +msgstr "" -msgid "Key shortcuts" -msgstr "Бързи клавиши" +msgid "Selected file exist! Overwrite?" +msgstr "Избраният файл съществува.Замяна?" -msgid "License" -msgstr "Лиценз" +msgid "Selected contact will be removed." +msgstr "Избор на контакт който ще бъде премахнат" -msgid "Save backup" -msgstr "Запазване на бакъп" - -msgid "Password protection" -msgstr "Защита на парола" - -msgid "Enter password" -msgstr "Въвеждане на парола" - -msgid "Re-enter password" -msgstr "Повторете паролата" - -msgid "Please enter the password" -msgstr "Моля въведете парола" - -msgid "Passwords do not match!" -msgstr "Паролите не съвпадат" - -msgid "Cannot create backup!" -msgstr "Невъзможно създаване на бакъп!" - -msgid "Backup file saved successfully!" -msgstr "Бакъп файла е запазан успешно!" - -msgid "Open backup file" -msgstr "Отваряне на бакъп файл" - -msgid "Osmo backup files (*.bck)" -msgstr "Osmo бакъп файлове (*.bck)" - -msgid "This is not Osmo backup file" -msgstr "Това не е бакъп файл на Osmo" - -msgid "Incorrect password!" -msgstr "Неправилна парола" - -msgid "All your data will be replaced with backup file content." -msgstr "Всичките ваши данни ще бъдат заменени със съдържанието на бакъп файла." - msgid "Are you sure?" msgstr "Сигурен/а ли сте?" -msgid "Osmo has to be restarted now..." -msgstr "OSMO ще се рестартира сега..." +msgid "No date" +msgstr "Без дата" -msgid "was born" -msgstr "е роден" +msgid "Select photo" +msgstr "Избор на снимка" -msgid "year old" -msgid_plural "years old" -msgstr[0] "year old" -msgstr[1] "years old" +msgid "Address" +msgstr "Адреси" -msgid "Current time" -msgstr "Текущо време" +msgid "Postcode" +msgstr "Пощенски код" -msgid "Day number" -msgstr "Номер на деня" +msgid "City" +msgstr "Град" -msgid "day till end of year" -msgid_plural "days till end of year" -msgstr[0] "ден до края на годината" -msgstr[1] "дни до края на годината" +msgid "State" +msgstr "Област" -msgid "the last day of the year" -msgstr "Последният ден от годината" +msgid "Country" +msgstr "Държава" -msgid "Today distance" -msgstr "Today distance" +msgid "Edit contact" +msgstr "Редактиране на контакт" -msgid "Week number" -msgstr "номер на седмицата" +msgid "Add contact" +msgstr "Добавяне на контакт" -msgid "Marked days" -msgstr "Пазарни дни" +msgid "Personal" +msgstr "Личен" -msgid "Weekend days" -msgstr "Седмични дни" +msgid "Group" +msgstr "Група" -msgid "Moon phase" -msgstr "Луна фаза" +msgid "Home" +msgstr "Домашен" -msgid "Zodiac sign" -msgstr "Зодия" +msgid "Work" +msgstr "Месторабота" -msgid "Day notes" -msgstr "Дневна бележка" +msgid "Phones" +msgstr "Телефони" -msgid "Day tasks" -msgstr "дневни задачи" +msgid "Internet" +msgstr "Интернет" -msgid "Birthday" -msgstr "Рожден ден" +msgid "Additional info" +msgstr "Допълнителна информация" -msgid "Day category" -msgstr "Категория за деня" - -msgid "Selected day note will be removed." -msgstr "Избраната дневна бележка ще бъде премахната" - -msgid "Continue?" -msgstr "Продължение?" - -msgid "Previous year" -msgstr "Предходна година" - -msgid "Previous month" -msgstr "Предходен месец" - -msgid "Previous day" -msgstr "Предходен ден" - -msgid "Today" -msgstr "Днес" - -msgid "Next day" -msgstr "Следващ ден" - -msgid "Next month" -msgstr "Следващ месец" - -msgid "Next year" -msgstr "Следваща година" - -msgid "Jump to date" -msgstr "Скочи до дата" - -msgid "Print calendar" -msgstr "Отпечатване на календар" - -msgid "Date calculator" -msgstr "Премятане на период" - #, fuzzy -msgid "Backup data" -msgstr "Бакъп" - -#, fuzzy -msgid "Restore data" -msgstr "Възтановяване" - -msgid "Preferences" -msgstr "Предпочитания" - -msgid "Quit" -msgstr "Изход" - -msgid "Toggle day note panel" -msgstr "Превключване панел Дневни бележки" - -msgid "Add task" -msgstr "Добавяне на задача" - -msgid "Select day color" -msgstr "Избиране цвят за деня" - -msgid "Browse notes" -msgstr "Преглед на бележки" - -msgid "Browse iCal events" -msgstr "Преглед на iCal събития" - -msgid "Export to iCal file" -msgstr "Eкспортиране като iCal файл" - -msgid "Previous and next month" -msgstr "Предходен и следващ месец" - -msgid "Close note panel" -msgstr "Затваряне панела за бележки" - -msgid "Highlight" -msgstr "Маркиране" - -msgid "Strikethrough" -msgstr "Зачеркване" - -msgid "Underline" -msgstr "Подчертаване" - -msgid "Italic" -msgstr "Italic" - -msgid "Bold" -msgstr "Bold" - -msgid "Insert timeline" -msgstr "Insert timeline" - -msgid "Clear text" -msgstr "Изчистване на текст" - -msgid "Info" -msgstr "Информация" - -msgid "Select color" -msgstr "Избор на цвят" - -msgid "None" -msgstr "Нищо" - -msgid "Cancel" -msgstr "Отказване" - -msgid "OK" +msgid "_OK" msgstr "ОК" -msgid "year" -msgid_plural "years" -msgstr[0] "Година" -msgstr[1] "Години" +msgid "no entries" +msgstr "няма записи" -msgid "month" -msgid_plural "months" -msgstr[0] "Месец" -msgstr[1] "Месеци" +msgid "entry" +msgid_plural "entries" +msgstr[0] "запис" +msgstr[1] "записи" -msgid "day" -msgid_plural "days" -msgstr[0] "Ден" -msgstr[1] "Дни" +msgid "Calendar notes" +msgstr "Календарни бележки " -msgid "hour" -msgid_plural "hours" -msgstr[0] "час" -msgstr[1] "часове" +msgid "Search" +msgstr "Търсене" -msgid "minute" -msgid_plural "minutes" -msgstr[0] "минута" -msgstr[1] "минути" +msgid "Filter" +msgstr "Филтър" -msgid "second" -msgid_plural "seconds" -msgstr[0] "Секунда" -msgstr[1] "Секунди" +msgid "Current month" +msgstr "Текущ месец" -msgid "or" -msgstr "или" +msgid "Selected month" +msgstr "Избран месец" -msgid "rounded down" -msgstr "закръгляване надолу" +msgid "Current year" +msgstr "Текуща година" -msgid "week" -msgid_plural "weeks" -msgstr[0] "Седмица" -msgstr[1] "Седмици" +msgid "Selected year" +msgstr "Избрана година" -msgid "working day" -msgid_plural "working days" -msgstr[0] "Работен ден" -msgstr[1] "Работни дни" +msgid "Selected month and year" +msgstr "Избрани месец и година" -msgid "time is ignored" -msgstr "времето е игнорирано" +msgid "All notes" +msgstr "Всички бележки" -msgid "weekend day" -msgid_plural "weekend days" -msgstr[0] "седмичен ден" -msgstr[1] "седмични дни" +msgid "Case sensitive" +msgstr "Case sensitive" -msgid "This calculator only supports dates after year 1." -msgstr "Калкулаторът подържа само дати след година 1." +msgid "Strikethrough past day notes" +msgstr "Зачерване последните бележки за деня" -msgid "weekend day ignored" -msgid_plural "weekend days ignored" -msgstr[0] "уйкенд ден игнориран " -msgstr[1] "уйкенд дни игнорирани" +msgid "Date" +msgstr "Дата" -msgid "Year" -msgstr "Година" +msgid "Note" +msgstr "Бележка" -msgid "Month" -msgstr "Месец" +#, fuzzy +msgid "_Close" +msgstr "Затвори" -msgid "Day" -msgstr "Ден" +msgid "Rat" +msgstr "Плъх" -msgid "Current date" -msgstr "Текуща дата" +msgid "Ox" +msgstr "Бивол" -msgid "Set current date" -msgstr "Настройка на текуща дата" +msgid "Tiger" +msgstr "Тигър" -msgid "Hour" -msgstr "Час" +msgid "Hare" +msgstr "Заек" -msgid "Minute" -msgstr "Минута" +msgid "Dragon" +msgstr "Дракон" -msgid "Second" -msgstr "Секунда" +msgid "Snake" +msgstr "Змия" -msgid "Set current time" -msgstr "Настройка на текущо време" +msgid "Horse" +msgstr "Кон" -msgid "Reset time" -msgstr "Нулиране " +msgid "Sheep" +msgstr "Овца" -msgid "First date and time" -msgstr "Първи дата и време" +msgid "Monkey" +msgstr "Маймуна" -msgid "Second date and time" -msgstr "Втори дата и време" +msgid "Fowl" +msgstr "Петел" -msgid "Alternative time units" -msgstr "Алтернативни времеви единици" +msgid "Dog" +msgstr "Куче" -msgid "Result" -msgstr "Резултат" +msgid "Pig" +msgstr "Свиня" -msgid "Duration between two dates" -msgstr "Период между две дати" +msgid "Unknown" +msgstr "Непознат" -msgid "Operation" -msgstr "Операция" +msgid "Aquarius" +msgstr "Водолей" -msgid "add" -msgstr "добавяне" +msgid "Pisces" +msgstr "Риби" -msgid "subtract" -msgstr "изваждане" +msgid "Aries" +msgstr "Овен" -msgid "Date and time to add or subtract from" -msgstr "Дата и време за добавяне или изваждане от" +msgid "Taurus" +msgstr "Бик" -msgid "Years" -msgstr "Години" +msgid "Gemini" +msgstr "Близнаци" -msgid "Months" -msgstr "Месеци" +msgid "Cancer" +msgstr "Рак" -msgid "Days" -msgstr "Дни" +msgid "Leo" +msgstr "Лъв" -msgid "Weeks" -msgstr "Седмици" +msgid "Virgo" +msgstr "Дева" -msgid "Hours" -msgstr "Часове" +msgid "Libra" +msgstr "Везни" -msgid "Minutes" -msgstr "Минути" +msgid "Scorpio" +msgstr "Скорпион" -msgid "Seconds" -msgstr "Секунди" +msgid "Sagittarius" +msgstr "Стрелец" -msgid "Ignore weekend days" -msgstr "Игнориране на уйкендите" +msgid "Capricorn" +msgstr "Козирог" -msgid "Reset fields" -msgstr "Нулиране на полета" +msgid "Osmo has to be restarted to take effect." +msgstr "OSMO трябва да се рестартира за да се приложат промените " -msgid "Time to add or subtract" -msgstr "Време за добавяне или изваждане" +msgid "Layout" +msgstr "Разпределение" -msgid "Jump to" -msgstr "Скочи до" +msgid "Vertical" +msgstr "Вертикално" -msgid "Add to or subtract from a date" -msgstr "Добавяне към или изваждане от дата" +msgid "Horizontal" +msgstr "Хоризонтално" -msgid "Leap year" -msgstr "Високосна година" +msgid "Tabs position" +msgstr "Позиция за табовете" -msgid "Yes" -msgstr "Да" +msgid "Left" +msgstr "Ляво" -msgid "No" -msgstr "Не" +msgid "Right" +msgstr "Дясно" -msgid "Chinese year animal" -msgstr "Китайска година" +msgid "Top" +msgstr "Горе" -msgid "Number of days" -msgstr "Брой дни" +msgid "Bottom" +msgstr "Доло" -msgid "Number of weeks" -msgstr "Брой седмици" +msgid "Disable underline in links" +msgstr "Изключване подчертаване във връзки" -msgid "Number of weekend days" -msgstr "Брой на уйкенд дни" +msgid "Show exit button in toolbar" +msgstr "" -msgid "Year info" -msgstr "Годишна информация" +msgid "At least one module must be visible." +msgstr "Най-малко един модул трябва д асе вижда." -msgid "Current year" -msgstr "Текуща година" +msgid "Calendar" +msgstr "Календар" -msgid "Alternative view" -msgstr "Алтернативен изглед" +msgid "Tasks" +msgstr "Задачи" -msgid "event" -msgid_plural "events" -msgstr[0] "събитие" -msgstr[1] "събития" +msgid "Override locale settings" +msgstr "Замяна на локалните настройки" -msgid "No valid calendars defined" -msgstr "Няма валидни определени календари" +msgid "Date format" +msgstr "Формат за дата" -msgid "iCalendar events" -msgstr "iCalendar събития" +msgid "DD-MM-YYYY" +msgstr "ДД-ММ-ГГГГ" -msgid "Date" -msgstr "Дата" +msgid "MM-DD-YYYY" +msgstr "ММ-ДД-ГГГГ" -msgid "Time" -msgstr "Време" +msgid "YYYY-MM-DD" +msgstr "ГГГГ-ММ-ДД" -msgid "Summary" -msgstr "Резюме" +msgid "YYYY-DD-MM" +msgstr "ГГГГ-ДД-ММ" -msgid "Select output file" -msgstr "Избор изходящ файл" +msgid "Time format" +msgstr "Формат за време" -msgid "The list will be cleared and all entries will be lost." -msgstr "Списъкът ще бъде изчистен и всички записи ще бъдат загубени." +msgid "hours" +msgstr "часове" -msgid "Done!" -msgstr "Направен !" +msgid "Spell checker language" +msgstr "Проверка за правопис " -msgid "event exported" -msgid_plural "events exported" -msgstr[0] "изнесено събитие" -msgstr[1] "изнесени събития" +msgid "Enable tooltips" +msgstr "Разрешаване на съвети" -msgid "iCalendar export" -msgstr "iCalendar export" +msgid "Remember last selected page" +msgstr "Запомняне на последната избрана страница" -msgid "Day Selector" -msgstr "Day Selector" +msgid "Save data after every modification" +msgstr "Запазване на даните след всяка модификация" -msgid "Use date period" -msgstr "Използване на период " +msgid "Web browser" +msgstr "Web browser" -msgid "Add" -msgstr "Добавяне" +msgid "E-mail client" +msgstr "E-mail client" -msgid "Clear" -msgstr "Изчистване" +msgid "Sound player" +msgstr "Sound player" -msgid "Remove" -msgstr "Премахване" +#, c-format +msgid "The %s pattern will be replaced with web address" +msgstr "Схемите %s ще бъдат заменени с уеб адрес" -msgid "Output filename" -msgstr "Изходящо файлово име" +#, c-format +msgid "The %s pattern will be replaced with e-mail address" +msgstr "Схемите %s ще бъдат заменени със имейл адрес" -msgid "Browse" -msgstr "Преглед" +#, c-format +msgid "The %s pattern will be replaced with sound filename" +msgstr "The %s pattern will be replaced with sound filename" -msgid "Export" -msgstr "Експорт" +msgid "Enable system tray" +msgstr "Разрешаване на системна област" -msgid "no entries" -msgstr "няма записи" +msgid "Start minimised" +msgstr "Стартиране минимализирано" -msgid "entry" -msgid_plural "entries" -msgstr[0] "запис" -msgstr[1] "записи" +msgid "Ignore day note events" +msgstr "Игнориране на събитие от дневна бележка" -msgid "Calendar notes" -msgstr "Календарни бележки " +msgid "General" +msgstr "Главно" -msgid "Search" -msgstr "Търсене" +msgid "Hide" +msgstr "Скриване" -msgid "Filter" -msgstr "Филтър" +msgid "Helpers" +msgstr "Помощници" -msgid "Current month" -msgstr "Текущ месец" +msgid "System tray" +msgstr "System tray" -msgid "Selected month" -msgstr "Избран месец" +msgid "Preferences" +msgstr "Предпочитания" -msgid "Selected year" -msgstr "Избрана година" - -msgid "Selected month and year" -msgstr "Избрани месец и година" - -msgid "All notes" -msgstr "Всички бележки" - -msgid "Case sensitive" -msgstr "Case sensitive" - -msgid "Strikethrough past day notes" -msgstr "Зачерване последните бележки за деня" - -msgid "Note" -msgstr "Бележка" - msgid "Syntax" msgstr "Синтаксис" @@ -844,6 +515,11 @@ msgid "day of the month without leading zeros" msgstr "ден от месеца без нула отпред" +msgid "month" +msgid_plural "months" +msgstr[0] "Месец" +msgstr[1] "Месеци" + msgid "year without century" msgstr "година без указване на век" @@ -883,15 +559,28 @@ msgid "Free-hand circle" msgstr "Свободен кръг" -msgid "Colors" -msgstr "Цветове" +msgid "Background color" +msgstr "" -msgid "Header color" +#, fuzzy +msgid "Header background color" msgstr "Главен цвят" +#, fuzzy +msgid "Header foreground color" +msgstr "Главен цвят" + msgid "Weekend days color" msgstr "Цвят на седмичен ден" +#, fuzzy +msgid "Day color" +msgstr "Главен цвят" + +#, fuzzy +msgid "Previous/Next month's day color" +msgstr "Предходен и следващ месец" + msgid "Cursor color" msgstr "Курсор цвят" @@ -991,13 +680,37 @@ msgid "Enable spell checker in day notes" msgstr "Разрешаване проврка на правописа в дневни бележки" +msgid "Current time" +msgstr "Текущо време" + #, fuzzy msgid "Show seconds" msgstr "Секунди" -msgid "Appearance" -msgstr "Външен вид" +msgid "Day number" +msgstr "Номер на деня" +msgid "Today distance" +msgstr "Today distance" + +msgid "Marked days" +msgstr "Пазарни дни" + +msgid "Week number" +msgstr "номер на седмицата" + +msgid "Weekend days" +msgstr "Седмични дни" + +msgid "Day category" +msgstr "Категория за деня" + +msgid "Moon phase" +msgstr "Луна фаза" + +msgid "Day notes" +msgstr "Дневна бележка" + msgid "Day categories" msgstr "Дневна категория" @@ -1007,51 +720,250 @@ msgid "Show in day info panel" msgstr "Показване в инфо панела на деня" -msgid "Name day" -msgstr "Имена деня" +msgid "Tasks list" +msgstr "Листа със задачи" +# е съкращение на думата "номер" +#. TRANSLATORS: "No." is an abbreviation of word "number" +msgid "No." +msgstr "No." + +msgid "Summary" +msgstr "Резюме" + +msgid "Due date" +msgstr "Краен срок" + +msgid "Priority" +msgstr "Приоритет" + msgid "Error printing" msgstr "Грешка при печатане" -msgid "Printing properties" -msgstr "Свойства за печат" +msgid "No birthdays defined" +msgstr "Няма дефинирани рожденни дни" -msgid "Month name" -msgstr "Име на месеца" +msgid "Birthdays list" +msgstr "Листа с рождени дни" -msgid "Day name" -msgstr "Име на деня" +msgid "Days to birthday" +msgstr "Days to birthday" -msgid "Events" -msgstr "Събития" +msgid "today" +msgstr "Днес" -msgid "Fonts" -msgstr "Шрифтове" +msgid "Select CSV file" +msgstr "Избиране на CSV файл" -msgid "Birthdays" -msgstr "Рождени дни" +msgid "CSV (comma-separated values) files (*.csv)" +msgstr "CSV (comma-separated values) files (*.csv)" -msgid "Namedays" -msgstr "Дневни имена" +msgid "Please select file first." +msgstr "Моля изберете файл първо." -msgid "Visible events" -msgstr "Видими събития" +msgid "Import contacts" +msgstr "Внеси цонтакти" -msgid "Padding" -msgstr "Вложка" +msgid "Import type" +msgstr "Входящ тип" -msgid "Event maximum length" -msgstr "Максимална дължина на събитие" +msgid "File" +msgstr "Файл" -msgid "Page orientation:" -msgstr "Орентация на страница:" +msgid "Input filename" +msgstr "Входящо име на файл" -msgid "Portrait" -msgstr "Портрет" +msgid "Import" +msgstr "Внасяне" -msgid "Landscape" -msgstr "Пейзаж" +msgid "Nothing to import." +msgstr "Нищо за внасяне" +msgid "contact added" +msgid_plural "contacts added" +msgstr[0] "добавен контакт" +msgstr[1] "добавени контакти" + +msgid "of" +msgstr "на" + +msgid "Record" +msgstr "Запис" + +msgid "Number fields per record" +msgstr "Брой полета за запис" + +msgid "Use first record as header" +msgstr "Използвай първият запис за главен" + +msgid "Field type" +msgstr "Тип поле" + +msgid "Value" +msgstr "Стойност" + +msgid "No records found in selected file." +msgstr "Няма намерен запис във избраният файл" + +msgid "Cannot read file." +msgstr "файлът не може да се прочете" + +msgid "Cannot open file." +msgstr "Файлът не може да се отвори" + +#, fuzzy +msgid "Counter" +msgstr "Държава" + +msgid "Show calendar" +msgstr "Показване календар" + +msgid "Show tasks" +msgstr "Показвана задачи" + +msgid "Show contacts" +msgstr "Показване на контакти" + +msgid "Show notes" +msgstr "Показване на бележки" + +msgid "Show options" +msgstr "Показване на опций" + +msgid "Quit" +msgstr "Изход" + +msgid "Show small calendar window" +msgstr "Показване календара в малък прозорец" + +msgid "Check for events since last run" +msgstr "Проверка за събития от последното изпълнение" + +msgid "Number of days to check forward for events (default: 0)" +msgstr "Брой на дните за проверка на събития напред (default: 0)" + +msgid "Set absolute path for settings and data files" +msgstr "Настройка на абсолютният път за настройки и файлове с данни" + +msgid "Match contacts with given string" +msgstr "" + +msgid "handy personal organizer" +msgstr "удобен личен органайзър" + +msgid "ERROR: Cannot create config files" +msgstr "ГРЕШКА:Не могат да се създадат конфигурациони файлове" + +msgid "Another copy of OSMO is already running." +msgstr "Друга копие на OSMO във момента работи" + +msgid "" +"Simultaneously use two or more copies of OSMO can be a cause of data loss." +msgstr "" +"Едновременото използване на два или повече копия на OSMO може да бъде " +"причина за загуба на данни." + +msgid "Do you really want to continue?" +msgstr "Найстина ли искате да продължите" + +msgid "Low" +msgstr "Ниско" + +msgid "High" +msgstr "Високо" + +msgid "Done!" +msgstr "Направен !" + +msgid "contact exported" +msgid_plural "contacts exported" +msgstr[0] "изнесен контакт" +msgstr[1] "изнесени контакти" + +msgid "Cannot create file." +msgstr "Не може да се създаде файл." + +msgid "Select output file" +msgstr "Избор изходящ файл" + +msgid "Export contacts" +msgstr "Изнеси контакти" + +msgid "Output format" +msgstr "Изходен формат" + +msgid "Add header" +msgstr "Добави главно" + +msgid "Fields to export" +msgstr "Полета за износ" + +msgid "All" +msgstr "Всичко" + +msgid "Invert" +msgstr "Обръщане" + +msgid "Select fields" +msgstr "Избирани полета" + +msgid "Output filename" +msgstr "Изходящо файлово име" + +msgid "Export" +msgstr "Експорт" + +msgid "Color of items that are due today" +msgstr "Цвят на артикулите за днес" + +msgid "Color of items that are due in the next 7 days" +msgstr "Цвят на артикулите които предстоят в следващите 7 дена" + +msgid "Color of items that are past due" +msgstr "Цвят на артикулите които са просрочени" + +msgid "Task info font" +msgstr "Информация за шрифта на задачата" + +msgid "Show in bold tasks with high priority" +msgstr "Покази във bold задачите с висок приоритет" + +msgid "Hide completed tasks" +msgstr "Скриване на приключените задачи" + +msgid "Delete completed tasks without confirmation" +msgstr "Изтриване на приключени задачи без предупреждение" + +msgid "Add new task when double clicked on tasks list" +msgstr "Добавяне на нова задача при двойно кликане върху списъка със задачи" + +msgid "Postpone time" +msgstr "Отлагане " + +msgid "minutes" +msgstr "минути" + +msgid "0 for disable" +msgstr "0 за забранените" + +msgid "Repeat sound alarm" +msgstr "Повторение звуковата аларма" + +msgid "times" +msgstr "времена" + +msgid "Global notification command" +msgstr "Глобална уведомителна команда" + +msgid "Tasks options" +msgstr "Опций задачи" + +msgid "Reminder options" +msgstr "Опций за напомняне" + +msgid "Insert timeline" +msgstr "Insert timeline" + msgid "Timeline" msgstr "Хронология" @@ -1064,153 +976,169 @@ msgid "To (hour)" msgstr "To (hour)" -msgid "No date" -msgstr "Без дата" +msgid "_Paste" +msgstr "" -msgid "Rat" -msgstr "Плъх" +msgid "Please select at least one day when recurrency is enabled." +msgstr "Изберете поне един ден когато recurrency е разрешено" -msgid "Ox" -msgstr "Бивол" +msgid "Set time" +msgstr "Настройка на време" -msgid "Tiger" -msgstr "Тигър" +msgid "Hour" +msgstr "Час" -msgid "Hare" -msgstr "Заек" +msgid "Minute" +msgstr "Минута" -msgid "Dragon" -msgstr "Дракон" +msgid "Today" +msgstr "Днес" -msgid "Snake" -msgstr "Змия" +msgid "Tomorrow" +msgstr "Утре" -msgid "Horse" -msgstr "Кон" +msgid "Selected task will be removed." +msgstr "Избрани задачи който ще бъдат премахнати" -msgid "Sheep" -msgstr "Овца" +msgid "Select date and time" +msgstr "Избиране дата и време" -msgid "Monkey" -msgstr "Маймуна" +msgid "Enable sound notification" +msgstr "Разрешаване на звуково оповестяване" -msgid "Fowl" -msgstr "Петел" +#, fuzzy +msgid "Enable notification dialog" +msgstr "Разрешаване на звуково оповестяване" -msgid "Dog" -msgstr "Куче" +msgid "Alarm warning" +msgstr "Аларма предупреждение" -msgid "Pig" -msgstr "Свиня" +msgid "Days" +msgstr "Дни" -msgid "Unknown" -msgstr "Непознат" +msgid "Hours" +msgstr "Часове" -msgid "Aquarius" -msgstr "Водолей" +msgid "Minutes" +msgstr "Минути" -msgid "Pisces" -msgstr "Риби" +msgid "Alarm command" +msgstr "Alarm command" -msgid "Aries" -msgstr "Овен" +msgid "Date period" +msgstr "Период за дата" -msgid "Taurus" -msgstr "Бик" +msgid "Months" +msgstr "Месеци" -msgid "Gemini" -msgstr "Близнаци" +msgid "Repeat" +msgstr "Повторение" -msgid "Cancer" -msgstr "Рак" +msgid "Repeat in the following days" +msgstr "Повторение във следващите дни" -msgid "Leo" -msgstr "Лъв" +msgid "Time period" +msgstr "Времеви период" -msgid "Virgo" -msgstr "Дева" +msgid "Start" +msgstr "Старт" -msgid "Libra" -msgstr "Везни" +msgid "End" +msgstr "Край" -msgid "Scorpio" -msgstr "Скорпион" +msgid "Interval" +msgstr "Интервал" -msgid "Sagittarius" -msgstr "Стрелец" +msgid "Ignore alarm when task expired offline" +msgstr "Игнорирай алармата когато срока е изтекъл" -msgid "Capricorn" -msgstr "Козирог" +msgid "Recurrent task" +msgstr "Повтарящи се задачи" -msgid "Cannot perform selected operation." -msgstr "Не може да се изпълне избраната операция." +msgid "Enable" +msgstr "Позволи" -msgid "Task has been modified or removed." -msgstr "Задачата е била променена или премахната" +msgid "Edit task" +msgstr "Редактиране на задача" -msgid "Remind me later" -msgstr "Напомни ми по-късно" +msgid "Add task" +msgstr "Добавяне на задача" -msgid "Done" -msgstr "Направено" +msgid "Basic" +msgstr "Основно" -msgid "postponed" -msgstr "отложено" +msgid "Advanced" +msgstr "Разширено търсене" -msgid "Show task" -msgstr "Покажи задача" +msgid "New Moon" +msgstr "Новолуние" -msgid "Alarm warning!" -msgstr "Аларма предупреждение !" +msgid "Waxing Crescent Moon" +msgstr "Полумосец" -msgid "Day note" -msgstr "Дневна бележка" +msgid "Quarter Moon" +msgstr "Първа четвърт" -msgid "Type" -msgstr "Тип" +msgid "Waxing Gibbous Moon" +msgstr "Полумесец" -msgid "Event" -msgstr "Събитие" +msgid "Full Moon" +msgstr "Пълнолуние" -msgid "Task" -msgstr "Задача" +msgid "Waning Gibbous Moon" +msgstr "Полумесец" -msgid "Show Osmo" -msgstr "Покажи OSMO" +msgid "Last Quarter Moon" +msgstr "Последна четвърт " -msgid "No birthdays defined" -msgstr "Няма дефинирани рожденни дни" +msgid "Waning Crescent Moon" +msgstr "Полумесец" -msgid "Birthdays list" -msgstr "Листа с рождени дни" +msgid "Save backup" +msgstr "Запазване на бакъп" -msgid "Days to birthday" -msgstr "Days to birthday" +msgid "Password protection" +msgstr "Защита на парола" -msgid "Age" -msgstr "Възраст" +msgid "Enter password" +msgstr "Въвеждане на парола" -msgid "Birthday date" -msgstr "Роженна дата" +msgid "Re-enter password" +msgstr "Повторете паролата" -msgid "today" -msgstr "Днес" +msgid "Please enter the password" +msgstr "Моля въведете парола" -msgid "Please select address" -msgstr "Моля изберете адрес" +msgid "Passwords do not match!" +msgstr "Паролите не съвпадат" -msgid "Information" -msgstr "Информация" +msgid "Cannot create backup!" +msgstr "Невъзможно създаване на бакъп!" -msgid "Work" -msgstr "Месторабота" +msgid "Backup file saved successfully!" +msgstr "Бакъп файла е запазан успешно!" -msgid "Home" -msgstr "Домашен" +msgid "Open backup file" +msgstr "Отваряне на бакъп файл" -msgid "Group" -msgstr "Група" +msgid "Osmo backup files (*.bck)" +msgstr "Osmo бакъп файлове (*.bck)" +msgid "This is not Osmo backup file" +msgstr "Това не е бакъп файл на Osmo" + +msgid "Incorrect password!" +msgstr "Неправилна парола" + +msgid "All your data will be replaced with backup file content." +msgstr "Всичките ваши данни ще бъдат заменени със съдържанието на бакъп файла." + +msgid "Osmo has to be restarted now..." +msgstr "OSMO ще се рестартира сега..." + +msgid "Please select address" +msgstr "Моля изберете адрес" + msgid "First name" msgstr "Име" @@ -1358,9 +1286,6 @@ msgid "Photo" msgstr "Снимка" -msgid "Additional info" -msgstr "Допълнителна информация" - msgid "New contact" msgstr "Нов контакт" @@ -1367,9 +1292,6 @@ msgid "Remove contact" msgstr "Премахване на контакт" -msgid "Edit contact" -msgstr "Редактиране на контакт" - msgid "Show birthdays" msgstr "Показване на рождени дни" @@ -1376,12 +1298,20 @@ msgid "Show contact location on the map" msgstr "Покажи локализацията на контакта на картата" -msgid "Import contacts" -msgstr "Внеси цонтакти" +#, fuzzy +msgid "Backup data" +msgstr "Бакъп" -msgid "Export contacts" -msgstr "Изнеси контакти" +#, fuzzy +msgid "Restore data" +msgstr "Възтановяване" +msgid "About" +msgstr "За" + +msgid "Clear" +msgstr "Изчистване" + msgid "First Name" msgstr "Първо име" @@ -1397,214 +1327,6 @@ msgid "Close contact panel" msgstr "Затваряне панела за контакта" -msgid "contact exported" -msgid_plural "contacts exported" -msgstr[0] "изнесен контакт" -msgstr[1] "изнесени контакти" - -msgid "Cannot create file." -msgstr "Не може да се създаде файл." - -msgid "Output format" -msgstr "Изходен формат" - -msgid "Add header" -msgstr "Добави главно" - -msgid "Fields to export" -msgstr "Полета за износ" - -msgid "All" -msgstr "Всичко" - -msgid "Invert" -msgstr "Обръщане" - -msgid "Select fields" -msgstr "Избирани полета" - -msgid "Select CSV file" -msgstr "Избиране на CSV файл" - -msgid "CSV (comma-separated values) files (*.csv)" -msgstr "CSV (comma-separated values) files (*.csv)" - -msgid "Please select file first." -msgstr "Моля изберете файл първо." - -msgid "Import type" -msgstr "Входящ тип" - -msgid "File" -msgstr "Файл" - -msgid "Input filename" -msgstr "Входящо име на файл" - -msgid "Import" -msgstr "Внасяне" - -msgid "Nothing to import." -msgstr "Нищо за внасяне" - -msgid "contact added" -msgid_plural "contacts added" -msgstr[0] "добавен контакт" -msgstr[1] "добавени контакти" - -msgid "of" -msgstr "на" - -msgid "Record" -msgstr "Запис" - -msgid "Number fields per record" -msgstr "Брой полета за запис" - -msgid "Use first record as header" -msgstr "Използвай първият запис за главен" - -msgid "Field type" -msgstr "Тип поле" - -msgid "Value" -msgstr "Стойност" - -msgid "No records found in selected file." -msgstr "Няма намерен запис във избраният файл" - -msgid "Cannot read file." -msgstr "файлът не може да се прочете" - -msgid "Cannot open file." -msgstr "Файлът не може да се отвори" - -msgid "Selected contact will be removed." -msgstr "Избор на контакт който ще бъде премахнат" - -msgid "Select photo" -msgstr "Избор на снимка" - -msgid "Address" -msgstr "Адреси" - -msgid "Postcode" -msgstr "Пощенски код" - -msgid "City" -msgstr "Град" - -msgid "State" -msgstr "Област" - -msgid "Country" -msgstr "Държава" - -msgid "Add contact" -msgstr "Добавяне на контакт" - -msgid "Personal" -msgstr "Личен" - -msgid "Phones" -msgstr "Телефони" - -msgid "Internet" -msgstr "Интернет" - -msgid "Color of contact tags" -msgstr "Цвят за тагове на контакти" - -msgid "Color of links" -msgstr "Цвят за връзки" - -msgid "Font size" -msgstr "Размер на шрифта" - -msgid "Name font size" -msgstr "Размер на шрифта име" - -msgid "Item font size" -msgstr "Позиция размера на шрифта" - -msgid "Photo size" -msgstr "Размер на изображението" - -msgid "Small" -msgstr "Малък" - -msgid "Medium" -msgstr "Среден" - -msgid "Large" -msgstr "Голям" - -msgid "Hide group column" -msgstr "Скриване колоната за група" - -msgid "Maps provider" -msgstr "" - -msgid "Miscellaneous" -msgstr "Разни" - -msgid "Groups" -msgstr "Групи" - -msgid "Visible columns in birthday browser" -msgstr "Показване колони в браузъра за рожден ден" - -msgid "Show calendar" -msgstr "Показване календар" - -msgid "Show tasks" -msgstr "Показвана задачи" - -msgid "Show contacts" -msgstr "Показване на контакти" - -msgid "Show notes" -msgstr "Показване на бележки" - -msgid "Show options" -msgstr "Показване на опций" - -msgid "Show small calendar window" -msgstr "Показване календара в малък прозорец" - -msgid "Check for events since last run" -msgstr "Проверка за събития от последното изпълнение" - -msgid "Number of days to check forward for events (default: 0)" -msgstr "Брой на дните за проверка на събития напред (default: 0)" - -msgid "Set absolute path for settings and data files" -msgstr "Настройка на абсолютният път за настройки и файлове с данни" - -msgid "Match contacts with given string" -msgstr "" - -msgid "handy personal organizer" -msgstr "удобен личен органайзър" - -msgid "ERROR: Cannot create config files" -msgstr "ГРЕШКА:Не могат да се създадат конфигурациони файлове" - -msgid "Another copy of OSMO is already running." -msgstr "Друга копие на OSMO във момента работи" - -msgid "" -"Simultaneously use two or more copies of OSMO can be a cause of data loss." -msgstr "" -"Едновременото използване на два или повече копия на OSMO може да бъде " -"причина за загуба на данни." - -msgid "Do you really want to continue?" -msgstr "Найстина ли искате да продължите" - -msgid "Warning" -msgstr "Внимание" - msgid "The note has changed." msgstr "Бележката бе променена" @@ -1622,9 +1344,6 @@ msgid "Do you want to continue?" msgstr "Найстина ли искате да продължите" -msgid "Question" -msgstr "Въпрос" - msgid "Words" msgstr "Думи" @@ -1646,9 +1365,6 @@ msgid "Selection" msgstr "Избор" -msgid "Created" -msgstr "Създаване" - msgid "Modified" msgstr "Модифициране" @@ -1655,9 +1371,6 @@ msgid "New note" msgstr "Нова бележка" -msgid "Add note" -msgstr "Добавяне на бележка" - msgid "Edit note" msgstr "Редактиране на бележка" @@ -1664,12 +1377,30 @@ msgid "Delete note" msgstr "Изтриване на бележка" -msgid "Remove note" -msgstr "Премахване на бележка" +msgid "Save note" +msgstr "Запазване на бележка" msgid "Find" msgstr "Намиране" +msgid "Toggle spell checker" +msgstr "Превключване за правописна проверка" + +msgid "Bold" +msgstr "Bold" + +msgid "Italic" +msgstr "Italic" + +msgid "Underline" +msgstr "Подчертаване" + +msgid "Strikethrough" +msgstr "Зачеркване" + +msgid "Highlight" +msgstr "Маркиране" + msgid "Clear attributes" msgstr "Изчистване на атрибути" @@ -1676,9 +1407,6 @@ msgid "Open URL links" msgstr "" -msgid "Save note" -msgstr "Запазване на бележка" - msgid "Insert current date and time" msgstr "Вмъкване на текуща дата и време" @@ -1691,18 +1419,9 @@ msgid "Close editor" msgstr "Затваряне на редактор" -msgid "Toggle spell checker" -msgstr "Превключване за правописна проверка" - -msgid "Category" -msgstr "Категория" - msgid "Note name" msgstr "Име на бележка" -msgid "Last changes" -msgstr "Последни промени" - msgid "Read-only" msgstr "Само за четене" @@ -1730,6 +1449,9 @@ msgid "No further data recovery will be possible." msgstr "No further data recovery will be possible." +msgid "Add note" +msgstr "Добавяне на бележка" + msgid "Plain" msgstr "Plain" @@ -1748,229 +1470,364 @@ msgid "Authorization" msgstr "Упълномощаване" -msgid "Algorithm" -msgstr "Алгоритъм" +msgid "year" +msgid_plural "years" +msgstr[0] "Година" +msgstr[1] "Години" -msgid "Hashing" -msgstr "Hashing" +msgid "day" +msgid_plural "days" +msgstr[0] "Ден" +msgstr[1] "Дни" -msgid "Compression" -msgstr "Свиване" +msgid "hour" +msgid_plural "hours" +msgstr[0] "час" +msgstr[1] "часове" -msgid "Ratio" -msgstr "Пропорция" +msgid "minute" +msgid_plural "minutes" +msgstr[0] "минута" +msgstr[1] "минути" -msgid "Fast" -msgstr "Бързо" +msgid "second" +msgid_plural "seconds" +msgstr[0] "Секунда" +msgstr[1] "Секунди" -msgid "Good" -msgstr "Добро" +msgid "or" +msgstr "или" -msgid "Best" -msgstr "Най-добро" +msgid "rounded down" +msgstr "закръгляване надолу" -msgid "Remember the last selected category" -msgstr "Запомняне на последната избрана категория" +msgid "week" +msgid_plural "weeks" +msgstr[0] "Седмица" +msgstr[1] "Седмици" -msgid "Use system format for date and time" -msgstr "Използване на системният формат за дата и време" +msgid "working day" +msgid_plural "working days" +msgstr[0] "Работен ден" +msgstr[1] "Работни дни" -msgid "Encryption" -msgstr "Шифроване" +msgid "time is ignored" +msgstr "времето е игнорирано" -msgid "Visible columns" -msgstr "Видими колони" +msgid "weekend day" +msgid_plural "weekend days" +msgstr[0] "седмичен ден" +msgstr[1] "седмични дни" -msgid "Categories" -msgstr "Категорий" +msgid "This calculator only supports dates after year 1." +msgstr "Калкулаторът подържа само дати след година 1." -msgid "Notes options" -msgstr "Опций за бележки" +msgid "weekend day ignored" +msgid_plural "weekend days ignored" +msgstr[0] "уйкенд ден игнориран " +msgstr[1] "уйкенд дни игнорирани" -msgid "Osmo has to be restarted to take effect." -msgstr "OSMO трябва да се рестартира за да се приложат промените " +msgid "Date calculator" +msgstr "Премятане на период" -msgid "Layout" -msgstr "Разпределение" +msgid "Current date" +msgstr "Текуща дата" -msgid "Vertical" -msgstr "Вертикално" +msgid "Set current date" +msgstr "Настройка на текуща дата" -msgid "Horizontal" -msgstr "Хоризонтално" +msgid "Second" +msgstr "Секунда" -msgid "Tabs position" -msgstr "Позиция за табовете" +msgid "Set current time" +msgstr "Настройка на текущо време" -msgid "Left" -msgstr "Ляво" +msgid "Reset time" +msgstr "Нулиране " -msgid "Right" -msgstr "Дясно" +msgid "First date and time" +msgstr "Първи дата и време" -msgid "Top" -msgstr "Горе" +msgid "Second date and time" +msgstr "Втори дата и време" -msgid "Bottom" -msgstr "Доло" +msgid "Alternative time units" +msgstr "Алтернативни времеви единици" -#, fuzzy -msgid "Use default stock icons" -msgstr "Използване иконите по подразбиране (необходимо е рестартиране)" +msgid "Result" +msgstr "Резултат" -msgid "Disable underline in links" -msgstr "Изключване подчертаване във връзки" +msgid "Duration between two dates" +msgstr "Период между две дати" -msgid "Draw rows in alternating colors" -msgstr "Начертаване на редове в редуване на цветове" +msgid "Operation" +msgstr "Операция" -msgid "Show exit button in toolbar" -msgstr "" +msgid "add" +msgstr "добавяне" -msgid "At least one module must be visible." -msgstr "Най-малко един модул трябва д асе вижда." +msgid "subtract" +msgstr "изваждане" -msgid "Override locale settings" -msgstr "Замяна на локалните настройки" +msgid "Date and time to add or subtract from" +msgstr "Дата и време за добавяне или изваждане от" -msgid "Date format" -msgstr "Формат за дата" +msgid "Years" +msgstr "Години" -msgid "DD-MM-YYYY" -msgstr "ДД-ММ-ГГГГ" +msgid "Weeks" +msgstr "Седмици" -msgid "MM-DD-YYYY" -msgstr "ММ-ДД-ГГГГ" +msgid "Seconds" +msgstr "Секунди" -msgid "YYYY-MM-DD" -msgstr "ГГГГ-ММ-ДД" +msgid "Ignore weekend days" +msgstr "Игнориране на уйкендите" -msgid "YYYY-DD-MM" -msgstr "ГГГГ-ДД-ММ" +msgid "Reset fields" +msgstr "Нулиране на полета" -msgid "Time format" -msgstr "Формат за време" +msgid "Time to add or subtract" +msgstr "Време за добавяне или изваждане" -msgid "hours" -msgstr "часове" +msgid "Add to or subtract from a date" +msgstr "Добавяне към или изваждане от дата" -msgid "Spell checker language" -msgstr "Проверка за правопис " +msgid "Cannot perform selected operation." +msgstr "Не може да се изпълне избраната операция." -msgid "Enable tooltips" -msgstr "Разрешаване на съвети" +msgid "Task has been modified or removed." +msgstr "Задачата е била променена или премахната" -msgid "Remember last selected page" -msgstr "Запомняне на последната избрана страница" +msgid "Remind me later" +msgstr "Напомни ми по-късно" -msgid "Save data after every modification" -msgstr "Запазване на даните след всяка модификация" +msgid "Done" +msgstr "Направено" -msgid "Web browser" -msgstr "Web browser" +msgid "Show task" +msgstr "Покажи задача" -msgid "E-mail client" -msgstr "E-mail client" +msgid "Alarm warning!" +msgstr "Аларма предупреждение !" -msgid "Sound player" -msgstr "Sound player" +msgid "postponed" +msgstr "отложено" -#, c-format -msgid "The %s pattern will be replaced with web address" -msgstr "Схемите %s ще бъдат заменени с уеб адрес" +msgid "Day note" +msgstr "Дневна бележка" -#, c-format -msgid "The %s pattern will be replaced with e-mail address" -msgstr "Схемите %s ще бъдат заменени със имейл адрес" +msgid "Events" +msgstr "Събития" -#, c-format -msgid "The %s pattern will be replaced with sound filename" -msgstr "The %s pattern will be replaced with sound filename" +msgid "Event" +msgstr "Събитие" -msgid "Enable system tray" -msgstr "Разрешаване на системна област" +msgid "Task" +msgstr "Задача" -msgid "Start minimised" -msgstr "Стартиране минимализирано" +msgid "Birthday" +msgstr "Рожден ден" -msgid "Blink on events" -msgstr "Мигане при събитие" +msgid "Show Osmo" +msgstr "Покажи OSMO" -msgid "Ignore day note events" -msgstr "Игнориране на събитие от дневна бележка" +msgid "event" +msgid_plural "events" +msgstr[0] "събитие" +msgstr[1] "събития" -msgid "Hide" -msgstr "Скриване" +msgid "No valid calendars defined" +msgstr "Няма валидни определени календари" -msgid "Helpers" -msgstr "Помощници" +msgid "iCalendar events" +msgstr "iCalendar събития" -msgid "System tray" -msgstr "System tray" +msgid "Time" +msgstr "Време" -msgid "Edit" -msgstr "Редактиране" +msgid "The list will be cleared and all entries will be lost." +msgstr "Списъкът ще бъде изчистен и всички записи ще бъдат загубени." -msgid "Go Down" -msgstr "Отиди долу" +msgid "event exported" +msgid_plural "events exported" +msgstr[0] "изнесено събитие" +msgstr[1] "изнесени събития" -msgid "Select date" -msgstr "Избиране на дата" +msgid "iCalendar export" +msgstr "iCalendar export" -msgid "Select font" -msgstr "Избиране на фонд" +msgid "Day Selector" +msgstr "Day Selector" -msgid "Open URL" +msgid "Use date period" +msgstr "Използване на период " + +msgid "_Add" msgstr "" -msgid "Calculator" -msgstr "Калкулатор" +#, fuzzy +msgid "_Clear" +msgstr "Изчистване" -msgid "Edit day note" -msgstr "Редактиране на дневна бележка" +#, fuzzy +msgid "_Remove" +msgstr "Премахване" -msgid "Save" -msgstr "Запазване" +msgid "No tasks with defined date found." +msgstr "Няма намерени задачи с определената дата." -msgid "Display full-year calendar" -msgstr "Показване на целогодишен календар" +msgid "Save tasks" +msgstr "Запазване на задачи" -msgid "Help" -msgstr "Помощ" +msgid "tasks exported" +msgstr "изнесени задачи" -msgid "Invalid item" -msgstr "Невалиден елемент" +msgid "was born" +msgstr "е роден" -msgid "Valid item" -msgstr "Валиден елемент" +msgid "year old" +msgid_plural "years old" +msgstr[0] "year old" +msgstr[1] "years old" -msgid "Edit task" -msgstr "Редактиране на задача" +msgid "day till end of year" +msgid_plural "days till end of year" +msgstr[0] "ден до края на годината" +msgstr[1] "дни до края на годината" -msgid "Remove task" -msgstr "Премахване на задача" +msgid "the last day of the year" +msgstr "Последният ден от годината" -msgid "Import tasks" -msgstr "Внасяне на задача" +msgid "Day tasks" +msgstr "дневни задачи" -msgid "Export tasks" -msgstr "Изнасяне на задача" +msgid "Selected day note will be removed." +msgstr "Избраната дневна бележка ще бъде премахната" -msgid "Change to previous date" -msgstr "Смяна към предишна дата" +msgid "Continue?" +msgstr "Продължение?" -msgid "Change to next date" -msgstr "Смяна към следваща дата" +msgid "Previous year" +msgstr "Предходна година" -msgid "Print" -msgstr "Печатане" +msgid "Previous month" +msgstr "Предходен месец" -msgid "Normal" -msgstr "Нормално" +msgid "Previous day" +msgstr "Предходен ден" -msgid "Recurrent" -msgstr "Повтарящи" +msgid "Next day" +msgstr "Следващ ден" +msgid "Next month" +msgstr "Следващ месец" + +msgid "Next year" +msgstr "Следваща година" + +msgid "Full-year calendar" +msgstr "Целогодишен календар" + +msgid "Print calendar" +msgstr "Отпечатване на календар" + +msgid "Toggle day note panel" +msgstr "Превключване панел Дневни бележки" + +msgid "Select day color" +msgstr "Избиране цвят за деня" + +msgid "Browse notes" +msgstr "Преглед на бележки" + +msgid "Browse iCal events" +msgstr "Преглед на iCal събития" + +msgid "Export to iCal file" +msgstr "Eкспортиране като iCal файл" + +msgid "Previous and next month" +msgstr "Предходен и следващ месец" + +msgid "Close note panel" +msgstr "Затваряне панела за бележки" + +msgid "Clear text" +msgstr "Изчистване на текст" + +msgid "Info" +msgstr "Информация" + +msgid "Select color" +msgstr "Избор на цвят" + +msgid "Name day" +msgstr "Имена деня" + +msgid "Printing properties" +msgstr "Свойства за печат" + +msgid "Month name" +msgstr "Име на месеца" + +msgid "Day name" +msgstr "Име на деня" + +msgid "Fonts" +msgstr "Шрифтове" + +msgid "Birthdays" +msgstr "Рождени дни" + +msgid "Namedays" +msgstr "Дневни имена" + +msgid "Visible events" +msgstr "Видими събития" + +msgid "Padding" +msgstr "Вложка" + +msgid "Event maximum length" +msgstr "Максимална дължина на събитие" + +msgid "Page orientation:" +msgstr "Орентация на страница:" + +msgid "Portrait" +msgstr "Портрет" + +msgid "Landscape" +msgstr "Пейзаж" + +msgid "Leap year" +msgstr "Високосна година" + +msgid "Yes" +msgstr "Да" + +msgid "No" +msgstr "Не" + +msgid "Chinese year animal" +msgstr "Китайска година" + +msgid "Number of days" +msgstr "Брой дни" + +msgid "Number of weeks" +msgstr "Брой седмици" + +msgid "Number of weekend days" +msgstr "Брой на уйкенд дни" + +msgid "Year info" +msgstr "Годишна информация" + +msgid "Alternative view" +msgstr "Алтернативен изглед" + msgid "Started" msgstr "Стартирани" @@ -1977,12 +1834,12 @@ msgid "Finished" msgstr "Завършени" -msgid "All items" -msgstr "Всички елементи" - msgid "New task" msgstr "Нова задача" +msgid "Remove task" +msgstr "Премахване на задача" + msgid "Change due date to previous date" msgstr "Промяна на крайният срок към предишна дата" @@ -1989,15 +1846,12 @@ msgid "Change due date to next date" msgstr "Промяна на крайният срок към следваща дата" +msgid "Export tasks" +msgstr "Изнасяне на задача" + msgid "Print visible tasks list" msgstr "Печатане на видимите задачи" -msgid "Due date" -msgstr "Краен срок" - -msgid "Priority" -msgstr "Приоритет" - msgid "Task details" msgstr "Детайли на задачата" @@ -2004,174 +1858,365 @@ msgid "Close description panel" msgstr "Затваряне панела с описание" -msgid "No tasks with defined date found." -msgstr "Няма намерени задачи с определената дата." +msgid "Ctrl+PageUp" +msgstr "Ctrl+PageUp" -msgid "Save tasks" -msgstr "Запазване на задачи" +msgid "switch to previous tab" +msgstr "Превключи на предходният таб" -msgid "tasks exported" -msgstr "изнесени задачи" +msgid "Ctrl+PageDn" +msgstr "Ctrl+PageDn" -msgid "Please select at least one day when recurrency is enabled." -msgstr "Изберете поне един ден когато recurrency е разрешено" +msgid "switch to next tab" +msgstr "превключи на следващият таб" -msgid "Set time" -msgstr "Настройка на време" +msgid "switch to selected page" +msgstr "превключи на избраната страница" -msgid "Tomorrow" -msgstr "Утре" +msgid "show options window" +msgstr "покажи прозореца с опций" -msgid "Selected task will be removed." -msgstr "Избрани задачи който ще бъдат премахнати" +msgid "show about window" +msgstr "show about window" -msgid "Basic" -msgstr "Основно" +msgid "toggle fullscreen mode" +msgstr "" -msgid "Select date and time" -msgstr "Избиране дата и време" +msgid "PageUp/PageDn" +msgstr "PageUp/PageDn" -msgid "Low" -msgstr "Ниско" +msgid "switch page in options and about tab" +msgstr "включи страницата с опций и за раздела" -msgid "High" -msgstr "Високо" +msgid "exit" +msgstr "изход" -msgid "Enable sound notification" -msgstr "Разрешаване на звуково оповестяване" +msgid "Space" +msgstr "Интервал" -#, fuzzy -msgid "Enable notification dialog" -msgstr "Разрешаване на звуково оповестяване" +msgid "select current date" +msgstr "изберете текуща дата" -msgid "Advanced" -msgstr "Разширено търсене" +msgid "Ctrl+Space" +msgstr "Ctrl+Интервал" -msgid "Alarm warning" -msgstr "Аларма предупреждение" +msgid "toggle personal data visibility" +msgstr "разрешаване видимост на личните данни" -msgid "Postpone time" -msgstr "Отлагане " +msgid "Arrows" +msgstr "Стрелки" -msgid "Alarm command" -msgstr "Alarm command" +msgid "change day" +msgstr "промяна на деня" -msgid "Recurrent task" -msgstr "Повтарящи се задачи" +msgid "Ctrl+Up/Down" +msgstr "Ctrl+Up/Down" -msgid "Enable" -msgstr "Позволи" +msgid "scroll the contents in the day info panel" +msgstr "превъртане съдържанието на панела за дневна информация" -msgid "Start" -msgstr "Старт" +msgid "change month" +msgstr "промяна на месеца" -msgid "End" -msgstr "Край" +msgid "Home/End" +msgstr "Home/End" -msgid "Interval" -msgstr "Интервал" +msgid "change year" +msgstr "Промяна на годината" -msgid "Time period" -msgstr "Времеви период" +msgid "toggle calendars for the previous and next month" +msgstr "превключване на календарите за предходният и следващ месец" -msgid "Date period" -msgstr "Период за дата" +msgid "day notes browser" +msgstr "браузър дневни бележки" -msgid "Repeat" -msgstr "Повторение" +msgid "assign background color to day note" +msgstr "присвояване цвят на фона за дневна бележка" -msgid "Repeat in the following days" -msgstr "Повторение във следващите дни" +msgid "date calculator" +msgstr "калкулатор на дни" -msgid "Ignore alarm when task expired offline" -msgstr "Игнорирай алармата когато срока е изтекъл" +msgid "show full-year calendar" +msgstr "покажи годишният календар" -msgid "Select a font..." -msgstr "Избиране на шрифт..." +msgid "jump to date" +msgstr "скочи на дата" -msgid "Color of items that are due today" -msgstr "Цвят на артикулите за днес" +msgid "Delete" +msgstr "Изтриване" -msgid "Color of items that are due in the next 7 days" -msgstr "Цвят на артикулите които предстоят в следващите 7 дена" +msgid "remove day note" +msgstr "премахване на дневна бележка" -msgid "Color of items that are past due" -msgstr "Цвят на артикулите които са просрочени" +msgid "Alt+Arrows" +msgstr "Alt+Стрелки" -msgid "Task info font" -msgstr "Информация за шрифта на задачата" +msgid "Esc" +msgstr "Esc" -msgid "Show in bold tasks with high priority" -msgstr "Покази във bold задачите с висок приоритет" +msgid "close editor" +msgstr "затвори редактора" -msgid "Hide completed tasks" -msgstr "Скриване на приключените задачи" +msgid "toggle bold" +msgstr "toggle bold" -msgid "Delete completed tasks without confirmation" -msgstr "Изтриване на приключени задачи без предупреждение" +msgid "toggle italic" +msgstr "toggle italic" -msgid "Add new task when double clicked on tasks list" -msgstr "Добавяне на нова задача при двойно кликане върху списъка със задачи" +msgid "toggle underline" +msgstr "toggle underline" -msgid "minutes" -msgstr "минути" +msgid "toggle strikethrough" +msgstr "toggle strikethrough" -msgid "0 for disable" -msgstr "0 за забранените" +msgid "toggle highlight" +msgstr "toggle highlight" -msgid "Repeat sound alarm" -msgstr "Повторение звуковата аларма" +msgid "Arrows Up/Down" +msgstr "Стрелки Up/Down" -msgid "times" -msgstr "времена" +msgid "toggle alternative view" +msgstr "превключи на алтернативен изглед" -msgid "Global notification command" -msgstr "Глобална уведомителна команда" +msgid "year info" +msgstr "годишна информация" -msgid "Tasks options" -msgstr "Опций задачи" +msgid "set current year" +msgstr "насройване текуща година" -msgid "Reminder options" -msgstr "Опций за напомняне" +msgid "close full-year calendar" +msgstr "затвори годишният календар" -msgid "Tasks list" -msgstr "Листа със задачи" +msgid "Alt+a, Insert" +msgstr "Alt+a, Insert" -# е съкращение на думата "номер" -#. TRANSLATORS: "No." is an abbreviation of word "number" -msgid "No." -msgstr "No." +msgid "add task" +msgstr "добавяне на задача" -msgid "New Moon" -msgstr "Новолуние" +msgid "Alt+e, Ctrl+Enter" +msgstr "Alt+e, Ctrl+Enter" -msgid "Waxing Crescent Moon" -msgstr "Полумосец" +msgid "edit task" +msgstr "редактиране на задача" -msgid "Quarter Moon" -msgstr "Първа четвърт" +msgid "Alt+r, Delete" +msgstr "Alt+r, Delete" -msgid "Waxing Gibbous Moon" -msgstr "Полумесец" +msgid "remove task" +msgstr "премахване на задача" -msgid "Full Moon" -msgstr "Пълнолуние" +msgid "toggle hidden tasks" +msgstr "превключи на скрити задачи" -msgid "Waning Gibbous Moon" -msgstr "Полумесец" +msgid "activate search field" +msgstr "активиране полето за търсене" -msgid "Last Quarter Moon" -msgstr "Последна четвърт " +msgid "Left, Right" +msgstr "Ляво,Дясно" -msgid "Wani... [truncated message content] |
From: <pa...@us...> - 2017-03-05 23:22:03
|
Revision: 1114 http://sourceforge.net/p/osmo-pim/code/1114 Author: pasp Date: 2017-03-05 23:22:00 +0000 (Sun, 05 Mar 2017) Log Message: ----------- * Calendar widget colors are now fully customizable Modified Paths: -------------- trunk/src/calendar.c trunk/src/calendar.h trunk/src/calendar_fullyear.c trunk/src/calendar_preferences_gui.c trunk/src/calendar_widget.c trunk/src/calendar_widget.h trunk/src/contacts_items.c trunk/src/gui.h trunk/src/tasks_items.c trunk/src/utils_gui.c Modified: trunk/src/calendar.c =================================================================== --- trunk/src/calendar.c 2017-02-25 22:04:34 UTC (rev 1113) +++ trunk/src/calendar.c 2017-03-05 23:22:00 UTC (rev 1114) @@ -1772,6 +1772,39 @@ /*------------------------------------------------------------------------------*/ void +gui_set_calendar_defaults(GtkWidget *calendar) { + + gui_calendar_set_color (GUI_CALENDAR (calendar), + config.background_color, 0, BACKGROUND_COLOR); + gui_calendar_set_color (GUI_CALENDAR (calendar), + config.header_bg_color, 0, HEADER_BG_COLOR); + gui_calendar_set_color (GUI_CALENDAR (calendar), + config.header_fg_color, 0, HEADER_FG_COLOR); + gui_calendar_set_color (GUI_CALENDAR (calendar), + config.day_color, 0, DAY_COLOR); + gui_calendar_set_color (GUI_CALENDAR (calendar), + config.pf_day_color, 0, PF_DAY_COLOR); + gui_calendar_set_color (GUI_CALENDAR (calendar), + config.weekend_color, 0, WEEKEND_COLOR); + gui_calendar_set_color (GUI_CALENDAR (calendar), + config.selection_color, config.selector_alpha, SELECTOR_COLOR); + gui_calendar_set_color (GUI_CALENDAR (calendar), + config.mark_color, 0, EVENT_MARKER_COLOR); + gui_calendar_set_color (GUI_CALENDAR (calendar), + config.mark_current_day_color, config.mark_current_day_alpha, TODAY_MARKER_COLOR); + gui_calendar_set_color (GUI_CALENDAR (calendar), + config.birthday_mark_color, 0, BIRTHDAY_MARKER_COLOR); + gui_calendar_set_marker (GUI_CALENDAR (calendar), + config.event_marker_type, EVENT_MARKER); + gui_calendar_set_marker (GUI_CALENDAR (calendar), + config.today_marker_type, TODAY_MARKER); + gui_calendar_set_day_note_marker_symbol (GUI_CALENDAR (calendar), + config.day_note_marker); +} + +/*------------------------------------------------------------------------------*/ + +void gui_create_calendar(GtkWidget *notebook, GUI *appGUI) { GtkWidget *vbox1; @@ -1995,21 +2028,8 @@ g_signal_connect (G_OBJECT(appGUI->cal->calendar), "button_press_event", G_CALLBACK(mouse_button_click_handler_cb), appGUI); gui_calendar_enable_cursor (GUI_CALENDAR (appGUI->cal->calendar), TRUE); + gui_set_calendar_defaults(appGUI->cal->calendar); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.mark_color, 0, EVENT_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.selection_color, config.selector_alpha, SELECTOR_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.background_color, 0, BACKGROUND_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.header_bg_color, 0, HEADER_BG_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.weekend_color, 0, WEEKEND_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.mark_current_day_color, config.mark_current_day_alpha, TODAY_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.birthday_mark_color, 0, BIRTHDAY_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.day_color, 0, DAY_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.header_fg_color, 0, HEADER_FG_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.pf_day_color, 0, PF_DAY_COLOR); - gui_calendar_set_day_note_marker_symbol (GUI_CALENDAR (appGUI->cal->calendar), config.day_note_marker); - gui_calendar_set_marker (GUI_CALENDAR (appGUI->cal->calendar), config.event_marker_type, EVENT_MARKER); - gui_calendar_set_marker (GUI_CALENDAR (appGUI->cal->calendar), config.today_marker_type, TODAY_MARKER); - appGUI->cal->month_selector_menu = gtk_menu_new(); calendar_create_popup_menu (appGUI->cal->month_selector_menu, appGUI); @@ -2061,15 +2081,7 @@ gui_calendar_set_display_options (GUI_CALENDAR (appGUI->cal->calendar_prev), (config.display_options & (GUI_CALENDAR_SHOW_DAY_NAMES | GUI_CALENDAR_WEEK_START_MONDAY)) | GUI_CALENDAR_NO_MONTH_CHANGE); gui_calendar_enable_cursor (GUI_CALENDAR (appGUI->cal->calendar_prev), FALSE); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.mark_color, 0, EVENT_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.selection_color, 0, SELECTOR_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.header_bg_color, 0, HEADER_BG_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.weekend_color, 0, WEEKEND_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.mark_current_day_color, config.mark_current_day_alpha, TODAY_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.birthday_mark_color, 0, BIRTHDAY_MARKER_COLOR); - gui_calendar_set_day_note_marker_symbol (GUI_CALENDAR (appGUI->cal->calendar_prev), config.day_note_marker); - gui_calendar_set_marker (GUI_CALENDAR (appGUI->cal->calendar_prev), config.event_marker_type, EVENT_MARKER); - gui_calendar_set_marker (GUI_CALENDAR (appGUI->cal->calendar_prev), config.today_marker_type, TODAY_MARKER); + gui_set_calendar_defaults(appGUI->cal->calendar_prev); g_signal_connect (G_OBJECT (appGUI->cal->calendar_prev), "day_selected_double_click", G_CALLBACK (date_selected_cb), appGUI); @@ -2081,15 +2093,7 @@ gui_calendar_set_display_options (GUI_CALENDAR (appGUI->cal->calendar_next), (config.display_options & (GUI_CALENDAR_SHOW_DAY_NAMES | GUI_CALENDAR_WEEK_START_MONDAY)) | GUI_CALENDAR_NO_MONTH_CHANGE); gui_calendar_enable_cursor (GUI_CALENDAR (appGUI->cal->calendar_next), FALSE); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_next), config.mark_color, 0, EVENT_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_next), config.selection_color, 0, SELECTOR_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_next), config.header_bg_color, 0, HEADER_BG_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_next), config.weekend_color, 0, WEEKEND_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_next), config.mark_current_day_color, config.mark_current_day_alpha, TODAY_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_next), config.birthday_mark_color, 0, BIRTHDAY_MARKER_COLOR); - gui_calendar_set_day_note_marker_symbol (GUI_CALENDAR (appGUI->cal->calendar_next), config.day_note_marker); - gui_calendar_set_marker (GUI_CALENDAR (appGUI->cal->calendar_next), config.event_marker_type, EVENT_MARKER); - gui_calendar_set_marker (GUI_CALENDAR (appGUI->cal->calendar_next), config.today_marker_type, TODAY_MARKER); + gui_set_calendar_defaults(appGUI->cal->calendar_next); g_signal_connect (G_OBJECT (appGUI->cal->calendar_next), "day_selected_double_click", G_CALLBACK (date_selected_cb), appGUI); Modified: trunk/src/calendar.h =================================================================== --- trunk/src/calendar.h 2017-02-25 22:04:34 UTC (rev 1113) +++ trunk/src/calendar.h 2017-03-05 23:22:00 UTC (rev 1114) @@ -26,6 +26,7 @@ #include "calendar_utils.h" void gui_create_calendar (GtkWidget *notebook, GUI *appGUI); +void gui_set_calendar_defaults (GtkWidget *calendar); void cal_jump_to_date (GDate *cdate, GUI *appGUI); void calendar_set_today (GUI *appGUI); void calendar_update_date (guint day, guint month, guint year, GUI *appGUI); Modified: trunk/src/calendar_fullyear.c =================================================================== --- trunk/src/calendar_fullyear.c 2017-02-25 22:04:34 UTC (rev 1113) +++ trunk/src/calendar_fullyear.c 2017-03-05 23:22:00 UTC (rev 1114) @@ -611,19 +611,7 @@ (config.display_options & (GUI_CALENDAR_SHOW_DAY_NAMES | GUI_CALENDAR_WEEK_START_MONDAY)) | GUI_CALENDAR_NO_MONTH_CHANGE); gui_calendar_enable_cursor (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), FALSE); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.mark_color, 0, EVENT_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.selection_color, 0, SELECTOR_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.header_bg_color, 0, HEADER_BG_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.background_color, 0, BACKGROUND_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.weekend_color, 0, WEEKEND_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.mark_current_day_color, config.mark_current_day_alpha, TODAY_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.birthday_mark_color, 0, BIRTHDAY_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.day_color, 0, DAY_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.header_fg_color, 0, HEADER_FG_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.pf_day_color, 0, PF_DAY_COLOR); - gui_calendar_set_day_note_marker_symbol (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.day_note_marker); - gui_calendar_set_marker (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.today_marker_type, TODAY_MARKER); - gui_calendar_set_marker (GUI_CALENDAR (appGUI->cal->fy_calendars[i]), config.event_marker_type, EVENT_MARKER); + gui_set_calendar_defaults(appGUI->cal->fy_calendars[i]); year = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (appGUI->cal->fy_spinbutton)); month = i + 1; Modified: trunk/src/calendar_preferences_gui.c =================================================================== --- trunk/src/calendar_preferences_gui.c 2017-02-25 22:04:34 UTC (rev 1113) +++ trunk/src/calendar_preferences_gui.c 2017-03-05 23:22:00 UTC (rev 1114) @@ -98,11 +98,25 @@ /* ========================================================================== */ static void -header_color_changed_cb (GtkColorButton *button, GUI *appGUI) +background_color_changed_cb (GtkColorButton *button, GUI *appGUI) { GdkRGBA color; gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color); + utl_gui_convert_color_to_string(&color, config.background_color); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.background_color, 0, BACKGROUND_COLOR); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.background_color, 0, BACKGROUND_COLOR); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_next), config.background_color, 0, BACKGROUND_COLOR); +} + +/* ========================================================================== */ + +static void +header_bg_color_changed_cb (GtkColorButton *button, GUI *appGUI) +{ + GdkRGBA color; + + gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color); utl_gui_convert_color_to_string(&color, config.header_bg_color); gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.header_bg_color, 0, HEADER_BG_COLOR); gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.header_bg_color, 0, HEADER_BG_COLOR); @@ -112,6 +126,20 @@ /* ========================================================================== */ static void +header_fg_color_changed_cb (GtkColorButton *button, GUI *appGUI) +{ + GdkRGBA color; + + gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color); + utl_gui_convert_color_to_string(&color, config.header_fg_color); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.header_fg_color, 0, HEADER_FG_COLOR); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.header_fg_color, 0, HEADER_FG_COLOR); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_next), config.header_fg_color, 0, HEADER_FG_COLOR); +} + +/* ========================================================================== */ + +static void weekend_color_changed_cb (GtkColorButton *button, GUI *appGUI) { GdkRGBA color; @@ -126,6 +154,34 @@ /* ========================================================================== */ static void +day_color_changed_cb (GtkColorButton *button, GUI *appGUI) +{ + GdkRGBA color; + + gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color); + utl_gui_convert_color_to_string(&color, config.day_color); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.day_color, 0, DAY_COLOR); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.day_color, 0, DAY_COLOR); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_next), config.day_color, 0, DAY_COLOR); +} + +/* ========================================================================== */ + +static void +pf_day_color_changed_cb (GtkColorButton *button, GUI *appGUI) +{ + GdkRGBA color; + + gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color); + utl_gui_convert_color_to_string(&color, config.pf_day_color); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar), config.pf_day_color, 0, PF_DAY_COLOR); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_prev), config.pf_day_color, 0, PF_DAY_COLOR); + gui_calendar_set_color (GUI_CALENDAR (appGUI->cal->calendar_next), config.pf_day_color, 0, PF_DAY_COLOR); +} + +/* ========================================================================== */ + +static void selection_color_changed_cb (GtkColorButton *button, GUI *appGUI) { GdkRGBA color; @@ -263,7 +319,7 @@ create_appearance_section (GtkWidget *appearance_vbox, GUI *appGUI) { GtkWidget *table, *label, *entry, *combobox, *color_button, *button; - GtkWidget *entry_hbox, *colors_hbox, *b_hbox; + GtkWidget *entry_hbox, *colors_hbox, *colors_hbox_2, *b_hbox; GdkRGBA color; GtkAdjustment *adj; gint i; @@ -355,7 +411,6 @@ appGUI->opt->today_marker_type_combobox = combobox; i++; - label = utl_gui_create_label ("%s:", _("Colors")); gtk_grid_attach (GTK_GRID (table), label, 0, i, 1, 1); @@ -364,15 +419,33 @@ color_button = gtk_color_button_new (); if (config.enable_tooltips) - gtk_widget_set_tooltip_text (color_button, _("Header color")); + gtk_widget_set_tooltip_text (color_button, _("Background color")); + gdk_rgba_parse (&color, config.background_color); + gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &color); + gtk_box_pack_start (GTK_BOX (colors_hbox), color_button, FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (color_button), "color-set", G_CALLBACK (background_color_changed_cb), appGUI); + appGUI->opt->background_color_picker = color_button; + + color_button = gtk_color_button_new (); + if (config.enable_tooltips) + gtk_widget_set_tooltip_text (color_button, _("Header background color")); gdk_rgba_parse (&color, config.header_bg_color); gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &color); gtk_box_pack_start (GTK_BOX (colors_hbox), color_button, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (color_button), "color-set", G_CALLBACK (header_color_changed_cb), appGUI); - appGUI->opt->header_color_picker = color_button; + g_signal_connect (G_OBJECT (color_button), "color-set", G_CALLBACK (header_bg_color_changed_cb), appGUI); + appGUI->opt->header_bg_color_picker = color_button; color_button = gtk_color_button_new (); if (config.enable_tooltips) + gtk_widget_set_tooltip_text (color_button, _("Header foreground color")); + gdk_rgba_parse (&color, config.header_fg_color); + gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &color); + gtk_box_pack_start (GTK_BOX (colors_hbox), color_button, FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (color_button), "color-set", G_CALLBACK (header_fg_color_changed_cb), appGUI); + appGUI->opt->header_fg_color_picker = color_button; + + color_button = gtk_color_button_new (); + if (config.enable_tooltips) gtk_widget_set_tooltip_text (color_button, _("Weekend days color")); gdk_rgba_parse (&color, config.weekend_color); gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &color); @@ -382,11 +455,33 @@ color_button = gtk_color_button_new (); if (config.enable_tooltips) + gtk_widget_set_tooltip_text (color_button, _("Day color")); + gdk_rgba_parse (&color, config.day_color); + gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &color); + gtk_box_pack_start (GTK_BOX (colors_hbox), color_button, FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (color_button), "color-set", G_CALLBACK (day_color_changed_cb), appGUI); + appGUI->opt->day_color_picker = color_button; + + i++; + colors_hbox_2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); + gtk_grid_attach (GTK_GRID (table), colors_hbox_2, 1, i, 4, 1); + + color_button = gtk_color_button_new (); + if (config.enable_tooltips) + gtk_widget_set_tooltip_text (color_button, _("Previous/Next month's day color")); + gdk_rgba_parse (&color, config.pf_day_color); + gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &color); + gtk_box_pack_start (GTK_BOX (colors_hbox_2), color_button, FALSE, FALSE, 0); + g_signal_connect (G_OBJECT (color_button), "color-set", G_CALLBACK (pf_day_color_changed_cb), appGUI); + appGUI->opt->pf_day_color_picker = color_button; + + color_button = gtk_color_button_new (); + if (config.enable_tooltips) gtk_widget_set_tooltip_text (color_button, _("Cursor color")); gdk_rgba_parse (&color, config.selection_color); - color.alpha = (gdouble)config.selector_alpha / 65536; + color.alpha = (gdouble)config.selector_alpha / 65536; gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &color); - gtk_box_pack_start (GTK_BOX (colors_hbox), color_button, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (colors_hbox_2), color_button, FALSE, FALSE, 0); gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (color_button), TRUE); g_signal_connect (G_OBJECT (color_button), "color-set", G_CALLBACK (selection_color_changed_cb), appGUI); appGUI->opt->selection_color_picker = color_button; @@ -396,7 +491,7 @@ gtk_widget_set_tooltip_text (color_button, _("Event marker color")); gdk_rgba_parse (&color, config.mark_color); gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &color); - gtk_box_pack_start (GTK_BOX (colors_hbox), color_button, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (colors_hbox_2), color_button, FALSE, FALSE, 0); g_signal_connect (G_OBJECT (color_button), "color-set", G_CALLBACK (mark_color_changed_cb), appGUI); appGUI->opt->mark_color_picker = color_button; @@ -406,7 +501,7 @@ gdk_rgba_parse (&color, config.mark_current_day_color); gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &color); color.alpha = (gdouble)config.mark_current_day_alpha / 65536; - gtk_box_pack_start (GTK_BOX (colors_hbox), color_button, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (colors_hbox_2), color_button, FALSE, FALSE, 0); gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (color_button), TRUE); g_signal_connect (G_OBJECT (color_button), "color-set", G_CALLBACK (mark_current_day_color_changed_cb), appGUI); appGUI->opt->mark_current_day_color_picker = color_button; @@ -416,7 +511,7 @@ gtk_widget_set_tooltip_text (color_button, _("Birthday marker color")); gdk_rgba_parse (&color, config.birthday_mark_color); gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (color_button), &color); - gtk_box_pack_start (GTK_BOX (colors_hbox), color_button, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (colors_hbox_2), color_button, FALSE, FALSE, 0); g_signal_connect (G_OBJECT (color_button), "color-set", G_CALLBACK (birthday_mark_color_changed_cb), appGUI); appGUI->opt->birthday_mark_color_picker = color_button; @@ -509,7 +604,6 @@ adj = gtk_adjustment_new (1, 1, 6, 1, 1, 1); appGUI->opt->cft_hscale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (adj)); gtk_scale_set_draw_value (GTK_SCALE (appGUI->opt->cft_hscale), FALSE); - // FIXME no replacement gtk_range_set_update_policy (GTK_RANGE (appGUI->opt->cft_hscale), GTK_UPDATE_DISCONTINUOUS); gtk_range_set_value (GTK_RANGE (appGUI->opt->cft_hscale), config.frame_cursor_thickness); gtk_widget_set_hexpand(appGUI->opt->cft_hscale, TRUE); gtk_grid_attach (GTK_GRID (table), appGUI->opt->cft_hscale, 1, i, 4, 1); Modified: trunk/src/calendar_widget.c =================================================================== --- trunk/src/calendar_widget.c 2017-02-25 22:04:34 UTC (rev 1113) +++ trunk/src/calendar_widget.c 2017-03-05 23:22:00 UTC (rev 1114) @@ -1038,7 +1038,6 @@ GtkWidget *widget = GTK_WIDGET (calendar); GuiCalendarPrivate *priv = GUI_CALENDAR_GET_PRIVATE (calendar); GdkWindowAttr attributes; - GdkRGBA color; gint attributes_mask; /* day names window */ @@ -1057,8 +1056,6 @@ priv->day_name_win = gdk_window_new (gtk_widget_get_window(widget), &attributes, attributes_mask); - get_background_color(widget, &color); - gdk_window_set_background_rgba (priv->day_name_win, &color); gdk_window_show (priv->day_name_win); gdk_window_set_user_data (priv->day_name_win, widget); } else { @@ -1073,7 +1070,6 @@ GtkWidget *widget = GTK_WIDGET (calendar); GuiCalendarPrivate *priv = GUI_CALENDAR_GET_PRIVATE (calendar); GdkWindowAttr attributes; - GdkRGBA color; gint attributes_mask; /* week number window */ @@ -1092,8 +1088,6 @@ attributes.height = priv->main_h; priv->week_win = gdk_window_new (gtk_widget_get_window(widget), &attributes, attributes_mask); - get_background_color(widget, &color); - gdk_window_set_background_rgba (priv->week_win, &color); gdk_window_show (priv->week_win); gdk_window_set_user_data (priv->week_win, widget); } else { @@ -1110,7 +1104,6 @@ GdkWindowAttr attributes; GtkAllocation allocation; GdkWindow *window; - GdkRGBA color; GtkBorder border; gint attributes_mask; @@ -1152,11 +1145,8 @@ attributes.height = priv->main_h; priv->main_win = gdk_window_new (gtk_widget_get_window(widget), &attributes, attributes_mask); - get_background_color(widget, &color); - gdk_window_set_background_rgba (priv->main_win, &color); gdk_window_show (priv->main_win); gdk_window_set_user_data (priv->main_win, widget); - gdk_window_set_background_rgba (gtk_widget_get_window(widget), &color); gdk_window_show (gtk_widget_get_window(widget)); gdk_window_set_user_data (gtk_widget_get_window(widget), widget); } @@ -1488,9 +1478,6 @@ max_month_width = priv->max_month_width; max_year_width = priv->max_year_width; - gtk_render_frame (gtk_widget_get_style_context(widget), cr, - 0, 0, header_width, priv->header_h); - tmp_time = 1; /* Jan 1 1970, 00:00:01 UTC */ tm = gmtime (&tmp_time); tm->tm_year = calendar->year - 1900; @@ -2084,7 +2071,6 @@ calendar_compute_days(calendar); - /* TODO convert to "native" Gtk3 draw in widget coordinates */ if (priv->main_win && gtk_cairo_should_draw_window(cr, priv->main_win)) { cairo_save(cr); gtk_cairo_transform_to_window(cr, widget, priv->main_win); @@ -2626,44 +2612,11 @@ /*------------------------------------------------------------------------------*/ static void -calendar_set_background (GtkWidget *widget) { - GuiCalendarPrivate *priv = GUI_CALENDAR_GET_PRIVATE (widget); - GdkRGBA header_bg_color; - GdkRGBA background_color; - gint i; - - if (gtk_widget_get_realized (widget)) { - get_header_bg_color(widget, &header_bg_color); - get_background_color(widget, &background_color); - for (i = 0; i < 4; i++) { - if (priv->arrow_win[i]) - gdk_window_set_background_rgba (priv->arrow_win[i], &header_bg_color); - } - if (priv->header_win) - gdk_window_set_background_rgba (priv->header_win, &header_bg_color); - if (priv->day_name_win) - gdk_window_set_background_rgba (priv->day_name_win, &background_color); - if (priv->week_win) - gdk_window_set_background_rgba (priv->week_win, &background_color); - if (priv->main_win) - gdk_window_set_background_rgba (priv->main_win, &background_color); - if (gtk_widget_get_window(widget)) - gdk_window_set_background_rgba (gtk_widget_get_window(widget), &background_color); - } -} +gui_calendar_style_set (GtkWidget *widget, GtkStyle *previous_style) { } /*------------------------------------------------------------------------------*/ static void -gui_calendar_style_set (GtkWidget *widget, - GtkStyle *previous_style) { - if (previous_style && gtk_widget_get_realized (widget)) - calendar_set_background (widget); -} - -/*------------------------------------------------------------------------------*/ - -static void gui_calendar_state_changed (GtkWidget *widget, GtkStateType previous_state) { GuiCalendar *calendar = GUI_CALENDAR (widget); @@ -2680,8 +2633,6 @@ priv->arrow_state[i] = GTK_STATE_FLAG_NORMAL; else priv->arrow_state[i] = GTK_STATE_FLAG_INSENSITIVE; - - calendar_set_background (widget); } /*------------------------------------------------------------------------------*/ Modified: trunk/src/calendar_widget.h =================================================================== --- trunk/src/calendar_widget.h 2017-02-25 22:04:34 UTC (rev 1113) +++ trunk/src/calendar_widget.h 2017-03-05 23:22:00 UTC (rev 1114) @@ -42,7 +42,7 @@ /* Spacing around day/week headers and main area, inside those windows */ #define CALENDAR_MARGIN 0 /* Spacing around day/week headers and main area, outside those windows */ -#define INNER_BORDER 1 +#define INNER_BORDER 2 /* Separation between day headers and main area */ #define CALENDAR_YSEP 4 /* Separation between week headers and main area */ Modified: trunk/src/contacts_items.c =================================================================== --- trunk/src/contacts_items.c 2017-02-25 22:04:34 UTC (rev 1113) +++ trunk/src/contacts_items.c 2017-03-05 23:22:00 UTC (rev 1114) @@ -420,16 +420,7 @@ msg->appGUI->cnt->select_date_calendar = gui_calendar_new(); gui_calendar_set_cursor_type (GUI_CALENDAR(msg->appGUI->cnt->select_date_calendar), CURSOR_BLOCK); - gui_calendar_set_color (GUI_CALENDAR (msg->appGUI->cnt->select_date_calendar), config.selection_color, config.selector_alpha, SELECTOR_COLOR); - gui_calendar_set_marker (GUI_CALENDAR (msg->appGUI->cnt->select_date_calendar), config.today_marker_type, TODAY_MARKER); - gui_calendar_set_color (GUI_CALENDAR (msg->appGUI->cnt->select_date_calendar), - config.mark_current_day_color, config.mark_current_day_alpha, TODAY_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (msg->appGUI->cnt->select_date_calendar), config.background_color, 0, BACKGROUND_COLOR); - gui_calendar_set_color (GUI_CALENDAR (msg->appGUI->cnt->select_date_calendar), config.header_bg_color, 0, HEADER_BG_COLOR); - gui_calendar_set_color (GUI_CALENDAR (msg->appGUI->cnt->select_date_calendar), config.weekend_color, 0, WEEKEND_COLOR); - gui_calendar_set_color (GUI_CALENDAR (msg->appGUI->cnt->select_date_calendar), config.day_color, 0, DAY_COLOR); - gui_calendar_set_color (GUI_CALENDAR (msg->appGUI->cnt->select_date_calendar), config.header_fg_color, 0, HEADER_FG_COLOR); - gui_calendar_set_color (GUI_CALENDAR (msg->appGUI->cnt->select_date_calendar), config.pf_day_color, 0, PF_DAY_COLOR); + gui_set_calendar_defaults(msg->appGUI->cnt->select_date_calendar); gtk_widget_show(msg->appGUI->cnt->select_date_calendar); msg_selected.data = msg->data; msg_selected.appGUI = msg->appGUI; Modified: trunk/src/gui.h =================================================================== --- trunk/src/gui.h 2017-02-25 22:04:34 UTC (rev 1113) +++ trunk/src/gui.h 2017-03-05 23:22:00 UTC (rev 1114) @@ -693,8 +693,12 @@ GtkWidget *calendar_vbox; GtkWidget *event_marker_type_combobox; GtkWidget *today_marker_type_combobox; - GtkWidget *header_color_picker; + GtkWidget *background_color_picker; + GtkWidget *header_bg_color_picker; + GtkWidget *header_fg_color_picker; GtkWidget *weekend_color_picker; + GtkWidget *day_color_picker; + GtkWidget *pf_day_color_picker; GtkWidget *selection_color_picker; GtkWidget *mark_color_picker; GtkWidget *mark_current_day_color_picker; Modified: trunk/src/tasks_items.c =================================================================== --- trunk/src/tasks_items.c 2017-02-25 22:04:34 UTC (rev 1113) +++ trunk/src/tasks_items.c 2017-03-05 23:22:00 UTC (rev 1114) @@ -358,14 +358,7 @@ appGUI->tsk->td_calendar = gui_calendar_new(); gui_calendar_set_cursor_type (GUI_CALENDAR (appGUI->tsk->td_calendar), CURSOR_BLOCK); - gui_calendar_set_color (GUI_CALENDAR (appGUI->tsk->td_calendar), config.selection_color, config.selector_alpha, SELECTOR_COLOR); - gui_calendar_set_marker (GUI_CALENDAR (appGUI->tsk->td_calendar), config.today_marker_type, TODAY_MARKER); - gui_calendar_set_color (GUI_CALENDAR (appGUI->tsk->td_calendar), config.mark_current_day_color, config.mark_current_day_alpha, TODAY_MARKER_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->tsk->td_calendar), config.header_bg_color, 0, HEADER_BG_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->tsk->td_calendar), config.weekend_color, 0, WEEKEND_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->tsk->td_calendar), config.day_color, 0, DAY_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->tsk->td_calendar), config.header_fg_color, 0, HEADER_FG_COLOR); - gui_calendar_set_color (GUI_CALENDAR (appGUI->tsk->td_calendar), config.pf_day_color, 0, PF_DAY_COLOR); + gui_set_calendar_defaults(appGUI->tsk->td_calendar); gtk_widget_show (appGUI->tsk->td_calendar); g_signal_connect (G_OBJECT (appGUI->tsk->td_calendar), "day_selected_double_click", G_CALLBACK (day_selected_cb), appGUI); Modified: trunk/src/utils_gui.c =================================================================== --- trunk/src/utils_gui.c 2017-02-25 22:04:34 UTC (rev 1113) +++ trunk/src/utils_gui.c 2017-03-05 23:22:00 UTC (rev 1114) @@ -1010,7 +1010,7 @@ void utl_gui_convert_color_to_string (GdkRGBA *color, gchar *string) { g_snprintf (string, MAXCOLORNAME, "#%02X%02X%02X", - (guint)(color->red * 256), (guint)(color->green * 256), (guint)(color->blue * 256)); + (guint)(color->red * 255), (guint)(color->green * 255), (guint)(color->blue * 255)); } /*------------------------------------------------------------------------------*/ void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2017-02-08 00:45:51
|
Revision: 1109 http://sourceforge.net/p/osmo-pim/code/1109 Author: pasp Date: 2017-02-08 00:45:49 +0000 (Wed, 08 Feb 2017) Log Message: ----------- * GUI fixes - part 2 Modified Paths: -------------- trunk/src/calendar.c trunk/src/calendar_preferences_gui.c trunk/src/calendar_widget.c trunk/src/contacts.c trunk/src/notes.c trunk/src/tasks.c Modified: trunk/src/calendar.c =================================================================== --- trunk/src/calendar.c 2017-02-07 19:12:46 UTC (rev 1108) +++ trunk/src/calendar.c 2017-02-08 00:45:49 UTC (rev 1109) @@ -552,27 +552,19 @@ gchar *output = g_strdup (""); gchar *icon; const guint8 *moon_icon; -GdkRGBA color; moon_icon = cal_get_moon_icon (utl_calc_moon_phase (date)); icon = utl_inline_image_to_html (moon_icon); - gtk_style_context_get_background_color(gtk_widget_get_style_context(appGUI->main_window), GTK_STATE_NORMAL, &color); - utl_gui_convert_color_to_string(&color, tmpbuf); - output = utl_strconcat (output, "<html><head>", NULL); output = utl_strconcat (output, "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />", NULL); output = utl_strconcat (output, "<style type=\"text/css\">", NULL); output = utl_strconcat (output, "body {", NULL); - output = utl_strconcat (output, "background-color: ", tmpbuf, "; ", NULL); output = utl_strconcat (output, "line-height: 145\%; ", NULL); output = utl_strconcat (output, "font-family: ", pango_font_description_get_family (appGUI->cal->fd_notes_font), NULL); output = utl_strconcat (output, "}", NULL); output = utl_strconcat (output, "table { width: 100\%; vertical-align: middle; text-align: left; }", NULL); - /*output = utl_strconcat (output, "table { width: 100\%; vertical-align: middle; text-align: left; border: 1px solid #000; border-collapse: collapse;}", NULL);*/ - /*output = utl_strconcat (output, "td { border: 1px solid #000; }", NULL);*/ - /*output = utl_strconcat (output, "table { line-height: 18pt; }", NULL);*/ output = utl_strconcat (output, "img { vertical-align: middle; }", NULL); output = utl_strconcat (output, "th { width: 1\%; white-space: pre; }", NULL); output = utl_strconcat (output, "</style>", NULL); @@ -1863,6 +1855,9 @@ vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_set_hexpand (vbox3, FALSE); + gtk_widget_set_margin_start(vbox3, 8); + gtk_widget_set_margin_end(vbox3, 8); + gtk_widget_set_margin_bottom(vbox3, 8); gtk_widget_show (vbox3); if (appGUI->calendar_only == TRUE) { gtk_box_pack_start (GTK_BOX (vbox2), vbox3, TRUE, TRUE, 0); @@ -1975,6 +1970,10 @@ appGUI->cal->month_selector_menu = gtk_menu_new(); calendar_create_popup_menu (appGUI->cal->month_selector_menu, appGUI); + hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); + gtk_widget_show (hseparator); + gtk_box_pack_start (GTK_BOX (vbox3), hseparator, FALSE, FALSE, 6); + /*-------------------------------------------------------------------------------------*/ if (appGUI->calendar_only == FALSE) { @@ -2057,6 +2056,8 @@ appGUI->cal->notes_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (appGUI->cal->notes_vbox); + gtk_widget_set_margin_end(GTK_WIDGET(appGUI->cal->notes_vbox), 8); + gtk_widget_set_margin_bottom(GTK_WIDGET(appGUI->cal->notes_vbox), 8); if (!config.gui_layout) { gtk_box_pack_start (GTK_BOX (vbox3), appGUI->cal->notes_vbox, TRUE, TRUE, 0); } else { @@ -2082,10 +2083,6 @@ g_signal_connect (G_OBJECT (appGUI->cal->n_close_button), "clicked", G_CALLBACK (calendar_close_text_cb), appGUI); - vseparator = gtk_separator_new (GTK_ORIENTATION_VERTICAL); - gtk_widget_show (vseparator); - gtk_box_pack_end (GTK_BOX (hbox3), vseparator, FALSE, TRUE, 0); - appGUI->cal->ta_highlight_button = gtk_button_new_from_icon_name (OSMO_STOCK_EDITOR_HIGHLIGHT_S, GTK_ICON_SIZE_BUTTON); gtk_widget_show (appGUI->cal->ta_highlight_button); gtk_widget_set_can_focus (appGUI->cal->ta_highlight_button, FALSE); @@ -2229,6 +2226,8 @@ frame = gtk_frame_new (NULL); gtk_widget_show (frame); gtk_box_pack_start (GTK_BOX (appGUI->cal->day_info_vbox), frame, TRUE, TRUE, 0); + gtk_widget_set_margin_end(GTK_WIDGET(frame), 8); + gtk_widget_set_margin_bottom(GTK_WIDGET(frame), 8); gtk_frame_set_label_align (GTK_FRAME (frame), 0.98, 0.5); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); @@ -2240,9 +2239,6 @@ appGUI->cal->day_info_scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (appGUI->cal->day_info_scrolledwindow); -#ifndef HAVE_LIBWEBKIT - gtk_widget_set_margin_start(appGUI->cal->day_info_scrolledwindow, 8); -#endif /* HAVE_LIBWEBKIT */ gtk_container_add (GTK_CONTAINER (frame), appGUI->cal->day_info_scrolledwindow); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (appGUI->cal->day_info_scrolledwindow), GTK_SHADOW_NONE); @@ -2272,8 +2268,6 @@ gtk_widget_show (appGUI->cal->day_desc_textview); gtk_container_add (GTK_CONTAINER (appGUI->cal->day_info_scrolledwindow), appGUI->cal->day_desc_textview); gtk_widget_realize (appGUI->cal->day_desc_textview); - gtk_style_context_get_background_color(gtk_widget_get_style_context(appGUI->main_window), GTK_STATE_NORMAL, &color); - gtk_widget_override_background_color(appGUI->cal->day_desc_textview, GTK_STATE_FLAG_NORMAL, &color); appGUI->cal->day_desc_text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(appGUI->cal->day_desc_textview)); gtk_text_buffer_create_tag (appGUI->cal->day_desc_text_buffer, "bold", "weight", PANGO_WEIGHT_BOLD, NULL); Modified: trunk/src/calendar_preferences_gui.c =================================================================== --- trunk/src/calendar_preferences_gui.c 2017-02-07 19:12:46 UTC (rev 1108) +++ trunk/src/calendar_preferences_gui.c 2017-02-08 00:45:49 UTC (rev 1109) @@ -241,17 +241,17 @@ g_snprintf (tmpbuf, BUFFER_SIZE, "<span size='medium'><b>%s</b></span>:\n\n" - "<i><tt>%%a</tt></i> : %s\n" "<i><tt>%%A</tt></i> : %s\n" - "<i><tt>%%b</tt></i> : %s\n" "<i><tt>%%B</tt></i> : %s\n" - "<i><tt>%%d</tt></i> : %s\n" "<i><tt>%%D</tt></i> : %s\n" - "<i><tt>%%e</tt></i> : %s\n" "<i><tt>%%m</tt></i> : %s\n" - "<i><tt>%%y</tt></i> : %s\n" "<i><tt>%%Y</tt></i> : %s\n", + "<i><tt>%sa</tt></i> : %s\n" "<i><tt>%sA</tt></i> : %s\n" + "<i><tt>%sb</tt></i> : %s\n" "<i><tt>%sB</tt></i> : %s\n" + "<i><tt>%sd</tt></i> : %s\n" "<i><tt>%sD</tt></i> : %s\n" + "<i><tt>%se</tt></i> : %s\n" "<i><tt>%sm</tt></i> : %s\n" + "<i><tt>%sy</tt></i> : %s\n" "<i><tt>%sY</tt></i> : %s\n", _("Syntax"), - _("abbreviated weekday name"), _("full weekday name"), - _("abbreviated month name"), _("full month name"), - _("day of the month"), _("MM/DD/YY"), - _("day of the month without leading zeros"), _("month"), - _("year without century"), _("year with century") + "%%",_("abbreviated weekday name"), "%%", _("full weekday name"), + "%%", _("abbreviated month name"), "%%", _("full month name"), + "%%", _("day of the month"), "%%", _("MM/DD/YY"), + "%%", _("day of the month without leading zeros"), "%%", _("month"), + "%%", _("year without century"), "%%", _("year with century") ); utl_gui_create_dialog (GTK_MESSAGE_INFO, tmpbuf, GTK_WINDOW (appGUI->opt->window)); Modified: trunk/src/calendar_widget.c =================================================================== --- trunk/src/calendar_widget.c 2017-02-07 19:12:46 UTC (rev 1108) +++ trunk/src/calendar_widget.c 2017-02-08 00:45:49 UTC (rev 1109) @@ -140,8 +140,14 @@ static void get_next_month_color(GtkWidget *widget, GdkRGBA *color); static void get_selected_fg_color(GtkWidget *widget, GdkRGBA *color); static void get_background_color(GtkWidget *widget, GdkRGBA *color); + /*------------------------------------------------------------------------------*/ +/* default colors */ +#define PREV_NEXT_DAYS "#DDDDDD" + +/*------------------------------------------------------------------------------*/ + static void gui_calendar_class_init (GuiCalendarClass *class) { @@ -1974,7 +1980,7 @@ } - get_normal_day_color(widget, &text_color); + get_normal_day_color(widget, &text_color); /* mark saturday and sunday */ if (((col == 5 || col == 6) && (priv->week_start == 1)) || ((!col || col == 6) && !priv->week_start)) { @@ -3343,12 +3349,12 @@ static void get_prev_month_color(GtkWidget *widget, GdkRGBA *color) { - get_background_color(widget, color); + gdk_rgba_parse(color, PREV_NEXT_DAYS); } static void get_next_month_color(GtkWidget *widget, GdkRGBA *color) { - get_background_color(widget, color); + gdk_rgba_parse(color, PREV_NEXT_DAYS); } static void @@ -3359,4 +3365,4 @@ static void get_selected_fg_color(GtkWidget *widget, GdkRGBA *color) { gtk_style_context_get_color(gtk_widget_get_style_context(widget), gtk_widget_has_focus(widget) ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE, color); -} \ No newline at end of file +} Modified: trunk/src/contacts.c =================================================================== --- trunk/src/contacts.c 2017-02-07 19:12:46 UTC (rev 1108) +++ trunk/src/contacts.c 2017-02-08 00:45:49 UTC (rev 1109) @@ -803,6 +803,7 @@ GtkWidget *vbox2; GtkWidget *vbox3; GtkWidget *hbox2; +GtkWidget *frame; GtkWidget *hseparator; GtkWidget *label; GtkWidget *top_viewport; @@ -889,6 +890,9 @@ vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1); gtk_widget_show (vbox3); gtk_container_add (GTK_CONTAINER (top_viewport), vbox3); + gtk_widget_set_margin_start (vbox3, 8); + gtk_widget_set_margin_end (vbox3, 8); + gtk_widget_set_margin_bottom (vbox3, 8); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator); @@ -899,8 +903,8 @@ gtk_widget_show (label); gtk_label_set_use_markup (GTK_LABEL(label), TRUE); gtk_box_pack_start (GTK_BOX (vbox3), label, FALSE, FALSE, 0); - gtk_widget_set_valign(label, GTK_ALIGN_START); - gtk_widget_set_halign(label, GTK_ALIGN_CENTER); + gtk_widget_set_valign(label, GTK_ALIGN_CENTER); + gtk_widget_set_halign(label, GTK_ALIGN_START); hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_show (hbox2); @@ -1046,10 +1050,20 @@ gtk_box_pack_start (GTK_BOX (vbox2), appGUI->cnt->panel_hbox, FALSE, FALSE, 0); gtk_widget_show(appGUI->cnt->panel_hbox); - g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", _("Contact details")); + frame = gtk_frame_new (NULL); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (vbox2), frame, TRUE, TRUE, 0); + gtk_widget_set_margin_start(GTK_WIDGET(frame), 8); + gtk_widget_set_margin_end(GTK_WIDGET(frame), 8); + gtk_widget_set_margin_bottom(GTK_WIDGET(frame), 8); + gtk_frame_set_label_align (GTK_FRAME (frame), 0.98, 0.5); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + + g_snprintf(tmpbuf, BUFFER_SIZE, "<b>%s</b>", _("Contact details")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (appGUI->cnt->panel_hbox), label, FALSE, FALSE, 0); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_frame_set_label_widget (GTK_FRAME (frame), label); if (!config.gui_layout) { close_button = gtk_button_new_from_icon_name ("window-close", GTK_ICON_SIZE_BUTTON); @@ -1065,8 +1079,8 @@ appGUI->cnt->contacts_panel_scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (appGUI->cnt->contacts_panel_scrolledwindow); - gtk_box_pack_start (GTK_BOX (vbox2), appGUI->cnt->contacts_panel_scrolledwindow, TRUE, TRUE, 0); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (appGUI->cnt->contacts_panel_scrolledwindow), GTK_SHADOW_IN); + gtk_container_add (GTK_CONTAINER (frame), appGUI->cnt->contacts_panel_scrolledwindow); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (appGUI->cnt->contacts_panel_scrolledwindow), GTK_SHADOW_NONE); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (appGUI->cnt->contacts_panel_scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); #ifdef HAVE_LIBWEBKIT Modified: trunk/src/notes.c =================================================================== --- trunk/src/notes.c 2017-02-07 19:12:46 UTC (rev 1108) +++ trunk/src/notes.c 2017-02-08 00:45:49 UTC (rev 1109) @@ -1377,13 +1377,14 @@ gui_create_notes (GUI *appGUI) { GtkWidget *vbox1; +GtkWidget *vbox2; +GtkWidget *vbox3; GtkWidget *hbox1; GtkTextBuffer *buffer; GtkToolbar *notes_toolbar; GtkCellRenderer *renderer; GtkWidget *hseparator; GtkWidget *label; -GtkWidget *vseparator; GtkWidget *close_button; GtkWidget *find_backward_button; GtkWidget *find_forward_button; @@ -1404,7 +1405,6 @@ vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1); gtk_widget_show (vbox1); - gtk_container_set_border_width (GTK_CONTAINER (vbox1), 0); g_snprintf(tmpbuf, BUFFER_SIZE, "<b>%s</b>", _("Notes")); gui_add_to_notebook (vbox1, tmpbuf, appGUI); @@ -1440,17 +1440,22 @@ gtk_toolbar_set_icon_size(appGUI->nte->editor_toolbar, GTK_ICON_SIZE_LARGE_TOOLBAR); /*-------------------------------------------------------------------------------------*/ + /* selector */ + vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_selector), vbox2, TRUE, TRUE, 0); + gtk_widget_set_margin_start(GTK_WIDGET(vbox2), 8); + gtk_widget_set_margin_end(GTK_WIDGET(vbox2), 8); + gtk_widget_set_margin_bottom(GTK_WIDGET(vbox2), 8); - /* selector */ - hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_selector), hseparator, FALSE, TRUE, 6); + gtk_box_pack_start (GTK_BOX (vbox2), hseparator, FALSE, TRUE, 6); table = gtk_grid_new (); gtk_widget_show (table); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_selector), table, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), table, FALSE, TRUE, 0); gtk_grid_set_column_spacing (GTK_GRID (table), 4); g_snprintf(tmpbuf, BUFFER_SIZE, "<b>%s:</b>", _("Category")); @@ -1469,9 +1474,6 @@ appGUI->nte->n_items_label = gtk_label_new (""); gtk_widget_show (appGUI->nte->n_items_label); - if (appGUI->tiny_gui == FALSE) { - gtk_widget_set_size_request (appGUI->nte->n_items_label, 100, -1); - } gtk_label_set_use_markup (GTK_LABEL (appGUI->nte->n_items_label), TRUE); if (!config.gui_layout) { /* vertical */ @@ -1481,7 +1483,7 @@ if (appGUI->tiny_gui == FALSE) { gtk_widget_set_hexpand(appGUI->nte->cf_combobox, TRUE); } - gtk_grid_attach (GTK_GRID (table), appGUI->nte->cf_combobox, 1, 0, 1, 1); + gtk_grid_attach (GTK_GRID (table), appGUI->nte->cf_combobox, 1, 0, 1, 1); gtk_grid_attach (GTK_GRID (table), appGUI->nte->n_items_label, 3, 0, 1, 1); } else { @@ -1497,8 +1499,8 @@ label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - gtk_widget_set_valign(label, GTK_ALIGN_START); - gtk_widget_set_halign(label, GTK_ALIGN_CENTER); + gtk_widget_set_valign(label, GTK_ALIGN_CENTER); + gtk_widget_set_halign(label, GTK_ALIGN_START); appGUI->nte->notes_find_entry = gtk_entry_new(); gtk_entry_set_max_length(GTK_ENTRY(appGUI->nte->notes_find_entry), 128); @@ -1530,7 +1532,7 @@ gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1); - gtk_widget_set_hexpand(appGUI->nte->notes_find_entry, TRUE); + gtk_widget_set_hexpand(appGUI->nte->notes_find_entry, TRUE); gtk_grid_attach (GTK_GRID (table), appGUI->nte->notes_find_entry, 1, 0, 1, 1); gtk_grid_attach (GTK_GRID (table), appGUI->nte->notes_find_clear_button, 2, 0, 1, 1); @@ -1538,14 +1540,14 @@ hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_selector), hseparator, FALSE, TRUE, 6); + gtk_box_pack_start (GTK_BOX (vbox2), hseparator, FALSE, TRUE, 6); /*-------------------------------------------------------------------------------------*/ appGUI->nte->editor_viewport = gtk_viewport_new (NULL, NULL); gtk_widget_show (appGUI->nte->editor_viewport); gtk_viewport_set_shadow_type (GTK_VIEWPORT (appGUI->nte->editor_viewport), GTK_SHADOW_IN); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_selector), appGUI->nte->editor_viewport, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), appGUI->nte->editor_viewport, TRUE, TRUE, 0); appGUI->nte->scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (appGUI->nte->scrolled_win); @@ -1755,23 +1757,30 @@ /*-------------------------------------------------------------------------------------*/ /* editor */ + vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_widget_show (vbox3); + gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_editor), vbox3, TRUE, TRUE, 0); + gtk_widget_set_margin_start(GTK_WIDGET(vbox3), 8); + gtk_widget_set_margin_end(GTK_WIDGET(vbox3), 8); + gtk_widget_set_margin_bottom(GTK_WIDGET(vbox3), 8); + hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_editor), hseparator, FALSE, TRUE, 4); + gtk_box_pack_start (GTK_BOX (vbox3), hseparator, FALSE, TRUE, 4); appGUI->nte->title_label = gtk_label_new (""); gtk_widget_show (appGUI->nte->title_label); gtk_label_set_ellipsize (GTK_LABEL(appGUI->nte->title_label), PANGO_ELLIPSIZE_END); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_editor), appGUI->nte->title_label, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), appGUI->nte->title_label, FALSE, FALSE, 0); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_editor), hseparator, FALSE, TRUE, 4); + gtk_box_pack_start (GTK_BOX (vbox3), hseparator, FALSE, TRUE, 4); appGUI->nte->editor_viewport = gtk_viewport_new (NULL, NULL); gtk_widget_show (appGUI->nte->editor_viewport); gtk_viewport_set_shadow_type (GTK_VIEWPORT (appGUI->nte->editor_viewport), GTK_SHADOW_IN); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_editor), appGUI->nte->editor_viewport, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), appGUI->nte->editor_viewport, TRUE, TRUE, 0); appGUI->nte->editor_scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (appGUI->nte->editor_scrolledwindow); @@ -1801,7 +1810,7 @@ appGUI->nte->ro_editor_viewport = gtk_viewport_new (NULL, NULL); gtk_widget_show (appGUI->nte->ro_editor_viewport); gtk_viewport_set_shadow_type (GTK_VIEWPORT (appGUI->nte->ro_editor_viewport), GTK_SHADOW_IN); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_editor), appGUI->nte->ro_editor_viewport, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), appGUI->nte->ro_editor_viewport, TRUE, TRUE, 0); appGUI->nte->ro_editor_scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (appGUI->nte->ro_editor_scrolledwindow); @@ -1828,7 +1837,7 @@ hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1); gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_editor), hbox1, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 2); appGUI->nte->readonly_checkbutton = gtk_check_button_new_with_mnemonic (_("Read-only")); gtk_widget_set_can_focus(appGUI->nte->readonly_checkbutton, FALSE); @@ -1870,7 +1879,7 @@ appGUI->nte->find_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_show (appGUI->nte->find_hbox); - gtk_box_pack_start (GTK_BOX (appGUI->nte->vbox_editor), appGUI->nte->find_hbox, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox3), appGUI->nte->find_hbox, FALSE, FALSE, 0); appGUI->nte->find_next_flag = FALSE; @@ -1920,10 +1929,6 @@ g_signal_connect (G_OBJECT (close_button), "clicked", G_CALLBACK (editor_find_text_hide_cb), appGUI); - vseparator = gtk_separator_new (GTK_ORIENTATION_VERTICAL); - gtk_widget_show (vseparator); - gtk_box_pack_end (GTK_BOX (appGUI->nte->find_hbox), vseparator, FALSE, TRUE, 0); - gtk_widget_hide (appGUI->nte->find_hbox); appGUI->nte->changed = FALSE; Modified: trunk/src/tasks.c =================================================================== --- trunk/src/tasks.c 2017-02-07 19:12:46 UTC (rev 1108) +++ trunk/src/tasks.c 2017-02-08 00:45:49 UTC (rev 1109) @@ -1194,6 +1194,7 @@ GtkWidget *vbox3; GtkWidget *grid; GtkWidget *label; + GtkWidget *frame; GtkWidget *hseparator; GtkWidget *close_button; GtkCellRenderer *renderer; @@ -1287,7 +1288,7 @@ appGUI->tsk->tasks_paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL ); } else { appGUI->tsk->tasks_paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); - } + } gtk_widget_show (appGUI->tsk->tasks_paned); gtk_box_pack_start (GTK_BOX (vbox1), appGUI->tsk->tasks_paned, TRUE, TRUE, 0); @@ -1300,6 +1301,9 @@ vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1); gtk_widget_show (vbox3); gtk_container_add (GTK_CONTAINER (top_viewport), vbox3); + gtk_widget_set_margin_start (vbox3, 8); + gtk_widget_set_margin_end (vbox3, 8); + gtk_widget_set_margin_bottom (vbox3, 8); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator); @@ -1334,18 +1338,15 @@ appGUI->tsk->n_items_label = gtk_label_new (""); gtk_widget_show (appGUI->tsk->n_items_label); - if (appGUI->tiny_gui == FALSE) - gtk_widget_set_size_request (appGUI->tsk->n_items_label, 100, -1); - - gtk_grid_attach (GTK_GRID (grid), appGUI->tsk->n_items_label, 3, 0, 1, 1); + gtk_grid_attach (GTK_GRID (grid), appGUI->tsk->n_items_label, 4, 0, 2, 1); gtk_label_set_use_markup (GTK_LABEL (appGUI->tsk->n_items_label), TRUE); g_snprintf (tmpbuf, BUFFER_SIZE, "<b>%s:</b>", _("Search")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - gtk_widget_set_valign(label, GTK_ALIGN_START); - gtk_widget_set_halign(label, GTK_ALIGN_CENTER); + gtk_widget_set_valign(label, GTK_ALIGN_CENTER); + gtk_widget_set_halign(label, GTK_ALIGN_START); gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1); appGUI->tsk->tasks_find_entry = gtk_entry_new (); @@ -1353,8 +1354,8 @@ gtk_widget_show (appGUI->tsk->tasks_find_entry); g_signal_connect (G_OBJECT (appGUI->tsk->tasks_find_entry), "changed", G_CALLBACK (tasks_search_entry_changed_cb), appGUI); - gtk_widget_set_hexpand(appGUI->tsk->tasks_find_entry, TRUE); - gtk_grid_attach (GTK_GRID (grid), appGUI->tsk->tasks_find_entry, 1, 1, 3, 1); + gtk_widget_set_hexpand(appGUI->tsk->tasks_find_entry, TRUE); + gtk_grid_attach (GTK_GRID (grid), appGUI->tsk->tasks_find_entry, 1, 1, 4, 1); appGUI->tsk->tasks_find_clear_button = gtk_button_new_from_icon_name ("edit-clear", GTK_ICON_SIZE_BUTTON); gtk_widget_show (appGUI->tsk->tasks_find_clear_button); @@ -1366,7 +1367,7 @@ g_signal_connect (G_OBJECT (appGUI->tsk->tasks_find_clear_button), "clicked", G_CALLBACK (gui_clear_find_cb), appGUI); - gtk_grid_attach (GTK_GRID (grid), appGUI->tsk->tasks_find_clear_button, 4, 1, 1, 1); + gtk_grid_attach (GTK_GRID (grid), appGUI->tsk->tasks_find_clear_button, 5, 1, 1, 1); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator); @@ -1788,10 +1789,20 @@ gtk_box_pack_start (GTK_BOX (vbox2), appGUI->tsk->panel_hbox, FALSE, FALSE, 0); gtk_widget_show (appGUI->tsk->panel_hbox); - g_snprintf (tmpbuf, BUFFER_SIZE, "%s:", _("Task details")); + frame = gtk_frame_new (NULL); + gtk_widget_show (frame); + gtk_box_pack_start (GTK_BOX (vbox2), frame, TRUE, TRUE, 0); + gtk_widget_set_margin_start(GTK_WIDGET(frame), 8); + gtk_widget_set_margin_end(GTK_WIDGET(frame), 8); + gtk_widget_set_margin_bottom(GTK_WIDGET(frame), 8); + gtk_frame_set_label_align (GTK_FRAME (frame), 0.98, 0.5); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + + g_snprintf (tmpbuf, BUFFER_SIZE, "<b>%s</b>", _("Task details")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (appGUI->tsk->panel_hbox), label, FALSE, FALSE, 0); + gtk_frame_set_label_widget (GTK_FRAME (frame), label); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); if (!config.gui_layout) { close_button = gtk_button_new_from_icon_name("window-close", GTK_ICON_SIZE_BUTTON); @@ -1807,8 +1818,8 @@ appGUI->tsk->panel_scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (appGUI->tsk->panel_scrolledwindow); - gtk_box_pack_start (GTK_BOX (vbox2), appGUI->tsk->panel_scrolledwindow, TRUE, TRUE, 0); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (appGUI->tsk->panel_scrolledwindow), GTK_SHADOW_IN); + gtk_container_add (GTK_CONTAINER (frame), appGUI->tsk->panel_scrolledwindow); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (appGUI->tsk->panel_scrolledwindow), GTK_SHADOW_NONE); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (appGUI->tsk->panel_scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); #ifdef HAVE_LIBWEBKIT @@ -1841,6 +1852,5 @@ gtk_widget_grab_focus (appGUI->tsk->tasks_find_entry); } - /*------------------------------------------------------------------------------*/ #endif /* TASKS_ENABLED */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pa...@us...> - 2017-02-07 19:12:50
|
Revision: 1108 http://sourceforge.net/p/osmo-pim/code/1108 Author: pasp Date: 2017-02-07 19:12:46 +0000 (Tue, 07 Feb 2017) Log Message: ----------- * GUI fixes - part 1 Modified Paths: -------------- trunk/src/Makefile.am trunk/src/backup.c trunk/src/calendar.c trunk/src/calendar_calc.c trunk/src/calendar_fullyear.c trunk/src/calendar_ical.c trunk/src/calendar_jumpto.c trunk/src/calendar_preferences_gui.c trunk/src/calendar_print.c trunk/src/calendar_timeline.c trunk/src/contacts.c trunk/src/contacts_export.c trunk/src/contacts_import.c trunk/src/contacts_items.c trunk/src/gui.c trunk/src/main.c trunk/src/notes.c trunk/src/notes_items.c trunk/src/stock_icons.c trunk/src/tasks.c trunk/src/tasks_items.c trunk/src/utils_gui.c Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/Makefile.am 2017-02-07 19:12:46 UTC (rev 1108) @@ -1,9 +1,9 @@ AUTOMAKE_OPTIONS = -Wno-portability -REVISION := $(shell if test -e .svn; then echo -DREV=\"`LC_ALL=C svn info | sed -n '/^Rev/p'| sed -e 's/^Revision:\ //'`\"; fi;) +REVISION := "$(shell LC_ALL=C svnversion -cn ../ | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/" | grep "[0-9]" )" VERSION_MAJOR := $(shell echo $(VERSION) | awk -F "." '{print $$1}') VERSION_MINOR := $(shell echo $(VERSION) | awk -F "." '{print $$2}') VERSION_MICRO := $(shell echo $(VERSION) | awk -F "." '{print $$3}') -AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" $(REVISION) -DDATADIR=\"$(datadir)\" \ +AM_CPPFLAGS = -DREV=$(REVISION) -DLOCALEDIR=\"$(datadir)/locale\" -DDATADIR=\"$(datadir)\" \ -DSOUNDSDIR=\"$(datadir)/sounds\" -DVERSION_MAJOR=\"$(VERSION_MAJOR)\" -DVERSION_MINOR=\"$(VERSION_MINOR)\" -DVERSION_MICRO=\"$(VERSION_MICRO)\" \ @GTK_CFLAGS@ @XML_CPPFLAGS@ -Wall dnl -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DG_DISABLE_CAST_CHECKS Modified: trunk/src/backup.c =================================================================== --- trunk/src/backup.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/backup.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -268,8 +268,8 @@ bck_p1_entry = gtk_entry_new (); gtk_widget_show (bck_p1_entry); gtk_container_add (GTK_CONTAINER (frame), bck_p1_entry); - gtk_widget_set_margin_left(bck_p1_entry, 16); - gtk_widget_set_margin_right(bck_p1_entry, 4); + gtk_widget_set_margin_start(bck_p1_entry, 16); + gtk_widget_set_margin_end(bck_p1_entry, 4); gtk_widget_set_margin_top(bck_p1_entry, 4); gtk_widget_set_margin_bottom(bck_p1_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (bck_p1_entry), 8226); @@ -289,8 +289,8 @@ bck_p2_entry = gtk_entry_new (); gtk_widget_show (bck_p2_entry); gtk_container_add (GTK_CONTAINER (frame), bck_p2_entry); - gtk_widget_set_margin_left(bck_p2_entry, 16); - gtk_widget_set_margin_right(bck_p2_entry, 4); + gtk_widget_set_margin_start(bck_p2_entry, 16); + gtk_widget_set_margin_end(bck_p2_entry, 4); gtk_widget_set_margin_top(bck_p2_entry, 4); gtk_widget_set_margin_bottom(bck_p2_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (bck_p2_entry), 8226); @@ -492,8 +492,8 @@ pass_entry = gtk_entry_new (); gtk_widget_show (pass_entry); gtk_container_add (GTK_CONTAINER (frame), pass_entry); - gtk_widget_set_margin_left(pass_entry, 16); - gtk_widget_set_margin_right(pass_entry, 4); + gtk_widget_set_margin_start(pass_entry, 16); + gtk_widget_set_margin_end(pass_entry, 4); gtk_widget_set_margin_top(pass_entry, 4); gtk_widget_set_margin_bottom(pass_entry, 4); gtk_entry_set_invisible_char (GTK_ENTRY (pass_entry), 8226); Modified: trunk/src/calendar.c =================================================================== --- trunk/src/calendar.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/calendar.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -1782,7 +1782,7 @@ vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox1); - gtk_container_set_border_width (GTK_CONTAINER (vbox1), 8); + gtk_container_set_border_width (GTK_CONTAINER (vbox1), 0); g_snprintf (tmpbuf, BUFFER_SIZE, "<b>%s</b>", _("Calendar")); gui_add_to_notebook (vbox1, tmpbuf, appGUI); @@ -1862,6 +1862,7 @@ } vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_widget_set_hexpand (vbox3, FALSE); gtk_widget_show (vbox3); if (appGUI->calendar_only == TRUE) { gtk_box_pack_start (GTK_BOX (vbox2), vbox3, TRUE, TRUE, 0); @@ -1944,7 +1945,7 @@ hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator); - gtk_box_pack_start (GTK_BOX (vbox3), hseparator, FALSE, FALSE, 6); + gtk_box_pack_start (GTK_BOX (vbox3), hseparator, FALSE, FALSE, 6); appGUI->cal->calendar = gui_calendar_new (); gtk_widget_show (appGUI->cal->calendar); @@ -2240,7 +2241,7 @@ appGUI->cal->day_info_scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (appGUI->cal->day_info_scrolledwindow); #ifndef HAVE_LIBWEBKIT - gtk_widget_set_margin_left(appGUI->cal->day_info_scrolledwindow, 8); + gtk_widget_set_margin_start(appGUI->cal->day_info_scrolledwindow, 8); #endif /* HAVE_LIBWEBKIT */ gtk_container_add (GTK_CONTAINER (frame), appGUI->cal->day_info_scrolledwindow); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (appGUI->cal->day_info_scrolledwindow), Modified: trunk/src/calendar_calc.c =================================================================== --- trunk/src/calendar_calc.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/calendar_calc.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -318,7 +318,7 @@ ts, ngettext ("second", "seconds", ts)); gtk_label_set_markup (GTK_LABEL (appGUI->cal->label_result_1_2), tmpbuf); - g_snprintf (tmpbuf, BUFFER_SIZE, "<small>(%s: %d %s, %d %s, %d %s, %d %s)</small>", + g_snprintf (tmpbuf, BUFFER_SIZE, "(%s: %d %s, %d %s, %d %s, %d %s)", _("or"), days, ngettext ("day", "days", days), th, ngettext ("hour", "hours", th), @@ -331,7 +331,7 @@ hours = minutes / 60; weeks = (gint) (hours / (24 * 7)); working_days = days - we_d + 1; - g_snprintf (tmpbuf, BUFFER_SIZE, "<small>%llu %s\n%llu %s (%s)\n%llu %s (%s)\n%d %s (%s)\n%d %s (%s)\n%d %s (%s)</small>", + g_snprintf (tmpbuf, BUFFER_SIZE, "%llu %s\n%llu %s (%s)\n%llu %s (%s)\n%d %s (%s)\n%d %s (%s)\n%d %s (%s)", seconds, ngettext ("second", "seconds", seconds), minutes, ngettext ("minute", "minutes", minutes), _("rounded down"), hours, ngettext ("hour", "hours", hours), _("rounded down"), @@ -344,7 +344,7 @@ E = 100.0 * sin (2.0 * M_PI * days / 28.0); I = 100.0 * sin (2.0 * M_PI * days / 33.0); g_snprintf (tmpbuf2, BUFFER_SIZE, - "<small>\n\nBiorhythms:\nPhysical: %d%%, Emotional: %d%%, Intellectual: %d%%</small>", P, E, I); + "\n\nBiorhythms:\nPhysical: %d%%, Emotional: %d%%, Intellectual: %d%%", P, E, I); g_strlcat (tmpbuf, tmpbuf2, BUFFER_SIZE); } @@ -521,16 +521,16 @@ if (ignore_weekend_days) { str = utl_date_print_j (julian, DATE_FULL, config.override_locale_settings); - text = g_strdup_printf ("<big>%s</big>\n<small>(%d %s)</small>", str, + text = g_strdup_printf ("<span size=\"xx-large\">%s</span>\n(%d %s)", str, wd_n, ngettext ("weekend day ignored", "weekend days ignored", wd_n)); } else if (hour == 0 && minute == 0 && second == 0) { str = utl_date_print_j (julian, DATE_FULL, config.override_locale_settings); - text = g_strdup_printf ("<big>%s</big>", str); + text = g_strdup_printf ("<span size=\"xx-large\">%s</span>", str); } else { str = utl_date_time_print_js (julian, DATE_FULL, utl_time_hms_to_seconds (hour, minute, second), TIME_HH_MM_SS, config.override_locale_settings); - text = g_strdup_printf ("<big>%s</big>", str); + text = g_strdup_printf ("<span size=\"xx-large\">%s</span>", str); } gtk_label_set_markup (GTK_LABEL (appGUI->cal->label2_result), text); g_free (str); @@ -675,18 +675,14 @@ frame = gtk_frame_new (NULL); gtk_widget_show (frame); - if (!config.gui_layout) { - gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, FALSE, 0); - } else { - gtk_box_pack_start (GTK_BOX (vbox99), frame, FALSE, FALSE, 0); - } + gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame), 4); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_show (hbox1); - gtk_widget_set_margin_left(hbox1, 16); - gtk_widget_set_margin_right(hbox1, 4); + gtk_widget_set_margin_start(hbox1, 16); + gtk_widget_set_margin_end(hbox1, 4); gtk_widget_set_margin_top(hbox1, 4); gtk_widget_set_margin_bottom(hbox1, 4); gtk_container_add (GTK_CONTAINER (frame), hbox1); @@ -832,18 +828,14 @@ frame = gtk_frame_new (NULL); gtk_widget_show (frame); - if (!config.gui_layout) { - gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, FALSE, 0); - } else { - gtk_box_pack_start (GTK_BOX (vbox99), frame, FALSE, FALSE, 0); - } + gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame), 4); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_show (hbox2); - gtk_widget_set_margin_left(hbox2, 16); - gtk_widget_set_margin_right(hbox2, 4); + gtk_widget_set_margin_start(hbox2, 16); + gtk_widget_set_margin_end(hbox2, 4); gtk_widget_set_margin_top(hbox2, 4); gtk_widget_set_margin_bottom(hbox2, 4); gtk_container_add (GTK_CONTAINER (frame), hbox2); @@ -987,30 +979,20 @@ gtk_frame_set_label_widget (GTK_FRAME (frame), label); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - if (!config.gui_layout) { - hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); - gtk_widget_show (hseparator); - gtk_box_pack_start (GTK_BOX (vbox2), hseparator, FALSE, FALSE, 6); - } else { - hseparator = gtk_separator_new (GTK_ORIENTATION_VERTICAL); - gtk_widget_show (hseparator); - gtk_box_pack_start (GTK_BOX (hbox99), hseparator, FALSE, FALSE, 6); - } + hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); + gtk_widget_show (hseparator); + gtk_box_pack_start (GTK_BOX (vbox2), hseparator, FALSE, FALSE, 6); frame = gtk_frame_new (NULL); gtk_widget_show (frame); - if (!config.gui_layout) { - gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, FALSE, 0); - } else { - gtk_box_pack_start (GTK_BOX (hbox99), frame, FALSE, FALSE, 0); - } + gtk_box_pack_start (GTK_BOX (vbox2), frame, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame), 4); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); vbox_result = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox_result); - gtk_widget_set_margin_left(vbox_result, 20); - gtk_widget_set_margin_right(vbox_result, 8); + gtk_widget_set_margin_start(vbox_result, 20); + gtk_widget_set_margin_end(vbox_result, 8); gtk_widget_set_margin_top(vbox_result, 8); gtk_widget_set_margin_bottom(vbox_result, 8); gtk_container_add (GTK_CONTAINER (frame), vbox_result); @@ -1030,7 +1012,7 @@ gtk_label_set_selectable (GTK_LABEL (appGUI->cal->label_result_2), 1); gtk_box_pack_start (GTK_BOX (vbox_result), appGUI->cal->label_result_2, TRUE, TRUE, 0); - g_snprintf (tmpbuf, BUFFER_SIZE, "<small>\n<i>%s:</i></small>", _("Alternative time units")); + g_snprintf (tmpbuf, BUFFER_SIZE, "\n<i>%s:</i>\n", _("Alternative time units")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (vbox_result), label, FALSE, FALSE, 0); @@ -1065,18 +1047,14 @@ frame = gtk_frame_new (NULL); gtk_widget_show (frame); - if (!config.gui_layout) { - gtk_box_pack_start (GTK_BOX (vbox7), frame, FALSE, FALSE, 0); - } else { - gtk_box_pack_start (GTK_BOX (hbox98), frame, FALSE, FALSE, 0); - } + gtk_box_pack_start (GTK_BOX (vbox7), frame, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame), 4); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); vbox22 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox22); - gtk_widget_set_margin_left(vbox22, 16); - gtk_widget_set_margin_right(vbox22, 4); + gtk_widget_set_margin_start(vbox22, 16); + gtk_widget_set_margin_end(vbox22, 4); gtk_widget_set_margin_top(vbox22, 4); gtk_widget_set_margin_bottom(vbox22, 4); gtk_container_add (GTK_CONTAINER (frame), vbox22); @@ -1247,17 +1225,13 @@ frame = gtk_frame_new (NULL); gtk_widget_show (frame); - if (!config.gui_layout) { - gtk_box_pack_start (GTK_BOX (vbox7), frame, FALSE, FALSE, 0); - } else { - gtk_box_pack_start (GTK_BOX (hbox98), frame, FALSE, FALSE, 0); - } + gtk_box_pack_start (GTK_BOX (vbox7), frame, FALSE, FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (frame), 4); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); vbox10 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox10); - gtk_widget_set_margin_left(vbox10, 12); + gtk_widget_set_margin_start(vbox10, 12); gtk_container_add (GTK_CONTAINER (frame), vbox10); table = gtk_grid_new (); @@ -1399,8 +1373,8 @@ hbox12 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_widget_show (hbox12); - gtk_widget_set_margin_left(hbox12, 20); - gtk_widget_set_margin_right(hbox12, 8); + gtk_widget_set_margin_start(hbox12, 20); + gtk_widget_set_margin_end(hbox12, 8); gtk_widget_set_margin_top(hbox12, 8); gtk_widget_set_margin_bottom(hbox12, 8); gtk_container_add (GTK_CONTAINER (frame), hbox12); Modified: trunk/src/calendar_fullyear.c =================================================================== --- trunk/src/calendar_fullyear.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/calendar_fullyear.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -141,8 +141,8 @@ selected_date[idx].appGUI = appGUI; g_signal_connect (G_OBJECT (appGUI->cal->calendar_buttons[idx]), "clicked", G_CALLBACK (select_date_day_cb), &selected_date[idx]); - gtk_button_set_label (GTK_BUTTON (appGUI->cal->calendar_buttons[idx]), ""); - // FIXME gtk_label_set_markup (GTK_LABEL (GTK_BIN (appGUI->cal->calendar_buttons[idx])->child), tmpbuf); + GList *btnCh = gtk_container_get_children(GTK_CONTAINER (appGUI->cal->calendar_buttons[idx])); + gtk_label_set_markup (GTK_LABEL (btnCh->data), tmpbuf); gtk_widget_show (appGUI->cal->calendar_buttons[idx]); } else { @@ -513,17 +513,16 @@ gtk_widget_show (label); gtk_grid_attach (GTK_GRID (appGUI->cal->fycal_table_1), label, 0, month + 1, 1, 1); - gtk_widget_set_margin_left (label, 8); - gtk_widget_set_margin_right (label, 8); + gtk_widget_set_margin_start (label, 8); + gtk_widget_set_margin_end (label, 8); gtk_label_set_markup (GTK_LABEL (label), tmpbuf); if (config.fy_simple_view == FALSE) { label = gtk_label_new (NULL); gtk_widget_show (label); gtk_grid_attach (GTK_GRID (appGUI->cal->fycal_table_1), label, FULL_YEAR_COLS + 3, month + 1, 1, 1); - - gtk_widget_set_margin_left (label, 8); - gtk_widget_set_margin_right (label, 8); + gtk_widget_set_margin_start (label, 8); + gtk_widget_set_margin_end (label, 8); gtk_label_set_markup (GTK_LABEL (label), tmpbuf); } } @@ -546,8 +545,8 @@ label = gtk_label_new (NULL); gtk_widget_show (label); gtk_grid_attach (GTK_GRID (appGUI->cal->fycal_table_1), label, i + 2, 0, 1, 1); - gtk_widget_set_margin_left (label, 4); - gtk_widget_set_margin_right (label, 4); + gtk_widget_set_margin_start (label, 4); + gtk_widget_set_margin_end (label, 4); if (rotate) gtk_label_set_angle (GTK_LABEL (label), 90); gtk_label_set_markup (GTK_LABEL (label), tmpbuf); @@ -556,8 +555,8 @@ label = gtk_label_new (NULL); gtk_widget_show (label); gtk_grid_attach (GTK_GRID (appGUI->cal->fycal_table_1), label, i + 2, MAX_MONTHS + 3, 1, 1); - gtk_widget_set_margin_left (label, 4); - gtk_widget_set_margin_right (label, 4); + gtk_widget_set_margin_start (label, 4); + gtk_widget_set_margin_end (label, 4); if (rotate) gtk_label_set_angle (GTK_LABEL (label), 90); gtk_label_set_markup (GTK_LABEL (label), tmpbuf); @@ -571,7 +570,7 @@ i = month - 1; idx = i * FULL_YEAR_COLS + j; - appGUI->cal->calendar_buttons[idx] = gtk_button_new (); + appGUI->cal->calendar_buttons[idx] = gtk_button_new_with_label (""); gtk_widget_set_can_focus (appGUI->cal->calendar_buttons[idx], FALSE); gtk_button_set_relief (GTK_BUTTON (appGUI->cal->calendar_buttons[idx]), GTK_RELIEF_NONE); gtk_widget_show (appGUI->cal->calendar_buttons[idx]); Modified: trunk/src/calendar_ical.c =================================================================== --- trunk/src/calendar_ical.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/calendar_ical.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -1526,7 +1526,7 @@ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_widget_show (vbox2); - gtk_widget_set_margin_left(vbox2, 12); + gtk_widget_set_margin_start(vbox2, 12); gtk_container_add (GTK_CONTAINER (frame), vbox2); hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); @@ -1698,7 +1698,7 @@ hbox3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_widget_show (hbox3); - gtk_widget_set_margin_left(hbox3, 12); + gtk_widget_set_margin_start(hbox3, 12); gtk_container_add (GTK_CONTAINER (frame), hbox3); appGUI->cal->output_file_entry = gtk_entry_new (); Modified: trunk/src/calendar_jumpto.c =================================================================== --- trunk/src/calendar_jumpto.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/calendar_jumpto.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -132,7 +132,7 @@ } /*------------------------------------------------------------------------------*/ -/* FIXME */ + void jumpto_go_window_close_cb (GtkButton *button, gpointer user_data) { @@ -197,7 +197,7 @@ GtkWidget *cancel_button; GtkWidget *jumpto_button; gint win_xpos, win_ypos; -gchar tmpbuf[BUFFER_SIZE]; +gchar tmpbuf[BUFFER_SIZE]; appGUI->cal->jumpto_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (appGUI->cal->jumpto_window), _("Jump to date")); @@ -226,12 +226,10 @@ label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); - gtk_widget_set_margin_left (label, 8); - gtk_widget_set_margin_right (label, 8); + gtk_widget_set_margin_end (label, 8); appGUI->cal->day_entry = gtk_entry_new (); gtk_widget_show (appGUI->cal->day_entry); - gtk_widget_set_size_request (appGUI->cal->day_entry, 50, -1); gtk_entry_set_max_length (GTK_ENTRY(appGUI->cal->day_entry), 2); g_signal_connect (G_OBJECT (appGUI->cal->day_entry), "key_press_event", G_CALLBACK (day_key_press_cb), appGUI); @@ -241,12 +239,11 @@ label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); - gtk_widget_set_margin_left (label, 8); - gtk_widget_set_margin_right (label, 8); + gtk_widget_set_margin_start (label, 8); + gtk_widget_set_margin_end (label, 8); appGUI->cal->month_entry = gtk_entry_new (); gtk_widget_show (appGUI->cal->month_entry); - gtk_widget_set_size_request (appGUI->cal->month_entry, 50, -1); gtk_entry_set_max_length (GTK_ENTRY(appGUI->cal->month_entry), 2); g_signal_connect (G_OBJECT (appGUI->cal->month_entry), "key_press_event", G_CALLBACK (month_key_press_cb), appGUI); @@ -256,12 +253,11 @@ label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); - gtk_widget_set_margin_left (label, 8); - gtk_widget_set_margin_right (label, 8); + gtk_widget_set_margin_start (label, 8); + gtk_widget_set_margin_end (label, 8); appGUI->cal->year_entry = gtk_entry_new (); gtk_widget_show (appGUI->cal->year_entry); - gtk_widget_set_size_request (appGUI->cal->year_entry, 50, -1); gtk_entry_set_max_length (GTK_ENTRY(appGUI->cal->year_entry), 4); g_signal_connect (G_OBJECT (appGUI->cal->year_entry), "key_press_event", G_CALLBACK (year_key_press_cb), appGUI); Modified: trunk/src/calendar_preferences_gui.c =================================================================== --- trunk/src/calendar_preferences_gui.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/calendar_preferences_gui.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -465,7 +465,7 @@ appGUI->opt->notes_font_entry = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (appGUI->opt->notes_font_entry), config.notes_font); gtk_widget_set_can_focus(appGUI->opt->notes_font_entry, FALSE); - gtk_widget_set_hexpand(appGUI->opt->notes_font_entry, TRUE); + gtk_widget_set_hexpand(appGUI->opt->notes_font_entry, TRUE); gtk_grid_attach (GTK_GRID (table), appGUI->opt->notes_font_entry, 1, i, 5, 1); sel3.config = config.notes_font; @@ -480,27 +480,27 @@ i++; appGUI->opt->enable_block_cursor_checkbutton = gtk_check_button_new_with_mnemonic (_("Enable block cursor")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (appGUI->opt->enable_block_cursor_checkbutton), !config.cursor_type); - gtk_widget_set_hexpand(appGUI->opt->enable_block_cursor_checkbutton, TRUE); + gtk_widget_set_hexpand(appGUI->opt->enable_block_cursor_checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), appGUI->opt->enable_block_cursor_checkbutton, 0, i, 5, 1); g_signal_connect (G_OBJECT (appGUI->opt->enable_block_cursor_checkbutton), "toggled", G_CALLBACK (calendar_options_cb), appGUI); i++; label = utl_gui_create_label ("%s:", _("Cursor thickness")); gtk_grid_attach (GTK_GRID (table), label, 0, i, 1, 2); - gtk_widget_set_valign(label, GTK_ALIGN_START); - gtk_widget_set_halign(label, GTK_ALIGN_CENTER); + gtk_widget_set_valign(label, GTK_ALIGN_START); + gtk_widget_set_halign(label, GTK_ALIGN_CENTER); appGUI->opt->cft_label_1 = label; label = utl_gui_create_label ("<u>%s</u>", _("Thin")); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_grid_attach (GTK_GRID (table), label, 1, i, 4, 1); - gtk_widget_set_halign(label, GTK_ALIGN_START); + gtk_widget_set_halign(label, GTK_ALIGN_START); appGUI->opt->cft_label_2 = label; label = utl_gui_create_label ("<u>%s</u>", _("Thick")); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_grid_attach (GTK_GRID (table), label, 1, i, 4, 1); - gtk_widget_set_halign(label, GTK_ALIGN_END); + gtk_widget_set_halign(label, GTK_ALIGN_END); appGUI->opt->cft_label_3 = label; @@ -511,7 +511,7 @@ gtk_scale_set_draw_value (GTK_SCALE (appGUI->opt->cft_hscale), FALSE); // FIXME no replacement gtk_range_set_update_policy (GTK_RANGE (appGUI->opt->cft_hscale), GTK_UPDATE_DISCONTINUOUS); gtk_range_set_value (GTK_RANGE (appGUI->opt->cft_hscale), config.frame_cursor_thickness); - gtk_widget_set_hexpand(appGUI->opt->cft_hscale, TRUE); + gtk_widget_set_hexpand(appGUI->opt->cft_hscale, TRUE); gtk_grid_attach (GTK_GRID (table), appGUI->opt->cft_hscale, 1, i, 4, 1); g_signal_connect (G_OBJECT (appGUI->opt->cft_hscale), "value-changed", G_CALLBACK (cursor_thickness_changed_cb), appGUI); } @@ -1517,7 +1517,7 @@ i = 0; checkbutton = gtk_check_button_new_with_mnemonic (_("Week start on Monday")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.display_options & GUI_CALENDAR_WEEK_START_MONDAY); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (calendar_options_cb), appGUI); appGUI->opt->week_start_monday_checkbutton = checkbutton; @@ -1525,7 +1525,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Show day names")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.display_options & GUI_CALENDAR_SHOW_DAY_NAMES); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (calendar_options_cb), appGUI); appGUI->opt->show_day_names_checkbutton = checkbutton; @@ -1533,7 +1533,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("No month change")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.display_options & GUI_CALENDAR_NO_MONTH_CHANGE); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (calendar_options_cb), appGUI); appGUI->opt->no_month_change_checkbutton = checkbutton; @@ -1541,7 +1541,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Show week numbers")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.display_options & GUI_CALENDAR_SHOW_WEEK_NUMBERS); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (calendar_options_cb), appGUI); appGUI->opt->show_week_numbers_checkbutton = checkbutton; @@ -1549,7 +1549,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Simple view in full-year calendar")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.fy_simple_view); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (calendar_options_cb), appGUI); appGUI->opt->simple_view_in_fy_calendar_checkbutton = checkbutton; @@ -1557,7 +1557,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Enable auxilary calendars")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.enable_auxilary_calendars); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (calendar_options_cb), appGUI); appGUI->opt->enable_auxilary_calendars_checkbutton = checkbutton; @@ -1565,7 +1565,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Strikethrough past day notes")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.strikethrough_past_notes); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (calendar_options_cb), appGUI); appGUI->opt->strikethrough_past_notes_checkbutton = checkbutton; @@ -1573,7 +1573,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Ascending sorting in day notes browser")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.ascending_sorting_in_day_notes_browser); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (calendar_options_cb), appGUI); appGUI->opt->ascending_sorting_in_day_notes_checkbutton = checkbutton; @@ -1582,7 +1582,7 @@ #ifdef HAVE_GTKSPELL checkbutton = gtk_check_button_new_with_mnemonic (_("Enable spell checker in day notes")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.day_note_spell_checker); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (calendar_options_cb), appGUI); appGUI->opt->spell_checker_in_day_notes_checkbutton = checkbutton; @@ -1626,15 +1626,15 @@ i = 0; checkbutton = gtk_check_button_new_with_mnemonic (_("Current time")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_current_time); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); appGUI->opt->di_show_current_time_checkbutton = checkbutton; i++; - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); checkbutton = gtk_check_button_new_with_mnemonic (_("Show seconds")); - gtk_widget_set_margin_left(checkbutton, 16); + gtk_widget_set_margin_start(checkbutton, 16); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_current_time_seconds); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); @@ -1644,7 +1644,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Day number")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_day_number); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); appGUI->opt->di_show_day_number_checkbutton = checkbutton; @@ -1660,7 +1660,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Marked days")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_marked_days); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); appGUI->opt->di_show_marked_days_checkbutton = checkbutton; @@ -1668,7 +1668,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Week number")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_week_number); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); appGUI->opt->di_show_week_number_checkbutton = checkbutton; @@ -1676,7 +1676,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Weekend days")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_weekend_days); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); appGUI->opt->di_show_weekend_days_checkbutton = checkbutton; @@ -1684,7 +1684,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Day category")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_day_category); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); appGUI->opt->di_show_day_category_checkbutton = checkbutton; @@ -1692,7 +1692,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Moon phase")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_moon_phase); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); appGUI->opt->di_show_moon_phase_checkbutton = checkbutton; @@ -1700,7 +1700,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Day notes")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_notes); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); appGUI->opt->di_show_notes_checkbutton = checkbutton; @@ -1708,7 +1708,7 @@ i++; checkbutton = gtk_check_button_new_with_mnemonic (_("Zodiac sign")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), config.di_show_zodiac_sign); - gtk_widget_set_hexpand(checkbutton, TRUE); + gtk_widget_set_hexpand(checkbutton, TRUE); gtk_grid_attach (GTK_GRID (table), checkbutton, 0, i, 1, 1); g_signal_connect (G_OBJECT (checkbutton), "toggled", G_CALLBACK (day_info_panel_options_cb), appGUI); appGUI->opt->di_show_zodiac_sign_checkbutton = checkbutton; Modified: trunk/src/calendar_print.c =================================================================== --- trunk/src/calendar_print.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/calendar_print.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -585,7 +585,7 @@ table_fonts = gtk_grid_new (); gtk_widget_show (table_fonts); - gtk_widget_set_margin_left(table_fonts, 12); + gtk_widget_set_margin_start(table_fonts, 12); gtk_container_add (GTK_CONTAINER (frame1), table_fonts); gtk_grid_set_row_spacing (GTK_GRID (table_fonts), 4); gtk_grid_set_column_spacing (GTK_GRID (table_fonts), 4); @@ -704,7 +704,7 @@ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox2); - gtk_widget_set_margin_left(vbox2, 12); + gtk_widget_set_margin_start(vbox2, 12); gtk_container_add (GTK_CONTAINER (frame2), vbox2); appGUI->cal->print_tasks_checkbutton = gtk_check_button_new_with_mnemonic (_("Tasks")); @@ -768,7 +768,7 @@ table5 = gtk_grid_new (); gtk_widget_show (table5); - gtk_widget_set_margin_left(table5, 12); + gtk_widget_set_margin_start(table5, 12); gtk_container_add (GTK_CONTAINER (frame3), table5); gtk_grid_set_row_spacing (GTK_GRID (table5), 4); gtk_grid_set_column_spacing (GTK_GRID (table5), 4); Modified: trunk/src/calendar_timeline.c =================================================================== --- trunk/src/calendar_timeline.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/calendar_timeline.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -182,7 +182,7 @@ gtk_container_set_border_width (GTK_CONTAINER (timeline_table), 4); gtk_grid_set_column_spacing (GTK_GRID (timeline_table), 8); gtk_grid_set_row_spacing (GTK_GRID (timeline_table), 4); - gtk_widget_set_margin_left(timeline_table, 12); + gtk_widget_set_margin_start(timeline_table, 12); gtk_widget_set_margin_bottom(timeline_table, 12); gtk_container_add (GTK_CONTAINER (frame), timeline_table); Modified: trunk/src/contacts.c =================================================================== --- trunk/src/contacts.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/contacts.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -822,7 +822,7 @@ vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox1); - gtk_container_set_border_width (GTK_CONTAINER (vbox1), 8); + gtk_container_set_border_width (GTK_CONTAINER (vbox1), 0); g_snprintf(tmpbuf, BUFFER_SIZE, "<b>%s</b>", _("Contacts")); gui_add_to_notebook (vbox1, tmpbuf, appGUI); Modified: trunk/src/contacts_export.c =================================================================== --- trunk/src/contacts_export.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/contacts_export.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -900,7 +900,7 @@ vbox4 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox4); - gtk_widget_set_margin_left(vbox4, 12); + gtk_widget_set_margin_start(vbox4, 12); gtk_container_add (GTK_CONTAINER (frame), vbox4); gtk_container_set_border_width (GTK_CONTAINER (vbox4), 8); @@ -921,7 +921,7 @@ vbox4 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox4); - gtk_widget_set_margin_left(vbox4, 12); + gtk_widget_set_margin_start(vbox4, 12); gtk_container_add (GTK_CONTAINER (frame), vbox4); gtk_container_set_border_width (GTK_CONTAINER (vbox4), 8); @@ -954,7 +954,7 @@ scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow); - gtk_widget_set_margin_left(scrolledwindow, 12); + gtk_widget_set_margin_start(scrolledwindow, 12); gtk_container_add (GTK_CONTAINER (frame), scrolledwindow); gtk_container_set_border_width (GTK_CONTAINER (scrolledwindow), 8); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -1025,7 +1025,7 @@ hbox3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_widget_show (hbox3); - gtk_widget_set_margin_left(hbox3, 12); + gtk_widget_set_margin_start(hbox3, 12); gtk_container_add (GTK_CONTAINER (frame), hbox3); appGUI->cnt->output_file_entry = gtk_entry_new (); Modified: trunk/src/contacts_import.c =================================================================== --- trunk/src/contacts_import.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/contacts_import.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -257,7 +257,7 @@ hbox4 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_show (hbox4); - gtk_widget_set_margin_left(hbox4, 12); + gtk_widget_set_margin_start(hbox4, 12); gtk_container_add (GTK_CONTAINER (frame), hbox4); appGUI->cnt->input_file_entry = gtk_entry_new (); @@ -288,7 +288,7 @@ vbox4 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox4); - gtk_widget_set_margin_left(vbox4, 12); + gtk_widget_set_margin_start(vbox4, 12); gtk_container_add (GTK_CONTAINER (frame), vbox4); hbox6 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); @@ -704,16 +704,16 @@ appGUI->cnt->n_records_label = gtk_label_new (tmpbuf); gtk_widget_show (appGUI->cnt->n_records_label); gtk_box_pack_end (GTK_BOX (hbox1), appGUI->cnt->n_records_label, FALSE, FALSE, 0); - gtk_widget_set_margin_left (appGUI->cnt->n_records_label, 6); - gtk_widget_set_margin_right (appGUI->cnt->n_records_label, 6); + gtk_widget_set_margin_start (appGUI->cnt->n_records_label, 6); + gtk_widget_set_margin_end (appGUI->cnt->n_records_label, 6); g_snprintf(tmpbuf, BUFFER_SIZE, "<b>%s</b>", _("of")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_box_pack_end (GTK_BOX (hbox1), label, FALSE, FALSE, 0); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - gtk_widget_set_margin_left (label, 6); - gtk_widget_set_margin_right (label, 6); + gtk_widget_set_margin_start (label, 6); + gtk_widget_set_margin_end (label, 6); appGUI->cnt->current_record_spinbutton_adj = gtk_adjustment_new (1, 1, n_records, 1, 10, 0); appGUI->cnt->current_record_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (appGUI->cnt->current_record_spinbutton_adj), 1, 0); @@ -727,23 +727,23 @@ gtk_widget_show (label); gtk_box_pack_end (GTK_BOX (hbox1), label, FALSE, FALSE, 0); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - gtk_widget_set_margin_left (label, 6); - gtk_widget_set_margin_right (label, 6); + gtk_widget_set_margin_start (label, 6); + gtk_widget_set_margin_end (label, 6); g_snprintf(tmpbuf, BUFFER_SIZE, "<b>%s:</b>", _("Number fields per record")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); - gtk_widget_set_margin_left (label, 6); - gtk_widget_set_margin_right (label, 6); + gtk_widget_set_margin_start (label, 6); + gtk_widget_set_margin_end (label, 6); g_snprintf(tmpbuf, BUFFER_SIZE, "%d", appGUI->cnt->max_fields); max_fields_label = gtk_label_new (tmpbuf); gtk_widget_show (max_fields_label); gtk_box_pack_start (GTK_BOX (hbox1), max_fields_label, FALSE, FALSE, 0); - gtk_widget_set_margin_left (max_fields_label, 6); - gtk_widget_set_margin_right (max_fields_label, 6); + gtk_widget_set_margin_start (max_fields_label, 6); + gtk_widget_set_margin_end (max_fields_label, 6); hseparator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL); gtk_widget_show (hseparator); @@ -812,8 +812,8 @@ gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_valign(label, GTK_ALIGN_START); gtk_widget_set_halign(label, GTK_ALIGN_CENTER); - gtk_widget_set_margin_left (label, 8); - gtk_widget_set_margin_right (label, 8); + gtk_widget_set_margin_start (label, 8); + gtk_widget_set_margin_end (label, 8); g_snprintf(tmpbuf, BUFFER_SIZE, "<b>%s:</b>", _("Value")); label = gtk_label_new (tmpbuf); @@ -822,8 +822,8 @@ gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_valign(label, GTK_ALIGN_START); gtk_widget_set_halign(label, GTK_ALIGN_CENTER); - gtk_widget_set_margin_left (label, 8); - gtk_widget_set_margin_right (label, 8); + gtk_widget_set_margin_start (label, 8); + gtk_widget_set_margin_end (label, 8); appGUI->cnt->value_labels[i] = gtk_label_new (""); gtk_widget_show (appGUI->cnt->value_labels[i]); @@ -832,8 +832,8 @@ gtk_widget_set_size_request (appGUI->cnt->value_labels[i], 50, -1); gtk_widget_set_valign(appGUI->cnt->value_labels[i], GTK_ALIGN_START); gtk_widget_set_halign(appGUI->cnt->value_labels[i], GTK_ALIGN_CENTER); - gtk_widget_set_margin_left (appGUI->cnt->value_labels[i], 8); - gtk_widget_set_margin_right (appGUI->cnt->value_labels[i], 8); + gtk_widget_set_margin_start (appGUI->cnt->value_labels[i], 8); + gtk_widget_set_margin_end (appGUI->cnt->value_labels[i], 8); appGUI->cnt->field_type_comboboxes[i] = gtk_combo_box_text_new (); gtk_widget_show (appGUI->cnt->field_type_comboboxes[i]); Modified: trunk/src/contacts_items.c =================================================================== --- trunk/src/contacts_items.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/contacts_items.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -431,8 +431,8 @@ msg_selected.appGUI = msg->appGUI; g_signal_connect (G_OBJECT (msg->appGUI->cnt->select_date_calendar), "day_selected_double_click", G_CALLBACK (select_date_selected_cb), &msg_selected); - gtk_widget_set_margin_left(msg->appGUI->cnt->select_date_calendar, 4); - gtk_widget_set_margin_right(msg->appGUI->cnt->select_date_calendar, 4); + gtk_widget_set_margin_start(msg->appGUI->cnt->select_date_calendar, 4); + gtk_widget_set_margin_end(msg->appGUI->cnt->select_date_calendar, 4); gtk_widget_set_margin_top(msg->appGUI->cnt->select_date_calendar, 4); gtk_widget_set_margin_bottom(msg->appGUI->cnt->select_date_calendar, 4); gtk_box_pack_start (GTK_BOX (vbox1), msg->appGUI->cnt->select_date_calendar, TRUE, TRUE, 0); @@ -442,8 +442,8 @@ (config.display_options & GUI_CALENDAR_WEEK_START_MONDAY)); hbox1 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); - gtk_widget_set_margin_left(hbox1, 4); - gtk_widget_set_margin_right(hbox1, 4); + gtk_widget_set_margin_start(hbox1, 4); + gtk_widget_set_margin_end(hbox1, 4); gtk_widget_set_margin_top(hbox1, 4); gtk_widget_set_margin_bottom(hbox1, 4); gtk_widget_show (hbox1); @@ -636,16 +636,16 @@ gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_valign(label, GTK_ALIGN_START); gtk_widget_set_halign(label, GTK_ALIGN_CENTER); - gtk_widget_set_margin_left (label, 5); - gtk_widget_set_margin_right (label, 5); + gtk_widget_set_margin_start (label, 5); + gtk_widget_set_margin_end (label, 5); pos++; g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", _("Group")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_left(label, 4); - gtk_widget_set_margin_right(label, 4); + gtk_widget_set_margin_start(label, 4); + gtk_widget_set_margin_end(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -668,8 +668,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[i*2])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_left(label, 4); - gtk_widget_set_margin_right(label, 4); + gtk_widget_set_margin_start(label, 4); + gtk_widget_set_margin_end(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -718,8 +718,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[COLUMN_NAME_DAY_DATE*2])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_left(label, 4); - gtk_widget_set_margin_right(label, 4); + gtk_widget_set_margin_start(label, 4); + gtk_widget_set_margin_end(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -746,8 +746,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[COLUMN_PHOTO*2])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_left(label, 4); - gtk_widget_set_margin_right(label, 4); + gtk_widget_set_margin_start(label, 4); + gtk_widget_set_margin_end(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -785,8 +785,8 @@ gtk_grid_attach (GTK_GRID (table), label, 0, pos, 5, 1); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_halign(label, GTK_ALIGN_START); - gtk_widget_set_margin_left (label, 5); - gtk_widget_set_margin_right (label, 5); + gtk_widget_set_margin_start (label, 5); + gtk_widget_set_margin_end (label, 5); pos++; @@ -795,8 +795,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(contact_replace_tags[i-COLUMN_HOME_ADDRESS])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_left(label, 4); - gtk_widget_set_margin_right(label, 4); + gtk_widget_set_margin_start(label, 4); + gtk_widget_set_margin_end(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -820,8 +820,8 @@ gtk_grid_attach (GTK_GRID (table), label, 0, pos, 5, 1); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_halign(label, GTK_ALIGN_START); - gtk_widget_set_margin_left (label, 5); - gtk_widget_set_margin_right (label, 5); + gtk_widget_set_margin_start (label, 5); + gtk_widget_set_margin_end (label, 5); pos++; @@ -834,8 +834,8 @@ } label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_left(label, 4); - gtk_widget_set_margin_right(label, 4); + gtk_widget_set_margin_start(label, 4); + gtk_widget_set_margin_end(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -859,8 +859,8 @@ gtk_grid_attach (GTK_GRID (table), label, 0, pos, 5, 1); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_halign(label, GTK_ALIGN_START); - gtk_widget_set_margin_left (label, 5); - gtk_widget_set_margin_right (label, 5); + gtk_widget_set_margin_start (label, 5); + gtk_widget_set_margin_end (label, 5); pos++; @@ -868,8 +868,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[i*2])); label = gtk_label_new (tmpbuf); - gtk_widget_set_margin_left(label, 4); - gtk_widget_set_margin_right(label, 4); + gtk_widget_set_margin_start(label, 4); + gtk_widget_set_margin_end(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -916,8 +916,8 @@ gtk_grid_attach (GTK_GRID (table), label, 0, pos, 5, 1); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_halign(label, GTK_ALIGN_START); - gtk_widget_set_margin_left (label, 5); - gtk_widget_set_margin_right (label, 5); + gtk_widget_set_margin_start (label, 5); + gtk_widget_set_margin_end (label, 5); pos++; @@ -926,8 +926,8 @@ g_snprintf(tmpbuf, BUFFER_SIZE, "%s:", gettext(appGUI->cnt->contact_fields_tags_name[i*2])); label = gtk_label_new (tmpbuf); gtk_widget_show (label); - gtk_widget_set_margin_left(label, 4); - gtk_widget_set_margin_right(label, 4); + gtk_widget_set_margin_start(label, 4); + gtk_widget_set_margin_end(label, 4); gtk_grid_attach (GTK_GRID (table), label, 0, pos, 2, 1); gtk_widget_set_halign(label, GTK_ALIGN_START); @@ -986,8 +986,8 @@ gtk_grid_attach (GTK_GRID (table), label, 0, pos, 5, 1); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_widget_set_halign(label, GTK_ALIGN_START); - gtk_widget_set_margin_left (label, 5); - gtk_widget_set_margin_right (label, 5); + gtk_widget_set_margin_start (label, 5); + gtk_widget_set_margin_end (label, 5); pos++; Modified: trunk/src/gui.c =================================================================== --- trunk/src/gui.c 2016-11-15 18:44:46 UTC (rev 1107) +++ trunk/src/gui.c 2017-02-07 19:12:46 UTC (rev 1108) @@ -83,7 +83,7 @@ cal_write_notes (appGUI); #ifdef TASKS_ENABLED - store_task_columns_info (appGUI); + store_task_columns_info (appGUI); write_tasks_entries (appGUI); #endif /* TASKS_ENABLED */ #ifdef HAVE_LIBICAL @@ -91,11 +91,11 @@ ics_calendar_refresh (appGUI); #endif /* HAVE_LIBICAL */ #ifdef CONTACTS_ENABLED - store_contact_columns_info (appGUI); + store_contact_columns_info (appGUI); write_contacts_entries (appGUI); #endif /* CONTACTS_ENABLED */ #ifdef NOTES_ENABLED - store_note_columns_info (appGUI); + store_note_columns_info (appGUI); write_notes_entries (appGUI); #endif /* NOTES_ENABLED */ prefs_write_config (appGUI); @@ -114,16 +114,16 @@ if (appGUI->window_visible == TRUE) { gtk_status_icon_set_from_icon_name (appGUI->osmo_trayicon, OSMO_STOCK_SYSTRAY_NORMAL); gtk_window_set_default_size (GTK_WINDOW(appGUI->main_window), - config.window_size_x, config.window_size_y); + config.window_size_x, config.window_size_y); gtk_window_move (GTK_WINDOW (appGUI->main_window), config.window_x, config.window_y); gtk_widget_show (appGUI->main_window); } else { if (appGUI->calendar_only == FALSE) { gui_save_all_data (appGUI); - gtk_window_get_size (GTK_WINDOW(appGUI->main_window), - &config.window_size_x, &config.window_size_y); - gdk_window_get_root_origin (gtk_widget_get_window(appGUI->main_window), - &config.window_x, &config.window_y); + gtk_window_get_size (GTK_WINDOW(appGUI->main_window), + &config.window_size_x, &config.window_size_y); + gdk_window_get_root_origin (gtk_widget_get_window(appGUI->main_window), + &config.window_x, &config.window_y); } gtk_widget_hide (appGUI->main_window); } @@ -134,13 +134,13 @@ void gui_toggle_fullscreen (GUI *appGUI) { - if (config.fullscreen == FALSE) { - gtk_window_fullscreen (GTK_WINDOW(appGUI->main_window)); - config.fullscreen = TRUE; - } else { - gtk_window_unfullscreen (GTK_WINDOW(appGUI->main_window)); - config.fullscreen = FALSE; - } + if (config.fullscreen == FALSE) { + gtk_window_fullscreen (GTK_WINDOW(appGUI->main_window)); + config.fullscreen = TRUE; + } else { + gtk_window_unfullscreen (GTK_WINDOW(appGUI->main_window)); + config.fullscreen = FALSE; + } } /*------------------------------------------------------------------------------*/ @@ -150,7 +150,7 @@ #ifdef NOTES_ENABLED if (appGUI->nte->editor_active == TRUE) { - editor_close_cb (NULL, appGUI); + editor_close_cb (NULL, appGUI); } #endif /* NOTES_ENABLED */ @@ -188,10 +188,10 @@ gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON(appGUI->cal->notes_button), FALSE); if (appGUI->window_visible == TRUE) { - if (!config.fullscreen) { - gtk_window_get_size (GTK_WINDOW(appGUI->main_window), - &config.window_size_x, &config.window_size_y); - } + if (!config.fullscreen) { + gtk_window_get_size (GTK_WINDOW(appGUI->main_window), + &config.window_size_x, &config.window_size_y); + } } } @@ -242,13 +242,13 @@ #ifdef NOTES_ENABLED if (appGUI->current_tab == PAGE_NOTES) { - gtk_widget_grab_focus (GTK_WIDGET(appGUI->nte->notes_find_entry)); - } + gtk_widget_grab_focus (GTK_WIDGET(appGUI->nte->notes_find_entry)); + } #endif /* NOTES_ENABLED */ #ifdef TASKS_ENABLED if (appGUI->current_tab == PAGE_TASKS) { - gtk_widget_grab_focus (GTK_WIDGET(appGUI->tsk->tasks_find_entry)); + gtk_widget_grab_focus (GTK_WIDGET(appGUI->tsk->tasks_find_entry)); } #endif /* TASKS_ENABLED */ @@ -341,7 +341,7 @@ } gtk_notebook_set_current_page (GTK_NOTEBOOK (appGUI->notebook), appGUI->current_tab); - gui_activate_find_fields (appGUI); + gui_activate_find_fields (appGUI); } @@ -350,20 +350,20 @@ static gint get_visible_tabs (GUI *appGUI) { - gint i = 0; + gint i = 0; - if (!config.hide_calendar) i++; + if (!config.hide_calendar) i++; #ifdef TASKS_ENABLED - if (!config.hide_tasks) i++; + if (!config.hide_tasks) i++; #endif /* TASKS_ENABLED */ #ifdef CONTACTS_ENABLED - if (!config.hide_contacts) i++; + if (!config.hide_contacts) i++; #endif /* CONTACTS_ENABLED */ #ifdef NOTES_ENABLED - if (!config.hide_notes) i++; + if (!config.hide_notes) i++; #endif /* NOTES_ENABLED */ - return i; + return i; } /*------------------------------------------------------------------------------*/ @@ -371,30 +371,30 @@ static void select_tab (gint tab, GUI *appGUI) { - gint i, n = 0; + gint i, n = 0; - if (tab >= get_visible_tabs (appGUI)) return; + if (tab >= get_visible_tabs (appGUI)) return; - for (i = PAGE_CALENDAR; i < NUMBER_OF_TABS; i++) { + for (i = PAGE_CALENDAR; i < NUMBER_OF_TABS; i++) { - if (i == PAGE_CALENDAR && !config.hide_calendar) n++; + if (i == PAGE_CALENDAR && !config.hide_calendar) n++; #ifdef TASKS_ENABLED - if (i == PAGE_TASKS && !config.hide_tasks) n++; + if (i == PAGE_TASKS && !config.hide_tasks) n++; #endif /* TASKS_ENABLED */ #ifdef CONTACTS_ENABLED - if (i == PAGE_CONTACTS && !config.hide_contacts) n++; + if (i == PAGE_CONTACTS && !config.hide_contacts) n++; #endif /* CONTACTS_ENABLED */ #ifdef NOTES_ENABLED - if (i == PAGE_NOTES && !config.hide_notes) n++; + if (i == PAGE_NOTES && !config.hide_notes) n++; #endif /* NOTES_ENABLED */ - if (n == tab + 1) { - gtk_notebook_set_current_page (GTK_NOTEBOOK (appGUI->notebook), i); - break; - } - } + if (n == tab + 1) { + gtk_notebook_set_current_page (GTK_NOTEBOOK (appGUI->notebook), i); + break; + } + } - gui_activate_find_fields (appGUI); + gui_activate_find_fields (appGUI); } /*------------------------------------------------------------------------------*/ @@ -423,8 +423,8 @@ gtk_widget_destroy(dialog); g_free(tmpbuff); } else if (appGUI->key_counter == 41) { - appGUI->cal->datecal_bio = TRUE; - } + appGUI->cal->datecal_bio = TRUE; + } } /*------------------------------------------------------------------------------*/ @@ -432,7 +432,7 @@ gint key_press_cb (GtkWidget *widget, GdkEventKey *event, GUI *appGUI) { - gint page; + gint page; page = gtk_notebook_get_current_page (GTK_NOTEBOOK(appGUI->notebook)); @@ -511,10 +511,10 @@ calendar_create_calc_window (appGUI); return TRUE; case GDK_KEY_a: - if (!config.gui_layout) { - gtk_expander_set_expanded (GTK_EXPANDER (appGUI->cal->aux_cal_expander), - !gtk_expander_get_expanded (GTK_EXPANDER (appGUI->cal->aux_cal_expander))); - } + if (!config.gui_layout) { + gtk_expander_set_expanded (GTK_EXPANDER (appGUI->cal->aux_cal_expander), + !gtk_expander_get_expanded (GTK_EXPANDER (appGUI->cal->aux_cal_expander))); + } key_counter_add (5, appGUI); return TRUE; case GDK_KEY_b: @@ -540,10 +540,10 @@ if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(appGUI->cal->notes_button)) == FALSE) { if (config.enable_systray == TRUE && appGUI->no_tray == FALSE && appGUI->calendar_only == FALSE) { gui_toggle_window_visibility (appGUI); - } - } else { - gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(appGUI->cal->notes_button), FALSE); - } + } + } else { + gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(appGUI->cal->notes_button), FALSE); + } } return TRUE; case GDK_KEY_L... [truncated message content] |
From: <mgo...@us...> - 2016-11-15 18:44:49
|
Revision: 1107 http://sourceforge.net/p/osmo-pim/code/1107 Author: mgordienko Date: 2016-11-15 18:44:46 +0000 (Tue, 15 Nov 2016) Log Message: ----------- Use correct parent windows for the file chooser dialogs Modified Paths: -------------- trunk/src/calendar_ical.c trunk/src/calendar_preferences_gui.c trunk/src/contacts_export.c trunk/src/contacts_import.c trunk/src/contacts_items.c Modified: trunk/src/calendar_ical.c =================================================================== --- trunk/src/calendar_ical.c 2016-11-14 22:25:30 UTC (rev 1106) +++ trunk/src/calendar_ical.c 2016-11-15 18:44:46 UTC (rev 1107) @@ -1183,7 +1183,7 @@ GUI *appGUI = (GUI *)data; dialog = utl_gui_create_save_file_dialog(_("Select output file"), - GTK_WINDOW(appGUI->main_window)); + GTK_WINDOW(appGUI->cal->ical_export_window)); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { Modified: trunk/src/calendar_preferences_gui.c =================================================================== --- trunk/src/calendar_preferences_gui.c 2016-11-14 22:25:30 UTC (rev 1106) +++ trunk/src/calendar_preferences_gui.c 2016-11-15 18:44:46 UTC (rev 1107) @@ -951,32 +951,6 @@ /* ========================================================================== */ -static GtkWidget * -ical_file_browser (GUI *appGUI) -{ - GtkWidget *dialog; - GtkFileFilter *filter_1, *filter_2; - - dialog = utl_gui_create_open_file_dialog (_("Select ICS file"), - GTK_WINDOW(appGUI->main_window)); - - filter_1 = gtk_file_filter_new (); - gtk_file_filter_add_pattern (filter_1, "*"); - gtk_file_filter_set_name (GTK_FILE_FILTER (filter_1), _("All Files")); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter_1); - - filter_2 = gtk_file_filter_new (); - gtk_file_filter_add_pattern (filter_2, "*.[iI][cC][sS]"); - gtk_file_filter_set_name (GTK_FILE_FILTER (filter_2), _("Calendar files (*.ics)")); - gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter_2); - - gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter_2); - - return dialog; -} - -/* ========================================================================== */ - static void calendar_ical_files_add_cb (GtkWidget *widget, GUI *appGUI) { @@ -1037,21 +1011,38 @@ return FALSE; } - /* ========================================================================== */ static void -calendar_ical_files_browse_cb (GtkWidget *widget, GUI *appGUI) +choose_ical_file (GtkEntry *entry, GUI *appGUI) { GtkWidget *dialog; + GtkFileFilter *filter_1, *filter_2; + GtkWidget *parent = gtk_widget_get_toplevel (GTK_WIDGET(entry)); - dialog = ical_file_browser (appGUI); + if(gtk_widget_is_toplevel(parent) == FALSE) { + parent = appGUI->main_window; + } + dialog = utl_gui_create_open_file_dialog (_("Select ICS file"), GTK_WINDOW(parent)); + filter_1 = gtk_file_filter_new (); + gtk_file_filter_add_pattern (filter_1, "*"); + gtk_file_filter_set_name (GTK_FILE_FILTER (filter_1), _("All Files")); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter_1); + + filter_2 = gtk_file_filter_new (); + gtk_file_filter_add_pattern (filter_2, "*.[iI][cC][sS]"); + gtk_file_filter_set_name (GTK_FILE_FILTER (filter_2), _("Calendar files (*.ics)")); + gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter_2); + + gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter_2); + + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { gtk_widget_hide (dialog); while (g_main_context_iteration (NULL, FALSE)); - gtk_entry_set_text (GTK_ENTRY (appGUI->opt->calendar_ical_files_filename_entry), + gtk_entry_set_text (entry, gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog))); calendar_ical_files_entry_key_release_cb (NULL, NULL, appGUI); @@ -1063,21 +1054,17 @@ /* ========================================================================== */ static void -ical_edit_filename_browse_cb (GtkWidget *widget, GUI *appGUI) +calendar_ical_files_browse_cb (GtkWidget *widget, GUI *appGUI) { - GtkWidget *dialog; + choose_ical_file(GTK_ENTRY (appGUI->opt->calendar_ical_files_filename_entry), appGUI); +} - dialog = ical_file_browser (appGUI); +/* ========================================================================== */ - if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { - gtk_widget_hide (dialog); - while (g_main_context_iteration (NULL, FALSE)); - - gtk_entry_set_text (GTK_ENTRY (appGUI->opt->ical_edit_filename_entry), - gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog))); - } - - gtk_widget_destroy (dialog); +static void +ical_edit_filename_browse_cb (GtkWidget *widget, GUI *appGUI) +{ + choose_ical_file(GTK_ENTRY (appGUI->opt->ical_edit_filename_entry), appGUI); } /* ========================================================================== */ Modified: trunk/src/contacts_export.c =================================================================== --- trunk/src/contacts_export.c 2016-11-14 22:25:30 UTC (rev 1106) +++ trunk/src/contacts_export.c 2016-11-15 18:44:46 UTC (rev 1107) @@ -690,7 +690,7 @@ GUI *appGUI = (GUI *)data; dialog = utl_gui_create_save_file_dialog(_("Select output file"), - GTK_WINDOW(appGUI->main_window)); + GTK_WINDOW(appGUI->cnt->export_window)); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { Modified: trunk/src/contacts_import.c =================================================================== --- trunk/src/contacts_import.c 2016-11-14 22:25:30 UTC (rev 1106) +++ trunk/src/contacts_import.c 2016-11-15 18:44:46 UTC (rev 1107) @@ -42,7 +42,7 @@ gboolean ret = FALSE; dialog = utl_gui_create_open_file_dialog(_("Select CSV file"), - GTK_WINDOW(appGUI->cnt->import_sel_window)); + GTK_WINDOW(appGUI->main_window)); filter_1 = gtk_file_filter_new(); gtk_file_filter_add_pattern(filter_1, "*"); Modified: trunk/src/contacts_items.c =================================================================== --- trunk/src/contacts_items.c 2016-11-14 22:25:30 UTC (rev 1106) +++ trunk/src/contacts_items.c 2016-11-15 18:44:46 UTC (rev 1107) @@ -496,7 +496,7 @@ GUI *appGUI = (GUI *)user_data; dialog = utl_gui_create_open_file_dialog(_("Select photo"), - GTK_WINDOW(appGUI->main_window)); + GTK_WINDOW (appGUI->cnt->contacts_add_window)); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { gtk_entry_set_text (GTK_ENTRY(appGUI->cnt->contact_entries[COLUMN_PHOTO]), gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-11-14 22:25:33
|
Revision: 1106 http://sourceforge.net/p/osmo-pim/code/1106 Author: mgordienko Date: 2016-11-14 22:25:30 +0000 (Mon, 14 Nov 2016) Log Message: ----------- Merge trunk into dbus Modified Paths: -------------- branches/dbus/src/backup.c branches/dbus/src/calendar_ical.c branches/dbus/src/calendar_preferences_gui.c branches/dbus/src/contacts_export.c branches/dbus/src/contacts_import.c branches/dbus/src/contacts_items.c branches/dbus/src/tasks_export.c branches/dbus/src/utils_gui.c branches/dbus/src/utils_gui.h Modified: branches/dbus/src/backup.c =================================================================== --- branches/dbus/src/backup.c 2016-11-14 22:17:44 UTC (rev 1105) +++ branches/dbus/src/backup.c 2016-11-14 22:25:30 UTC (rev 1106) @@ -224,19 +224,11 @@ /* select filename and password */ - dialog = gtk_file_chooser_dialog_new (_("Save backup"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_SAVE, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_Save"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_save_file_dialog (_("Save backup"), + GTK_WINDOW(appGUI->main_window)); + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), + utl_add_timestamp_to_filename("osmobackup", "bck")); - gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER(dialog), FALSE); - gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER(dialog), - utl_add_timestamp_to_filename ("osmobackup", "bck")); - gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER(dialog), TRUE); - ret = gtk_dialog_run(GTK_DIALOG(dialog)); if (ret == GTK_RESPONSE_CANCEL || ret == GTK_RESPONSE_DELETE_EVENT) { gtk_widget_destroy(dialog); @@ -440,17 +432,9 @@ GtkWidget *dialog, *passwd_dialog, *pass_entry; GtkWidget *passwd_content, *vbox1, *frame, *label; - dialog = gtk_file_chooser_dialog_new (_("Open backup file"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_OPEN, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_Open"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_open_file_dialog (_("Open backup file"), + GTK_WINDOW(appGUI->main_window)); - gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER(dialog), FALSE); - gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER(dialog), TRUE); - filter = gtk_file_filter_new(); gtk_file_filter_add_pattern(filter, "*.[bB][cC][kK]"); gtk_file_filter_set_name(GTK_FILE_FILTER(filter), _("Osmo backup files (*.bck)")); Modified: branches/dbus/src/calendar_ical.c =================================================================== --- branches/dbus/src/calendar_ical.c 2016-11-14 22:17:44 UTC (rev 1105) +++ branches/dbus/src/calendar_ical.c 2016-11-14 22:25:30 UTC (rev 1106) @@ -1182,17 +1182,9 @@ GUI *appGUI = (GUI *)data; - dialog = gtk_file_chooser_dialog_new(_("Select output file"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_SAVE, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_OK"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_save_file_dialog(_("Select output file"), + GTK_WINDOW(appGUI->main_window)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { g_strlcpy (f_filename, gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)), PATH_MAX-1); Modified: branches/dbus/src/calendar_preferences_gui.c =================================================================== --- branches/dbus/src/calendar_preferences_gui.c 2016-11-14 22:17:44 UTC (rev 1105) +++ branches/dbus/src/calendar_preferences_gui.c 2016-11-14 22:25:30 UTC (rev 1106) @@ -957,17 +957,9 @@ GtkWidget *dialog; GtkFileFilter *filter_1, *filter_2; - dialog = gtk_file_chooser_dialog_new (_("Select ICS file"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_OPEN, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_OK"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_open_file_dialog (_("Select ICS file"), + GTK_WINDOW(appGUI->main_window)); - gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (dialog), FALSE); - gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); - filter_1 = gtk_file_filter_new (); gtk_file_filter_add_pattern (filter_1, "*"); gtk_file_filter_set_name (GTK_FILE_FILTER (filter_1), _("All Files")); Modified: branches/dbus/src/contacts_export.c =================================================================== --- branches/dbus/src/contacts_export.c 2016-11-14 22:17:44 UTC (rev 1105) +++ branches/dbus/src/contacts_export.c 2016-11-14 22:25:30 UTC (rev 1106) @@ -689,17 +689,9 @@ GUI *appGUI = (GUI *)data; - dialog = gtk_file_chooser_dialog_new(_("Select output file"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_SAVE, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_OK"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_save_file_dialog(_("Select output file"), + GTK_WINDOW(appGUI->main_window)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { g_strlcpy (f_filename, gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)), PATH_MAX-1); Modified: branches/dbus/src/contacts_import.c =================================================================== --- branches/dbus/src/contacts_import.c 2016-11-14 22:17:44 UTC (rev 1105) +++ branches/dbus/src/contacts_import.c 2016-11-14 22:25:30 UTC (rev 1106) @@ -41,17 +41,9 @@ GtkFileFilter *filter_1, *filter_2; gboolean ret = FALSE; - dialog = gtk_file_chooser_dialog_new(_("Select CSV file"), - GTK_WINDOW(appGUI->cnt->import_sel_window), - GTK_FILE_CHOOSER_ACTION_OPEN, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_OK"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_open_file_dialog(_("Select CSV file"), + GTK_WINDOW(appGUI->cnt->import_sel_window)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); - filter_1 = gtk_file_filter_new(); gtk_file_filter_add_pattern(filter_1, "*"); gtk_file_filter_set_name(GTK_FILE_FILTER(filter_1), _("All Files")); Modified: branches/dbus/src/contacts_items.c =================================================================== --- branches/dbus/src/contacts_items.c 2016-11-14 22:17:44 UTC (rev 1105) +++ branches/dbus/src/contacts_items.c 2016-11-14 22:25:30 UTC (rev 1106) @@ -495,17 +495,9 @@ GUI *appGUI = (GUI *)user_data; - dialog = gtk_file_chooser_dialog_new(_("Select photo"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_OPEN, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_OK"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_open_file_dialog(_("Select photo"), + GTK_WINDOW(appGUI->main_window)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { gtk_entry_set_text (GTK_ENTRY(appGUI->cnt->contact_entries[COLUMN_PHOTO]), gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog))); } Modified: branches/dbus/src/tasks_export.c =================================================================== --- branches/dbus/src/tasks_export.c 2016-11-14 22:17:44 UTC (rev 1105) +++ branches/dbus/src/tasks_export.c 2016-11-14 22:25:30 UTC (rev 1106) @@ -59,19 +59,11 @@ return FALSE; } - dialog = gtk_file_chooser_dialog_new (_("Save tasks"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_SAVE, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_Save"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_save_file_dialog (_("Save tasks"), + GTK_WINDOW(appGUI->main_window)); + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), + utl_add_timestamp_to_filename("tasks", "ics")); - gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER(dialog), FALSE); - gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER(dialog), - utl_add_timestamp_to_filename ("tasks", "ics")); - gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER(dialog), TRUE); - ret = gtk_dialog_run(GTK_DIALOG(dialog)); if (ret == GTK_RESPONSE_CANCEL || ret == GTK_RESPONSE_DELETE_EVENT) { gtk_widget_destroy(dialog); Modified: branches/dbus/src/utils_gui.c =================================================================== --- branches/dbus/src/utils_gui.c 2016-11-14 22:17:44 UTC (rev 1105) +++ branches/dbus/src/utils_gui.c 2016-11-14 22:25:30 UTC (rev 1106) @@ -584,9 +584,59 @@ return response; } +/*------------------------------------------------------------------------------*/ +static void +show_hidden_cb(GtkToggleButton *togglebutton, gpointer user_data) { + GtkFileChooser *file_chooser = user_data; + gboolean checked = gtk_toggle_button_get_active(togglebutton); + gtk_file_chooser_set_show_hidden(file_chooser, checked); +} +static void +utl_gui_file_chooser_add_show_hidden(GtkFileChooser *file_chooser) { + GtkWidget *show_hidden = gtk_check_button_new_with_label(_("Show hidden files")); + g_signal_connect(G_OBJECT(show_hidden), "toggled", G_CALLBACK(show_hidden_cb), file_chooser); + gtk_widget_show(show_hidden); + gtk_file_chooser_set_extra_widget(file_chooser, show_hidden); +} /*------------------------------------------------------------------------------*/ +GtkWidget * +utl_gui_create_save_file_dialog(const gchar *title, GtkWindow *parent) { + GtkWidget *dialog = gtk_file_chooser_dialog_new(title, + parent, + GTK_FILE_CHOOSER_ACTION_SAVE, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Save"), GTK_RESPONSE_ACCEPT, + NULL); + + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); + gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); + gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); + return dialog; +} + +/*------------------------------------------------------------------------------*/ + +GtkWidget * +utl_gui_create_open_file_dialog(const gchar *title, GtkWindow *parent) { + GtkWidget *dialog = gtk_file_chooser_dialog_new(title, + parent, + GTK_FILE_CHOOSER_ACTION_OPEN, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Open"), GTK_RESPONSE_ACCEPT, + NULL); + + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); + gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); + gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); + return dialog; +} +/*------------------------------------------------------------------------------*/ void utl_gui_update_command_status (GtkEditable *editable, GtkWidget *icon_widget, GUI *appGUI) { Modified: branches/dbus/src/utils_gui.h =================================================================== --- branches/dbus/src/utils_gui.h 2016-11-14 22:17:44 UTC (rev 1105) +++ branches/dbus/src/utils_gui.h 2016-11-14 22:25:30 UTC (rev 1106) @@ -83,6 +83,8 @@ void utl_gui_update_command_status (GtkEditable *editable, GtkWidget *icon_widget, GUI *appGUI); gint utl_gui_create_dialog (gint dialog_type, gchar *message, GtkWindow *parent); +GtkWidget * utl_gui_create_save_file_dialog (const gchar *title, GtkWindow *parent); +GtkWidget * utl_gui_create_open_file_dialog (const gchar *title, GtkWindow *parent); gint utl_gui_check_overwrite_file (gchar *filename, GtkWidget *window, GUI *appGUI); gint utl_gui_list_store_get_text_index (GtkListStore *store, gchar *text); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-11-14 22:17:46
|
Revision: 1105 http://sourceforge.net/p/osmo-pim/code/1105 Author: mgordienko Date: 2016-11-14 22:17:44 +0000 (Mon, 14 Nov 2016) Log Message: ----------- Refactor creation of the open/save file dialogs Modified Paths: -------------- trunk/src/backup.c trunk/src/calendar_ical.c trunk/src/calendar_preferences_gui.c trunk/src/contacts_export.c trunk/src/contacts_import.c trunk/src/contacts_items.c trunk/src/tasks_export.c trunk/src/utils_gui.c trunk/src/utils_gui.h Modified: trunk/src/backup.c =================================================================== --- trunk/src/backup.c 2016-11-14 22:17:36 UTC (rev 1104) +++ trunk/src/backup.c 2016-11-14 22:17:44 UTC (rev 1105) @@ -224,19 +224,10 @@ /* select filename and password */ - dialog = gtk_file_chooser_dialog_new (_("Save backup"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_SAVE, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_Save"), GTK_RESPONSE_ACCEPT, - NULL); - - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); + dialog = utl_gui_create_save_file_dialog (_("Save backup"), + GTK_WINDOW(appGUI->main_window)); gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), utl_add_timestamp_to_filename("osmobackup", "bck")); - gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE); - utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); ret = gtk_dialog_run(GTK_DIALOG(dialog)); if (ret == GTK_RESPONSE_CANCEL || ret == GTK_RESPONSE_DELETE_EVENT) { @@ -441,18 +432,9 @@ GtkWidget *dialog, *passwd_dialog, *pass_entry; GtkWidget *passwd_content, *vbox1, *frame, *label; - dialog = gtk_file_chooser_dialog_new (_("Open backup file"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_OPEN, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_Open"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_open_file_dialog (_("Open backup file"), + GTK_WINDOW(appGUI->main_window)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE); - utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); - filter = gtk_file_filter_new(); gtk_file_filter_add_pattern(filter, "*.[bB][cC][kK]"); gtk_file_filter_set_name(GTK_FILE_FILTER(filter), _("Osmo backup files (*.bck)")); Modified: trunk/src/calendar_ical.c =================================================================== --- trunk/src/calendar_ical.c 2016-11-14 22:17:36 UTC (rev 1104) +++ trunk/src/calendar_ical.c 2016-11-14 22:17:44 UTC (rev 1105) @@ -1182,18 +1182,9 @@ GUI *appGUI = (GUI *)data; - dialog = gtk_file_chooser_dialog_new(_("Select output file"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_SAVE, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_OK"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_save_file_dialog(_("Select output file"), + GTK_WINDOW(appGUI->main_window)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); - utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { g_strlcpy (f_filename, gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)), PATH_MAX-1); Modified: trunk/src/calendar_preferences_gui.c =================================================================== --- trunk/src/calendar_preferences_gui.c 2016-11-14 22:17:36 UTC (rev 1104) +++ trunk/src/calendar_preferences_gui.c 2016-11-14 22:17:44 UTC (rev 1105) @@ -957,18 +957,9 @@ GtkWidget *dialog; GtkFileFilter *filter_1, *filter_2; - dialog = gtk_file_chooser_dialog_new (_("Select ICS file"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_OPEN, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_OK"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_open_file_dialog (_("Select ICS file"), + GTK_WINDOW(appGUI->main_window)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); - utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); - filter_1 = gtk_file_filter_new (); gtk_file_filter_add_pattern (filter_1, "*"); gtk_file_filter_set_name (GTK_FILE_FILTER (filter_1), _("All Files")); Modified: trunk/src/contacts_export.c =================================================================== --- trunk/src/contacts_export.c 2016-11-14 22:17:36 UTC (rev 1104) +++ trunk/src/contacts_export.c 2016-11-14 22:17:44 UTC (rev 1105) @@ -689,18 +689,9 @@ GUI *appGUI = (GUI *)data; - dialog = gtk_file_chooser_dialog_new(_("Select output file"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_SAVE, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_OK"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_save_file_dialog(_("Select output file"), + GTK_WINDOW(appGUI->main_window)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); - utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { g_strlcpy (f_filename, gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)), PATH_MAX-1); Modified: trunk/src/contacts_import.c =================================================================== --- trunk/src/contacts_import.c 2016-11-14 22:17:36 UTC (rev 1104) +++ trunk/src/contacts_import.c 2016-11-14 22:17:44 UTC (rev 1105) @@ -41,18 +41,9 @@ GtkFileFilter *filter_1, *filter_2; gboolean ret = FALSE; - dialog = gtk_file_chooser_dialog_new(_("Select CSV file"), - GTK_WINDOW(appGUI->cnt->import_sel_window), - GTK_FILE_CHOOSER_ACTION_OPEN, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_OK"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_open_file_dialog(_("Select CSV file"), + GTK_WINDOW(appGUI->cnt->import_sel_window)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); - utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); - filter_1 = gtk_file_filter_new(); gtk_file_filter_add_pattern(filter_1, "*"); gtk_file_filter_set_name(GTK_FILE_FILTER(filter_1), _("All Files")); Modified: trunk/src/contacts_items.c =================================================================== --- trunk/src/contacts_items.c 2016-11-14 22:17:36 UTC (rev 1104) +++ trunk/src/contacts_items.c 2016-11-14 22:17:44 UTC (rev 1105) @@ -495,18 +495,9 @@ GUI *appGUI = (GUI *)user_data; - dialog = gtk_file_chooser_dialog_new(_("Select photo"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_OPEN, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_OK"), GTK_RESPONSE_ACCEPT, - NULL); + dialog = utl_gui_create_open_file_dialog(_("Select photo"), + GTK_WINDOW(appGUI->main_window)); - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); - utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { gtk_entry_set_text (GTK_ENTRY(appGUI->cnt->contact_entries[COLUMN_PHOTO]), gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog))); } Modified: trunk/src/tasks_export.c =================================================================== --- trunk/src/tasks_export.c 2016-11-14 22:17:36 UTC (rev 1104) +++ trunk/src/tasks_export.c 2016-11-14 22:17:44 UTC (rev 1105) @@ -59,19 +59,10 @@ return FALSE; } - dialog = gtk_file_chooser_dialog_new (_("Save tasks"), - GTK_WINDOW(appGUI->main_window), - GTK_FILE_CHOOSER_ACTION_SAVE, - _("_Cancel"), GTK_RESPONSE_CANCEL, - _("_Save"), GTK_RESPONSE_ACCEPT, - NULL); - - gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); + dialog = utl_gui_create_save_file_dialog (_("Save tasks"), + GTK_WINDOW(appGUI->main_window)); gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), utl_add_timestamp_to_filename("tasks", "ics")); - gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE); - utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); ret = gtk_dialog_run(GTK_DIALOG(dialog)); if (ret == GTK_RESPONSE_CANCEL || ret == GTK_RESPONSE_DELETE_EVENT) { Modified: trunk/src/utils_gui.c =================================================================== --- trunk/src/utils_gui.c 2016-11-14 22:17:36 UTC (rev 1104) +++ trunk/src/utils_gui.c 2016-11-14 22:17:44 UTC (rev 1105) @@ -592,16 +592,51 @@ gtk_file_chooser_set_show_hidden(file_chooser, checked); } -void +static void utl_gui_file_chooser_add_show_hidden(GtkFileChooser *file_chooser) { GtkWidget *show_hidden = gtk_check_button_new_with_label(_("Show hidden files")); g_signal_connect(G_OBJECT(show_hidden), "toggled", G_CALLBACK(show_hidden_cb), file_chooser); gtk_widget_show(show_hidden); gtk_file_chooser_set_extra_widget(file_chooser, show_hidden); } +/*------------------------------------------------------------------------------*/ +GtkWidget * +utl_gui_create_save_file_dialog(const gchar *title, GtkWindow *parent) { + GtkWidget *dialog = gtk_file_chooser_dialog_new(title, + parent, + GTK_FILE_CHOOSER_ACTION_SAVE, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Save"), GTK_RESPONSE_ACCEPT, + NULL); + + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); + gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); + gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); + return dialog; +} + /*------------------------------------------------------------------------------*/ +GtkWidget * +utl_gui_create_open_file_dialog(const gchar *title, GtkWindow *parent) { + GtkWidget *dialog = gtk_file_chooser_dialog_new(title, + parent, + GTK_FILE_CHOOSER_ACTION_OPEN, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Open"), GTK_RESPONSE_ACCEPT, + NULL); + + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); + gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); + gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); + return dialog; +} +/*------------------------------------------------------------------------------*/ void utl_gui_update_command_status (GtkEditable *editable, GtkWidget *icon_widget, GUI *appGUI) { Modified: trunk/src/utils_gui.h =================================================================== --- trunk/src/utils_gui.h 2016-11-14 22:17:36 UTC (rev 1104) +++ trunk/src/utils_gui.h 2016-11-14 22:17:44 UTC (rev 1105) @@ -83,7 +83,8 @@ void utl_gui_update_command_status (GtkEditable *editable, GtkWidget *icon_widget, GUI *appGUI); gint utl_gui_create_dialog (gint dialog_type, gchar *message, GtkWindow *parent); -void utl_gui_file_chooser_add_show_hidden (GtkFileChooser *file_chooser); +GtkWidget * utl_gui_create_save_file_dialog (const gchar *title, GtkWindow *parent); +GtkWidget * utl_gui_create_open_file_dialog (const gchar *title, GtkWindow *parent); gint utl_gui_check_overwrite_file (gchar *filename, GtkWidget *window, GUI *appGUI); gint utl_gui_list_store_get_text_index (GtkListStore *store, gchar *text); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-11-14 22:17:38
|
Revision: 1104 http://sourceforge.net/p/osmo-pim/code/1104 Author: mgordienko Date: 2016-11-14 22:17:36 +0000 (Mon, 14 Nov 2016) Log Message: ----------- Allow to show hidden files in the file chooser dialog Feature request #143. Modified Paths: -------------- trunk/src/backup.c trunk/src/calendar_ical.c trunk/src/calendar_preferences_gui.c trunk/src/contacts_export.c trunk/src/contacts_import.c trunk/src/contacts_items.c trunk/src/tasks_export.c trunk/src/utils_gui.c trunk/src/utils_gui.h Modified: trunk/src/backup.c =================================================================== --- trunk/src/backup.c 2016-11-13 01:03:06 UTC (rev 1103) +++ trunk/src/backup.c 2016-11-14 22:17:36 UTC (rev 1104) @@ -231,11 +231,12 @@ _("_Save"), GTK_RESPONSE_ACCEPT, NULL); - gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER(dialog), FALSE); - gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER(dialog), - utl_add_timestamp_to_filename ("osmobackup", "bck")); - gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER(dialog), TRUE); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); + gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), + utl_add_timestamp_to_filename("osmobackup", "bck")); + gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); ret = gtk_dialog_run(GTK_DIALOG(dialog)); if (ret == GTK_RESPONSE_CANCEL || ret == GTK_RESPONSE_DELETE_EVENT) { @@ -447,9 +448,10 @@ _("_Open"), GTK_RESPONSE_ACCEPT, NULL); - gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER(dialog), FALSE); - gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER(dialog), TRUE); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); + gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); + gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); filter = gtk_file_filter_new(); gtk_file_filter_add_pattern(filter, "*.[bB][cC][kK]"); Modified: trunk/src/calendar_ical.c =================================================================== --- trunk/src/calendar_ical.c 2016-11-13 01:03:06 UTC (rev 1103) +++ trunk/src/calendar_ical.c 2016-11-14 22:17:36 UTC (rev 1104) @@ -1192,6 +1192,7 @@ gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { Modified: trunk/src/calendar_preferences_gui.c =================================================================== --- trunk/src/calendar_preferences_gui.c 2016-11-13 01:03:06 UTC (rev 1103) +++ trunk/src/calendar_preferences_gui.c 2016-11-14 22:17:36 UTC (rev 1104) @@ -964,9 +964,10 @@ _("_OK"), GTK_RESPONSE_ACCEPT, NULL); - gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER); - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (dialog), FALSE); - gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); + gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); + gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); filter_1 = gtk_file_filter_new (); gtk_file_filter_add_pattern (filter_1, "*"); Modified: trunk/src/contacts_export.c =================================================================== --- trunk/src/contacts_export.c 2016-11-13 01:03:06 UTC (rev 1103) +++ trunk/src/contacts_export.c 2016-11-14 22:17:36 UTC (rev 1104) @@ -699,6 +699,7 @@ gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { Modified: trunk/src/contacts_import.c =================================================================== --- trunk/src/contacts_import.c 2016-11-13 01:03:06 UTC (rev 1103) +++ trunk/src/contacts_import.c 2016-11-14 22:17:36 UTC (rev 1104) @@ -51,6 +51,7 @@ gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); filter_1 = gtk_file_filter_new(); gtk_file_filter_add_pattern(filter_1, "*"); Modified: trunk/src/contacts_items.c =================================================================== --- trunk/src/contacts_items.c 2016-11-13 01:03:06 UTC (rev 1103) +++ trunk/src/contacts_items.c 2016-11-14 22:17:36 UTC (rev 1104) @@ -505,6 +505,7 @@ gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { gtk_entry_set_text (GTK_ENTRY(appGUI->cnt->contact_entries[COLUMN_PHOTO]), gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog))); Modified: trunk/src/tasks_export.c =================================================================== --- trunk/src/tasks_export.c 2016-11-13 01:03:06 UTC (rev 1103) +++ trunk/src/tasks_export.c 2016-11-14 22:17:36 UTC (rev 1104) @@ -66,11 +66,12 @@ _("_Save"), GTK_RESPONSE_ACCEPT, NULL); - gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); - gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER(dialog), FALSE); - gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER(dialog), - utl_add_timestamp_to_filename ("tasks", "ics")); - gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER(dialog), TRUE); + gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); + gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), + utl_add_timestamp_to_filename("tasks", "ics")); + gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE); + utl_gui_file_chooser_add_show_hidden(GTK_FILE_CHOOSER(dialog)); ret = gtk_dialog_run(GTK_DIALOG(dialog)); if (ret == GTK_RESPONSE_CANCEL || ret == GTK_RESPONSE_DELETE_EVENT) { Modified: trunk/src/utils_gui.c =================================================================== --- trunk/src/utils_gui.c 2016-11-13 01:03:06 UTC (rev 1103) +++ trunk/src/utils_gui.c 2016-11-14 22:17:36 UTC (rev 1104) @@ -584,7 +584,22 @@ return response; } +/*------------------------------------------------------------------------------*/ +static void +show_hidden_cb(GtkToggleButton *togglebutton, gpointer user_data) { + GtkFileChooser *file_chooser = user_data; + gboolean checked = gtk_toggle_button_get_active(togglebutton); + gtk_file_chooser_set_show_hidden(file_chooser, checked); +} +void +utl_gui_file_chooser_add_show_hidden(GtkFileChooser *file_chooser) { + GtkWidget *show_hidden = gtk_check_button_new_with_label(_("Show hidden files")); + g_signal_connect(G_OBJECT(show_hidden), "toggled", G_CALLBACK(show_hidden_cb), file_chooser); + gtk_widget_show(show_hidden); + gtk_file_chooser_set_extra_widget(file_chooser, show_hidden); +} + /*------------------------------------------------------------------------------*/ void Modified: trunk/src/utils_gui.h =================================================================== --- trunk/src/utils_gui.h 2016-11-13 01:03:06 UTC (rev 1103) +++ trunk/src/utils_gui.h 2016-11-14 22:17:36 UTC (rev 1104) @@ -83,6 +83,7 @@ void utl_gui_update_command_status (GtkEditable *editable, GtkWidget *icon_widget, GUI *appGUI); gint utl_gui_create_dialog (gint dialog_type, gchar *message, GtkWindow *parent); +void utl_gui_file_chooser_add_show_hidden (GtkFileChooser *file_chooser); gint utl_gui_check_overwrite_file (gchar *filename, GtkWidget *window, GUI *appGUI); gint utl_gui_list_store_get_text_index (GtkListStore *store, gchar *text); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-11-13 01:03:08
|
Revision: 1103 http://sourceforge.net/p/osmo-pim/code/1103 Author: mgordienko Date: 2016-11-13 01:03:06 +0000 (Sun, 13 Nov 2016) Log Message: ----------- Clean up the notification text preparation Modified Paths: -------------- trunk/src/check_events.c Modified: trunk/src/check_events.c =================================================================== --- trunk/src/check_events.c 2016-11-13 01:03:00 UTC (rev 1102) +++ trunk/src/check_events.c 2016-11-13 01:03:06 UTC (rev 1103) @@ -397,97 +397,91 @@ static TASK_NTF * create_task_notification(TASK_ITEM *item, GUI *appGUI) { TASK_NTF * notification = g_malloc(sizeof (TASK_NTF)); - gchar *datestr, *text, *textdesc = NULL; + gchar *date, *date_formatted; - datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); - text = g_strdup_printf("<i>%s</i>", datestr); - g_free(datestr); - - textdesc = NULL; - if (item->desc != NULL && strlen(item->desc)) - textdesc = g_strdup_printf("%s\n%.100s", text, item->desc); - notification->id = item->id; notification->type = NOTIFY_ALARM; notification->time = -1; notification->date = 0; - if (textdesc != NULL) { - notification->notify = create_notify_notification(item, item->summary, textdesc, appGUI); + date = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); + date_formatted = g_strdup_printf("<i>%s</i>", date); + + if (item->desc != NULL && strlen(item->desc)) { + gchar *text = g_strdup_printf("%s\n%.100s", date_formatted, item->desc); + notification->notify = create_notify_notification(item, item->summary, text, appGUI); + g_free(text); } else { - gchar *datestr, *text; - datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); - text = g_strdup_printf("<i>%s</i>", datestr); - g_free(datestr); - notification->notify = create_notify_notification(item, item->summary, text, appGUI); + notification->notify = create_notify_notification(item, item->summary, date_formatted, appGUI); } - g_free(textdesc); - g_free(text); + g_free(date); + g_free(date_formatted); return notification; } static TASK_NTF * create_task_warning(TASK_ITEM *item, GUI *appGUI) { TASK_NTF * notification = g_malloc(sizeof (TASK_NTF)); - gchar *datestr, *text, *textdesc = NULL; - datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); - text = g_strdup_printf("<b>%s</b>\n<i>%s</i>", item->summary, datestr); - g_free(datestr); + gchar *date, *summary; - if (item->desc != NULL && strlen(item->desc)) - textdesc = g_strdup_printf("%s\n%.100s", text, item->desc); - - notification->id = item->id; notification->type = NOTIFY_WARNING; notification->time = -1; notification->date = 0; - if (textdesc != NULL) + + date = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); + summary = g_strdup_printf("<b>%s</b>\n<i>%s</i>", item->summary, date); + + if (item->desc != NULL && strlen(item->desc)) { + gchar *text = g_strdup_printf("%s\n%.100s", summary, item->desc); #ifdef HAVE_LIBNOTIFY7 - notification->notify = notify_notification_new(_("Alarm warning!"), textdesc, "dialog-information"); + notification->notify = notify_notification_new(_("Alarm warning!"), text, "dialog-information"); #else notification->notify = notify_notification_new(_("Alarm warning!"), textdesc, "dialog-information", NULL); #endif /* HAVE_LIBNOTIFY7 */ - else + g_free(text); + } else { #ifdef HAVE_LIBNOTIFY7 - notification->notify = notify_notification_new(_("Alarm warning!"), text, "dialog-information"); + notification->notify = notify_notification_new(_("Alarm warning!"), summary, "dialog-information"); #else notification->notify = notify_notification_new(_("Alarm warning!"), text, "dialog-information", NULL); #endif /* HAVE_LIBNOTIFY7 */ + } notify_notification_set_timeout(notification->notify, NOTIFY_EXPIRES_NEVER); notify_notification_set_urgency(notification->notify, NOTIFY_URGENCY_NORMAL); if (tsk_get_category_state(item->category, STATE_TASKS, appGUI) == TRUE) notify_notification_add_action(notification->notify, "show_task", _("Show task"), (NotifyActionCallback) tsk_show_task_cb, appGUI, NULL); + + g_free(date); + g_free(summary); return notification; } static void update_postponed_notification(TASK_NTF *a, TASK_ITEM *item, GUI *appGUI) { - gchar *datestr, *datestri, *title, *text = NULL; + gchar *date, *date_formatted, *title; a->date = 0; a->time = -1; - datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); - datestri = g_strdup_printf("<i>%s</i>", datestr); - g_free(datestr); - - if (item->desc != NULL && strlen(item->desc)) - text = g_strdup_printf("%s\n%.100s", datestri, item->desc); - + date = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); + date_formatted = g_strdup_printf("<i>%s</i>", date); title = g_strdup_printf("%s (%s)", item->summary, _("postponed")); - if (text != NULL) + if (item->desc != NULL && strlen(item->desc)) { + gchar *text = g_strdup_printf("%s\n%.100s", date_formatted, item->desc); a->notify = create_notify_notification(item, title, text, appGUI); - else - a->notify = create_notify_notification(item, title, datestri, appGUI); + g_free(text); + } else { + a->notify = create_notify_notification(item, title, date_formatted, appGUI); + } g_free(title); - g_free(text); - g_free(datestri); + g_free(date); + g_free(date_formatted); } #endif /* HAVE_LIBNOTIFY */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-11-13 01:03:03
|
Revision: 1102 http://sourceforge.net/p/osmo-pim/code/1102 Author: mgordienko Date: 2016-11-13 01:03:00 +0000 (Sun, 13 Nov 2016) Log Message: ----------- Recreate the notification after it was closed with Remind me later action This prevent (sporadic) errors with showing it again. Modified Paths: -------------- trunk/src/check_events.c Modified: trunk/src/check_events.c =================================================================== --- trunk/src/check_events.c 2016-11-13 01:02:55 UTC (rev 1101) +++ trunk/src/check_events.c 2016-11-13 01:03:00 UTC (rev 1102) @@ -176,6 +176,7 @@ a->time -= 24 * 3600; a->date++; } + a->notify = NULL; tsk_item_free(t); tsk_status_icon_set_normal(appGUI); @@ -359,6 +360,40 @@ return FALSE; } +static NotifyNotification * +create_notify_notification(TASK_ITEM *item, const char *summary, const char *body, GUI *appGUI) { + NotifyNotification *notification; +#ifdef HAVE_LIBNOTIFY7 + notification = notify_notification_new(summary, body, "dialog-warning"); +#else + notification = notify_notification_new(summary, body, "dialog-warning", NULL); +#endif /* HAVE_LIBNOTIFY7 */ + notify_notification_set_timeout(notification, NOTIFY_EXPIRES_NEVER); + switch (tsk_get_priority_index(item->priority)) { + case LOW_PRIORITY: notify_notification_set_urgency(notification, NOTIFY_URGENCY_LOW); + break; + case MEDIUM_PRIORITY: notify_notification_set_urgency(notification, NOTIFY_URGENCY_NORMAL); + break; + case HIGH_PRIORITY: notify_notification_set_urgency(notification, NOTIFY_URGENCY_CRITICAL); + break; + } + + if (item->postpone_time > 0) { + notify_notification_add_action(notification, "postpone", _("Remind me later"), + (NotifyActionCallback) tsk_postpone_notify_cb, appGUI, NULL); + } + + if (tsk_get_category_state(item->category, STATE_TASKS, appGUI) == TRUE) { + notify_notification_add_action(notification, "show_task", _("Show task"), + (NotifyActionCallback) tsk_show_task_cb, appGUI, NULL); + } + + notify_notification_add_action(notification, "done", _("Done"), + (NotifyActionCallback) tsk_done_cb, appGUI, NULL); + + return notification; +} + static TASK_NTF * create_task_notification(TASK_ITEM *item, GUI *appGUI) { TASK_NTF * notification = g_malloc(sizeof (TASK_NTF)); @@ -377,51 +412,18 @@ notification->time = -1; notification->date = 0; - - - if (textdesc != NULL) -#ifdef HAVE_LIBNOTIFY7 - notification->notify = notify_notification_new(item->summary, textdesc, "dialog-warning"); -#else - notification->notify = notify_notification_new(item->summary, textdesc, "dialog-warning", NULL); -#endif /* HAVE_LIBNOTIFY7 */ -else { + if (textdesc != NULL) { + notification->notify = create_notify_notification(item, item->summary, textdesc, appGUI); + } else { gchar *datestr, *text; datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); text = g_strdup_printf("<i>%s</i>", datestr); g_free(datestr); -#ifdef HAVE_LIBNOTIFY7 - notification->notify = notify_notification_new(item->summary, text, "dialog-warning"); -#else - notification->notify = notify_notification_new(item->summary, text, "dialog-warning", NULL); -#endif /* HAVE_LIBNOTIFY7 */ + notification->notify = create_notify_notification(item, item->summary, text, appGUI); } g_free(textdesc); g_free(text); - notify_notification_set_timeout(notification->notify, NOTIFY_EXPIRES_NEVER); - switch (tsk_get_priority_index(item->priority)) { - case LOW_PRIORITY: notify_notification_set_urgency(notification->notify, NOTIFY_URGENCY_LOW); - break; - case MEDIUM_PRIORITY: notify_notification_set_urgency(notification->notify, NOTIFY_URGENCY_NORMAL); - break; - case HIGH_PRIORITY: notify_notification_set_urgency(notification->notify, NOTIFY_URGENCY_CRITICAL); - break; - } - - if (item->postpone_time > 0) { - notify_notification_add_action(notification->notify, "postpone", _("Remind me later"), - (NotifyActionCallback) tsk_postpone_notify_cb, appGUI, NULL); - } - - if (tsk_get_category_state(item->category, STATE_TASKS, appGUI) == TRUE) { - notify_notification_add_action(notification->notify, "show_task", _("Show task"), - (NotifyActionCallback) tsk_show_task_cb, appGUI, NULL); - } - - notify_notification_add_action(notification->notify, "done", _("Done"), - (NotifyActionCallback) tsk_done_cb, appGUI, NULL); - return notification; } @@ -479,9 +481,9 @@ title = g_strdup_printf("%s (%s)", item->summary, _("postponed")); if (text != NULL) - notify_notification_update(a->notify, title, text, "dialog-warning"); + a->notify = create_notify_notification(item, title, text, appGUI); else - notify_notification_update(a->notify, title, datestri, "dialog-warning"); + a->notify = create_notify_notification(item, title, datestri, appGUI); g_free(title); g_free(text); @@ -520,8 +522,9 @@ delete_task_notification(notification->id, appGUI); } if (notification_enabled) { - if (!notify_notification_show(notification->notify, NULL)) { - g_warning("Failed to send notification"); + GError *err = NULL; + if (!notify_notification_show(notification->notify, &err)) { + g_warning("Failed to send notification: %s", err->message); return; } } @@ -638,7 +641,10 @@ #ifdef HAVE_LIBNOTIFY TASK_NTF *a = get_task_notification(id, appGUI); if (a != NULL) { - notify_notification_close(a->notify, NULL); + GError *err = NULL; + if(!notify_notification_close(a->notify, &err)) { + g_warning("Failed to close notification: %s", err->message); + } appGUI->tsk->notifications = g_slist_remove(appGUI->tsk->notifications, a); g_free(a); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-11-13 01:02:57
|
Revision: 1101 http://sourceforge.net/p/osmo-pim/code/1101 Author: mgordienko Date: 2016-11-13 01:02:55 +0000 (Sun, 13 Nov 2016) Log Message: ----------- Remove the unused functions Modified Paths: -------------- trunk/src/tasks_utils.c trunk/src/tasks_utils.h Modified: trunk/src/tasks_utils.c =================================================================== --- trunk/src/tasks_utils.c 2016-11-13 01:02:48 UTC (rev 1100) +++ trunk/src/tasks_utils.c 2016-11-13 01:02:55 UTC (rev 1101) @@ -65,132 +65,6 @@ /*------------------------------------------------------------------------------*/ -void -tsk_tasks_foreach (guint32 julian_start, guint32 julian_end, gboolean (*ttfunc)(), GUI *appGUI) -{ - GtkTreeModel *model = NULL; - GtkTreePath *path; - GtkTreeIter iter; - gchar *category; - guint32 julian; - - model = GTK_TREE_MODEL (appGUI->tsk->tasks_list_store); - if (model == NULL) return; - - path = gtk_tree_path_new_first (); - - while (gtk_tree_model_get_iter (model, &iter, path) == TRUE) { - - gtk_tree_model_get (model, &iter, - TA_COLUMN_DUE_DATE_JULIAN, &julian, - TA_COLUMN_CATEGORY, &category, -1); - - if (julian >= julian_start && julian <= julian_end) - if (tsk_get_category_state (category, STATE_EITHER, appGUI) == TRUE) { - if ((*ttfunc)(julian, model, &iter, appGUI) == TRUE) { - g_free (category); - break; - } - } - - g_free (category); - gtk_tree_path_next (path); - } - - gtk_tree_path_free (path); -} - -/*------------------------------------------------------------------------------*/ - -gint -tsk_get_tasks_num (guint32 julian, gboolean check_only, gboolean show_done, gint hidden_category, GUI *appGUI) -{ - GtkTreeModel *model = NULL; - GtkTreePath *path; - GtkTreeIter iter; - guint32 tsk_julian; - gchar *buf; - gint tasks = 0; - gint done; - - model = GTK_TREE_MODEL (appGUI->tsk->tasks_list_store); - g_return_val_if_fail (model != NULL, 0); - - path = gtk_tree_path_new_first (); - - while (gtk_tree_model_get_iter (model, &iter, path) == TRUE) { - - gtk_tree_model_get (model, &iter, TA_COLUMN_DUE_DATE_JULIAN, &tsk_julian, - TA_COLUMN_CATEGORY, &buf, - TA_COLUMN_DONE, &done, -1); - - if (tsk_julian == julian && (show_done || !done) && tsk_get_category_state (buf, hidden_category, appGUI)) { - tasks++; - } - - g_free (buf); - if (check_only && tasks) break; - gtk_tree_path_next (path); - - } - - gtk_tree_path_free (path); - - return tasks; -} - -/*------------------------------------------------------------------------------*/ - -char * -tsk_get_tasks_str (guint32 julian, gboolean show_done, gint hidden_category, GUI *appGUI) -{ - GtkTreeModel *model; - GtkTreePath *path; - GtkTreeIter iter; - - char buffer[BUFFER_SIZE], tmpbuf[BUFFER_SIZE]; - char *summ, *categ; - guint32 tsk_julian; - gint time; - gint done; - - model = GTK_TREE_MODEL (appGUI->tsk->tasks_list_store); - g_return_val_if_fail (model != NULL, NULL); - - path = gtk_tree_path_new_first (); - buffer[0] = '\0'; - - while (gtk_tree_model_get_iter (model, &iter, path) == TRUE) { - - gtk_tree_model_get (model, &iter, TA_COLUMN_DUE_DATE_JULIAN, &tsk_julian, - TA_COLUMN_CATEGORY, &categ, - TA_COLUMN_DONE, &done, -1); - - if (tsk_julian == julian && (show_done || !done) && tsk_get_category_state (categ, hidden_category, appGUI)) { - gtk_tree_model_get (model, &iter, TA_COLUMN_DUE_TIME, &time, TA_COLUMN_SUMMARY, &summ, -1); - - if (time >= 0) { - g_snprintf (tmpbuf, BUFFER_SIZE, "\n[%02d:%02d] %s", time / 3600, time / 60 % 60, summ); - } else { - g_snprintf (tmpbuf, BUFFER_SIZE, "\n%s", summ); - } - - g_strlcat (buffer, tmpbuf, BUFFER_SIZE); - g_free (summ); - } - - g_free (categ); - gtk_tree_path_next (path); - } - - gtk_tree_path_free (path); - g_strstrip (buffer); - - return g_strdup (buffer); -} - -/*------------------------------------------------------------------------------*/ - gboolean tsk_get_category_state (gchar *category_name, gint type, GUI *appGUI) { Modified: trunk/src/tasks_utils.h =================================================================== --- trunk/src/tasks_utils.h 2016-11-13 01:02:48 UTC (rev 1100) +++ trunk/src/tasks_utils.h 2016-11-13 01:02:55 UTC (rev 1101) @@ -33,9 +33,6 @@ }; gboolean tsk_check_tasks (guint32 julian_start, guint32 julian_end, gint type, GUI *appGUI); -void tsk_tasks_foreach (guint32 julian_start, guint32 julian_end, gboolean (*ttfunc)(), GUI *appGUI); -gint tsk_get_tasks_num (guint32 julian, gboolean check_only, gboolean show_done, gint hidden_category, GUI *appGUI); -char * tsk_get_tasks_str (guint32 julian, gboolean show_done, gint hidden_category, GUI *appGUI); gboolean tsk_get_category_state (gchar *category_name, gint type, GUI *appGUI); gchar * tsk_get_priority_text (gint index); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-11-13 01:02:51
|
Revision: 1100 http://sourceforge.net/p/osmo-pim/code/1100 Author: mgordienko Date: 2016-11-13 01:02:48 +0000 (Sun, 13 Nov 2016) Log Message: ----------- Removed unused method parameters Modified Paths: -------------- trunk/src/calendar_notes.c trunk/src/contacts_items.c trunk/src/notes_items.c trunk/src/options_prefs.c trunk/src/tasks_items.c trunk/src/utils.c trunk/src/utils.h Modified: trunk/src/calendar_notes.c =================================================================== --- trunk/src/calendar_notes.c 2016-11-05 22:24:26 UTC (rev 1099) +++ trunk/src/calendar_notes.c 2016-11-13 01:02:48 UTC (rev 1100) @@ -329,8 +329,8 @@ a = g_slist_nth_data (appGUI->cal->notes_list, i); note_node = xmlNewChild (main_node, NULL, (const xmlChar *) "note", (xmlChar *) NULL); utl_xml_put_uint ("date", a->date, note_node); - utl_xml_put_str ("color", a->color, note_node, doc); - utl_xml_put_str ("message", a->note, note_node, doc); + utl_xml_put_str ("color", a->color, note_node); + utl_xml_put_str ("message", a->note, note_node); } xmlSaveFormatFileEnc (prefs_get_config_filename (CALENDAR_NOTES_FILENAME, appGUI), doc, "utf-8", 1); Modified: trunk/src/contacts_items.c =================================================================== --- trunk/src/contacts_items.c 2016-11-05 22:24:26 UTC (rev 1099) +++ trunk/src/contacts_items.c 2016-11-13 01:02:48 UTC (rev 1100) @@ -1265,7 +1265,7 @@ while (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(appGUI->opt->contacts_group_store), &iter, NULL, i++)) { gtk_tree_model_get (GTK_TREE_MODEL(appGUI->opt->contacts_group_store), &iter, 0, &item, -1); - utl_xml_put_str ("name", item, node, doc); + utl_xml_put_str ("name", item, node); g_free (item); } @@ -1285,7 +1285,7 @@ gtk_tree_model_get (GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, j, &date, -1); g_snprintf(tmpbuf, BUFFER_SIZE, "%d", date); - utl_xml_put_str (appGUI->cnt->contact_fields_tags_name[j*2+1], tmpbuf, note_node, doc); + utl_xml_put_str (appGUI->cnt->contact_fields_tags_name[j*2+1], tmpbuf, note_node); } else { @@ -1293,7 +1293,7 @@ if (item != NULL) { if (strlen(item)) { - utl_xml_put_str (appGUI->cnt->contact_fields_tags_name[j*2+1], item, note_node, doc); + utl_xml_put_str (appGUI->cnt->contact_fields_tags_name[j*2+1], item, note_node); } } Modified: trunk/src/notes_items.c =================================================================== --- trunk/src/notes_items.c 2016-11-05 22:24:26 UTC (rev 1099) +++ trunk/src/notes_items.c 2016-11-13 01:02:48 UTC (rev 1100) @@ -1283,9 +1283,9 @@ note_node = xmlNewChild (node, NULL, (const xmlChar *) "entry", (xmlChar *) NULL); - utl_xml_put_str ("name", name, note_node, doc); + utl_xml_put_str ("name", name, note_node); g_free (name); - utl_xml_put_str ("category", category, note_node, doc); + utl_xml_put_str ("category", category, note_node); g_free (category); utl_xml_put_uint ("last_changes_date", last_changes_date_julian, note_node); utl_xml_put_int ("last_changes_time", last_changes_time, note_node); @@ -1294,8 +1294,8 @@ utl_xml_put_int ("remember_editor_line", remember_editor_line, note_node); utl_xml_put_int ("editor_line", editor_line, note_node); utl_xml_put_int ("read_only", editor_readonly, note_node); - utl_xml_put_str ("fontname", note_fontname, note_node, doc); - utl_xml_put_str ("filename", note_filename, note_node, doc); + utl_xml_put_str ("fontname", note_fontname, note_node); + utl_xml_put_str ("filename", note_filename, note_node); g_free (note_filename); } Modified: trunk/src/options_prefs.c =================================================================== --- trunk/src/options_prefs.c 2016-11-05 22:24:26 UTC (rev 1099) +++ trunk/src/options_prefs.c 2016-11-13 01:02:48 UTC (rev 1100) @@ -657,10 +657,10 @@ utl_xml_put_int ("override_locale_settings", config.override_locale_settings, general_node); utl_xml_put_int ("gui_layout", config.gui_layout, general_node); utl_xml_put_int ("sound_alarm_repeat", config.sound_alarm_repeat, general_node); - utl_xml_put_strn ("spell_lang", config.spell_lang, MAXNAME, general_node, doc); - utl_xml_put_strn ("web_browser", config.web_browser, MAXHELPERCMD, general_node, doc); - utl_xml_put_strn ("email_client", config.email_client, MAXHELPERCMD, general_node, doc); - utl_xml_put_strn ("sound_player", config.sound_player, MAXHELPERCMD, general_node, doc); + utl_xml_put_strn ("spell_lang", config.spell_lang, MAXNAME, general_node); + utl_xml_put_strn ("web_browser", config.web_browser, MAXHELPERCMD, general_node); + utl_xml_put_strn ("email_client", config.email_client, MAXHELPERCMD, general_node); + utl_xml_put_strn ("sound_player", config.sound_player, MAXHELPERCMD, general_node); /*---------------------------------------------------------------------------------------*/ /* calendar */ @@ -700,27 +700,27 @@ utl_xml_put_int ("ascending_sorting_in_day_notes_browser", config.ascending_sorting_in_day_notes_browser, calendar_node); utl_xml_put_int ("auxilary_calendars_state", config.auxilary_calendars_state, calendar_node); utl_xml_put_int ("day_note_spell_checker", config.day_note_spell_checker, calendar_node); - utl_xml_put_strn ("day_note_marker", config.day_note_marker, MAXNAME, calendar_node, doc); - utl_xml_put_strn ("date_header_format", config.date_header_format, MAXNAME, calendar_node, doc); + utl_xml_put_strn ("day_note_marker", config.day_note_marker, MAXNAME, calendar_node); + utl_xml_put_strn ("date_header_format", config.date_header_format, MAXNAME, calendar_node); utl_xml_put_int ("event_marker_type", config.event_marker_type, calendar_node); utl_xml_put_int ("today_marker_type", config.today_marker_type, calendar_node); utl_xml_put_int ("day_notes_browser_filter", config.day_notes_browser_filter, calendar_node); utl_xml_put_int ("ical_export_pane_pos", config.ical_export_pane_pos, calendar_node); - utl_xml_put_strn ("header_color", config.header_color, MAXCOLORNAME, calendar_node, doc); - utl_xml_put_strn ("weekend_color", config.weekend_color, MAXCOLORNAME, calendar_node, doc); - utl_xml_put_strn ("selection_color", config.selection_color, MAXCOLORNAME, calendar_node, doc); - utl_xml_put_strn ("mark_color", config.mark_color, MAXCOLORNAME, calendar_node, doc); - utl_xml_put_strn ("mark_current_day_color", config.mark_current_day_color, MAXCOLORNAME, calendar_node, doc); + utl_xml_put_strn ("header_color", config.header_color, MAXCOLORNAME, calendar_node); + utl_xml_put_strn ("weekend_color", config.weekend_color, MAXCOLORNAME, calendar_node); + utl_xml_put_strn ("selection_color", config.selection_color, MAXCOLORNAME, calendar_node); + utl_xml_put_strn ("mark_color", config.mark_color, MAXCOLORNAME, calendar_node); + utl_xml_put_strn ("mark_current_day_color", config.mark_current_day_color, MAXCOLORNAME, calendar_node); utl_xml_put_int ("mark_current_day_alpha", config.mark_current_day_alpha, calendar_node); - utl_xml_put_strn ("birthday_mark_color", config.birthday_mark_color, MAXCOLORNAME, calendar_node, doc); + utl_xml_put_strn ("birthday_mark_color", config.birthday_mark_color, MAXCOLORNAME, calendar_node); utl_xml_put_int ("selector_alpha", config.selector_alpha, calendar_node); - utl_xml_put_strn ("day_name_font", config.day_name_font, MAXFONTNAME, calendar_node, doc); - utl_xml_put_strn ("calendar_font", config.calendar_font, MAXFONTNAME, calendar_node, doc); - utl_xml_put_strn ("notes_font", config.notes_font, MAXFONTNAME, calendar_node, doc); - utl_xml_put_strn ("cal_print_month_name_font", config.cal_print_month_name_font, MAXFONTNAME, calendar_node, doc); - utl_xml_put_strn ("cal_print_day_name_font", config.cal_print_day_name_font, MAXFONTNAME, calendar_node, doc); - utl_xml_put_strn ("cal_print_day_num_font", config.cal_print_day_num_font, MAXFONTNAME, calendar_node, doc); - utl_xml_put_strn ("cal_print_event_font", config.cal_print_event_font, MAXFONTNAME, calendar_node, doc); + utl_xml_put_strn ("day_name_font", config.day_name_font, MAXFONTNAME, calendar_node); + utl_xml_put_strn ("calendar_font", config.calendar_font, MAXFONTNAME, calendar_node); + utl_xml_put_strn ("notes_font", config.notes_font, MAXFONTNAME, calendar_node); + utl_xml_put_strn ("cal_print_month_name_font", config.cal_print_month_name_font, MAXFONTNAME, calendar_node); + utl_xml_put_strn ("cal_print_day_name_font", config.cal_print_day_name_font, MAXFONTNAME, calendar_node); + utl_xml_put_strn ("cal_print_day_num_font", config.cal_print_day_num_font, MAXFONTNAME, calendar_node); + utl_xml_put_strn ("cal_print_event_font", config.cal_print_event_font, MAXFONTNAME, calendar_node); utl_xml_put_int ("cal_print_event_length", config.cal_print_event_length, calendar_node); utl_xml_put_int ("cal_print_padding", config.cal_print_padding, calendar_node); utl_xml_put_int ("cal_print_page_orientation", config.cal_print_page_orientation, calendar_node); @@ -766,11 +766,11 @@ utl_xml_put_int ("column_idx_4_width", config.tasks_column_idx_4_width, tasks_node); utl_xml_put_int ("column_idx_5", config.tasks_column_idx_5, tasks_node); utl_xml_put_int ("column_idx_5_width", config.tasks_column_idx_5_width, tasks_node); - utl_xml_put_strn ("due_today_color", config.due_today_color, MAXCOLORNAME, tasks_node, doc); - utl_xml_put_strn ("due_7days_color", config.due_7days_color, MAXCOLORNAME, tasks_node, doc); - utl_xml_put_strn ("past_due_color", config.past_due_color, MAXCOLORNAME, tasks_node, doc); - utl_xml_put_strn ("task_info_font", config.task_info_font, MAXFONTNAME, tasks_node, doc); - utl_xml_put_strn ("global_notification_command", config.global_notification_command, MAXHELPERCMD, tasks_node, doc); + utl_xml_put_strn ("due_today_color", config.due_today_color, MAXCOLORNAME, tasks_node); + utl_xml_put_strn ("due_7days_color", config.due_7days_color, MAXCOLORNAME, tasks_node); + utl_xml_put_strn ("past_due_color", config.past_due_color, MAXCOLORNAME, tasks_node); + utl_xml_put_strn ("task_info_font", config.task_info_font, MAXFONTNAME, tasks_node); + utl_xml_put_strn ("global_notification_command", config.global_notification_command, MAXHELPERCMD, tasks_node); /*---------------------------------------------------------------------------------------*/ /* contacts */ @@ -786,12 +786,12 @@ utl_xml_put_int ("visible_age_column", config.cnt_visible_age_column, contacts_node); utl_xml_put_int ("visible_birthday_date_column", config.cnt_visible_birthday_date_column, contacts_node); utl_xml_put_int ("visible_zodiac_sign_column", config.cnt_visible_zodiac_sign_column, contacts_node); - utl_xml_put_strn ("contact_tag_color", config.contact_tag_color, MAXCOLORNAME, contacts_node, doc); - utl_xml_put_strn ("contact_link_color", config.contact_link_color, MAXCOLORNAME, contacts_node, doc); + utl_xml_put_strn ("contact_tag_color", config.contact_tag_color, MAXCOLORNAME, contacts_node); + utl_xml_put_strn ("contact_link_color", config.contact_link_color, MAXCOLORNAME, contacts_node); utl_xml_put_int ("contact_name_font_size", config.contact_name_font_size, contacts_node); utl_xml_put_int ("contact_item_font_size", config.contact_item_font_size, contacts_node); utl_xml_put_int ("export_format", config.export_format, contacts_node); - utl_xml_put_strn ("export_fields", config.export_fields, MAXCONTACTFIELDS, contacts_node, doc); + utl_xml_put_strn ("export_fields", config.export_fields, MAXCONTACTFIELDS, contacts_node); utl_xml_put_int ("contacts_sorting_order", config.contacts_sorting_order, contacts_node); utl_xml_put_int ("contacts_sorting_column", config.contacts_sorting_column, contacts_node); utl_xml_put_int ("contacts_addedit_win_x", config.contacts_addedit_win_x, contacts_node); @@ -821,7 +821,7 @@ utl_xml_put_int ("import_bluetooth_channel", config.import_bluetooth_channel, contacts_node); utl_xml_put_int ("import_usb_interface", config.import_usb_interface, contacts_node); utl_xml_put_int ("import_binary_xml", config.import_binary_xml, contacts_node); - utl_xml_put_strn ("import_bluetooth_address", config.import_bluetooth_address, MAXADDRESS, contacts_node, doc); + utl_xml_put_strn ("import_bluetooth_address", config.import_bluetooth_address, MAXADDRESS, contacts_node); /*---------------------------------------------------------------------------------------*/ /* notes */ @@ -852,8 +852,8 @@ utl_xml_put_int ("remember_category", config.remember_category_in_notes, notes_node); utl_xml_put_int ("current_category", config.current_category_in_notes, notes_node); utl_xml_put_int ("use_system_date", config.use_system_date_in_notes, notes_node); - utl_xml_put_char ("text_separator", config.text_separator, notes_node, doc); - utl_xml_put_strn ("editor_font", config.notes_editor_font, MAXFONTNAME, notes_node, doc); + utl_xml_put_char ("text_separator", config.text_separator, notes_node); + utl_xml_put_strn ("editor_font", config.notes_editor_font, MAXFONTNAME, notes_node); /*---------------------------------------------------------------------------------------*/ Modified: trunk/src/tasks_items.c =================================================================== --- trunk/src/tasks_items.c 2016-11-05 22:24:26 UTC (rev 1099) +++ trunk/src/tasks_items.c 2016-11-13 01:02:48 UTC (rev 1100) @@ -1581,10 +1581,10 @@ utl_xml_put_int ("sound_enable", item->sound_enable, note_node); utl_xml_put_int ("notification_dialog_enable", item->ndialog_enable, note_node); utl_xml_put_int ("priority", tsk_get_priority_index (gettext (item->priority)), note_node); - utl_xml_put_str ("alarm_command", item->alarm_command, note_node, doc); - utl_xml_put_str ("category", item->category, note_node, doc); - utl_xml_put_str ("summary", item->summary, note_node, doc); - utl_xml_put_str ("description", item->desc, note_node, doc); + utl_xml_put_str ("alarm_command", item->alarm_command, note_node); + utl_xml_put_str ("category", item->category, note_node); + utl_xml_put_str ("summary", item->summary, note_node); + utl_xml_put_str ("description", item->desc, note_node); tsk_item_free (item); } Modified: trunk/src/utils.c =================================================================== --- trunk/src/utils.c 2016-11-05 22:24:26 UTC (rev 1099) +++ trunk/src/utils.c 2016-11-13 01:02:48 UTC (rev 1100) @@ -676,7 +676,7 @@ /*------------------------------------------------------------------------------*/ void -utl_xml_put_char (gchar *name, gchar character, xmlNodePtr node, xmlDocPtr doc) +utl_xml_put_char (gchar *name, gchar character, xmlNodePtr node) { gchar buffer[32]; @@ -687,7 +687,7 @@ /*------------------------------------------------------------------------------*/ void -utl_xml_put_str (gchar *name, gchar *string, xmlNodePtr node, xmlDocPtr doc) +utl_xml_put_str (gchar *name, gchar *string, xmlNodePtr node) { xmlNewTextChild (node, NULL, (const xmlChar *) name, (xmlChar *) string); } @@ -695,7 +695,7 @@ /*------------------------------------------------------------------------------*/ void -utl_xml_put_strn (gchar *name, gchar *string, gint buffer_size, xmlNodePtr node, xmlDocPtr doc) +utl_xml_put_strn (gchar *name, gchar *string, gint buffer_size, xmlNodePtr node) { gchar buffer[BUFFER_SIZE]; Modified: trunk/src/utils.h =================================================================== --- trunk/src/utils.h 2016-11-05 22:24:26 UTC (rev 1099) +++ trunk/src/utils.h 2016-11-13 01:02:48 UTC (rev 1100) @@ -63,9 +63,9 @@ void utl_xml_get_strn (gchar *name, gchar *sname, gint buffer_size, xmlNodePtr node); void utl_xml_put_int (gchar *name, gint value, xmlNodePtr node); void utl_xml_put_uint (gchar *name, guint value, xmlNodePtr node); -void utl_xml_put_char (gchar *name, gchar character, xmlNodePtr node, xmlDocPtr doc); -void utl_xml_put_str (gchar *name, gchar *string, xmlNodePtr node, xmlDocPtr doc); -void utl_xml_put_strn (gchar *name, gchar *string, gint buffer_size, xmlNodePtr node, xmlDocPtr doc); +void utl_xml_put_char (gchar *name, gchar character, xmlNodePtr node); +void utl_xml_put_str (gchar *name, gchar *string, xmlNodePtr node); +void utl_xml_put_strn (gchar *name, gchar *string, gint buffer_size, xmlNodePtr node); void utl_name_strcat (gchar *first, gchar *second, gchar *buffer); gboolean utl_run_helper (gchar *parameter, gint helper); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-11-05 22:24:29
|
Revision: 1099 http://sourceforge.net/p/osmo-pim/code/1099 Author: mgordienko Date: 2016-11-05 22:24:26 +0000 (Sat, 05 Nov 2016) Log Message: ----------- Merge branch 'master' into dbus Modified Paths: -------------- branches/dbus/src/vcf.c Property Changed: ---------------- branches/dbus/ Index: branches/dbus =================================================================== --- branches/dbus 2016-11-05 22:01:26 UTC (rev 1098) +++ branches/dbus 2016-11-05 22:24:26 UTC (rev 1099) Property changes on: branches/dbus ___________________________________________________________________ Modified: svn:mergeinfo ## -1 +1 ## -/branches/gtk3:1029-1072 +/trunk:1098 \ No newline at end of property Modified: branches/dbus/src/vcf.c =================================================================== --- branches/dbus/src/vcf.c 2016-11-05 22:01:26 UTC (rev 1098) +++ branches/dbus/src/vcf.c 2016-11-05 22:24:26 UTC (rev 1099) @@ -120,7 +120,7 @@ void vcf_write_N(vcf_writer *writer, char const *last_name, char const *first_name, char const *second_name) { - write_multivalue(writer, N, DELIM_COMPONENT, 4, last_name, first_name, second_name, NULL); + write_multivalue(writer, N, DELIM_COMPONENT, 5, last_name, first_name, second_name, NULL, NULL); } void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-11-05 22:01:27
|
Revision: 1098 http://sourceforge.net/p/osmo-pim/code/1098 Author: mgordienko Date: 2016-11-05 22:01:26 +0000 (Sat, 05 Nov 2016) Log Message: ----------- Fixed the VCard N field format Modified Paths: -------------- trunk/src/vcf.c Modified: trunk/src/vcf.c =================================================================== --- trunk/src/vcf.c 2016-11-01 19:58:06 UTC (rev 1097) +++ trunk/src/vcf.c 2016-11-05 22:01:26 UTC (rev 1098) @@ -120,7 +120,7 @@ void vcf_write_N(vcf_writer *writer, char const *last_name, char const *first_name, char const *second_name) { - write_multivalue(writer, N, DELIM_COMPONENT, 4, last_name, first_name, second_name, NULL); + write_multivalue(writer, N, DELIM_COMPONENT, 5, last_name, first_name, second_name, NULL, NULL); } void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-11-01 19:58:08
|
Revision: 1097 http://sourceforge.net/p/osmo-pim/code/1097 Author: mgordienko Date: 2016-11-01 19:58:06 +0000 (Tue, 01 Nov 2016) Log Message: ----------- Fix the typo in the exported object and interface name Modified Paths: -------------- branches/dbus/src/dbus.c Modified: branches/dbus/src/dbus.c =================================================================== --- branches/dbus/src/dbus.c 2016-10-30 18:44:14 UTC (rev 1096) +++ branches/dbus/src/dbus.c 2016-11-01 19:58:06 UTC (rev 1097) @@ -210,7 +210,7 @@ static const gchar contacts_introspection_xml[] = "<node>" - " <interface name=\"org.crayo.osmo.Contacts\">" + " <interface name=\"org.clayo.osmo.Contacts\">" " <method name=\"Find\">" " <arg name=\"query\" type=\"s\" direction=\"in\" />" " <arg name=\"vcard\" type=\"s\" direction=\"out\" />" @@ -226,7 +226,7 @@ guint registration_id; registration_id = g_dbus_connection_register_object(connection, - "/org/crayo/osmo/Contacts", + "/org/clayo/osmo/Contacts", contacts_introspection->interfaces[0], &interface_vtable, contacts, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-10-30 18:44:16
|
Revision: 1096 http://sourceforge.net/p/osmo-pim/code/1096 Author: mgordienko Date: 2016-10-30 18:44:14 +0000 (Sun, 30 Oct 2016) Log Message: ----------- Exported the contact search function via dbus Modified Paths: -------------- branches/dbus/configure.ac branches/dbus/src/Makefile.am branches/dbus/src/contacts.c branches/dbus/src/contacts.h branches/dbus/src/gui.c Added Paths: ----------- branches/dbus/src/dbus.c branches/dbus/src/dbus.h Modified: branches/dbus/configure.ac =================================================================== --- branches/dbus/configure.ac 2016-10-30 18:43:25 UTC (rev 1095) +++ branches/dbus/configure.ac 2016-10-30 18:44:14 UTC (rev 1096) @@ -221,6 +221,18 @@ fi fi +AC_ARG_ENABLE([dbus], +[ --enable-dbus=yes,no compile with dbus support (default: no)], +[case "${enableval}" in + yes) dbus=yes ;; + no) dbus=no ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-dbus]) ;; +esac],[dbus=no]) +if test "x$dbus" = "xyes"; then + AC_DEFINE([DBUS_SUPPORT], [1], [Defined if dbus support is enabled]) +fi +AM_CONDITIONAL([DBUS_SUPPORT], [test x$dbus = xyes]) + AC_ARG_WITH([config-path], AS_HELP_STRING([--with-config-path=PATH], [use a non-default config path]), [configpath=$withval AC_SUBST([configpath])]) @@ -282,4 +294,5 @@ libnotify: $libnotify libarchive: $libarchive libgringotts: $libgringotts + dbus: $dbus " Modified: branches/dbus/src/Makefile.am =================================================================== --- branches/dbus/src/Makefile.am 2016-10-30 18:43:25 UTC (rev 1095) +++ branches/dbus/src/Makefile.am 2016-10-30 18:44:14 UTC (rev 1096) @@ -33,6 +33,7 @@ contacts_export.c contacts_export.h \ contacts_items.c contacts_items.h \ contacts_preferences_gui.c contacts_preferences_gui.h \ + dbus.c dbus.h \ gui.c gui.h \ gui_icon.h gui_logo.h \ gtksourceiter.c gtksourceiter.h \ Modified: branches/dbus/src/contacts.c =================================================================== --- branches/dbus/src/contacts.c 2016-10-30 18:43:25 UTC (rev 1095) +++ branches/dbus/src/contacts.c 2016-10-30 18:44:14 UTC (rev 1096) @@ -34,6 +34,7 @@ #include "contacts_import.h" #include "contacts_export.h" #include "calendar_utils.h" +#include "dbus.h" #ifdef CONTACTS_ENABLED @@ -85,30 +86,23 @@ g_object_get(paned, "max-position", &max_position, NULL); gtk_paned_set_position(paned, max_position); } - /*------------------------------------------------------------------------------*/ +gboolean contact_matches(GtkTreeModel *model, GtkTreeIter *iter, const gchar *query, gint find_mode) { -gboolean -contacts_list_filter_cb (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { + gchar *value; + gint i; + guint32 date; + gboolean result; -const gchar *text; -gchar *value; -gint i; -guint32 date; -gboolean result; - GUI *appGUI = (GUI *)data; - - text = gtk_entry_get_text(GTK_ENTRY(appGUI->cnt->contacts_find_entry)); - - if (text == NULL) { + if (query == NULL) { return TRUE; } - if (!g_utf8_strlen(text, -1)) { + if (!g_utf8_strlen(query, -1)) { return TRUE; } - if (config.find_mode == CONTACTS_FF_ALL_FIELDS) { + if (find_mode == CONTACTS_FF_ALL_FIELDS) { result = FALSE; for (i = 0; i < CONTACTS_NUM_COLUMNS && !result; i++) { @@ -129,24 +123,24 @@ } if (value != NULL) { - result = utl_text_strcasestr(value, text); + result = utl_text_strcasestr(value, query); g_free(value); } } } } else { - if (config.find_mode == CONTACTS_FF_FIRST_NAME) { + if (find_mode == CONTACTS_FF_FIRST_NAME) { gtk_tree_model_get(model, iter, COLUMN_FIRST_NAME, &value, -1); - } else if (config.find_mode == CONTACTS_FF_LAST_NAME) { + } else if (find_mode == CONTACTS_FF_LAST_NAME) { gtk_tree_model_get(model, iter, COLUMN_LAST_NAME, &value, -1); - } else if (config.find_mode == CONTACTS_FF_TAGS) { + } else if (find_mode == CONTACTS_FF_TAGS) { gtk_tree_model_get(model, iter, COLUMN_TAGS, &value, -1); } if (value == NULL) { result = FALSE; } else { - result = utl_text_strcasestr(value, text); + result = utl_text_strcasestr(value, query); } g_free(value); } @@ -154,6 +148,15 @@ return result; } +static gboolean +contacts_list_filter_cb(GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { + const gchar *text; + GUI *appGUI = (GUI *) data; + + text = gtk_entry_get_text(GTK_ENTRY(appGUI->cnt->contacts_find_entry)); + return contact_matches(model, iter, text, config.find_mode); +} + /*------------------------------------------------------------------------------*/ void @@ -1092,6 +1095,10 @@ gtk_paned_set_position(GTK_PANED(appGUI->cnt->contacts_paned), config.contacts_pane_pos); gtk_widget_grab_focus (appGUI->cnt->contacts_find_entry); + +#ifdef DBUS_SUPPORT + dbus_export_contacts(appGUI); +#endif /* DBUS_SUPPORT */ } /*------------------------------------------------------------------------------*/ @@ -1197,7 +1204,7 @@ /*------------------------------------------------------------------------------*/ -gboolean +static gboolean queryFilter(GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { gboolean matches; @@ -1276,6 +1283,7 @@ &iter, col, &text, -1); if (text) { printf("%s\n", text); + g_free(text); n++; } } Modified: branches/dbus/src/contacts.h =================================================================== --- branches/dbus/src/contacts.h 2016-10-30 18:43:25 UTC (rev 1095) +++ branches/dbus/src/contacts.h 2016-10-30 18:44:14 UTC (rev 1096) @@ -60,6 +60,7 @@ void show_contact_location_on_map (gint address_type, GUI *appGUI); void contacts_selection_activate (gboolean active, GUI *appGUI); gint query (GUI* appGUI, gchar* matchWith); +gboolean contact_matches (GtkTreeModel *model, GtkTreeIter *iter, const gchar *query, gint find_mode); #endif /* _CONTACTS_H */ Added: branches/dbus/src/dbus.c =================================================================== --- branches/dbus/src/dbus.c (rev 0) +++ branches/dbus/src/dbus.c 2016-10-30 18:44:14 UTC (rev 1096) @@ -0,0 +1,265 @@ + +/* + * Osmo - a handy personal organizer + * + * Copyright (C) 2016 Tomasz Maka <pa...@us...> + * + * This program 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 2 of the License, or + * (at your option) any later version. + * + * This program 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "gui.h" + +#ifdef DBUS_SUPPORT +#include "dbus.h" +#include "vcf.h" +#include "contacts.h" +#include <gio/gio.h> + + +typedef struct _ContactsClass ContactsClass; +typedef struct _Contacts Contacts; + +struct _ContactsClass { + GObjectClass parent_class; +}; + +struct _Contacts { + GObject parent_instance; + + GUI *appGUI; +}; + +enum { + PROP_0, + PROP_APP_GUI, +}; + + +static GType contacts_get_type(void); +G_DEFINE_TYPE(Contacts, contacts, G_TYPE_OBJECT); + +static void +contacts_finalize(GObject *object) { + Contacts *contacts = (Contacts *) object; + + contacts->appGUI = NULL; + + G_OBJECT_CLASS(contacts_parent_class)->finalize(object); +} + +static void +contacts_init(Contacts *object) { +} + +static void +contacts_set_property(GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { + Contacts *contacts = (Contacts*) object; + + switch (prop_id) { + case PROP_APP_GUI: + contacts->appGUI = g_value_get_pointer(value); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + } +} + +static void +contacts_class_init(ContactsClass *class) { + GObjectClass *gobject_class = G_OBJECT_CLASS(class); + + gobject_class->finalize = contacts_finalize; + gobject_class->set_property = contacts_set_property; + + g_object_class_install_property(gobject_class, + PROP_APP_GUI, + g_param_spec_pointer("appGui", + "AppGui", + "AppGui", + G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE)); +} + +gboolean +queryFilter(GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { + const gchar *query = data; + return contact_matches(model, iter, query, CONTACTS_FF_ALL_FIELDS); +} + +void +writer(gchar const *buffer, gsize buffer_size, void *user_data) { + gchar **out = user_data; + gchar *tmp; + tmp = g_strconcat(*out, buffer, NULL); + g_free(*out); + *out = tmp; +} + +static gchar* +contacts_find(Contacts *contacts, gchar *query) { + GtkTreeIter iter; + GtkTreePath *sort_path; + gchar *text; + gint col; + GUI *appGUI = contacts->appGUI; + GtkTreeModel *filter, *sort; + vcf_writer *vcf; + gchar *buffer; + gchar **ptr; + + filter = gtk_tree_model_filter_new(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), + NULL); + + gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(filter), + queryFilter, + query, NULL); + + sort = gtk_tree_model_sort_new_with_model(filter); + sort_path = gtk_tree_path_new_first(); + buffer = g_strdup(""); + ptr = &buffer; + vcf = vcf_create_writer(writer, ptr); + + while (gtk_tree_model_get_iter(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), + &iter, sort_path) && sort_path != NULL) { + GtkTreePath *filter_path = gtk_tree_model_sort_convert_path_to_child_path(GTK_TREE_MODEL_SORT(sort), + sort_path); + if (filter_path != NULL) { + GtkTreePath *path = gtk_tree_model_filter_convert_path_to_child_path(GTK_TREE_MODEL_FILTER(filter), + filter_path); + if (path != NULL) { + gchar *first_name, *last_name, *second_name; + + gtk_tree_model_get_iter(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, path); + vcf_write_begin(vcf); + + gtk_tree_model_get(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), &iter, + COLUMN_FIRST_NAME, &first_name, + COLUMN_LAST_NAME, &last_name, + COLUMN_SECOND_NAME, &second_name, + -1); + vcf_write_FN(vcf, first_name, last_name); + vcf_write_N(vcf, last_name, first_name, second_name); + + g_free(first_name); + g_free(last_name); + g_free(second_name); + + for (col = COLUMN_EMAIL_1; col <= COLUMN_EMAIL_4; col++) { + gtk_tree_model_get(GTK_TREE_MODEL(appGUI->cnt->contacts_list_store), + &iter, col, &text, -1); + if (text) { + gint pref = col - COLUMN_EMAIL_1 + 1; + vcf_write_EMAIL(vcf, text, pref); + } + } + vcf_write_end(vcf); + } + } + + gtk_tree_path_next(sort_path); + } + vcf_close_writer(vcf); + + return *ptr; +} + +/* DBus stuff*/ +static void +handle_method_call(GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) { + Contacts *contacts = user_data; + + if (g_strcmp0(method_name, "Find") == 0) { + gchar *query; + gchar *vcard; + g_variant_get(parameters, "(s)", &query); + + vcard = contacts_find(contacts, query); + + g_dbus_method_invocation_return_value(invocation, g_variant_new("(s)", vcard)); + g_free(vcard); + } +} +static const GDBusInterfaceVTable interface_vtable = { + handle_method_call +}; + +static GDBusNodeInfo *contacts_introspection = NULL; + +static const gchar contacts_introspection_xml[] = + "<node>" + " <interface name=\"org.crayo.osmo.Contacts\">" + " <method name=\"Find\">" + " <arg name=\"query\" type=\"s\" direction=\"in\" />" + " <arg name=\"vcard\" type=\"s\" direction=\"out\" />" + " </method>" + " </interface>" + "</node>"; + +static void +on_bus_acquired(GDBusConnection *connection, + const gchar *name, + gpointer user_data) { + Contacts *contacts = user_data; + guint registration_id; + + registration_id = g_dbus_connection_register_object(connection, + "/org/crayo/osmo/Contacts", + contacts_introspection->interfaces[0], + &interface_vtable, + contacts, + NULL, + NULL); + g_assert(registration_id > 0); +} + +static guint owner_id; +static Contacts *contacts; + +void +dbus_export_contacts(GUI *appGUI) { + + + contacts_introspection = g_dbus_node_info_new_for_xml(contacts_introspection_xml, NULL); + contacts = g_object_new(contacts_get_type(), "appGui", appGUI, NULL); + + owner_id = g_bus_own_name(G_BUS_TYPE_SESSION, + "org.clayo.osmo.Contacts", + G_BUS_NAME_OWNER_FLAGS_NONE, + on_bus_acquired, + NULL, + NULL, + contacts, + NULL); +} + +void +dbus_unexport_contacts() { + g_bus_unown_name(owner_id); + g_dbus_node_info_unref(contacts_introspection); + g_object_unref(contacts); +} + +#endif /* DBUS_SUPPORT */ Added: branches/dbus/src/dbus.h =================================================================== --- branches/dbus/src/dbus.h (rev 0) +++ branches/dbus/src/dbus.h 2016-10-30 18:44:14 UTC (rev 1096) @@ -0,0 +1,36 @@ + +/* + * Osmo - a handy personal organizer + * + * Copyright (C) 2016 Tomasz Maka <pa...@us...> + * + * This program 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 2 of the License, or + * (at your option) any later version. + * + * This program 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef DBUS_H +#define DBUS_H + +#ifdef DBUS_SUPPORT + +#include "gui.h" + + +void dbus_export_contacts(GUI *appGUI); +void dbus_unexport_contacts(); + +#endif /* DBUS_SUPPORT */ + +#endif /* DBUS_H */ + Modified: branches/dbus/src/gui.c =================================================================== --- branches/dbus/src/gui.c 2016-10-30 18:43:25 UTC (rev 1095) +++ branches/dbus/src/gui.c 2016-10-30 18:44:14 UTC (rev 1096) @@ -49,6 +49,7 @@ #include "preferences_gui.h" #include "calendar_preferences_gui.h" #include "config.h" +#include "dbus.h" #include "gui_icon.h" @@ -175,6 +176,9 @@ #ifdef CONTACTS_ENABLED config.find_mode = gtk_combo_box_get_active (GTK_COMBO_BOX(appGUI->cnt->contacts_find_combobox)); +#ifdef DBUS_SUPPORT + dbus_unexport_contacts(); +#endif /* DBUS_SUPPORT */ #endif /* CONTACTS_ENABLED */ #ifdef TASKS_ENABLED This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-10-30 18:43:27
|
Revision: 1095 http://sourceforge.net/p/osmo-pim/code/1095 Author: mgordienko Date: 2016-10-30 18:43:25 +0000 (Sun, 30 Oct 2016) Log Message: ----------- Created a new development branch Added Paths: ----------- branches/dbus/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-10-09 17:21:45
|
Revision: 1094 http://sourceforge.net/p/osmo-pim/code/1094 Author: mgordienko Date: 2016-10-09 17:21:43 +0000 (Sun, 09 Oct 2016) Log Message: ----------- Refactored the task notifications Fixed the missing postponed notifications. Fixed the multiple sound alerts on simultaneous notifications. Modified Paths: -------------- trunk/src/check_events.c trunk/src/check_events.h trunk/src/tasks.c trunk/src/tasks_items.c Modified: trunk/src/check_events.c =================================================================== --- trunk/src/check_events.c 2016-10-09 17:21:17 UTC (rev 1093) +++ trunk/src/check_events.c 2016-10-09 17:21:43 UTC (rev 1094) @@ -37,31 +37,48 @@ /*------------------------------------------------------------------------------*/ -#ifdef HAVE_LIBNOTIFY static void -tsk_status_icon_set_normal (GUI *appGUI) -{ - gtk_status_icon_set_from_icon_name (appGUI->osmo_trayicon, OSMO_STOCK_SYSTRAY_NORMAL); +tsk_status_icon_set_normal(GUI *appGUI) { + gtk_status_icon_set_from_icon_name(appGUI->osmo_trayicon, OSMO_STOCK_SYSTRAY_NORMAL); } + +static void +tsk_status_icon_set_task(GUI *appGUI) { + if (gtk_status_icon_get_visible(appGUI->osmo_trayicon)) { +#ifdef HAVE_LIBNOTIFY +#ifndef HAVE_LIBNOTIFY7 + notify_notification_attach_to_status_icon(a->notify, appGUI->osmo_trayicon); +#endif /* HAVE_LIBNOTIFY7 */ #endif /* HAVE_LIBNOTIFY */ - + gtk_status_icon_set_from_icon_name(appGUI->osmo_trayicon, OSMO_STOCK_SYSTRAY_TASK); + } +} /*------------------------------------------------------------------------------*/ +#ifdef HAVE_LIBNOTIFY +static TASK_NTF * +get_task_notification(guint id, GUI *appGUI) { + GSList *node; + for (node = appGUI->tsk->notifications; node != NULL; node = node->next) { + TASK_NTF *notification = (TASK_NTF *) node->data; + if (notification->id == id) { + return notification; + } + } + return NULL; +} +#endif /* HAVE_LIBNOTIFY */ +/*------------------------------------------------------------------------------*/ static gboolean -tsk_check_notification_id (guint id, gint type, GUI *appGUI) -{ +tsk_check_notification_id(guint id, gint type, GUI *appGUI) { #ifdef HAVE_LIBNOTIFY - GSList *node; - TASK_NTF *a; - - for (node = appGUI->tsk->notifications; node != NULL; node = node->next) { - a = (TASK_NTF *) node->data; - /* Don't show warning notification when alarm notification is visible */ - if (a->id == id && (a->type == NOTIFY_ALARM || a->type == type)) - return TRUE; - } + TASK_NTF *a = get_task_notification(id, appGUI); + /* Don't show warning notification when alarm notification is visible */ + if (a != NULL && (a->type == NOTIFY_ALARM || a->type == type)) { + return TRUE; + } #endif /* HAVE_LIBNOTIFY */ - return FALSE; + return FALSE; } /*------------------------------------------------------------------------------*/ @@ -88,7 +105,7 @@ /*------------------------------------------------------------------------------*/ -void +static void tsk_show_info_dialog (GUI *appGUI) { gchar tmpbuf[BUFFER_SIZE]; @@ -97,86 +114,80 @@ _("Task has been modified or removed.")); utl_gui_create_dialog (GTK_MESSAGE_INFO, tmpbuf, GTK_WINDOW (appGUI->main_window)); } +/*------------------------------------------------------------------------------*/ +static TASK_NTF * +get_task_notification_by_notification(NotifyNotification *n, GUI *appGUI) { +#ifdef HAVE_LIBNOTIFY + GSList *node; + for (node = appGUI->tsk->notifications; node != NULL; node = node->next) { + TASK_NTF *notification = (TASK_NTF *) node->data; + if (notification->notify == n) { + return notification; + } + } +#endif /* HAVE_LIBNOTIFY */ + return NULL; +} /*------------------------------------------------------------------------------*/ -void -tsk_done_cb (NotifyNotification *n, const char *action, GUI *appGUI) -{ - GtkTreeIter *iter; - GSList *node; - TASK_NTF *a; - TASK_ITEM *t; +static void +tsk_done_cb(NotifyNotification *n, const char *action, GUI *appGUI) { + TASK_NTF *a = get_task_notification_by_notification(n, appGUI); - for (node = appGUI->tsk->notifications; node != NULL; node = node->next) { - a = (TASK_NTF *) node->data; + if (a != NULL) { + GtkTreeIter *iter = tsk_get_iter(a->id, appGUI); - if (a->notify == n) { - iter = tsk_get_iter (a->id, appGUI); + if (iter != NULL) { + TASK_ITEM *t = tsk_get_item(iter, appGUI); - if (iter != NULL) { + if (t->repeat == TRUE) { + // delete the notification so it can be recreated by the next due date + delete_task_notification(a->id, appGUI); + tasks_repeat_done(iter, t, appGUI); + } else { + // notification will be deleted via a callback + tasks_done(iter, t, appGUI); + } - t = tsk_get_item (iter, appGUI); + tsk_item_free(t); + } else { + tsk_show_info_dialog(appGUI); + } - if (t->repeat == TRUE) { - tasks_repeat_done (iter, t, appGUI); - } else { - tasks_done (iter, t, appGUI); - } - - tsk_item_free (t); - notify_task_delete(a->id, appGUI); - } else { - tsk_show_info_dialog (appGUI); - } - - tsk_status_icon_set_normal (appGUI); - - break; - } - } + tsk_status_icon_set_normal(appGUI); + } } /*------------------------------------------------------------------------------*/ -void -tsk_postpone_notify_cb (NotifyNotification *n, const char *action, GUI *appGUI) -{ - GSList *node; - TASK_NTF *a; - TASK_ITEM *t; +static void +tsk_postpone_notify_cb(NotifyNotification *n, const char *action, GUI *appGUI) { + TASK_NTF *a = get_task_notification_by_notification(n, appGUI); - for (node = appGUI->tsk->notifications; node != NULL; node = node->next) { - a = (TASK_NTF *) node->data; + if (a != NULL) { + TASK_ITEM *t = tsk_get_item_id(a->id, appGUI); + g_return_if_fail(t != NULL); - if (a->notify == n) { + a->time = utl_time_get_current_seconds() + t->postpone_time * 60; + a->date = utl_date_get_current_julian(); - t = tsk_get_item_id (a->id, appGUI); - g_return_if_fail (t != NULL); + if (a->time >= 24 * 3600) { + a->time -= 24 * 3600; + a->date++; + } - a->time = utl_time_get_current_seconds () + t->postpone_time * 60; - a->date = utl_date_get_current_julian (); - - if (a->time >= 24 * 3600) { - a->time -= 24 * 3600; - a->date++; - } - - tsk_item_free (t); - notify_task_delete(a->id, appGUI); - tsk_status_icon_set_normal (appGUI); - break; - } - } + tsk_item_free(t); + tsk_status_icon_set_normal(appGUI); + } } /*------------------------------------------------------------------------------*/ -void +static void tsk_show_task_cb (NotifyNotification *n, const char *action, GUI *appGUI) { GtkTreeIter iter; - GSList *node; GtkTreePath *sort_path, *filter_path, *path; GtkTreeModel *model; TASK_NTF *a; @@ -199,11 +210,9 @@ gtk_combo_box_set_active (GTK_COMBO_BOX (appGUI->tsk->cf_combobox), 0); + a = get_task_notification_by_notification(n, appGUI); + if (a != NULL) { /* select task on list */ - for (node = appGUI->tsk->notifications; node != NULL; node = node->next) { - a = (TASK_NTF *) node->data; - - if (a->notify == n) { tasks_selection_activate (FALSE, appGUI); if (gtk_tree_model_get_iter_first (model, &iter) == TRUE) { @@ -245,7 +254,7 @@ tsk_status_icon_set_normal (appGUI); if (a->type == NOTIFY_WARNING) - break; + return; notify_notification_clear_actions (a->notify); @@ -260,84 +269,13 @@ notify_notification_show (a->notify, NULL); tsk_item_free (t); - break; } - } } - -/*------------------------------------------------------------------------------*/ - -void -show_postponed_notification (GUI *appGUI) -{ - guint32 current_date; - gint current_time; - GSList *node; - TASK_NTF *a; - TASK_ITEM *t; - gchar *datestr, *datestri, *title, *text = NULL; - gboolean sound_flag = TRUE; - - current_date = utl_date_get_current_julian (); - current_time = utl_time_get_current_seconds (); - - for (node = appGUI->tsk->notifications; node != NULL; node = node->next) { - a = (TASK_NTF *) node->data; - - if (a->type == NOTIFY_WARNING) continue; - - if ((g_date_valid_julian (a->date) && utl_time_valid_seconds (a->time)) == FALSE) - continue; - - if (utl_date_time_compare_js (a->date, a->time, current_date, current_time) <= 0) { - a->date = 0; - a->time = -1; - - t = tsk_get_item_id (a->id, appGUI); - g_return_if_fail (t != NULL); - - datestr = utl_date_time_print_default (t->due_date_julian, t->due_time, FALSE); - datestri = g_strdup_printf ("<i>%s</i>", datestr); - g_free (datestr); - - if (t->desc != NULL && strlen (t->desc)) - text = g_strdup_printf ("%s\n%.100s", datestri, t->desc); - - title = g_strdup_printf ("%s (%s)", t->summary, _("postponed")); - - if (text != NULL) - notify_notification_update (a->notify, title, text, "dialog-warning"); - else - notify_notification_update (a->notify, title, datestri, "dialog-warning"); - - g_free (title); - g_free (text); - g_free (datestri); - - if (strlen (config.global_notification_command)) - gui_save_data_and_run_command (config.global_notification_command, appGUI); - - if (t->sound_enable && sound_flag) { - utl_play_alarm_sound (config.sound_alarm_repeat); - sound_flag = FALSE; - } - - if (t->ndialog_enable == TRUE) { - notify_notification_show (a->notify, NULL); - } - - tsk_item_free (t); - } - } -} - -/*------------------------------------------------------------------------------*/ - #endif /* HAVE_LIBNOTIFY */ /*------------------------------------------------------------------------------*/ static gboolean -is_show_warning(TASK_ITEM *item, GUI *appGUI) { +is_past_task_warning_time(TASK_ITEM *item, GUI *appGUI) { if (item->warning_days > 0 || item->warning_time > 0) { guint32 current_date, warning_date; gint current_time, warning_time; @@ -360,277 +298,315 @@ } static gboolean -is_show_notification(TASK_ITEM *item) { +is_past_task_due_time(TASK_ITEM *item) { return utl_date_time_in_the_past_js (item->due_date_julian, item->due_time); } /*------------------------------------------------------------------------------*/ static gboolean -tsk_show_warning_notification (TASK_ITEM *item, GUI *appGUI) +is_show_warning_notification (TASK_ITEM *item, GUI *appGUI) { if (tsk_check_notification_id (item->id, NOTIFY_WARNING, appGUI)) return FALSE; - return is_show_warning(item, appGUI); + return is_past_task_warning_time(item, appGUI); } - /*------------------------------------------------------------------------------*/ static gboolean -tsk_show_task_notification (TASK_ITEM *item, GUI *appGUI) -{ - if (item->due_date_julian == 0 || tsk_check_notification_id (item->id, NOTIFY_ALARM, appGUI)) - return FALSE; - return is_show_notification(item); +is_show_task_notification(TASK_ITEM *item, GUI *appGUI) { + if (!item->active) { + return FALSE; + } else if (item->done) { + return FALSE; + } else if (item->due_date_julian == 0 || tsk_check_notification_id(item->id, NOTIFY_ALARM, appGUI)) { + return FALSE; + } + return is_past_task_due_time(item); } /*------------------------------------------------------------------------------*/ static gboolean -tsk_delete_ntask_notification(TASK_ITEM *item, GUI *appGUI) { +is_delete_task_notification(TASK_ITEM *item, GUI *appGUI) { if(item->done) { return TRUE; - } else if(!is_show_notification(item) && !is_show_warning(item, appGUI)) { + } else if(!is_past_task_due_time(item) && !is_past_task_warning_time(item, appGUI)) { return TRUE; } return FALSE; } /*------------------------------------------------------------------------------*/ - -void -notify_task(TASK_ITEM *item, GUI *appGUI) { #ifdef HAVE_LIBNOTIFY - TASK_NTF *a; - gchar *datestr, *text, *textdesc; -#endif /* HAVE_LIBNOTIFY */ - gboolean sound_flag = TRUE; - if (!appGUI->tsk->notifications_enable) { - return; +static gboolean +is_show_postponed_notification(TASK_NTF *notification) { + guint32 current_date; + gint current_time; + + if (notification->type == NOTIFY_WARNING) { + return FALSE; } + current_date = utl_date_get_current_julian(); + current_time = utl_time_get_current_seconds(); - if (item == NULL) { - return; + if ((g_date_valid_julian(notification->date) && utl_time_valid_seconds(notification->time)) == FALSE) { + return FALSE; } + if (utl_date_time_compare_js(notification->date, notification->time, current_date, current_time) <= 0) { + return TRUE; + } + return FALSE; +} - if (tsk_delete_ntask_notification(item, appGUI)) { - notify_task_delete(item->id, appGUI); - } else if (item->active == TRUE && item->done == FALSE) { +static TASK_NTF * +create_task_notification(TASK_ITEM *item, GUI *appGUI) { + TASK_NTF * notification = g_malloc(sizeof (TASK_NTF)); + gchar *datestr, *text, *textdesc = NULL; - if (tsk_show_task_notification(item, appGUI) == TRUE) { + datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); + text = g_strdup_printf("<i>%s</i>", datestr); + g_free(datestr); - if (item->alarm_command != NULL) { - if (strlen(item->alarm_command)) { - gui_save_data_and_run_command(item->alarm_command, appGUI); - } - } + textdesc = NULL; + if (item->desc != NULL && strlen(item->desc)) + textdesc = g_strdup_printf("%s\n%.100s", text, item->desc); -#ifdef HAVE_LIBNOTIFY + notification->id = item->id; + notification->type = NOTIFY_ALARM; + notification->time = -1; + notification->date = 0; - datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); - text = g_strdup_printf("<i>%s</i>", datestr); - g_free(datestr); - textdesc = NULL; - if (item->desc != NULL && strlen(item->desc)) - textdesc = g_strdup_printf("%s\n%.100s", text, item->desc); - a = g_malloc(sizeof (TASK_NTF)); - - a->id = item->id; - a->type = NOTIFY_ALARM; - a->time = -1; - a->date = 0; - - if (textdesc != NULL) + if (textdesc != NULL) #ifdef HAVE_LIBNOTIFY7 - a->notify = notify_notification_new(item->summary, textdesc, "dialog-warning"); + notification->notify = notify_notification_new(item->summary, textdesc, "dialog-warning"); #else - a->notify = notify_notification_new(item->summary, textdesc, "dialog-warning", NULL); + notification->notify = notify_notification_new(item->summary, textdesc, "dialog-warning", NULL); #endif /* HAVE_LIBNOTIFY7 */ - else +else { + gchar *datestr, *text; + datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); + text = g_strdup_printf("<i>%s</i>", datestr); + g_free(datestr); #ifdef HAVE_LIBNOTIFY7 - a->notify = notify_notification_new(item->summary, text, "dialog-warning"); + notification->notify = notify_notification_new(item->summary, text, "dialog-warning"); #else - a->notify = notify_notification_new(item->summary, text, "dialog-warning", NULL); + notification->notify = notify_notification_new(item->summary, text, "dialog-warning", NULL); #endif /* HAVE_LIBNOTIFY7 */ + } - g_free(textdesc); - g_free(text); + g_free(textdesc); + g_free(text); + notify_notification_set_timeout(notification->notify, NOTIFY_EXPIRES_NEVER); + switch (tsk_get_priority_index(item->priority)) { + case LOW_PRIORITY: notify_notification_set_urgency(notification->notify, NOTIFY_URGENCY_LOW); + break; + case MEDIUM_PRIORITY: notify_notification_set_urgency(notification->notify, NOTIFY_URGENCY_NORMAL); + break; + case HIGH_PRIORITY: notify_notification_set_urgency(notification->notify, NOTIFY_URGENCY_CRITICAL); + break; + } - notify_notification_set_timeout(a->notify, NOTIFY_EXPIRES_NEVER); - switch (tsk_get_priority_index(item->priority)) { - case LOW_PRIORITY: notify_notification_set_urgency(a->notify, NOTIFY_URGENCY_LOW); - break; - case MEDIUM_PRIORITY: notify_notification_set_urgency(a->notify, NOTIFY_URGENCY_NORMAL); - break; - case HIGH_PRIORITY: notify_notification_set_urgency(a->notify, NOTIFY_URGENCY_CRITICAL); - break; - } + if (item->postpone_time > 0) { + notify_notification_add_action(notification->notify, "postpone", _("Remind me later"), + (NotifyActionCallback) tsk_postpone_notify_cb, appGUI, NULL); + } - if (item->postpone_time > 0) { - notify_notification_add_action(a->notify, "postpone", _("Remind me later"), - (NotifyActionCallback) tsk_postpone_notify_cb, appGUI, NULL); - } + if (tsk_get_category_state(item->category, STATE_TASKS, appGUI) == TRUE) { + notify_notification_add_action(notification->notify, "show_task", _("Show task"), + (NotifyActionCallback) tsk_show_task_cb, appGUI, NULL); + } - if (tsk_get_category_state(item->category, STATE_TASKS, appGUI) == TRUE) { - notify_notification_add_action(a->notify, "show_task", _("Show task"), - (NotifyActionCallback) tsk_show_task_cb, appGUI, NULL); - } + notify_notification_add_action(notification->notify, "done", _("Done"), + (NotifyActionCallback) tsk_done_cb, appGUI, NULL); - notify_notification_add_action(a->notify, "done", _("Done"), - (NotifyActionCallback) tsk_done_cb, appGUI, NULL); -#endif /* HAVE_LIBNOTIFY */ + return notification; +} - if (gtk_status_icon_get_visible(appGUI->osmo_trayicon)) { -#ifdef HAVE_LIBNOTIFY -#ifndef HAVE_LIBNOTIFY7 - notify_notification_attach_to_status_icon(a->notify, appGUI->osmo_trayicon); +static TASK_NTF * +create_task_warning(TASK_ITEM *item, GUI *appGUI) { + TASK_NTF * notification = g_malloc(sizeof (TASK_NTF)); + gchar *datestr, *text, *textdesc = NULL; + datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); + text = g_strdup_printf("<b>%s</b>\n<i>%s</i>", item->summary, datestr); + g_free(datestr); + + if (item->desc != NULL && strlen(item->desc)) + textdesc = g_strdup_printf("%s\n%.100s", text, item->desc); + + + notification->id = item->id; + notification->type = NOTIFY_WARNING; + notification->time = -1; + notification->date = 0; + if (textdesc != NULL) +#ifdef HAVE_LIBNOTIFY7 + notification->notify = notify_notification_new(_("Alarm warning!"), textdesc, "dialog-information"); +#else + notification->notify = notify_notification_new(_("Alarm warning!"), textdesc, "dialog-information", NULL); #endif /* HAVE_LIBNOTIFY7 */ -#endif /* HAVE_LIBNOTIFY */ - gtk_status_icon_set_from_icon_name(appGUI->osmo_trayicon, OSMO_STOCK_SYSTRAY_TASK); - } + else +#ifdef HAVE_LIBNOTIFY7 + notification->notify = notify_notification_new(_("Alarm warning!"), text, "dialog-information"); +#else + notification->notify = notify_notification_new(_("Alarm warning!"), text, "dialog-information", NULL); +#endif /* HAVE_LIBNOTIFY7 */ - if (strlen(config.global_notification_command)) { - gui_save_data_and_run_command(config.global_notification_command, appGUI); - } + notify_notification_set_timeout(notification->notify, NOTIFY_EXPIRES_NEVER); + notify_notification_set_urgency(notification->notify, NOTIFY_URGENCY_NORMAL); + if (tsk_get_category_state(item->category, STATE_TASKS, appGUI) == TRUE) + notify_notification_add_action(notification->notify, "show_task", _("Show task"), + (NotifyActionCallback) tsk_show_task_cb, appGUI, NULL); + return notification; +} - if (item->sound_enable && sound_flag) { - utl_play_alarm_sound(config.sound_alarm_repeat); - sound_flag = FALSE; - } +static void +update_postponed_notification(TASK_NTF *a, TASK_ITEM *item, GUI *appGUI) { + gchar *datestr, *datestri, *title, *text = NULL; -#ifdef HAVE_LIBNOTIFY - /* Delete alarm warning */ - notify_task_delete(item->id, appGUI); + a->date = 0; + a->time = -1; - if (item->ndialog_enable == TRUE) { - if (!notify_notification_show(a->notify, NULL)) { - g_warning("Failed to send notification"); - return; - } - } + datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); + datestri = g_strdup_printf("<i>%s</i>", datestr); + g_free(datestr); - appGUI->tsk->notifications = g_slist_prepend(appGUI->tsk->notifications, a); -#endif /* HAVE_LIBNOTIFY */ + if (item->desc != NULL && strlen(item->desc)) + text = g_strdup_printf("%s\n%.100s", datestri, item->desc); - } else if (tsk_show_warning_notification(item, appGUI)) { + title = g_strdup_printf("%s (%s)", item->summary, _("postponed")); -#ifdef HAVE_LIBNOTIFY - datestr = utl_date_time_print_default(item->due_date_julian, item->due_time, FALSE); - text = g_strdup_printf("<b>%s</b>\n<i>%s</i>", item->summary, datestr); - g_free(datestr); + if (text != NULL) + notify_notification_update(a->notify, title, text, "dialog-warning"); + else + notify_notification_update(a->notify, title, datestri, "dialog-warning"); - textdesc = NULL; - if (item->desc != NULL && strlen(item->desc)) - textdesc = g_strdup_printf("%s\n%.100s", text, item->desc); + g_free(title); + g_free(text); + g_free(datestri); +} +#endif /* HAVE_LIBNOTIFY */ - a = g_malloc(sizeof (TASK_NTF)); +/*------------------------------------------------------------------------------*/ +static void +warn_task(TASK_ITEM *item, gboolean play_sound, GUI *appGUI) { + tsk_status_icon_set_task(appGUI); - a->id = item->id; - a->type = NOTIFY_WARNING; - a->time = -1; - a->date = 0; - if (textdesc != NULL) -#ifdef HAVE_LIBNOTIFY7 - a->notify = notify_notification_new(_("Alarm warning!"), textdesc, "dialog-information"); -#else - a->notify = notify_notification_new(_("Alarm warning!"), textdesc, "dialog-information", NULL); -#endif /* HAVE_LIBNOTIFY7 */ - else -#ifdef HAVE_LIBNOTIFY7 - a->notify = notify_notification_new(_("Alarm warning!"), text, "dialog-information"); -#else - a->notify = notify_notification_new(_("Alarm warning!"), text, "dialog-information", NULL); -#endif /* HAVE_LIBNOTIFY7 */ + if (item->sound_enable && play_sound) { + utl_play_alarm_sound(config.sound_alarm_repeat); + } +} - notify_notification_set_timeout(a->notify, NOTIFY_EXPIRES_NEVER); - notify_notification_set_urgency(a->notify, NOTIFY_URGENCY_NORMAL); - if (tsk_get_category_state(item->category, STATE_TASKS, appGUI) == TRUE) - notify_notification_add_action(a->notify, "show_task", _("Show task"), - (NotifyActionCallback) tsk_show_task_cb, appGUI, NULL); +static void +notify_task(TASK_ITEM *item, gboolean play_sound, GUI *appGUI) { + if (item->alarm_command != NULL) { + if (strlen(item->alarm_command)) { + gui_save_data_and_run_command(item->alarm_command, appGUI); + } + } + if (strlen(config.global_notification_command)) { + gui_save_data_and_run_command(config.global_notification_command, appGUI); + } + warn_task(item, play_sound, appGUI); +} +#ifdef HAVE_LIBNOTIFY +static void +show_task_notification(TASK_NTF *notification, gboolean notification_enabled, gboolean new_notification, GUI *appGUI) { + if (new_notification) { + /* Delete alarm warning */ + delete_task_notification(notification->id, appGUI); + } + if (notification_enabled) { + if (!notify_notification_show(notification->notify, NULL)) { + g_warning("Failed to send notification"); + return; + } + } + if (new_notification) { + appGUI->tsk->notifications = g_slist_prepend(appGUI->tsk->notifications, notification); + } +} #endif /* HAVE_LIBNOTIFY */ - if (gtk_status_icon_get_visible(appGUI->osmo_trayicon)) { +/*------------------------------------------------------------------------------*/ + +static gboolean +check_task_notification(TASK_ITEM *item, gboolean play_sound, GUI *appGUI) { #ifdef HAVE_LIBNOTIFY -#ifndef HAVE_LIBNOTIFY7 - notify_notification_attach_to_status_icon(a->notify, appGUI->osmo_trayicon); -#endif /* HAVE_LIBNOTIFY7 */ + TASK_NTF *notification; #endif /* HAVE_LIBNOTIFY */ - gtk_status_icon_set_from_icon_name(appGUI->osmo_trayicon, OSMO_STOCK_SYSTRAY_TASK); - } + if (!appGUI->tsk->notifications_enable) { + return FALSE; + } - if (item->sound_enable && sound_flag) { - utl_play_alarm_sound(config.sound_alarm_repeat); - sound_flag = FALSE; - } + if (item == NULL) { + return FALSE; + } #ifdef HAVE_LIBNOTIFY - if (item->ndialog_enable == TRUE) { - if (!notify_notification_show(a->notify, NULL)) { - g_warning("Failed to send notification"); - return; - } - } - - appGUI->tsk->notifications = g_slist_prepend(appGUI->tsk->notifications, a); + if (get_task_notification(item->id, appGUI) == NULL) { #endif /* HAVE_LIBNOTIFY */ + if (is_show_task_notification(item, appGUI)) { + notify_task(item, play_sound, appGUI); +#ifdef HAVE_LIBNOTIFY + notification = create_task_notification(item, appGUI); + show_task_notification(notification, item->ndialog_enable, TRUE, appGUI); +#endif /* HAVE_LIBNOTIFY */ + return TRUE; + } else if (is_show_warning_notification(item, appGUI)) { + warn_task(item, play_sound, appGUI); +#ifdef HAVE_LIBNOTIFY + notification = create_task_warning(item, appGUI); + show_task_notification(notification, item->ndialog_enable, TRUE, appGUI); +#endif /* HAVE_LIBNOTIFY */ + return TRUE; } +#ifdef HAVE_LIBNOTIFY + } else { + if (is_delete_task_notification(item, appGUI)) { + delete_task_notification(item->id, appGUI); + } else { + notification = get_task_notification(item->id, appGUI); + if (is_show_postponed_notification(notification)) { + notify_task(item, play_sound, appGUI); + update_postponed_notification(notification, item, appGUI); + show_task_notification(notification, item->ndialog_enable, FALSE, appGUI); + return TRUE; + } + } } +#endif /* HAVE_LIBNOTIFY */ + return FALSE; } /*------------------------------------------------------------------------------*/ +void +change_task_notification(TASK_ITEM *item, GUI *appGUI) { + check_task_notification(item, TRUE, appGUI); +} -void +/*------------------------------------------------------------------------------*/ + +static void notify_tasks(GUI *appGUI) { GtkTreeIter iter; TASK_ITEM *item; - gint i, due_time; - guint32 julian_day; - gchar *priority; - gboolean done; + gint i = 0; + gboolean play_sound = TRUE; if (appGUI->tsk->notifications_enable == FALSE) { return; } -#ifdef HAVE_LIBNOTIFY - show_postponed_notification(appGUI); -#endif /* HAVE_LIBNOTIFY */ - - i = 0; - while (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(appGUI->tsk->tasks_list_store), &iter, NULL, i++)) { + gboolean task_notified; item = tsk_get_item(&iter, appGUI); - notify_task(item, appGUI); - - if (item->ndialog_enable == FALSE) { - gtk_tree_model_get (GTK_TREE_MODEL (appGUI->tsk->tasks_list_store), &iter, - TA_COLUMN_DONE, &done, - TA_COLUMN_DUE_DATE_JULIAN, &julian_day, - TA_COLUMN_DUE_TIME, &due_time, - TA_COLUMN_PRIORITY, &priority, -1); - - if (tsk_get_priority_index (priority) == HIGH_PRIORITY && config.tasks_high_in_bold == TRUE) /* high priority ? */ - { - gtk_list_store_set (appGUI->tsk->tasks_list_store, &iter, - TA_COLUMN_DUE_DATE, get_date_time_full_str (julian_day, due_time), - TA_COLUMN_COLOR, get_date_color (julian_day, due_time, done, appGUI), - TA_COLUMN_BOLD, PANGO_WEIGHT_BOLD,-1); - } - else - { - gtk_list_store_set (appGUI->tsk->tasks_list_store, &iter, - TA_COLUMN_DUE_DATE, get_date_time_full_str (julian_day, due_time), - TA_COLUMN_COLOR, get_date_color (julian_day, due_time, done, appGUI), - TA_COLUMN_BOLD, PANGO_WEIGHT_NORMAL,-1); - } - - g_free (priority); - } - - tsk_item_free(item); + task_notified = check_task_notification(item, play_sound, appGUI); + play_sound = play_sound && !task_notified; + tsk_item_free(item); } } @@ -658,21 +634,14 @@ /*------------------------------------------------------------------------------*/ void -notify_task_delete (guint id, GUI *appGUI) -{ +delete_task_notification(guint id, GUI *appGUI) { #ifdef HAVE_LIBNOTIFY - GSList *node; - TASK_NTF *a; - - for (node = appGUI->tsk->notifications; node != NULL; node = node->next) { - a = (TASK_NTF *) node->data; - if (a->id == id) { - notify_notification_close (a->notify, NULL); - appGUI->tsk->notifications = g_slist_remove (appGUI->tsk->notifications, a); - g_free (a); - break; - } - } + TASK_NTF *a = get_task_notification(id, appGUI); + if (a != NULL) { + notify_notification_close(a->notify, NULL); + appGUI->tsk->notifications = g_slist_remove(appGUI->tsk->notifications, a); + g_free(a); + } #endif /* HAVE_LIBNOTIFY */ } Modified: trunk/src/check_events.h =================================================================== --- trunk/src/check_events.h 2016-10-09 17:21:17 UTC (rev 1093) +++ trunk/src/check_events.h 2016-10-09 17:21:43 UTC (rev 1094) @@ -56,7 +56,7 @@ gboolean check_tasks_contacts (guint32 julian_day, GUI *appGUI); gboolean create_event_checker_window (GUI *appGUI); -void notify_task (TASK_ITEM *item, GUI *appGUI); -void notify_task_delete (guint id, GUI *appGUI); +void change_task_notification (TASK_ITEM *item, GUI *appGUI); +void delete_task_notification (guint id, GUI *appGUI); #endif /* _CHECK_EVENTS_H */ Modified: trunk/src/tasks.c =================================================================== --- trunk/src/tasks.c 2016-10-09 17:21:17 UTC (rev 1093) +++ trunk/src/tasks.c 2016-10-09 17:21:43 UTC (rev 1094) @@ -708,7 +708,7 @@ task_list_row_changed_cb (GtkTreeModel *tree_model, GtkTreePath *path, GtkTreeIter *iter, GUI *appGUI) { TASK_ITEM *item = tsk_get_item(iter, appGUI); - notify_task(item, appGUI); + change_task_notification(item, appGUI); tsk_item_free(item); } Modified: trunk/src/tasks_items.c =================================================================== --- trunk/src/tasks_items.c 2016-10-09 17:21:17 UTC (rev 1093) +++ trunk/src/tasks_items.c 2016-10-09 17:21:43 UTC (rev 1094) @@ -155,10 +155,6 @@ item->done_date_julian = 0; -#ifdef HAVE_LIBNOTIFY - if (appGUI->tsk->tasks_edit_state) - notify_task_delete (id, appGUI); -#endif /* HAVE_LIBNOTIFY */ add_item_to_list (item, appGUI); gui_systray_tooltip_update(appGUI); @@ -562,7 +558,7 @@ TA_COLUMN_ID, &id, -1); #ifdef HAVE_LIBNOTIFY - notify_task_delete(id, appGUI); + delete_task_notification(id, appGUI); #endif /* HAVE_LIBNOTIFY */ gtk_tree_model_sort_convert_iter_to_child_iter(GTK_TREE_MODEL_SORT(model), &filter_iter, &sort_iter); gtk_tree_model_filter_convert_iter_to_child_iter(GTK_TREE_MODEL_FILTER(gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(model))), &iter, &filter_iter); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-10-09 17:21:18
|
Revision: 1093 http://sourceforge.net/p/osmo-pim/code/1093 Author: mgordienko Date: 2016-10-09 17:21:17 +0000 (Sun, 09 Oct 2016) Log Message: ----------- Made recurrent tasks expire while suspenden Modified Paths: -------------- trunk/src/calendar_utils.c trunk/src/calendar_utils.h trunk/src/check_events.c Modified: trunk/src/calendar_utils.c =================================================================== --- trunk/src/calendar_utils.c 2016-07-20 20:47:36 UTC (rev 1092) +++ trunk/src/calendar_utils.c 2016-10-09 17:21:17 UTC (rev 1093) @@ -325,7 +325,14 @@ } /*------------------------------------------------------------------------------*/ +gint32 +get_absolute_minute() { + time_t tm = time(NULL); + return tm/60; +} +/*------------------------------------------------------------------------------*/ + gchar* current_time_to_str(gint time_format, gint override_locale) { Modified: trunk/src/calendar_utils.h =================================================================== --- trunk/src/calendar_utils.h 2016-07-20 20:47:36 UTC (rev 1092) +++ trunk/src/calendar_utils.h 2016-10-09 17:21:17 UTC (rev 1093) @@ -38,6 +38,7 @@ gint get_current_hour (void); gint get_current_minute (void); gint get_current_second (void); +gint32 get_absolute_minute (); void sync_cal_date_with_gdate (GUI *appGUI); guint get_day_of_week (guint day, guint month, guint year); Modified: trunk/src/check_events.c =================================================================== --- trunk/src/check_events.c 2016-07-20 20:47:36 UTC (rev 1092) +++ trunk/src/check_events.c 2016-10-09 17:21:17 UTC (rev 1093) @@ -636,18 +636,18 @@ /*------------------------------------------------------------------------------*/ -void +static void ignore_offline_tasks(GUI *appGUI) { GtkTreeIter iter; TASK_ITEM *item; - gint i; + gint i = 0; + guint32 now_date = utl_date_get_current_julian (); + gint now_time = utl_time_get_current_seconds (); - i = 0; - while (gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(appGUI->tsk->tasks_list_store), &iter, NULL, i++)) { item = tsk_get_item(&iter, appGUI); if (item->repeat == TRUE && item->offline_ignore == TRUE) { - if (utl_date_time_compare_js(item->due_date_julian, item->due_time, appGUI->run_date, appGUI->run_time) < 0) { + if (utl_date_time_compare_js(item->due_date_julian, item->due_time, now_date, now_time) < 0) { tasks_repeat_done(&iter, item, appGUI); } } @@ -691,25 +691,27 @@ gboolean time_handler (gpointer data) { -static gint minute = -1; +static gint32 minute = -1; static guint32 last_refresh_date = 0; GUI *appGUI = data; -gint current_minute; +gint32 current_minute; guint32 current_date; if (config.di_show_current_time_seconds == TRUE) { update_clock (appGUI); } - current_minute = get_current_minute (); + current_minute = get_absolute_minute (); current_date = utl_date_get_current_julian (); if (minute != current_minute) { #ifdef TASKS_ENABLED - /* TODO: would it be simplier to ignore all offline tasks at the program start? */ - ignore_offline_tasks(appGUI); - notify_tasks (appGUI); + if (current_minute - minute > 1) { + // the program just started or resumed from suspend + ignore_offline_tasks(appGUI); + } + notify_tasks(appGUI); #endif /* TASKS_ENABLED */ minute = current_minute; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mgo...@us...> - 2016-07-20 20:47:39
|
Revision: 1092 http://sourceforge.net/p/osmo-pim/code/1092 Author: mgordienko Date: 2016-07-20 20:47:36 +0000 (Wed, 20 Jul 2016) Log Message: ----------- Fixed the calendar time refresh after the date change Modified Paths: -------------- trunk/src/calendar.c Modified: trunk/src/calendar.c =================================================================== --- trunk/src/calendar.c 2016-07-20 19:01:58 UTC (rev 1091) +++ trunk/src/calendar.c 2016-07-20 20:47:36 UTC (rev 1092) @@ -510,13 +510,7 @@ update_clock (GUI *appGUI) { #ifdef HAVE_LIBWEBKIT -GDate *date; -gboolean current_date; - - date = appGUI->cal->date; - current_date = (g_date_get_julian (date) == utl_date_get_current_julian ()); - - if (current_date && config.di_show_current_time) { + if (config.di_show_current_time) { cal_set_day_info (appGUI); } @@ -544,7 +538,6 @@ gchar tmpbuf[BUFFER_SIZE]; GDate *date; guint dday, dmonth, dyear; -gboolean current_date; gint edays, i; gchar *text; @@ -554,8 +547,6 @@ dmonth = g_date_get_month (date) - 1; dyear = g_date_get_year (date); - current_date = (g_date_get_julian (date) == utl_date_get_current_julian ()); - #ifdef HAVE_LIBWEBKIT gchar *output = g_strdup (""); @@ -592,7 +583,7 @@ /* body */ output = utl_strconcat (output, "<table><tr>", NULL); - if (current_date && config.di_show_current_time) { + if (config.di_show_current_time) { gchar *tstr = utl_time_print_default (utl_time_get_current_seconds (), config.di_show_current_time_seconds); g_snprintf (tmpbuf, BUFFER_SIZE, "<th>%s:</th><td>", _("Current time")); output = utl_strconcat (output, tmpbuf, tstr, "</td>", NULL); @@ -766,7 +757,7 @@ i = 0; - if (current_date && config.di_show_current_time) { + if (config.di_show_current_time) { g_snprintf (tmpbuf, BUFFER_SIZE, "<b>%s:</b>", _("Current time")); label = gtk_label_new (tmpbuf); gtk_widget_show (label); @@ -867,7 +858,7 @@ i = 0; appGUI->cal->time_label = gtk_label_new (NULL); - if (current_date && config.di_show_current_time) { + if (config.di_show_current_time) { update_clock (appGUI); gtk_widget_show (appGUI->cal->time_label); gtk_grid_attach (GTK_GRID (table), appGUI->cal->time_label, 1, i, 2, 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |