[gnote] Use title in create notebook dialog



commit a831979bbac8016542424a4b64fb1ebe98b11a59
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Sep 8 20:12:12 2013 +0300

    Use title in create notebook dialog
    
    Title instead primary text.
    Part of bug 701845.

 src/notebooks/createnotebookdialog.cpp |    4 ++--
 src/utils.cpp                          |   25 ++++++++++++-------------
 src/utils.hpp                          |    4 ++--
 3 files changed, 16 insertions(+), 17 deletions(-)
---
diff --git a/src/notebooks/createnotebookdialog.cpp b/src/notebooks/createnotebookdialog.cpp
index 3ce4fc3..d175de1 100644
--- a/src/notebooks/createnotebookdialog.cpp
+++ b/src/notebooks/createnotebookdialog.cpp
@@ -36,9 +36,9 @@ namespace gnote {
   namespace notebooks {
 
     CreateNotebookDialog::CreateNotebookDialog(Gtk::Window *parent, GtkDialogFlags f)
-      : utils::HIGMessageDialog(parent, f, Gtk::MESSAGE_OTHER, Gtk::BUTTONS_NONE,
-                                _("Create a new notebook"), "")
+      : utils::HIGMessageDialog(parent, f, Gtk::MESSAGE_OTHER, Gtk::BUTTONS_NONE)
     {
+      set_title(_("Create Notebook"));
       Gtk::Table *table = manage(new Gtk::Table (2, 2, false));
       table->set_col_spacings(6);
       
diff --git a/src/utils.cpp b/src/utils.cpp
index 9b6914b..b2f4d54 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -354,21 +354,20 @@ namespace gnote {
       label_vbox->set_hexpand(true);
       hbox->attach(*label_vbox, hbox_col++, 0, 1, 1);
 
-      std::string title = str(boost::format("<span weight='bold' size='larger'>%1%"
-                                            "</span>\n") % header.c_str());
-
-      Gtk::Label *label;
-
-      label = manage(new Gtk::Label (title));
-      label->set_use_markup(true);
-      label->set_justify(Gtk::JUSTIFY_LEFT);
-      label->set_line_wrap(true);
-      label->set_alignment (0.0f, 0.5f);
-      label->show();
-      label_vbox->attach(*label, 0, label_vbox_row++, 1, 1);
+      if(header != "") {
+        std::string title = str(boost::format("<span weight='bold' size='larger'>%1%"
+                                              "</span>\n") % header.c_str());
+        Gtk::Label *label = manage(new Gtk::Label (title));
+        label->set_use_markup(true);
+        label->set_justify(Gtk::JUSTIFY_LEFT);
+        label->set_line_wrap(true);
+        label->set_alignment (0.0f, 0.5f);
+        label->show();
+        label_vbox->attach(*label, 0, label_vbox_row++, 1, 1);
+      }
 
       if(msg != "") {
-        label = manage(new Gtk::Label(msg));
+        Gtk::Label *label = manage(new Gtk::Label(msg));
         label->set_use_markup(true);
         label->set_justify(Gtk::JUSTIFY_LEFT);
         label->set_line_wrap(true);
diff --git a/src/utils.hpp b/src/utils.hpp
index 4fd9d91..21343d5 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -95,8 +95,8 @@ namespace gnote {
     {
     public:
       HIGMessageDialog(Gtk::Window *, GtkDialogFlags flags, Gtk::MessageType msg_type, 
-                       Gtk::ButtonsType btn_type, const Glib::ustring & header,
-                       const Glib::ustring & msg);
+                       Gtk::ButtonsType btn_type, const Glib::ustring & header = Glib::ustring(),
+                       const Glib::ustring & msg = Glib::ustring());
       void add_button(const Gtk::BuiltinStockID& stock_id, 
                        Gtk::ResponseType response, bool is_default);
       void add_button(const Glib::RefPtr<Gdk::Pixbuf> & pixbuf, 


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