summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-04-24 06:47:35 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-04-24 06:47:35 +0000
commit001832de6c20442ae98cdf2ab52a61556e9b0085 (patch)
tree2497fcff0d6f29abd81e43ac9fe8aa6772794ada /plugins/SmileyAdd/src
parent930fa5e62b924b66bee881070fd9619994da202d (diff)
SmileyAdd:
change ‘Use per protocol global smiley packs’ option logic Copyright update git-svn-id: http://svn.miranda-ng.org/main/trunk@13062 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SmileyAdd/src')
-rw-r--r--plugins/SmileyAdd/src/options.cpp17
-rw-r--r--plugins/SmileyAdd/src/options.h3
-rw-r--r--plugins/SmileyAdd/src/services.cpp6
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp13
-rw-r--r--plugins/SmileyAdd/src/smileys.h10
-rw-r--r--plugins/SmileyAdd/src/version.h22
6 files changed, 45 insertions, 26 deletions
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp
index f0c971cac2..5fb0abf771 100644
--- a/plugins/SmileyAdd/src/options.cpp
+++ b/plugins/SmileyAdd/src/options.cpp
@@ -1,5 +1,6 @@
/*
-Miranda SmileyAdd Plugin
+Miranda NG SmileyAdd Plugin
+Copyright (C) 2012 - 2015 Miranda NG project (http://miranda-ng.org)
Copyright (C) 2005 - 2011 Boris Krasnovskiy All Rights Reserved
Copyright (C) 2003 - 2004 Rein-Peter de Boer
@@ -132,6 +133,11 @@ BOOL OptionsDialogType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lParam)
case IDC_USESTDPACK:
if (HIWORD(wParam) == BN_CLICKED) {
+ BOOL en = IsDlgButtonChecked(m_hwndDialog, IDC_USESTDPACK) == BST_CHECKED;
+ EnableWindow(GetDlgItem(m_hwndDialog, IDC_USEPHYSPROTO), en);
+ } // no break!
+ case IDC_USEPHYSPROTO:
+ if (HIWORD(wParam) == BN_CLICKED) {
PopulateSmPackList();
SetChanged();
}
@@ -159,7 +165,6 @@ BOOL OptionsDialogType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lParam)
break;
case IDC_SPACES:
- case IDC_USEPHYSPROTO:
case IDC_SCALETOTEXTHEIGHT:
case IDC_APPENDSPACES:
case IDC_SMLBUT:
@@ -316,6 +321,7 @@ long OptionsDialogType::GetSelProto(HTREEITEM hItem)
void OptionsDialogType::PopulateSmPackList(void)
{
bool useOne = IsDlgButtonChecked(m_hwndDialog, IDC_USESTDPACK) == BST_UNCHECKED;
+ bool usePhysProto = IsDlgButtonChecked(m_hwndDialog, IDC_USEPHYSPROTO) == BST_CHECKED;
HWND hLstView = GetDlgItem(m_hwndDialog, IDC_CATEGORYLIST);
@@ -329,8 +335,10 @@ void OptionsDialogType::PopulateSmPackList(void)
tvi.item.stateMask = TVIS_STATEIMAGEMASK | TVIS_SELECTED;
SmileyCategoryListType::SmileyCategoryVectorType& smc = *tmpsmcat.GetSmileyCategoryList();
- for (int i=0; i < smc.getCount(); i++) {
- if (!useOne || !smc[i].IsProto()) {
+ for (int i=0; i < smc.getCount(); i++) {
+ bool visiblecat = usePhysProto ? !smc[i].IsAcc() : !smc[i].IsPhysProto();
+ bool visible = useOne ? !smc[i].IsProto() : visiblecat;
+ if (visible) {
tvi.item.pszText = (TCHAR*)smc[i].GetDisplayName().c_str();
if (!smc[i].IsProto()) {
tvi.item.iImage = 0;
@@ -377,6 +385,7 @@ void OptionsDialogType::InitDialog(void)
SendDlgItemMessage(m_hwndDialog, IDC_SMLBUT, CB_SETCURSEL, opt.ButtonStatus, 0);
EnableWindow(GetDlgItem(m_hwndDialog, IDC_SMLBUT), opt.PluginSupportEnabled);
+ EnableWindow(GetDlgItem(m_hwndDialog, IDC_USEPHYSPROTO), !opt.UseOneForAll);
SendDlgItemMessage(m_hwndDialog, IDC_MAXCUSTSPIN, UDM_SETRANGE32, 0, 99);
SendDlgItemMessage(m_hwndDialog, IDC_MAXCUSTSPIN, UDM_SETPOS, 0, opt.MaxCustomSmileySize);
diff --git a/plugins/SmileyAdd/src/options.h b/plugins/SmileyAdd/src/options.h
index fea3d97a6a..f5d10d659d 100644
--- a/plugins/SmileyAdd/src/options.h
+++ b/plugins/SmileyAdd/src/options.h
@@ -1,5 +1,6 @@
/*
-Miranda SmileyAdd Plugin
+Miranda NG SmileyAdd Plugin
+Copyright (C) 2012 - 2015 Miranda NG project (http://miranda-ng.org)
Copyright (C) 2005 - 2011 Boris Krasnovskiy
Copyright (C) 2003 - 2004 Rein-Peter de Boer
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp
index a06f5468ba..0ada278cb0 100644
--- a/plugins/SmileyAdd/src/services.cpp
+++ b/plugins/SmileyAdd/src/services.cpp
@@ -1,5 +1,6 @@
/*
-Miranda SmileyAdd Plugin
+Miranda NG SmileyAdd Plugin
+Copyright (C) 2012 - 2015 Miranda NG project (http://miranda-ng.org)
Copyright (C) 2005 - 2011 Boris Krasnovskiy All Rights Reserved
Copyright (C) 2003 - 2004 Rein-Peter de Boer
@@ -67,7 +68,8 @@ SmileyPackType* GetSmileyPack(const char* proto, MCONTACT hContact, SmileyPackCT
categoryName = A2T_SM(proto);
if (opt.UseOneForAll) {
SmileyCategoryType *smc = g_SmileyCategories.GetSmileyCategory(categoryName);
- if (smc == NULL || smc->IsProto()) categoryName = _T("Standard");
+ if (smc == NULL || smc->IsProto())
+ categoryName = _T("Standard");
}
}
}
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index bd5aa658b1..8ac6d9bafe 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -1,5 +1,6 @@
/*
-Miranda SmileyAdd Plugin
+Miranda NG SmileyAdd Plugin
+Copyright (C) 2012 - 2015 Miranda NG project (http://miranda-ng.org)
Copyright (C) 2005 - 2011 Boris Krasnovskiy All Rights Reserved
Copyright (C) 2003 - 2004 Rein-Peter de Boer
@@ -730,7 +731,7 @@ SmileyCategoryType::SmileyCategoryType(SmileyPackListType* pSPS, const CMString&
void SmileyCategoryType::Load(void)
{
- if (!opt.UseOneForAll || type != smcProto)
+ if (!opt.UseOneForAll || !IsProto())
m_pSmileyPackStore->AddSmileyPack(m_Filename);
}
@@ -877,7 +878,7 @@ void SmileyCategoryListType::AddProtoAsCategory(char *acc, const CMString& defau
displayName += TranslateT(" global smiley pack");
CMString tname("AllProto");
tname += A2T_SM(acc);
- AddCategory(tname, displayName, smcProto, paths);
+ AddCategory(tname, displayName, smcPhysProto, paths);
}
void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc)
@@ -945,9 +946,9 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co
if (_taccess(patha.c_str(), 0) != 0)
paths = defaultFile;
- AddCategory(displayName, displayName, smcProto, paths);
+ AddCategory(displayName, displayName, smcTransportProto, paths);
}
- else AddCategory(displayName, displayName, smcProto, defaultFile);
+ else AddCategory(displayName, displayName, smcTransportProto, defaultFile);
db_free(&dbv);
}
@@ -977,7 +978,7 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void)
PROTOACCOUNT **accList;
ProtoEnumAccounts(&protoCount, &accList);
- for (int i = 0; i < protoCount; i++)
+ for (int i = 0; i < protoCount; i++)
AddAccountAsCategory(accList[i], defaultFile);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h
index 4b04a1d756..fce65fffa2 100644
--- a/plugins/SmileyAdd/src/smileys.h
+++ b/plugins/SmileyAdd/src/smileys.h
@@ -1,5 +1,6 @@
/*
-Miranda SmileyAdd Plugin
+Miranda NG SmileyAdd Plugin
+Copyright (C) 2012 - 2015 Miranda NG project (http://miranda-ng.org)
Copyright (C) 2005 - 2011 Boris Krasnovskiy
Copyright (C) 2003 - 2004 Rein-Peter de Boer
@@ -224,6 +225,8 @@ typedef enum
smcNone,
smcStd,
smcProto,
+ smcTransportProto,
+ smcPhysProto,
smcCustom,
smcExt
} SmcType;
@@ -250,7 +253,10 @@ public:
const CMString& GetFilename(void) const { return m_Filename; }
bool IsCustom(void) { return type == smcCustom; }
- bool IsProto(void) { return type == smcProto; }
+ bool IsProto(void) { return type == smcProto || type == smcPhysProto || type == smcTransportProto; }
+ bool IsAcc(void) { return type == smcProto; }
+ bool IsPhysProto(void) { return type == smcPhysProto; }
+ bool IsTransportProto(void) { return type == smcTransportProto; }
bool IsExt(void) { return type == smcExt; }
SmcType GetType(void) { return type; }
diff --git a/plugins/SmileyAdd/src/version.h b/plugins/SmileyAdd/src/version.h
index d4e03ce728..a8df0fc5d4 100644
--- a/plugins/SmileyAdd/src/version.h
+++ b/plugins/SmileyAdd/src/version.h
@@ -1,14 +1,14 @@
-#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 2
-#define __RELEASE_NUM 3
-#define __BUILD_NUM 18
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 2
+#define __RELEASE_NUM 3
+#define __BUILD_NUM 18
#include <stdver.h>
-#define __PLUGIN_NAME "SmileyAdd"
-#define __FILENAME "SmileyAdd.dll"
-#define __DESCRIPTION "Smiley support for Miranda NG."
-#define __AUTHOR "Peacow, nightwish, bid, borkra"
-#define __AUTHOREMAIL "borkra@miranda-im.org"
-#define __AUTHORWEB "http://miranda-ng.org/p/SmileyAdd/"
-#define __COPYRIGHT "© 2004 - 2012 Boris Krasnovskiy, portions by Rein-Peter de Boer"
+#define __PLUGIN_NAME "SmileyAdd"
+#define __FILENAME "SmileyAdd.dll"
+#define __DESCRIPTION "Smiley support for Miranda NG."
+#define __AUTHOR "Peacow, nightwish, bid, borkra"
+#define __AUTHOREMAIL "borkra@miranda-im.org"
+#define __AUTHORWEB "http://miranda-ng.org/p/SmileyAdd/"
+#define __COPYRIGHT "© 2012 - 15 Miranda NG Team, 2004 - 12 Boris Krasnovskiy, portions by Rein-Peter de Boer"