[Uml-devel] KDE/kdesdk/umbrello/umbrello
Ralf Habacker
ralf.habacker at gmail.com
Wed Mar 28 12:56:41 UTC 2012
SVN commit 1287497 by habacker:
Only display available auto layouts when graphviz is installed.
M +3 -1 layoutgenerator.h
M +8 -2 listpopupmenu.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/layoutgenerator.h #1287496:1287497
@@ -122,8 +122,10 @@
QTemporaryFile in;
QTemporaryFile out;
QTemporaryFile xdotOut;
- if (!isEnabled())
+ if (!isEnabled()) {
+ uWarning() << "Could not apply autolayout because graphviz installation has not been found.";
return false;
+ }
#ifdef LAYOUTGENERATOR_DEBUG
in.setAutoRemove(false);
--- trunk/KDE/kdesdk/umbrello/umbrello/listpopupmenu.cpp #1287496:1287497
@@ -1717,9 +1717,11 @@
insert(mt_Clear, Icon_Utils::SmallIcon(Icon_Utils::it_Clear), i18n("Clear Diagram"));
insert(mt_Export_Image);
addSeparator();
- QHash<QString, QString> configFiles;
QList<MenuType> types;
types << mt_Apply_Layout << mt_Apply_Layout1 << mt_Apply_Layout2 << mt_Apply_Layout3 << mt_Apply_Layout4 << mt_Apply_Layout5 << mt_Apply_Layout6 << mt_Apply_Layout7 << mt_Apply_Layout8 << mt_Apply_Layout9;
+ LayoutGenerator generator;
+ if (generator.isEnabled()) {
+ QHash<QString, QString> configFiles;
if (LayoutGenerator::availableConfigFiles(view->umlScene(), configFiles)) {
int i = 0;
foreach(const QString &key, configFiles.keys()) {
@@ -1729,8 +1731,12 @@
getAction(types[i])->setData(QVariant(key));
i++;
}
+ addSeparator();
}
- addSeparator();
+ }
+ else {
+ uWarning() << "Could not add autolayout entries because graphviz installation has not been found.";
+ }
insert(mt_SnapToGrid, i18n("Snap to Grid"), CHECKABLE);
setActionChecked(mt_SnapToGrid, view->umlScene()->getSnapToGrid() );
insert(mt_ShowSnapGrid, i18n("Show Grid"), CHECKABLE);
More information about the umbrello-devel
mailing list