summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@cs.ox.ac.uk>2013-02-04 12:09:24 +0000
committerAlex Merry <alex.merry@cs.ox.ac.uk>2013-02-04 12:09:24 +0000
commite92425f179ee806eb27c10b47709b7ea2833a90b (patch)
tree63440cec9b7655014c83d49594f8d9801da43360
parent5349460f6ba630d92ab61f4cbe1c04210e7684cc (diff)
Clean up the SettingsDialog class a little
-rw-r--r--tikzit/src/gtk/SettingsDialog.h8
-rw-r--r--tikzit/src/gtk/SettingsDialog.m34
2 files changed, 20 insertions, 22 deletions
diff --git a/tikzit/src/gtk/SettingsDialog.h b/tikzit/src/gtk/SettingsDialog.h
index d937774..22d0d17 100644
--- a/tikzit/src/gtk/SettingsDialog.h
+++ b/tikzit/src/gtk/SettingsDialog.h
@@ -30,17 +30,15 @@
GtkEntry *pdflatexPathEntry;
}
-@property (retain) Configuration* configuration;
+@property (retain) Configuration *configuration;
+@property (assign) GtkWindow *parentWindow;
+@property (assign,getter=isVisible) BOOL visible;
- (id) initWithConfiguration:(Configuration*)c;
-- (void) setParentWindow:(GtkWindow*)parent;
-
- (void) present;
- (void) show;
- (void) hide;
-- (BOOL) isVisible;
-- (void) setVisible:(BOOL)visible;
@end
diff --git a/tikzit/src/gtk/SettingsDialog.m b/tikzit/src/gtk/SettingsDialog.m
index 11a0d0d..a70a412 100644
--- a/tikzit/src/gtk/SettingsDialog.m
+++ b/tikzit/src/gtk/SettingsDialog.m
@@ -50,13 +50,24 @@ static void cancel_button_clicked_cb (GtkButton *widget, SettingsDialog *dialog)
if (self) {
configuration = [c retain];
- parentWindow = NULL;
- window = NULL;
}
return self;
}
+- (void) dealloc {
+ if (window) {
+ gtk_widget_destroy (GTK_WIDGET (window));
+ }
+ if (parentWindow) {
+ g_object_unref (parentWindow);
+ }
+
+ [configuration release];
+
+ [super dealloc];
+}
+
- (Configuration*) configuration {
return configuration;
}
@@ -68,6 +79,10 @@ static void cancel_button_clicked_cb (GtkButton *widget, SettingsDialog *dialog)
[self revert];
}
+- (GtkWindow*) parentWindow {
+ return parentWindow;
+}
+
- (void) setParentWindow:(GtkWindow*)parent {
GtkWindow *oldParent = parentWindow;
@@ -118,21 +133,6 @@ static void cancel_button_clicked_cb (GtkButton *widget, SettingsDialog *dialog)
}
}
-- (void) dealloc {
- [configuration release];
- configuration = nil;
-
- if (window) {
- gtk_widget_destroy (GTK_WIDGET (window));
- window = NULL;
- }
- if (parentWindow) {
- g_object_ref (parentWindow);
- }
-
- [super dealloc];
-}
-
@end
// }}}