glom r1498 - in trunk: . glom



Author: arminb
Date: Mon Mar 31 15:01:05 2008
New Revision: 1498
URL: http://svn.gnome.org/viewvc/glom?rev=1498&view=rev

Log:
2008-03-31  Armin Burgmeier  <armin openismus com>

	* glom/glom.glade:
	* glom/dialog_existing_or_new.h:
	* glom/dialog_existing_or_new.cc: Use a notebook for the two
	treeviews, add a Select button. Removed the signals, instead added
	get_action(), get_uri(), get_service_info() and get_service_name().
	This way, the application can hide the dialog before handling the
	action more easily.

	* glom/application.h:
	* glom/application.cc: offer_new_or_existing(): Hide the
	existing_or_new dialog after having run it.
	existing_or_new_new(): Removed the signal handlers, but keep the
	action for creating a new empty document in a separate function since
	it is still a lot of code.


Modified:
   trunk/ChangeLog
   trunk/glom/application.cc
   trunk/glom/application.h
   trunk/glom/dialog_existing_or_new.cc
   trunk/glom/dialog_existing_or_new.h
   trunk/glom/glom.glade

Modified: trunk/glom/application.cc
==============================================================================
--- trunk/glom/application.cc	(original)
+++ trunk/glom/application.cc	Mon Mar 31 15:01:05 2008
@@ -1166,11 +1166,11 @@
   refXml->get_widget_derived("dialog_existing_or_new", dialog_raw);
   std::auto_ptr<Dialog_ExistingOrNew> dialog(dialog_raw);
   dialog->set_transient_for(*this);
-
+/*
   dialog->signal_new().connect(sigc::mem_fun(*this, &App_Glom::on_existing_or_new_new));
   dialog->signal_open_from_uri().connect(sigc::mem_fun(*this, &App_Glom::on_existing_or_new_open_from_uri));
   dialog->signal_open_from_remote().connect(sigc::mem_fun(*this, &App_Glom::on_existing_or_new_open_from_remote));
-
+*/
   bool ask_again = true;
   while(ask_again)
   {
@@ -1179,12 +1179,31 @@
 
     if(response_id == Gtk::RESPONSE_ACCEPT)
     {
+      switch(dialog->get_action())
+      {
+      case Dialog_ExistingOrNew::NONE:
+        // This should not happen
+        break;
+      case Dialog_ExistingOrNew::NEW_EMPTY:
+        existing_or_new_new();
+        break;
+      case Dialog_ExistingOrNew::NEW_FROM_TEMPLATE:
+      case Dialog_ExistingOrNew::OPEN_URI:
+        open_document(dialog->get_uri());
+        break;
+#ifndef G_OS_WIN32
+      case Dialog_ExistingOrNew::OPEN_REMOTE:
+        open_browsed_document(dialog->get_service_info(), dialog->get_service_name());
+        break;
+#endif
+      }
+
       //Check that a document was opened:
       Document_Glom* document = dynamic_cast<Document_Glom*>(get_document());
       if(!document->get_file_uri().empty() || (document->get_opened_from_browse()))
         ask_again = false;
     }
-    else if((response_id == Gtk::RESPONSE_CANCEL)  || (response_id == Gtk::RESPONSE_DELETE_EVENT))
+    else if((response_id == Gtk::RESPONSE_CLOSE)  || (response_id == Gtk::RESPONSE_DELETE_EVENT))
     {
       return false; //close the window to close the application, because they need to choose a new or existing document.
     }
@@ -1197,107 +1216,87 @@
   return true;
 }
 
