final IGuide guide = model.getSelectedGuide();
if (guide != null)
{
boolean oldPublishingEnabled = guide.isPublishingEnabled();
GuidesSet set = model.getGuidesSet();
MainFrame mainFrame = GlobalController.SINGLETON.getMainFrame();
// Figure out if the publishing limit is already hit
FeatureManager featureManager = GlobalController.SINGLETON.getFeatureManager();
int pubLimit = featureManager.getPublicationLimit();
boolean pubLimitReached = pubLimit > -1 && set.countPublishedGuides() >= pubLimit;
boolean actAvailable = model.getServicePreferences().isAccountInformationEntered();
EditGuideDialog dialog = new EditGuideDialog(mainFrame, actAvailable, pubLimit, pubLimitReached);
dialog.open(set, guide);
if (!dialog.hasBeenCanceled())
{
performUpdates(guide, dialog, set.indexOf(guide));
boolean newPublishingEnabled = guide.isPublishingEnabled();
if (newPublishingEnabled && !oldPublishingEnabled)
{
GlobalController.SINGLETON.showNewPublishingDialog();