FeatureManager featureManager = GlobalController.SINGLETON.getFeatureManager();
int pubLimit = featureManager.getPublicationLimit();
boolean pubLimitReached = pubLimit > -1 && cgs.countPublishedGuides() >= pubLimit;
boolean actAvailable = model.getServicePreferences().isAccountInformationEntered();
AddGuideDialog dialog = new AddGuideDialog(controller.getMainFrame(), actAvailable, pubLimit, pubLimitReached);
String urls = dialog.open(cgs);
if (!dialog.hasBeenCanceled())
{
final String title = dialog.getGuideTitle();
final String iconKey = dialog.getIconKey();
final boolean autoFeedDiscovery = dialog.isAutoFeedDiscovery();
StandardGuide guide = controller.createStandardGuide(title, iconKey, autoFeedDiscovery);
if (guide != null)
{
// Propagate publishing information
boolean publishingEnabled = dialog.isPublishingEnabled();
guide.setPublishingEnabled(publishingEnabled);
guide.setPublishingTitle(dialog.getPublishingTitle());
guide.setPublishingTags(dialog.getPublishingTags());
guide.setPublishingPublic(dialog.isPublishingPublic());
guide.setPublishingRating(dialog.getPublishingRating() - 1);
guide.setNotificationsAllowed(dialog.isNotificationsAllowed());
ReadingList[] readingLists = dialog.getReadingLists();
if (readingLists != null)
{
for (ReadingList readingList : readingLists) guide.add(readingList);
// if there were reading lists -- update them immediately