linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #06033
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3050: multiline plugin descriptions
------------------------------------------------------------
revno: 3050
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2012-09-14 19:15:20 +0200
message:
multiline plugin descriptions
modified:
dwt/src/widgets/Link.cpp
win32/PluginPage.cpp
win32/PluginPage.h
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dwt/src/widgets/Link.cpp'
--- dwt/src/widgets/Link.cpp 2012-07-07 15:36:18 +0000
+++ dwt/src/widgets/Link.cpp 2012-09-14 17:15:20 +0000
@@ -63,6 +63,7 @@
void Link::setLink(const tstring& link, size_t index) {
LITEM item = { LIF_ITEMINDEX | LIF_URL, static_cast<int>(index) };
link.copy(item.szUrl, std::min(link.size(), static_cast<size_t>(L_MAX_URL_LENGTH - 1)));
+ sendMessage(LM_SETITEM, 0, reinterpret_cast<LPARAM>(&item));
}
Point Link::getPreferredSize() {
@@ -80,8 +81,8 @@
(closing = text.find(_T("</a"), end)) != tstring::npos &&
(closingEnd = text.find(_T(">"), closing)) != tstring::npos)
{
- text.erase(closing, closingEnd - closing);
- text.erase(start, end - start);
+ text.erase(closing, closingEnd - closing + 1);
+ text.erase(start, end - start + 1);
}
return getTextSize(text);
}
=== modified file 'win32/PluginPage.cpp'
--- win32/PluginPage.cpp 2012-09-04 21:10:41 +0000
+++ win32/PluginPage.cpp 2012-09-14 17:15:20 +0000
@@ -43,7 +43,7 @@
using dwt::LoadDialog;
static const ColumnInfo columns[] = {
- { "", 440, false },
+ { "", 100, false },
};
PluginPage::PluginPage(dwt::Widget* parent) :
@@ -128,8 +128,7 @@
group->setHelpId(IDH_SETTINGS_PLUGINS_INFO);
pluginInfo = group->addChild(Grid::Seed(1, 1));
pluginInfo->column(0).mode = GridInfo::FILL;
- pluginInfo->row(0).mode = GridInfo::STATIC;
- pluginInfo->row(0).align = GridInfo::STRETCH;
+ pluginInfo->setSpacing(grid->getSpacing());
}
grid->addChild(Label::Seed(str(TF_("Some plugins may require you to restart %1%") % Text::toT(APPNAME))));
@@ -151,6 +150,12 @@
PluginPage::~PluginPage() {
}
+void PluginPage::layout() {
+ PropPage::layout();
+
+ plugins->setColumnWidth(0, plugins->getWindowSize().x - 20);
+}
+
void PluginPage::handleDoubleClick() {
if(plugins->hasSelected()) {
handleConfigurePlugin();
@@ -180,26 +185,34 @@
HoldRedraw hold(pluginInfo);
+ pluginInfo->clearRows();
+
/* destroy previous children. store them in a vector beforehand or the enumeration will fail
(since they're getting destroyed)... */
auto children = pluginInfo->getChildren<Control>();
boost::for_each(std::vector<Control*>(children.first, children.second), [](Control* w) { w->close(); });
- pluginInfo->clearRows();
-
if(plugins->countSelected() != 1) {
- pluginInfo->addRow();
+ pluginInfo->addRow(GridInfo(0, GridInfo::FILL, GridInfo::STRETCH));
pluginInfo->addChild(Label::Seed(T_("No plugin has been selected")));
return;
}
- pluginInfo->addRow();
+ pluginInfo->addRow(GridInfo(0, GridInfo::FILL, GridInfo::STRETCH));
auto infoGrid = pluginInfo->addChild(Grid::Seed(0, 2));
-
- auto addInfo = [this, infoGrid](tstring name, const string& value, bool link) {
- infoGrid->addRow();
+ infoGrid->column(1).mode = GridInfo::FILL;
+ infoGrid->setSpacing(pluginInfo->getSpacing());
+
+ enum Type { Name, Version, Description, Author, Website };
+
+ auto addInfo = [this, infoGrid](tstring name, const string& value, Type type) {
+ if(type == Description) {
+ infoGrid->addRow(GridInfo(0, GridInfo::FILL, GridInfo::STRETCH));
+ } else {
+ infoGrid->addRow();
+ }
infoGrid->addChild(Label::Seed(name));
- if(link && !value.empty()) {
+ if(type == Website && !value.empty()) {
infoGrid->addChild(Link::Seed(Text::toT(value), true));
} else {
infoGrid->addChild(Label::Seed(value.empty() ?
@@ -209,11 +222,11 @@
auto info = reinterpret_cast<MetaData*>(plugins->getData(plugins->getSelected()));
- addInfo(T_("Name: "), info->name, false);
- addInfo(T_("Version: "), Util::toString(info->version), false);
- addInfo(T_("Description: "), info->description, false);
- addInfo(T_("Author: "), info->author, false);
- addInfo(T_("Website: "), info->web, true);
+ addInfo(T_("Name: "), info->name, Name);
+ addInfo(T_("Version: "), Util::toString(info->version), Version);
+ addInfo(T_("Description: "), info->description, Description);
+ addInfo(T_("Author: "), info->author, Author);
+ addInfo(T_("Website: "), info->web, Website);
}
bool PluginPage::handleContextMenu(dwt::ScreenCoordinate pt) {
=== modified file 'win32/PluginPage.h'
--- win32/PluginPage.h 2012-07-02 18:13:18 +0000
+++ win32/PluginPage.h 2012-09-14 17:15:20 +0000
@@ -28,6 +28,8 @@
PluginPage(dwt::Widget* parent);
virtual ~PluginPage();
+ virtual void layout();
+
private:
TablePtr plugins;