-void App_Glom::on_existing_or_new_new(const std::string& template_uri)
+void App_Glom::existing_or_new_new()
 {
-  if(!template_uri.empty())
-  {
-    // New from template
-    open_document(template_uri);
-  }
-  else
-  {
-    // New empty document
+  // New empty document
+
+  //Each document must have a location, so ask the user for one.
+  //This will use an extended save dialog that also asks for the database title and some hosting details:
+  Glib::ustring db_title;
 
-    //Each document must have a location, so ask the user for one.
-    //This will use an extended save dialog that also asks for the database title and some hosting details:
-    Glib::ustring db_title;
+  m_ui_save_extra_showextras = true; //Offer self-hosting or central hosting, and offer the database title.
+  m_ui_save_extra_newdb_selfhosted = true; /* Default to self-hosting */
+  m_ui_save_extra_newdb_title.clear();
+  offer_saveas();
 
-    m_ui_save_extra_showextras = true; //Offer self-hosting or central hosting, and offer the database title.
-    m_ui_save_extra_newdb_selfhosted = true; /* Default to self-hosting */
+  //Check that the document was given a location:
+  Document_Glom* document = dynamic_cast<Document_Glom*>(get_document());
+  if(!document->get_file_uri().empty())
+  {
+    //Get details from the extended save dialog:
+    const Glib::ustring db_title = m_ui_save_extra_newdb_title;
+    const bool self_hosted = m_ui_save_extra_newdb_selfhosted;
     m_ui_save_extra_newdb_title.clear();
-    offer_saveas();
+    m_ui_save_extra_newdb_selfhosted = false;
 
-    //Check that the document was given a location:
-    Document_Glom* document = dynamic_cast<Document_Glom*>(get_document());
-    if(!document->get_file_uri().empty())
-    {
-      //Get details from the extended save dialog:
-      const Glib::ustring db_title = m_ui_save_extra_newdb_title;
-      const bool self_hosted = m_ui_save_extra_newdb_selfhosted;
-      m_ui_save_extra_newdb_title.clear();
-      m_ui_save_extra_newdb_selfhosted = false;
-
-      //Make sure that the user can do something with his new document:
-      document->set_userlevel(AppState::USERLEVEL_DEVELOPER);
-      // Try various ports if connecting to an existing database server instead
-      // of self-hosting one:
-      document->set_connection_try_other_ports(!m_ui_save_extra_newdb_selfhosted);
-
-      //Each new document must have an associated new database,
-      //so choose a name
-
-      //Create a database name based on the title.
-      //The user will (almost) never see this anyway but it's nicer than using a random number:
-      Glib::ustring db_name = Utils::create_name_from_title(db_title);
-
-      //Prefix glom_ to the database name, so it's more obvious
-      //for the system administrator.
-      //This database name should never be user-visible again, either prefixed or not prefixed.
-      db_name = "glom_" + db_name;
-
-      //Connect to the server and choose a variation of this db_name that does not exist yet:
-      document->set_connection_database(db_name);
-      document->set_connection_is_self_hosted(self_hosted);
-           
+    //Make sure that the user can do something with his new document:
+    document->set_userlevel(AppState::USERLEVEL_DEVELOPER);
+    // Try various ports if connecting to an existing database server instead
+    // of self-hosting one:
+    document->set_connection_try_other_ports(!m_ui_save_extra_newdb_selfhosted);
+
+    //Each new document must have an associated new database,
+    //so choose a name
+
+    //Create a database name based on the title.
+    //The user will (almost) never see this anyway but it's nicer than using a random number:
+    Glib::ustring db_name = Utils::create_name_from_title(db_title);
+
+    //Prefix glom_ to the database name, so it's more obvious
+    //for the system administrator.
+    //This database name should never be user-visible again, either prefixed or not prefixed.
+    db_name = "glom_" + db_name;
+
+    //Connect to the server and choose a variation of this db_name that does not exist yet:
+    document->set_connection_database(db_name);
+    document->set_connection_is_self_hosted(self_hosted);
+         
 #ifndef GLOM_ENABLE_CLIENT_ONLY
-     //Tell the connection pool about the document:
-     ConnectionPool* connection_pool = ConnectionPool::get_instance();
-     if(connection_pool)
-       connection_pool->set_get_document_func( sigc::mem_fun(*this, &App_Glom::on_connection_pool_get_document) );
+   //Tell the connection pool about the document:
+   ConnectionPool* connection_pool = ConnectionPool::get_instance();
+   if(connection_pool)
+     connection_pool->set_get_document_func( sigc::mem_fun(*this, &App_Glom::on_connection_pool_get_document) );
 #endif
 
-      const bool connected = m_pFrame->connection_request_password_and_choose_new_database_name();
-      if(!connected)
+    const bool connected = m_pFrame->connection_request_password_and_choose_new_database_name();
+    if(!connected)
+    {
+      // Unset URI so that the offer_new_or_existing does not disappear
+      // so the user can make a different choice about what document to open.
+      // TODO: Show some error message?
+      document->set_file_uri("");
+    }
+    else
+    {
+      const bool db_created = m_pFrame->create_database(document->get_connection_database(), db_title, false /* do not request password */);
+      if(db_created)
+      {
+        const Glib::ustring database_name_used = document->get_connection_database();
+        ConnectionPool::get_instance()->set_database(database_name_used);
+        document->set_database_title(db_title);
+        m_pFrame->set_databases_selected(database_name_used);
+      }
+      else
       {
         // Unset URI so that the offer_new_or_existing does not disappear
         // so the user can make a different choice about what document to open.
         // TODO: Show some error message?
         document->set_file_uri("");
       }
-      else
-      {
-        const bool db_created = m_pFrame->create_database(document->get_connection_database(), db_title, false /* do not request password */);
-        if(db_created)
-        {
-          const Glib::ustring database_name_used = document->get_connection_database();
-          ConnectionPool::get_instance()->set_database(database_name_used);
-          document->set_database_title(db_title);
-          m_pFrame->set_databases_selected(database_name_used);
-        }
-        else
-        {
-          // Unset URI so that the offer_new_or_existing does not disappear
-          // so the user can make a different choice about what document to open.
-          // TODO: Show some error message?
-          document->set_file_uri("");
-        }
-      }
     }
   }
 }
 
-void App_Glom::on_existing_or_new_open_from_uri(const std::string& document_uri)
-{
-  open_document(document_uri);
-}
-
-#ifndef G_OS_WIN32
-void App_Glom::on_existing_or_new_open_from_remote(EpcServiceInfo* info, const Glib::ustring& service_name)
-{
-  open_browsed_document(info, service_name);
-}
-#endif
-
 void App_Glom::set_mode_data()
 {
   m_action_mode_data->activate();

Modified: trunk/glom/application.h
==============================================================================
--- trunk/glom/application.h	(original)
+++ trunk/glom/application.h	Mon Mar 31 15:01:05 2008
@@ -98,12 +98,7 @@
 
   bool offer_new_or_existing();
 
-  void on_existing_or_new_new(const std::string& template_uri);
-  void on_existing_or_new_open_from_uri(const std::string& document_uri);
-
-#ifndef G_OS_WIN32
-  void on_existing_or_new_open_from_remote(EpcServiceInfo* info, const Glib::ustring& service_name);
-#endif
+  void existing_or_new_new();
 
   void on_menu_help_contents();
 #ifndef GLOM_ENABLE_CLIENT_ONLY

Modified: trunk/glom/dialog_existing_or_new.cc
==============================================================================
--- trunk/glom/dialog_existing_or_new.cc	(original)
+++ trunk/glom/dialog_existing_or_new.cc	Mon Mar 31 15:01:05 2008
@@ -92,6 +92,11 @@
   if(!m_existing_view || !m_new_view)
     throw std::runtime_error("Glade file does not contain treeviews for ExistingOrNew dialog");
 
+  refGlade->get_widget("existing_or_new_notebook", m_notebook);
+  refGlade->get_widget("existing_or_new_button_select", m_select_button);
+  if(!m_notebook || !m_select_button)
+    throw std::runtime_error("Glade file does not contain the notebook or the select button for ExistingOrNew dialog");
+
   m_existing_model = Gtk::TreeStore::create(m_existing_columns);
   m_existing_model->set_sort_column(m_existing_columns.m_col_time, Gtk::SORT_DESCENDING);
   m_existing_view->set_model(m_existing_model);
@@ -190,6 +195,13 @@
       (*iter)[m_existing_columns.m_col_recent_info] = new Glib::RefPtr<Gtk::RecentInfo>(info);
     }
   }
+
+  m_select_button->signal_clicked().connect(sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_select_clicked));
+  m_notebook->signal_switch_page().connect(sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_switch_page));
+  m_existing_view->get_selection()->signal_changed().connect(sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_existing_selection_changed));
+  m_new_view->get_selection()->signal_changed().connect(sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_new_selection_changed));
+
+  update_ui_sensitivity();
 }
 
 Dialog_ExistingOrNew::~Dialog_ExistingOrNew()
