summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/new-from-template.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
commit35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch)
tree657d15a03cc46bd099fc2c6546a7a4ad43815d9f /src/ui/dialog/new-from-template.cpp
parentInitial commit. (diff)
downloadinkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz
inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ui/dialog/new-from-template.cpp')
-rw-r--r--src/ui/dialog/new-from-template.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/ui/dialog/new-from-template.cpp b/src/ui/dialog/new-from-template.cpp
new file mode 100644
index 0000000..bfccdb6
--- /dev/null
+++ b/src/ui/dialog/new-from-template.cpp
@@ -0,0 +1,72 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/** @file
+ * @brief New From Template main dialog - implementation
+ */
+/* Authors:
+ * Jan Darowski <jan.darowski@gmail.com>, supervised by Krzysztof KosiƄski
+ *
+ * Copyright (C) 2013 Authors
+ * Released under GNU GPL v2+, read the file 'COPYING' for more information.
+ */
+
+#include "new-from-template.h"
+#include "file.h"
+
+#include "include/gtkmm_version.h"
+
+namespace Inkscape {
+namespace UI {
+
+
+NewFromTemplate::NewFromTemplate()
+ : _create_template_button(_("Create from template"))
+{
+ set_title(_("New From Template"));
+ resize(400, 400);
+
+ _main_widget = new TemplateLoadTab(this);
+
+ get_content_area()->pack_start(*_main_widget);
+
+ _create_template_button.set_halign(Gtk::ALIGN_END);
+ _create_template_button.set_valign(Gtk::ALIGN_END);
+ _create_template_button.set_margin_end(15);
+
+ get_content_area()->pack_end(_create_template_button, Gtk::PACK_SHRINK);
+
+ _create_template_button.signal_clicked().connect(
+ sigc::mem_fun(*this, &NewFromTemplate::_createFromTemplate));
+ _create_template_button.set_sensitive(false);
+
+ show_all();
+}
+
+NewFromTemplate::~NewFromTemplate()
+{
+ delete _main_widget;
+}
+
+void NewFromTemplate::setCreateButtonSensitive(bool value)
+{
+ _create_template_button.set_sensitive(value);
+}
+
+void NewFromTemplate::_createFromTemplate()
+{
+ _main_widget->createTemplate();
+ _onClose();
+}
+
+void NewFromTemplate::_onClose()
+{
+ response(0);
+}
+
+void NewFromTemplate::load_new_from_template()
+{
+ NewFromTemplate dl;
+ dl.run();
+}
+
+}
+}