[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp po/de.po po/pspp.pot src/ui/gui/TODO src/u...
From: |
John Darrington |
Subject: |
[Pspp-cvs] pspp po/de.po po/pspp.pot src/ui/gui/TODO src/u... |
Date: |
Sun, 30 Jul 2006 12:27:59 +0000 |
CVSROOT: /sources/pspp
Module name: pspp
Changes by: John Darrington <jmd> 06/07/30 12:27:59
Modified files:
po : de.po pspp.pot
src/ui/gui : TODO data-sheet.c menu-actions.c
psppire-case-file.c psppire-case-file.h
psppire-data-store.c psppire-data-store.h
Log message:
Re-enabled automatic insertion of cases in data sheet.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/po/de.po?cvsroot=pspp&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/pspp/po/pspp.pot?cvsroot=pspp&r1=1.95&r2=1.96
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/TODO?cvsroot=pspp&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-sheet.c?cvsroot=pspp&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/menu-actions.c?cvsroot=pspp&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-case-file.c?cvsroot=pspp&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-case-file.h?cvsroot=pspp&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-data-store.c?cvsroot=pspp&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-data-store.h?cvsroot=pspp&r1=1.4&r2=1.5
Patches:
Index: po/de.po
===================================================================
RCS file: /sources/pspp/pspp/po/de.po,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- po/de.po 29 Jul 2006 05:57:26 -0000 1.10
+++ po/de.po 30 Jul 2006 12:27:59 -0000 1.11
@@ -10,7 +10,7 @@
msgstr ""
"Project-Id-Version: PSPP 0.4.2\n"
"Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2006-07-29 13:49+0800\n"
+"POT-Creation-Date: 2006-07-30 14:13+0800\n"
"PO-Revision-Date: 2006-05-26 17:49+0800\n"
"Last-Translator: John Darrington <address@hidden>\n"
"Language-Team: German <address@hidden>\n"
@@ -4218,11 +4218,11 @@
msgid "All Files"
msgstr "Alle Datei"
-#: src/ui/gui/menu-actions.c:272
+#: src/ui/gui/menu-actions.c:273
msgid "Save Data As"
msgstr "Speichern unter"
-#: src/ui/gui/menu-actions.c:568
+#: src/ui/gui/menu-actions.c:582
msgid "Font Selection"
msgstr "Schriftwahlung"
@@ -4250,11 +4250,11 @@
msgid "Sorry. The help system hasn't yet been implemented."
msgstr "Es gibt noch nicht kein Helpsysteme. Schade!"
-#: src/ui/gui/psppire-data-store.c:699
+#: src/ui/gui/psppire-data-store.c:731
msgid "var"
msgstr ""
-#: src/ui/gui/psppire-data-store.c:780 src/ui/gui/psppire-var-store.c:518
+#: src/ui/gui/psppire-data-store.c:812 src/ui/gui/psppire-var-store.c:518
#: src/ui/gui/psppire-var-store.c:528 src/ui/gui/psppire-var-store.c:538
#: src/ui/gui/psppire-var-store.c:735
#, c-format
Index: po/pspp.pot
===================================================================
RCS file: /sources/pspp/pspp/po/pspp.pot,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- po/pspp.pot 29 Jul 2006 05:57:26 -0000 1.95
+++ po/pspp.pot 30 Jul 2006 12:27:59 -0000 1.96
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2006-07-29 13:49+0800\n"
+"POT-Creation-Date: 2006-07-30 14:13+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <address@hidden>\n"
"Language-Team: LANGUAGE <address@hidden>\n"
@@ -4217,11 +4217,11 @@
msgid "All Files"
msgstr ""
-#: src/ui/gui/menu-actions.c:272
+#: src/ui/gui/menu-actions.c:273
msgid "Save Data As"
msgstr ""
-#: src/ui/gui/menu-actions.c:568
+#: src/ui/gui/menu-actions.c:582
msgid "Font Selection"
msgstr ""
@@ -4249,11 +4249,11 @@
msgid "Sorry. The help system hasn't yet been implemented."
msgstr ""
-#: src/ui/gui/psppire-data-store.c:699
+#: src/ui/gui/psppire-data-store.c:731
msgid "var"
msgstr ""
-#: src/ui/gui/psppire-data-store.c:780 src/ui/gui/psppire-var-store.c:518
+#: src/ui/gui/psppire-data-store.c:812 src/ui/gui/psppire-var-store.c:518
#: src/ui/gui/psppire-var-store.c:528 src/ui/gui/psppire-var-store.c:538
#: src/ui/gui/psppire-var-store.c:735
#, c-format
Index: src/ui/gui/TODO
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/TODO,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- src/ui/gui/TODO 23 Jul 2006 10:32:50 -0000 1.4
+++ src/ui/gui/TODO 30 Jul 2006 12:27:59 -0000 1.5
@@ -1,6 +1,6 @@
-* Blank cell reference when deselecting cells. (Eg New command).
+* Crashes when reducing the size of string variables.
-* Strip leading/trailing whitespace on data in cells.
+* Blank cell reference when deselecting cells. (Eg New command).
* Cell Ref Entry populate/depopulate.
@@ -8,11 +8,11 @@
* Goto Variable.
-* Widen columns in var sheet as necessary to accomodate non-english
translations.
-
Wishlist
========
+* Widen columns in var sheet as necessary to accomodate non-english
translations.
+
* Cut/Paste Buffer. Cut and paste: a) Between psppire instances. b) From
other applications.
* In datasheet, add tooltips to column buttons, so that hovering over a column
button displays
Index: src/ui/gui/data-sheet.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-sheet.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- src/ui/gui/data-sheet.c 23 Jul 2006 10:32:50 -0000 1.9
+++ src/ui/gui/data-sheet.c 30 Jul 2006 12:27:59 -0000 1.10
@@ -44,20 +44,31 @@
extern GladeXML *xml;
-
static gboolean
traverse_callback (GtkSheet * sheet,
gint row, gint col,
gint *new_row, gint *new_column
)
{
+ gint case_count;
PsppireDataStore *data_store =
PSPPIRE_DATA_STORE(gtk_sheet_get_model(sheet));
-
const gint n_vars = psppire_dict_get_var_cnt(data_store->dict);
if ( *new_column >= n_vars )
return FALSE;
+ case_count = psppire_case_file_get_case_count(data_store->case_file);
+
+ if ( *new_row >= case_count )
+ {
+ gint i;
+
+ for ( i = case_count ; i <= *new_row; ++i )
+ psppire_data_store_insert_new_case (data_store, i);
+
+ return TRUE;
+ }
+
return TRUE;
}
Index: src/ui/gui/menu-actions.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/menu-actions.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- src/ui/gui/menu-actions.c 29 Jul 2006 08:49:59 -0000 1.15
+++ src/ui/gui/menu-actions.c 30 Jul 2006 12:27:59 -0000 1.16
@@ -364,6 +364,8 @@
switch (page)
{
+ case PAGE_VAR_SHEET:
+ break;
case PAGE_DATA_SHEET:
{
GtkSheet *data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet"));
@@ -410,87 +412,6 @@
}
void
-on_insert1_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- GtkNotebook *notebook = GTK_NOTEBOOK(get_widget_assert(xml, "notebook1"));
- gint page = -1;
-
- page = gtk_notebook_get_current_page(notebook);
-
- switch (page)
- {
- case PAGE_DATA_SHEET:
-#if 0
- {
- GtkSheet *data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet"));
- PsppireDataStore *data_store =
- PSPPIRE_DATA_STORE(gtk_sheet_get_model(data_sheet));
-
- psppire_case_array_insert_case(data_store->cases,
- data_sheet->range.row0,
- blank_case, the_dictionary);
- }
- break;
-#endif
- case PAGE_VAR_SHEET:
- {
- GtkSheet *var_sheet =
- GTK_SHEET(get_widget_assert(xml, "variable_sheet"));
-
- PsppireVarStore *var_store =
- PSPPIRE_VAR_STORE(gtk_sheet_get_model(var_sheet));
-
- psppire_dict_insert_variable(var_store->dict, var_sheet->range.row0, 0);
- }
- break;
- }
-}
-
-#if 0
-void
-on_delete1_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- gint page = -1;
- GtkWidget *notebook = get_widget_assert(xml, "notebook1");
-
- page = gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook));
- switch ( page)
- {
-#if 0
- case PAGE_DATA_SHEET:
- {
- GtkSheet *data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet"));
- PsppireDataStore *data_store =
- PSPPIRE_DATA_STORE(gtk_sheet_get_model(data_sheet));
-
- psppire_case_array_delete_cases(data_store->cases,
- data_sheet->range.row0,
- 1 + data_sheet->range.rowi
- - data_sheet->range.row0 );
- }
- break;
-#endif
- case PAGE_VAR_SHEET:
- {
- GtkSheet *var_sheet =
- GTK_SHEET(get_widget_assert(xml, "variable_sheet"));
-
- PsppireVarStore *var_store =
- PSPPIRE_VAR_STORE(gtk_sheet_get_model(var_sheet));
-
- psppire_dict_delete_variables(var_store->dict,
- var_sheet->range.row0,
- 1 + var_sheet->range.rowi
- - var_sheet->range.row0 );
- }
- break;
- }
-}
-#endif
-
-void
on_about1_activate(GtkMenuItem *menuitem,
gpointer user_data)
{
@@ -769,7 +690,7 @@
gtk_sheet_get_active_cell(data_sheet, &row, &col);
- psppire_case_file_insert_case(data_store->case_file, row);
+ psppire_data_store_insert_new_case(data_store, row);
}
void
Index: src/ui/gui/psppire-case-file.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-case-file.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- src/ui/gui/psppire-case-file.c 29 Jul 2006 05:57:26 -0000 1.4
+++ src/ui/gui/psppire-case-file.c 30 Jul 2006 12:27:59 -0000 1.5
@@ -156,7 +156,7 @@
{
PsppireCaseFile *cf = g_object_new (G_TYPE_PSPPIRE_CASE_FILE, NULL);
- cf->flexifile = flexifile_create(val_cnt);
+ cf->flexifile = flexifile_create (val_cnt);
return cf;
}
@@ -177,22 +177,18 @@
return result;
}
-/* Insert a blank case to the case file */
+/* Insert case CC into the case file before POSN */
gboolean
psppire_case_file_insert_case(PsppireCaseFile *cf,
+ struct ccase *cc,
gint posn)
{
bool result ;
- struct ccase cc;
g_return_val_if_fail(cf, FALSE);
g_return_val_if_fail(cf->flexifile, FALSE);
- case_create (&cc, casefile_get_value_cnt(cf->flexifile));
-
- result = flexifile_insert_case(FLEXIFILE(cf->flexifile), &cc, posn);
-
- case_destroy (&cc);
+ result = flexifile_insert_case(FLEXIFILE(cf->flexifile), cc, posn);
if ( result )
g_signal_emit(cf, signal[CASE_INSERTED], 0, posn);
@@ -202,6 +198,7 @@
return result;
}
+
/* Append a case to the case file */
gboolean
psppire_case_file_append_case(PsppireCaseFile *cf,
@@ -354,7 +351,7 @@
/* Resize the cases in the casefile, by inserting N_VALUES into every
one of them. */
gboolean
-psppire_case_file_insert_values(PsppireCaseFile *cf,
+psppire_case_file_insert_values (PsppireCaseFile *cf,
gint n_values, gint before)
{
g_return_val_if_fail(cf, FALSE);
@@ -365,21 +362,18 @@
return TRUE;
}
- return flexifile_resize(FLEXIFILE(cf->flexifile), n_values, before);
+ return flexifile_resize (FLEXIFILE(cf->flexifile), n_values, before);
}
-
-
-
/* Fills C with the CASENUMth case.
Returns true on success, false otherwise.
*/
gboolean
-psppire_case_file_get_case(const PsppireCaseFile *cf, gint casenum,
+psppire_case_file_get_case (const PsppireCaseFile *cf, gint casenum,
struct ccase *c)
{
- g_return_val_if_fail(cf, FALSE);
- g_return_val_if_fail(cf->flexifile, FALSE);
+ g_return_val_if_fail (cf, FALSE);
+ g_return_val_if_fail (cf->flexifile, FALSE);
- return flexifile_get_case(FLEXIFILE(cf->flexifile), casenum, c);
+ return flexifile_get_case (FLEXIFILE(cf->flexifile), casenum, c);
}
Index: src/ui/gui/psppire-case-file.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-case-file.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- src/ui/gui/psppire-case-file.h 29 Jul 2006 05:57:26 -0000 1.4
+++ src/ui/gui/psppire-case-file.h 30 Jul 2006 12:27:59 -0000 1.5
@@ -71,6 +71,8 @@
gboolean psppire_case_file_append_case(PsppireCaseFile *cf,
struct ccase *c);
+gboolean psppire_case_file_insert_case(PsppireCaseFile *cf, struct ccase *c,
gint row);
+
gint psppire_case_file_get_case_count(const PsppireCaseFile *cf);
@@ -91,9 +93,6 @@
gboolean psppire_case_file_delete_cases(PsppireCaseFile *cf, gint n_rows,
gint first);
-gboolean psppire_case_file_insert_case(PsppireCaseFile *cf, gint row);
-
-
gboolean psppire_case_file_insert_values(PsppireCaseFile *cf, gint n_values,
gint before);
struct sort_criteria;
Index: src/ui/gui/psppire-data-store.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-data-store.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- src/ui/gui/psppire-data-store.c 29 Jul 2006 05:57:26 -0000 1.17
+++ src/ui/gui/psppire-data-store.c 30 Jul 2006 12:27:59 -0000 1.18
@@ -327,9 +327,6 @@
store = PSPPIRE_DATA_STORE(data);
- /*
- if ( adjustment > 0 )
- */
psppire_case_file_insert_values (store->case_file, adjustment, posn);
}
@@ -423,8 +420,43 @@
}
+
+/* Insert a blank case before POSN */
+gboolean
+psppire_data_store_insert_new_case(PsppireDataStore *ds, gint posn)
+{
+ gboolean result;
+ gint val_cnt, v;
+ struct ccase cc;
+ g_return_val_if_fail (ds, FALSE);
+
+
+ /* Opportunity for optimisation exists here when creating a blank case */
+ val_cnt = casefile_get_value_cnt(ds->case_file->flexifile) ;
+
+ case_create (&cc, val_cnt);
+
+ memset ( case_data_rw (&cc, 0), 0, val_cnt * MAX_SHORT_STRING);
+
+ for (v = 0 ; v < psppire_dict_get_var_cnt (ds->dict) ; ++v)
+ {
+ const struct PsppireVariable *pv = psppire_dict_get_variable(ds->dict,
v);
+ if (ALPHA == psppire_variable_get_type(pv) )
+ continue;
+
+ case_data_rw (&cc, psppire_variable_get_fv (pv))->f = SYSMIS;
+ }
+
+ result = psppire_case_file_insert_case (ds->case_file, &cc, posn);
+
+ case_destroy (&cc);
+
+ return result;
+}
+
+
static gchar *
-psppire_data_store_get_string(const GSheetModel *model, gint row, gint column)
+psppire_data_store_get_string (const GSheetModel *model, gint row, gint column)
{
gint idx;
char *text;
@@ -434,26 +466,26 @@
GString *s;
PsppireDataStore *store = PSPPIRE_DATA_STORE(model);
- g_return_val_if_fail(store->dict, NULL);
- g_return_val_if_fail(store->case_file, NULL);
+ g_return_val_if_fail (store->dict, NULL);
+ g_return_val_if_fail (store->case_file, NULL);
- if (column >= psppire_dict_get_var_cnt(store->dict))
+ if (column >= psppire_dict_get_var_cnt (store->dict))
return NULL;
- if ( row >= psppire_case_file_get_case_count(store->case_file))
+ if ( row >= psppire_case_file_get_case_count (store->case_file))
return NULL;
- pv = psppire_dict_get_variable(store->dict, column);
+ pv = psppire_dict_get_variable (store->dict, column);
- idx = psppire_variable_get_fv(pv);
+ idx = psppire_variable_get_fv (pv);
- v = psppire_case_file_get_value(store->case_file, row, idx);
+ v = psppire_case_file_get_value (store->case_file, row, idx);
g_return_val_if_fail(v, NULL);
if ( store->show_labels)
{
- const struct val_labs * vl = psppire_variable_get_value_labels(pv);
+ const struct val_labs * vl = psppire_variable_get_value_labels (pv);
const gchar *label;
if ( (label = val_labs_find(vl, *v)) )
@@ -462,29 +494,31 @@
}
}
- fp = psppire_variable_get_write_spec(pv);
+ fp = psppire_variable_get_write_spec (pv);
s = g_string_sized_new (fp->w + 1);
- g_string_set_size(s, fp->w);
+ g_string_set_size (s, fp->w);
- memset(s->str, 0, fp->w);
+ memset (s->str, 0, fp->w);
- g_assert(fp->w == s->len);
+ g_assert (fp->w == s->len);
/* Converts binary value V into printable form in the exactly
FP->W character in buffer S according to format specification
FP. No null terminator is appended to the buffer. */
data_out (s->str, fp, v);
- text = pspp_locale_to_utf8(s->str, fp->w, 0);
- g_string_free(s, TRUE);
+ text = pspp_locale_to_utf8 (s->str, fp->w, 0);
+ g_string_free (s, TRUE);
+
+ g_strchomp (text);
return text;
}
static gboolean
-psppire_data_store_clear_datum(GSheetModel *model,
+psppire_data_store_clear_datum (GSheetModel *model,
gint row, gint col)
{
Index: src/ui/gui/psppire-data-store.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-data-store.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- src/ui/gui/psppire-data-store.h 23 Jul 2006 10:32:50 -0000 1.4
+++ src/ui/gui/psppire-data-store.h 30 Jul 2006 12:27:59 -0000 1.5
@@ -98,9 +98,12 @@
struct file_handle;
-void psppire_data_store_create_system_file(PsppireDataStore *store,
+void psppire_data_store_create_system_file (PsppireDataStore *store,
struct file_handle *handle);
+gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, gint posn);
+
+
#ifdef __cplusplus
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp po/de.po po/pspp.pot src/ui/gui/TODO src/u...,
John Darrington <=