@@ -221,6 +233,93 @@
   }
 }
 
+Dialog_ExistingOrNew::Action Dialog_ExistingOrNew::get_action_impl(Gtk::TreeIter& iter) const
+{
+  if(m_notebook->get_current_page() == 0)
+  {
+    if(m_existing_view->get_selection()->count_selected_rows() == 0)
+      return NONE;
+
+    iter = m_existing_view->get_selection()->get_selected();
+    if(m_existing_model->is_ancestor(m_iter_existing_recent, iter))
+      return OPEN_URI;
+    else if(m_existing_model->is_ancestor(m_iter_existing_network, iter))
+      return OPEN_REMOTE;
+    else if(iter == m_iter_existing_other)
+      return OPEN_URI;
+    else
+      return NONE;
+  }
+  else
+  {
+    if(m_new_view->get_selection()->count_selected_rows() == 0)
+      return NONE;
+
+    iter = m_new_view->get_selection()->get_selected();
+    if(m_new_model->is_ancestor(m_iter_new_template, iter))
+      return NEW_FROM_TEMPLATE;
+    else if(iter == m_iter_new_empty)
+      return NEW_EMPTY;
+    else
+      return NONE;
+  }
+}
+
+Dialog_ExistingOrNew::Action Dialog_ExistingOrNew::get_action() const
+{
+  Gtk::TreeIter iter;
+  return get_action_impl(iter);
+}
+
+Glib::ustring Dialog_ExistingOrNew::get_uri() const
+{
+  Gtk::TreeIter iter;
+  Action action = get_action_impl(iter);
+
+  if(action == NEW_FROM_TEMPLATE)
+  {
+    return (*iter)[m_new_columns.m_col_template_uri];
+  }
+  else if(action == OPEN_URI)
+  {
+    if(iter == m_iter_existing_other)
+    {
+      return m_chosen_uri;
+    }
+    else
+    {
+      Glib::RefPtr<Gtk::RecentInfo>* info = (*iter)[m_existing_columns.m_col_recent_info];
+      return (*info)->get_uri();
+    }
+  }
+  else
+  {
+    throw std::logic_error("Dialog_ExistingOrNew::get_uri: action is neither NEW_FROM_TEMPLATE nor OPEN_URI");
+  }
+}
+
+EpcServiceInfo* Dialog_ExistingOrNew::get_service_info() const
+{
+  Gtk::TreeIter iter;
+  Action action = get_action_impl(iter);
+
+  if(action == OPEN_REMOTE)
+    return (*iter)[m_existing_columns.m_col_service_info];
+  else
+    throw std::logic_error("Dialog_ExistingOrNew::get_service_info: action is not OPEN_REMOTE");
+}
+
+Glib::ustring Dialog_ExistingOrNew::get_service_name() const
+{
+  Gtk::TreeIter iter;
+  Action action = get_action_impl(iter);
+
+  if(action == OPEN_REMOTE)
+    return (*iter)[m_existing_columns.m_col_service_name];
+  else
+    throw std::logic_error("Dialog_ExistingOrNew::get_service_name: action is not OPEN_REMOTE");
+}
+
 void Dialog_ExistingOrNew::existing_icon_data_func(Gtk::CellRenderer* renderer, const Gtk::TreeIter& iter)
 {
   Gtk::CellRendererPixbuf* pixbuf_renderer = dynamic_cast<Gtk::CellRendererPixbuf*>(renderer);
@@ -282,6 +381,57 @@
   }
 }
 
