/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Author : * JP Rosevear * * Copyright 2003, Ximian, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * 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 "calendar-config.h" #include "e-date-edit-config.h" struct _EDateEditConfigPrivate { EDateEdit *edit; GList *notifications; }; static GObjectClass *parent_class = NULL; /* Property IDs */ enum props { PROP_0, PROP_EDIT, }; static void e_date_edit_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { EDateEditConfig *edit_config; EDateEditConfigPrivate *priv; edit_config = E_DATE_EDIT_CONFIG (object); priv = edit_config->priv; switch (property_id) { case PROP_EDIT: e_date_edit_config_set_edit (edit_config, g_value_get_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_date_edit_config_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { EDateEditConfig *edit_config; EDateEditConfigPrivate *priv; edit_config = E_DATE_EDIT_CONFIG (object); priv = edit_config->priv; switch (property_id) { case PROP_EDIT: g_value_set_object (value, e_date_edit_config_get_edit (edit_config)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void e_date_edit_config_dispose (GObject *object) { EDateEditConfig *edit_config = E_DATE_EDIT_CONFIG (object); EDateEditConfigPrivate *priv; priv = edit_config->priv; e_date_edit_config_set_edit (edit_config, NULL); if (G_OBJECT_CLASS (parent_class)->dispose) G_OBJECT_CLASS (parent_class)->dispose (object); } static void e_date_edit_config_finalize (GObject *object) { EDateEditConfig *edit_config = E_DATE_EDIT_CONFIG (object); EDateEditConfigPrivate *priv; priv = edit_config->priv; g_free (priv); if (G_OBJECT_CLASS (parent_class)->finalize) G_OBJECT_CLASS (parent_class)->finalize (object); } static void e_date_edit_config_class_init (EDateEditConfigClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *spec; parent_class = g_type_class_peek_parent (klass); /* Method override */ gobject_class->set_property = e_date_edit_config_set_property; gobject_class->get_property = e_date_edit_config_get_property; gobject_class->dispose = e_date_edit_config_dispose; gobject_class->finalize = e_date_edit_config_finalize; spec = g_param_spec_object ("edit", NULL, NULL, e_date_edit_get_type (), G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT); g_object_class_install_property (gobject_class, PROP_EDIT, spec); } static void e_date_edit_config_init (EDateEditConfig *edit_config, EDateEditConfigClass *klass) { edit_config->priv = g_new0 (EDateEditConfigPrivate, 1); } E_MAKE_TYPE (e_date_edit_config, "EDateEditConfig", EDateEditConfig, e_date_edit_config_class_init, e_date_edit_config_init, G_TYPE_OBJECT); EDateEditConfig * e_date_edit_config_new (EDateEdit *date_edit) { EDateEditConfig *edit_config; edit_config = g_object_new (e_date_edit_config_get_type (), "edit", date_edit, NULL); return edit_config; } EDateEdit * e_date_edit_config_get_edit (EDateEditConfig *edit_config) { EDateEditConfigPrivate *priv; g_return_val_if_fail (edit_config != NULL, NULL); g_return_val_if_fail (E_IS_DATE_EDIT_CONFIG (edit_config), NULL); priv = edit_config->priv; return priv->edit; } static void set_week_start (EDateEdit *date_edit) { int week_start_day; week_start_day = calendar_config_get_week_start_day (); /* Convert it to 0 (Mon) to 6 (Sun), which is what we use. */ week_start_day = (week_start_day + 6) % 7; e_date_edit_set_week_start_day (date_edit, week_start_day); } static void week_start_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { EDateEditConfig *edit_config = data; EDateEditConfigPrivate *priv; priv = edit_config->priv; set_week_start (priv->edit); } static void set_twentyfour_hour (EDateEdit *date_edit) { gboolean use_24_hour; use_24_hour = calendar_config_get_24_hour_format (); e_date_edit_set_use_24_hour_format (date_edit, use_24_hour); } static void twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { EDateEditConfig *edit_config = data; EDateEditConfigPrivate *priv; priv = edit_config->priv; set_twentyfour_hour (priv->edit); } static void set_dnav_show_week_no (EDateEdit *date_edit) { gboolean show_week_no; show_week_no = calendar_config_get_dnav_show_week_no (); e_date_edit_set_show_week_numbers (date_edit, show_week_no); } static void dnav_show_week_no_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { EDateEditConfig *edit_config = data; EDateEditConfigPrivate *priv; priv = edit_config->priv; set_dnav_show_week_no (priv->edit); } void e_date_edit_config_set_edit (EDateEditConfig *edit_config, EDateEdit *date_edit) { EDateEditConfigPrivate *priv; guint not; GList *l; g_return_if_fail (edit_config != NULL); g_return_if_fail (E_IS_DATE_EDIT_CONFIG (edit_config)); priv = edit_config->priv; if (priv->edit) { g_object_unref (priv->edit); priv->edit = NULL; } for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); g_list_free (priv->notifications); priv->notifications = NULL; /* If the new edit is NULL, return right now */ if (!date_edit) return; priv->edit = g_object_ref (date_edit); /* Week start */ set_week_start (date_edit); not = calendar_config_add_notification_week_start_day (week_start_changed_cb, edit_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* 24 Hour format */ set_twentyfour_hour (date_edit); not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, edit_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* Show week numbers */ set_dnav_show_week_no (date_edit); not = calendar_config_add_notification_dnav_show_week_no (dnav_show_week_no_changed_cb, edit_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); } 6'>|\ \ \ | * | | refill transaction testsDimitry2017-08-30455-284/+2740 | * | | more transaction testsDimitry2017-08-30173-2898/+3081 | * | | split transaction tests into separate filesDimitry2017-08-30868-12573/+11631 * | | | Merge pull request #286 from ethereum/refill-stQuadraticComplexityYoichi Hirai2017-08-3030-1410/+1200 |\ \ \ \ | * | | | --fillchain on GeneralStateTests/stQuadraticComplexityTestYoichi Hirai2017-08-2930-1410/+1200 * | | | | Merge pull request #284 from holgerd77/add-docsYoichi Hirai2017-08-3014-1/+890 |\ \ \ \ \ | |_|/ / / |/| | | | | * | | | Some updates on state tests, note on outdated structureholgerd772017-08-301-4/+19 | * | | | Updated the test structure of BlockchainTests, removed outdated informationholgerd772017-08-301-82/+91 | * | | | Added note on outdated docs, seek for helpholgerd772017-08-302-1/+7 | * | | | Updated test doc URL in README, added some contribution notesholgerd772017-08-303-1/+21 | * | | | Added doc rst files from the Homestead docsholgerd772017-08-309-8/+598 | * | | | Add initial Sphinx docs directory, added docs/_build/ folder to .gitignoreholgerd772017-08-305-0/+249 |/ / / / * | | | Merge pull request #288 from ethereum/fillchain-stRandomYoichi Hirai2017-08-301-54/+40 |\ \ \ \ | |/ / / |/| | | | * | | --fillchain BlockchainTests/GeneralStateTests/stRandom/randomStatetest642_d0g...Yoichi Hirai2017-08-301-54/+40 |/ / / * | | Merge pull request #285 from ethereum/log-as-hashYoichi Hirai2017-08-291-1509/+128 |\ \ \ | * | | Replace the remaining log arrays with log hashesYoichi Hirai2017-08-291-1509/+128 * | | | Merge pull request #283 from ethereum/returndatasize_after_staticcallYoichi Hirai2017-08-298-0/+772 |\ \ \ \ | |/ / / |/| | | | * | | add 'returndatacopy_after_successful_delegatecall' state testJared Wasinger2017-08-292-0/+193 | * | | add 'returndatacopy_after_successful_callcode' state testJared Wasinger2017-08-292-0/+193 | * | | add 'returndatasize_after_successful_delegatecall' state testJared Wasinger2017-08-292-0/+193 | * | | add 'returndatasize_after_successful_staticcall' state testJared Wasinger2017-08-292-0/+193 |/ / / * | | Merge pull request #282 from ethereum/precompiled-failure-means-balance-revertYoichi Hirai2017-08-291-3/+3 |\ \ \ | * | | This change is a part of the fix to https://github.com/ethereum/cpp-ethereum/...Yoichi Hirai2017-08-281-3/+3 |/ / / * / / add randomTest642 that fails on geth. a call to precompiled 007Dimitry2017-08-283-0/+896 |/ / * | Merge pull request #279 from ethereum/filled-hive-testsYoichi Hirai2017-08-283036-141382/+244798 |\ \ | * | Translate GeneralStateTests into BlockahtinTests/GeneralStateTestsYoichi Hirai2017-08-283036-141382/+244798 * | | Merge pull request #278 from ethereum/returndatasize_after_callcodeYoichi Hirai2017-08-282-0/+192 |\ \ \ | |/ / |/| | | * | add state test 'returndatasize_after_callcode'Jared Wasinger2017-08-282-0/+192 |/ / * | Merge pull request #268 from ethereum/bc-schemaYoichi Hirai2017-08-265-4/+507 |\ \ | * | add blockchain test linting to travisJared Wasinger2017-08-265-4/+507 |/ / * | Merge pull request #275 from ethereum/bc-schema-test-fixesYoichi Hirai2017-08-264-1549/+1532 |\ \ | |/ |/| | * fix tests that don't conform to blockchain test schemaJared Wasinger2017-08-264-1549/+1532 |/ * Merge pull request #273 from ethereum/vmIO-fixYoichi Hirai2017-08-252-146/+145 |\ | * Fix the filler and fill vmIOandFlowOperationsTestYoichi Hirai2017-08-242-146/+145 * | Merge pull request #274 from ethereum/log-new-formatYoichi Hirai2017-08-253-76969/+38570 |\ \ | |/ |/| | * Replace more logs with log hashesYoichi Hirai2017-08-242-76924/+38463 | * Replace logs with log hashesYoichi Hirai2017-08-241-45/+107 |/ * Merge pull request #271 from ethereum/address-collision-failsYoichi Hirai2017-08-246-112/+22 |\ | * Changes for EIP-684Yoichi Hirai2017-08-246-112/+22 |/ * Merge pull request #267 from ethereum/some-vm-test-failuresYoichi Hirai2017-08-2419-1468/+3457 |\ | * Replace logs with hashesYoichi Hirai2017-08-238-17/+9 | * Fix some VMTest filling failuresYoichi Hirai2017-08-2311-1451/+3448 |/ * Merge pull request #269 from ethereum/eip649Yoichi Hirai2017-08-23224-36522/+36848 |\ | * Fix uncleHeaderAt2ByzantiumFiller with a correct state root hashYoichi Hirai2017-08-232-3/+705 | * Fix uncleBloomNot0_2 with the expected state root hashYoichi Hirai2017-08-232-97/+148 | * Fix futureUncleTimestampDifficultyDrop2Yoichi Hirai2017-08-232-98/+149 | * Fill more testsYoichi Hirai2017-08-2247-1338/+1551 | * Fill more testsYoichi Hirai2017-08-2247-1695/+1482 | * Fill more tests on eip649 branchYoichi Hirai2017-08-2221-788/+762 | * Fill in more testsYoichi Hirai2017-08-2216-1369/+917 | * Refill more straightforward BlockchainTestsYoichi Hirai2017-08-2278-6787/+6787 | * Refill straightforward casesYoichi Hirai2017-08-2272-26077/+26077 * | Merge pull request #266 from ethereum/0x-fieldswinsvega2017-08-234-1563/+1563 |\ \ | * | Refilled tests again so that 0x is in front of byte sequencesYoichi Hirai2017-08-224-1563/+1563 * | | Merge pull request #213 from jwasinger/issue-204Yoichi Hirai2017-08-234-1/+688 |\ \ \ | * | | add storage and code restrictions to json schemacdetrio2017-08-082-3/+25 | * | | replace Metropolis with Byzantium and Constantinople in state test schemacdetrio2017-08-081-1/+4 | * | | add schema for state test fillerscdetrio2017-08-082-0/+258 | * | | use more type definitions in schemacdetrio2017-08-081-116/+214 | * | | validate.js takes schema file as argumentcdetrio2017-08-082-2/+4 | * | | improve type checking.Jared Wasinger2017-08-081-148/+190 | * | | remove es6 syntax from validation script.Jared Wasinger2017-08-081-1/+1 | * | | make travis use node8Jared Wasinger2017-08-081-1/+1 | * | | make log ordering consistentJared Wasinger2017-08-081-0/+11 | * | | add ECDSA parameters r, s, v. Make sure certain fields are marked as require...Jared Wasinger2017-08-081-8/+25 | * | | make error output more informative. Make schema more comprehensive. Add exi...Jared Wasinger2017-08-083-38/+81 | * | | fix process errorJared Wasinger2017-08-081-1/+0 | * | | format code. Remove unused python codeJared Wasinger2017-08-083-132/+105 | * | | use JS for json schema validation because the Node 'jsonschema' library is th...Jared Wasinger2017-08-083-8/+15 | * | | add schema validation with Travis integration.Jared Wasinger2017-08-084-20/+42 | * | | add "explanation" field. Reduce number of schema errorsJared Wasinger2017-08-084-2/+7 | * | | modify validation script to run against all test cases under GeneralStateTestsJared Wasinger2017-08-082-27/+9 | * | | add working schema outlineJared Wasinger2017-08-083-62/+194 | * | | add JSON schema skeleton for #204Jared Wasinger2017-08-081-0/+71 * | | | Merge pull request #253 from cdetrio/fix-data-0xYoichi Hirai2017-08-2334-138/+138 |\ \ \ \ | |_|/ / |/| | | | * | | add 0x prefix to state test transaction datacdetrio2017-08-0834-138/+138 | |/ / * | | Merge pull request #265 from ethereum/refill-wallet-testswinsvega2017-08-224-1727/+1727 |\ \ \ | |_|/ |/| | | * | Refill bcWalletTestYoichi Hirai2017-08-224-1727/+1727 |/ / * | refill opcodes test with logsDimitry2017-08-221-469/+235 * | Merge pull request #264 from ethereum/refill-empty-accountwinsvega2017-08-224-2315/+2287 |\ \ | * | Refill wallet testsYoichi Hirai2017-08-224-1984/+1963 | * | Refill the test wallet2outOf3txsRevoke.jsonYoichi Hirai2017-08-221-595/+588 * | | Merge pull request #263 from ethereum/logswinsvega2017-08-212726-89623/+23638 |\ \ \ | * | | make all logs hexDimitry2017-08-212193-81494/+17073 | * | | remove old fields from random testsDimitry2017-08-211081-8677/+7113 |/ / / * | | Merge pull request #261 from jwasinger/masterwinsvega2017-08-213-1/+2523 |\ \ \ | * | | check for all possible invalid opcodes.Jared Wasinger2017-08-178-640/+2477 | * | | fix tests to conform to schemaJared Wasinger2017-08-175-7/+7 | * | | add SLOADBYTESJared Wasinger2017-08-173-1/+189 | * | | add badOpcode tests for SLOADBYTES and SSIZEJared Wasinger2017-08-175-3/+313 | * | | add badOpcode state test for SSIZEJared Wasinger2017-08-172-0/+187 * | | | Merge pull request #254 from cdetrio/fix-filler-storagewinsvega2017-08-2118-26/+26 |\ \ \ \ | |_|/ / |/| | | | * | | use hex for storage keys and values in state test fillerscdetrio2017-08-0818-26/+26 | | |/ | |/| * | | Merge pull request #262 from ethereum/eip96-to-constantinopleYoichi Hirai2017-08-17221-36812/+35337 |\ \ \ | |_|/ |/| | | * | Fix more BlockchainTestsYoichi Hirai2017-08-1719-2908/+2826 | * | fill BlockchainTests after delaying EIP96 to ConstantinopleYoichi Hirai2017-08-16206-34380/+32987 |/ / * | update comments in dao transition testsDimitry2017-08-157-472/+472 * | Merge pull request #260 from ethereum/bigger-memory-allocwinsvega2017-08-154-133/+133 |\ \ | * | Fix the modexpFiller about large base length and large exp lengthYoichi Hirai2017-08-144-133/+133 |/ / * | fix test name zeroSigTransactionCreateDimitry2017-08-144-5/+787 * | Merge pull request #258 from cdetrio/returndata-caseswinsvega2017-08-1110-0/+891 |\ \ | * | more returndata test casescdetrio2017-08-1110-0/+891 * | | Update and rename zeroSigTransacrionCreate.json to zeroSigTransactionCreate.jsonwinsvega2017-08-111-2/+2 |/ / * | Merge pull request #255 from ethereum/revert-returndatacopywinsvega2017-08-093-0/+953 |\ \ | |/ |/| | * Add a test case that RETURNDATACOPYs REVERTed dataYoichi Hirai2017-08-083-0/+953 |/ * Merge pull request #250 from cdetrio/filler-valid-jsonYoichi Hirai2017-08-0721-554/+554 |\ | * fix invalid json fillerscdetrio2017-08-0621-554/+554 * | Merge pull request #248 from ethereum/odd-length-hex-in-vm-fillerwinsvega2017-08-064-89/+439 |\ \ | * | Fix some formatting issues in VMTest fillersYoichi Hirai2017-08-054-89/+439 | |/ * | Merge pull request #246 from ethereum/filled-vm-test-no-expectwinsvega2017-08-063-68/+0 |\ \ | * | Remove "expect" sections from VM testsYoichi Hirai2017-08-053-68/+0 | |/ * | Merge pull request #251 from ethereum/hivetestswinsvega2017-08-062851-164758/+619483 |\ \ | |/ |/| | * Hive tests with ByzantineDimitry2017-08-062851-164758/+619483 |/ * Merge pull request #245 from ethereum/blockhashtestYoichi Hirai2017-08-042-102/+155 |\ | * blockhash test on Byzantine transitionDimitry2017-08-042-102/+155 * | Merge pull request #244 from ethereum/clear-storage-after-initwinsvega2017-08-043-80/+226 |\ \ | |/ |/| | * Fix the filler as wellYoichi Hirai2017-08-041-1/+5 | * Change tests so that the storage is cleared before, not after contract initia...Yoichi Hirai2017-08-042-79/+221 |/ * Merge pull request #241 from ethereum/metrosplitwinsvega2017-08-043205-75436/+304768 |\ | * Transition tests with ByzantiumDimitry2017-08-0315-3448/+865 | * split metropolisDimitry2017-08-033191-71988/+303903 |/ * Merge pull request #214 from ethereum/add-commentwinsvega2017-08-011-0/+1 |\ | * Add an explanationYoichi Hirai2017-07-061-0/+1 * | Merge pull request #238 from ethereum/updateHivewinsvega2017-08-016932-1764363/+2404939 |\ \ | * | update general testsDimitry2017-08-012187-257753/+273877 | * | regenerate hive testsDimitry2017-08-01