diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2012-11-04 21:30:55 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2012-11-04 21:30:55 +0000 |
commit | da6b969a01def44518afd0055a4bc53c648228db (patch) | |
tree | 32bc4ae8b21bee1c9d7a0e0d6a1ca8446d23f44d | |
parent | 486ade956ea661d979fb385b0efd69196b1f94d7 (diff) |
fix for the locked protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@2198 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/CSList/src/cslist.cpp | 38 | ||||
-rw-r--r-- | plugins/CSList/src/cslist.h | 9 |
2 files changed, 9 insertions, 38 deletions
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 2dbfabb240..7c0c4b23b5 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -93,15 +93,6 @@ extern "C" __declspec( dllexport ) int Load( ) InitCommonControlsEx( &icc );
}
- // set global variables
- // we need 0.8.0.9 core which introduced accounts support for protocols
- CSList::bAccountsSupported = ( CSList::dwMirandaVersion >= PLUGIN_MAKE_VERSION( 0, 8, 0, 9 ));
-
- // are we running under Unicode core?
- CSList::bUnicodeCore = true;
-
- // TODO: Alerts with wrong combination of ANSI/Unicode Windows/core/plugin
-
// create handler
cslist = new CSList( );
@@ -407,7 +398,13 @@ void CSList::addProtoStatusMenuItem( char* protoName, void* arg ) mi.ptszName = _T(MODULENAME);
mi.position = 2000040000;
mi.pszService = buf;
- mi.ptszPopupName = pdescr->tszAccountName;
+ if (CallService(MS_PROTO_ISACCOUNTLOCKED,0,(LPARAM)pdescr->szModuleName))
+ {
+ TCHAR szBuffer[256];
+ mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s (locked)"), pdescr->tszAccountName);
+ mi.ptszPopupName = szBuffer;
+ }
+ else mi.ptszPopupName = pdescr->tszAccountName;
Menu_AddStatusMenuItem(&mi);
cslist->registerHotkeys(buf, pdescr->tszAccountName, pdescr->iOrder);
@@ -571,29 +568,10 @@ void CSWindow::initButtons( ) void CSWindow::loadWindowPosition( )
{
- RECT rect = { 0 };
- int width = GetSystemMetrics( SM_CXSCREEN );
- int height = GetSystemMetrics( SM_CYSCREEN );
- GetWindowRect( this->handle, &rect );
- int x, y, defX, defY;
- defX = x = ( width + 1 - ( rect.right - rect.left )) >> 1;
- defY = y = ( height + 1 - ( rect.bottom - rect.top )) >> 1;
if ( getByte( "RememberWindowPosition", DEFAULT_REMEMBER_WINDOW_POSITION ))
{
- x = getWord( "PositionX", defX );
- y = getWord( "PositionY", defY );
+ Utils_RestoreWindowPosition(this->handle,NULL,__INTERNAL_NAME,"Position");
}
- if ( x > width || y > height || x < 0 || y < 0 )
- {
- x = defX;
- y = defY;
- }
-
- MoveWindow( this->handle,
- x, y,
- ( rect.right - rect.left ),
- ( rect.bottom - rect.top ),
- TRUE );
}
diff --git a/plugins/CSList/src/cslist.h b/plugins/CSList/src/cslist.h index c38859fdd9..ec2e533771 100644 --- a/plugins/CSList/src/cslist.h +++ b/plugins/CSList/src/cslist.h @@ -556,10 +556,7 @@ struct CSWindow {
if ( getByte( "RememberWindowPosition", DEFAULT_REMEMBER_WINDOW_POSITION ) == TRUE )
{
- RECT rect = { 0 };
- GetWindowRect( hwnd, &rect );
- setWord( "PositionX", rect.left );
- setWord( "PositionY", rect.top );
+ Utils_SaveWindowPosition(hwnd,NULL,__INTERNAL_NAME,"Position");
}
}
};
@@ -570,8 +567,6 @@ struct CSList // global variables
static HINSTANCE handle;
static DWORD dwMirandaVersion;
- static BOOL bUnicodeCore;
- static BOOL bAccountsSupported;
// class components
CSWindow* mainWindow;
@@ -614,8 +609,6 @@ struct CSList HINSTANCE CSList::handle = NULL;
DWORD CSList::dwMirandaVersion = 0x00000000;
-BOOL CSList::bUnicodeCore = FALSE;
-BOOL CSList::bAccountsSupported = FALSE;
// ====[ GLOBALS ]============================================================
|