[niepce/gtk4] gtk4: Fix edit label dialog



commit 567e76d6ac53931a630932e478304a3f53ab85a6
Author: Hubert Figuière <hub figuiere net>
Date:   Sat May 7 10:47:23 2022 -0400

    gtk4: Fix edit label dialog

 src/niepce/ui/dialogs/editlabels.ui | 6 +++++-
 src/niepce/ui/niepceapplication.cpp | 1 -
 src/niepce/ui/niepcewindow.cpp      | 7 +++++--
 src/niepce/ui/niepcewindow.hpp      | 2 ++
 4 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/niepce/ui/dialogs/editlabels.ui b/src/niepce/ui/dialogs/editlabels.ui
index ad02e95..d811006 100644
--- a/src/niepce/ui/dialogs/editlabels.ui
+++ b/src/niepce/ui/dialogs/editlabels.ui
@@ -226,12 +226,16 @@
       <object class="GtkBox" id="dialog-action_area1">
         <property name="visible">True</property>
         <property name="can-focus">False</property>
+        <property name="margin-start">6</property>
+        <property name="margin-end">6</property>
+        <property name="margin-top">6</property>
+        <property name="margin-bottom">6</property>
         <child>
           <placeholder/>
         </child>
         <child>
           <object class="GtkButton" id="button1">
-            <property name="label">gtk-close</property>
+            <property name="label">Close</property>
             <property name="focusable">1</property>
             <property name="receives-default">1</property>
           </object>
diff --git a/src/niepce/ui/niepceapplication.cpp b/src/niepce/ui/niepceapplication.cpp
index b618bf6..efafc2e 100644
--- a/src/niepce/ui/niepceapplication.cpp
+++ b/src/niepce/ui/niepceapplication.cpp
@@ -72,7 +72,6 @@ void NiepceApplication::on_about()
 {
     DBG_OUT("on_about");
     Gtk::AboutDialog* dlg = new Gtk::AboutDialog();
-//    dlg.set_name("Niepce");
     dlg->set_program_name("Niepce Digital");
     dlg->set_version(VERSION);
     dlg->set_logo_icon_name("org.gnome.Niepce");
diff --git a/src/niepce/ui/niepcewindow.cpp b/src/niepce/ui/niepcewindow.cpp
index 623980f..0888744 100644
--- a/src/niepce/ui/niepcewindow.cpp
+++ b/src/niepce/ui/niepcewindow.cpp
@@ -387,8 +387,11 @@ void NiepceWindow::on_action_edit_labels()
 {
     DBG_OUT("edit labels");
     // get the labels.
-    EditLabels::Ptr dlg(new EditLabels(getLibraryClient()));
-    dlg->run_modal(shared_frame_ptr());
+    m_editlabel_dialog = EditLabels::Ptr(new EditLabels(getLibraryClient()));
+    // XXX I do have serious doubt on the safety of this
+    m_editlabel_dialog->run_modal(shared_frame_ptr(), [this] (int) {
+        m_editlabel_dialog.reset((EditLabels*)nullptr);
+    });
 }
 
 void NiepceWindow::on_action_edit_delete()
diff --git a/src/niepce/ui/niepcewindow.hpp b/src/niepce/ui/niepcewindow.hpp
index 8616252..84b72f0 100644
--- a/src/niepce/ui/niepcewindow.hpp
+++ b/src/niepce/ui/niepcewindow.hpp
@@ -33,6 +33,7 @@
 #include "ui/selectioncontroller.hpp"
 #include "ui/filmstripcontroller.hpp"
 #include "niepce/notificationcenter.hpp"
+#include "dialogs/editlabels.hpp"
 
 namespace ui {
 
@@ -80,6 +81,7 @@ private:
     WorkspaceController::Ptr       m_workspacectrl;
     FilmStripController::Ptr       m_filmstrip;
     Gtk::Statusbar                 m_statusBar;
+    EditLabels::Ptr m_editlabel_dialog;
     libraryclient::LibraryClientPtr m_libClient;
     fwk::Configuration::Ptr        m_library_cfg;
 };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]