diff options
author | randomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64> | 2012-01-09 11:38:49 +0000 |
---|---|---|
committer | randomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64> | 2012-01-09 11:38:49 +0000 |
commit | 469ddcf97d23d4b38a761345ba58f9761d757456 (patch) | |
tree | 49da3e0f9a2350060838fd6090dbee29da90475a /tikzit/src/linux/MainWindow.m | |
parent | c5f1d88491018af8a2e86ea55a439d730c759605 (diff) |
Don't bother with preambles if we can't do previews
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@369 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'tikzit/src/linux/MainWindow.m')
-rw-r--r-- | tikzit/src/linux/MainWindow.m | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tikzit/src/linux/MainWindow.m b/tikzit/src/linux/MainWindow.m index ecaf1fa..eceb7f9 100644 --- a/tikzit/src/linux/MainWindow.m +++ b/tikzit/src/linux/MainWindow.m @@ -27,9 +27,9 @@ #import "GraphRenderer.h" #import "Menu.h" #import "PreambleEditor.h" +#ifdef HAVE_POPPLER #import "Preambles.h" #import "Preambles+Storage.h" -#ifdef HAVE_POPPLER #import "PreviewWindow.h" #endif #import "PropertyPane.h" @@ -122,6 +122,7 @@ static void update_paste_action (GtkClipboard *clipboard, GdkEvent *event, GtkAc if (self) { document = nil; + preambles = nil; preambleWindow = nil; previewWindow = nil; suppressTikzUpdates = NO; @@ -339,11 +340,13 @@ static void update_paste_action (GtkClipboard *clipboard, GdkEvent *event, GtkAc } - (void) editPreambles { +#ifdef HAVE_POPPLER if (preambleWindow == nil) { preambleWindow = [[PreambleEditor alloc] initWithPreambles:preambles]; [preambleWindow setParentWindow:mainWindow]; } [preambleWindow show]; +#endif } - (void) showPreview { @@ -440,6 +443,7 @@ static void update_paste_action (GtkClipboard *clipboard, GdkEvent *event, GtkAc - (void) saveConfiguration { NSError *error = nil; +#ifdef HAVE_POPPLER if (preambles != nil) { NSString *preamblesDir = [[SupportDir userSupportDir] stringByAppendingPathComponent:@"preambles"]; // NSFileManager is slightly dodgy on Windows @@ -447,6 +451,7 @@ static void update_paste_action (GtkClipboard *clipboard, GdkEvent *event, GtkAc [preambles storeToDirectory:preamblesDir]; [configFile setStringEntry:@"selectedPreamble" inGroup:@"Preambles" value:[preambles selectedPreambleName]]; } +#endif [styleManager saveStylesUsingConfigurationName:@"styles"]; [propertyPane saveUiStateToConfig:configFile group:@"PropertyPane"]; @@ -553,6 +558,7 @@ static void update_paste_action (GtkClipboard *clipboard, GdkEvent *event, GtkAc // must happen after _loadStyles - (void) _loadPreambles { +#ifdef HAVE_POPPLER NSString *preamblesDir = [[SupportDir userSupportDir] stringByAppendingPathComponent:@"preambles"]; preambles = [[Preambles alloc] initFromDirectory:preamblesDir]; [preambles setStyleManager:styleManager]; @@ -560,6 +566,7 @@ static void update_paste_action (GtkClipboard *clipboard, GdkEvent *event, GtkAc if (selectedPreamble != nil) { [preambles setSelectedPreambleName:selectedPreamble]; } +#endif } - (void) _loadUi { |