+void Dialog_ExistingOrNew::on_switch_page(GtkNotebookPage* page, guint page_num)
+{
+  update_ui_sensitivity();
+}
+
+void Dialog_ExistingOrNew::on_existing_selection_changed()
+{
+  update_ui_sensitivity();
+}
+
+void Dialog_ExistingOrNew::on_new_selection_changed()
+{
+  update_ui_sensitivity();
+}
+
+void Dialog_ExistingOrNew::update_ui_sensitivity()
+{
+  bool sensitivity;
+
+  if(m_notebook->get_current_page() == 0)
+  {
+    int count = m_existing_view->get_selection()->count_selected_rows();
+
+    if(count == 0)
+    {
+      sensitivity = false;
+    }
+    else
+    {
+      Gtk::TreeIter sel = m_existing_view->get_selection()->get_selected();
+      sensitivity = (sel != m_iter_existing_recent && sel != m_iter_existing_network);
+    }
+  }
+  else
+  {
+    int count = m_new_view->get_selection()->count_selected_rows();
+
+    if(count == 0)
+    {
+      sensitivity = false;
+    }
+    else
+    {
+      Gtk::TreeIter sel = m_new_view->get_selection()->get_selected();
+      sensitivity = (sel != m_iter_new_template);
+    }
+  }
+
+  m_select_button->set_sensitive(sensitivity);
+}
+
 void Dialog_ExistingOrNew::on_enumerate_children(const Glib::RefPtr<Gio::AsyncResult>& res)
 {
   try
@@ -427,27 +577,38 @@
 
 void Dialog_ExistingOrNew::on_existing_row_activated(const Gtk::TreePath& path, Gtk::TreeViewColumn* column)
 {
-  existing_activated(m_existing_model->get_iter(path));
+  if(m_select_button->is_sensitive())
+    on_select_clicked();
 }
 
 void Dialog_ExistingOrNew::on_existing_button_clicked(const Gtk::TreePath& path)
 {
-  existing_activated(m_existing_model->get_iter(path));
+  m_existing_view->get_selection()->select(path);
+
+  if(m_select_button->is_sensitive())
+    on_select_clicked();
 }
 
 void Dialog_ExistingOrNew::on_new_row_activated(const Gtk::TreePath& path, Gtk::TreeViewColumn* column)
 {
-  new_activated(m_new_model->get_iter(path));
+  if(m_select_button->is_sensitive())
+    on_select_clicked();
 }
 
 void Dialog_ExistingOrNew::on_new_button_clicked(const Gtk::TreePath& path)
 {
-  new_activated(m_new_model->get_iter(path));
+  m_new_view->get_selection()->select(path);
+
+  if(m_select_button->is_sensitive())
+    on_select_clicked();
 }
 
-void Dialog_ExistingOrNew::existing_activated(const Gtk::TreeIter& iter)
+void Dialog_ExistingOrNew::on_select_clicked()
 {
-  if(iter == m_iter_existing_other)
+  Gtk::TreeIter iter;
+  Action action = get_action_impl(iter);
+
+  if(action == OPEN_URI && iter == m_iter_existing_other)
   {
     Gtk::FileChooserDialog dialog(*this, "Choose a glom file to open");
     Gtk::FileFilter filter;
@@ -461,36 +622,12 @@
 
     if(dialog.run() == Gtk::RESPONSE_ACCEPT)
     {
-      dialog.hide();
-      m_signal_open_from_uri.emit(dialog.get_uri());
+      m_chosen_uri = dialog.get_uri();
       response(Gtk::RESPONSE_ACCEPT);
     }
   }
-  else if(m_existing_model->is_ancestor(m_iter_existing_recent, iter))
-  {
-    Glib::RefPtr<Gtk::RecentInfo>* info = (*iter)[m_existing_columns.m_col_recent_info];
-    m_signal_open_from_uri.emit((*info)->get_uri());
-    response(Gtk::RESPONSE_ACCEPT);
-  }
-  else if(m_existing_model->is_ancestor(m_iter_existing_network, iter))
-  {
-#ifndef G_OS_WIN32
-    m_signal_open_from_remote.emit((*iter)[m_existing_columns.m_col_service_info], (*iter)[m_existing_columns.m_col_service_name]);
-    response(Gtk::RESPONSE_ACCEPT);
-#endif
-  }
-}
-
-void Dialog_ExistingOrNew::new_activated(const Gtk::TreeIter& iter)
-{
-  if(iter == m_iter_new_empty)
-  {
-    m_signal_new.emit(std::string());
-    response(Gtk::RESPONSE_ACCEPT);
-  }
-  else if(m_new_model->is_ancestor(m_iter_new_template, iter))
+  else
   {
-    m_signal_new.emit((*iter)[m_new_columns.m_col_template_uri]);
     response(Gtk::RESPONSE_ACCEPT);
   }
 }

Modified: trunk/glom/dialog_existing_or_new.h
==============================================================================
--- trunk/glom/dialog_existing_or_new.h	(original)
+++ trunk/glom/dialog_existing_or_new.h	Mon Mar 31 15:01:05 2008
@@ -34,6 +34,7 @@
 #include <gtkmm/treeview.h>
 #include <gtkmm/treestore.h>
 #include <gtkmm/recentinfo.h>
+#include <gtkmm/notebook.h>
 #include <libglademm/xml.h>
 #include <glom/utility_widgets/db_adddel/cellrenderer_buttontext.h>
 
@@ -43,27 +44,37 @@
 class Dialog_ExistingOrNew
   : public Gtk::Dialog
 {
-  typedef sigc::signal<void, const std::string&> SignalNew;
-  typedef sigc::signal<void, const std::string&> SignalOpenFromUri;
-#ifndef G_OS_WIN32
-  typedef sigc::signal<void, EpcServiceInfo*, const Glib::ustring&> SignalOpenFromRemote;
-#endif
-
 public:
+  enum Action {
+    NONE,
+    NEW_EMPTY,
+    NEW_FROM_TEMPLATE,
+    OPEN_URI,
+    OPEN_REMOTE
+  };
+
   Dialog_ExistingOrNew(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
   virtual ~Dialog_ExistingOrNew();
 
-  SignalNew signal_new() const { return m_signal_new; }
-  SignalOpenFromUri signal_open_from_uri() const { return m_signal_open_from_uri; }
-
+  Action get_action() const;
+  Glib::ustring get_uri() const; // Only when get_action is NEW_FROM_TEMPLATE or OPEN_URI
 #ifndef G_OS_WIN32
-  SignalOpenFromRemote signal_open_from_remote() const { return m_signal_open_from_remote; }
+  EpcServiceInfo* get_service_info() const; // Only when get_action is OPEN_REMOTE
+  Glib::ustring get_service_name() const; // Only when get_action is OPEN_REMOTE
 #endif
 
 protected:
+  Action get_action_impl(Gtk::TreeIter& iter) const;
+
   void existing_icon_data_func(Gtk::CellRenderer* renderer, const Gtk::TreeIter& iter);
   void new_icon_data_func(Gtk::CellRenderer* renderer, const Gtk::TreeIter& iter);
 
+  void on_switch_page(GtkNotebookPage* page, guint page_num);
+  void on_existing_selection_changed();
+  void on_new_selection_changed();
+
+  void update_ui_sensitivity();
+
   void on_enumerate_children(const Glib::RefPtr<Gio::AsyncResult>& res);
   void on_next_files(const Glib::RefPtr<Gio::AsyncResult>& res);
   void on_read(const Glib::RefPtr<Gio::AsyncResult>& res);
@@ -82,8 +93,7 @@
   void on_new_row_activated(const Gtk::TreePath& path, Gtk::TreeViewColumn* column);
   void on_new_button_clicked(const Gtk::TreePath& path);
 
-  void existing_activated(const Gtk::TreeIter& iter);
-  void new_activated(const Gtk::TreeIter& iter);
+  void on_select_clicked();
 
   class ExistingModelColumns : public Gtk::TreeModel::ColumnRecord
   {
@@ -129,9 +139,12 @@
 
     Gtk::TreeModelColumn<Glib::ustring> m_col_title;
     Gtk::TreeModelColumn<Glib::ustring> m_col_button_text;
-    Gtk::TreeModelColumn<std::string> m_col_template_uri;
+    Gtk::TreeModelColumn<Glib::ustring> m_col_template_uri;
   };
 
+  Gtk::Notebook* m_notebook;
+  Gtk::Button* m_select_button;
+
   ExistingModelColumns m_existing_columns;
   Glib::RefPtr<Gtk::TreeStore> m_existing_model;
   Gtk::TreeView* m_existing_view;
@@ -171,12 +184,8 @@
   EpcServiceMonitor* m_service_monitor;
 #endif
 
-  SignalNew m_signal_new;
-  SignalOpenFromUri m_signal_open_from_uri;
-
-#ifndef G_OS_WIN32
-  SignalOpenFromRemote m_signal_open_from_remote;
-#endif
+  // URI chosen in the file chooser
+  Glib::ustring m_chosen_uri;
 };
 
 } //namespace Glom

Modified: trunk/glom/glom.glade
==============================================================================
--- trunk/glom/glom.glade	(original)
+++ trunk/glom/glom.glade	Mon Mar 31 15:01:05 2008
@@ -238,100 +238,75 @@
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkFrame" id="existing_or_new_existing_frame">
+                  <widget class="GtkNotebook" id="existing_or_new_notebook">
                     <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label_xalign">0</property>
-                    <property name="shadow_type">GTK_SHADOW_NONE</property>
+                    <property name="can_focus">True</property>
                     <child>
-                      <widget class="GtkAlignment" id="alignment3">
+                      <widget class="GtkScrolledWindow" id="scrolledwindow2">
                         <property name="visible">True</property>
+                        <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="top_padding">6</property>
-                        <property name="left_padding">12</property>
+                        <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                        <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                        <property name="shadow_type">GTK_SHADOW_IN</property>
                         <child>
-                          <widget class="GtkScrolledWindow" id="scrolledwindow2">
+                          <widget class="GtkTreeView" id="existing_or_new_existing_treeview">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                            <property name="shadow_type">GTK_SHADOW_IN</property>
-                            <child>
-                              <widget class="GtkTreeView" id="existing_or_new_existing_treeview">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="headers_clickable">True</property>
-                                <property name="search_column">0</property>
-                              </widget>
-                            </child>
+                            <property name="headers_clickable">True</property>
+                            <property name="search_column">0</property>
                           </widget>
                         </child>
                       </widget>
                     </child>
                     <child>
-                      <widget class="GtkLabel" id="label6">
+                      <widget class="GtkLabel" id="label2">
                         <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="label" translatable="yes">&lt;b&gt;Open Existing Document&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Open _Existing Document</property>
+                        <property name="use_underline">True</property>
                       </widget>
                       <packing>
-                        <property name="type">label_item</property>
+                        <property name="type">tab</property>
+                        <property name="tab_fill">False</property>
                       </packing>
                     </child>
-                  </widget>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkFrame" id="existing_or_new_new_frame">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label_xalign">0</property>
-                    <property name="shadow_type">GTK_SHADOW_NONE</property>
                     <child>
-                      <widget class="GtkAlignment" id="alignment1">
+                      <widget class="GtkScrolledWindow" id="scrolledwindow3">
                         <property name="visible">True</property>
+                        <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="top_padding">6</property>
-                        <property name="left_padding">12</property>
+                        <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                        <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                        <property name="shadow_type">GTK_SHADOW_IN</property>
                         <child>
-                          <widget class="GtkScrolledWindow" id="scrolledwindow3">
+                          <widget class="GtkTreeView" id="existing_or_new_new_treeview">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-                            <property name="shadow_type">GTK_SHADOW_IN</property>
-                            <child>
-                              <widget class="GtkTreeView" id="existing_or_new_new_treeview">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                                <property name="headers_clickable">True</property>
-                              </widget>
-                            </child>
+                            <property name="headers_clickable">True</property>
                           </widget>
                         </child>
                       </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
                     </child>
                     <child>
-                      <widget class="GtkLabel" id="label1">
+                      <widget class="GtkLabel" id="label3">
                         <property name="visible">True</property>
-                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="label" translatable="yes">&lt;b&gt;Create New Document&lt;/b&gt;</property>
-                        <property name="use_markup">True</property>
+                        <property name="label" translatable="yes">Create _New Document</property>
+                        <property name="use_underline">True</property>
                       </widget>
                       <packing>
-                        <property name="type">label_item</property>
+                        <property name="type">tab</property>
+                        <property name="position">1</property>
+                        <property name="tab_fill">False</property>
                       </packing>
                     </child>
                   </widget>
                   <packing>
-                    <property name="position">2</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
               </widget>
@@ -349,14 +324,49 @@
             <property name="visible">True</property>
             <property name="layout_style">GTK_BUTTONBOX_END</property>
             <child>
+              <widget class="GtkButton" id="existing_or_new_button_select">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="response_id">0</property>
+                <child>
+                  <widget class="GtkHBox" id="hbox1">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkImage" id="image1">
+                        <property name="visible">True</property>
+                        <property name="stock">gtk-apply</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label1">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">_Select</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
               <widget class="GtkButton" id="cancelbutton1">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
-                <property name="label">gtk-close</property>
+                <property name="label">gtk-quit</property>
                 <property name="use_stock">True</property>
-                <property name="response_id">-6</property>
+                <property name="response_id">-7</property>
               </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
             </child>
           </widget>
           <packing>



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