From f3311cd7eb5e87b3718f763a3c08cd3764c84f51 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 28 Jul 2012 16:23:55 +0000 Subject: - added MS_DB_SETDEFAULTPROFILE service for the service plugins - added ability to call the service plugin before loading database - changed the core module modules' loading order git-svn-id: http://svn.miranda-ng.org/main/trunk@1225 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/miranda.h | 3 +++ src/core/modules.cpp | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'src/core') diff --git a/src/core/miranda.h b/src/core/miranda.h index aeaa1fd593..169b8d5db4 100644 --- a/src/core/miranda.h +++ b/src/core/miranda.h @@ -114,6 +114,9 @@ extern MIDatabase* currDb; extern DATABASELINK* currDblink; extern LIST arDbPlugins; +int InitIni(void); +void UninitIni(void); + /**** fontService.cpp ******************************************************************/ void KillModuleFonts(int hLangpack); diff --git a/src/core/modules.cpp b/src/core/modules.cpp index 6ada0cf650..a1fd29b5c3 100644 --- a/src/core/modules.cpp +++ b/src/core/modules.cpp @@ -42,8 +42,10 @@ int LoadProtocolsModule(void); // core: protocol manager int LoadAccountsModule(void); // core: account manager int LoadIgnoreModule(void); // protocol filter: ignore int LoadDbintfModule(void); +int LoadEventsModule(void); int LoadContactListModule(void);// ui: clist +int LoadDatabaseModule(void); int LoadOptionsModule(void); // ui: options dialog int LoadFindAddModule(void); // ui: search/add users int LoadSkinIcons(void); @@ -60,6 +62,7 @@ int LoadButtonModule(void); // window class: button class int LoadFontserviceModule(void); // ui: font manager int LoadIcoLibModule(void); // ui: icons manager int LoadServiceModePlugin(void); +int LoadDefaultServiceModePlugin(void); int LoadErrorsModule(); void UnloadUtilsModule(void); @@ -92,8 +95,23 @@ int LoadDefaultModules(void) if ( LoadIcoTabsModule()) return 1; if ( LoadHeaderbarModule()) return 1; if ( LoadDbintfModule()) return 1; + if ( LoadEventsModule()) return 1; + + // load database drivers & service plugins without executing their Load() if ( LoadNewPluginsModuleInfos()) return 1; + switch ( LoadDefaultServiceModePlugin()) { + case SERVICE_CONTINUE: // continue loading Miranda normally + break; + case SERVICE_MONOPOLY: // unload database and go to the message cycle + return 0; + default: // smth went wrong, terminating + return 1; + } + + // the database will select which db plugin to use, or fail if no profile is selected + if ( LoadDatabaseModule()) return 1; + // database is available here if ( LoadButtonModule()) return 1; if ( LoadIcoLibModule()) return 1; -- cgit v1.2.3