glom r1641 - in trunk: . glom



Author: jhs
Date: Sat Jul 19 09:18:35 2008
New Revision: 1641
URL: http://svn.gnome.org/viewvc/glom?rev=1641&view=rev

Log:
2008-07-19  Johannes Schmid  <johannes schmid openismus com>

	* glom/dialog_existing_or_new.cc:
	* glom/dialog_existing_or_new.h:
	Don\'t show \"Create database\" tab for client only mode

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

Modified: trunk/glom/dialog_existing_or_new.cc
==============================================================================
--- trunk/glom/dialog_existing_or_new.cc	(original)
+++ trunk/glom/dialog_existing_or_new.cc	Sat Jul 19 09:18:35 2008
@@ -37,6 +37,10 @@
 
 #include <iostream>
 
+#ifdef GLOM_ENABLE_CLIENT_ONLY
+#define NEW_PAGE 1
+#endif /* GLOM_ENABLE_CLIENT_ONLY */
+
 namespace
 {
 
@@ -157,9 +161,12 @@
   std::string path(dir);
   g_free(dir);
 #else
+#ifndef GLOM_ENABLE_CLIENT_ONLY
   const char* path = GLOM_EXAMPLES_DIR;
 #endif
+#endif
 
+#ifndef GLOM_ENABLE_CLIENT_ONLY
   m_examples_dir = Gio::File::create_for_path(path);
 
   try
@@ -172,6 +179,7 @@
   {
     std::cerr << "Could not enumerate examples: " << ex.what() << std::endl;
   }
+#endif /* !GLOM_ENABLE_CLIENT_ONLY */
 
   // Browse local network
 #ifndef G_OS_WIN32
@@ -208,16 +216,24 @@
   m_existing_view->expand_row(m_existing_model->get_path(m_iter_existing_recent), false);
 
   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));
 
+#ifndef GLOM_ENABLE_CLIENT_ONLY
+  m_notebook->signal_switch_page().connect(sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_switch_page));
+#endif /* !GLOM_ENABLE_CLIENT_ONLY */
+    
   Glib::RefPtr<Gtk::TreeView::Selection> existing_view_selection = m_existing_view->get_selection();
   existing_view_selection->signal_changed().connect(sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_existing_selection_changed));
   existing_view_selection->set_select_function( sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_existing_select_func) ); 
 
+#ifndef GLOM_ENABLE_CLIENT_ONLY
   Glib::RefPtr<Gtk::TreeView::Selection> new_view_selection = m_new_view->get_selection();
   new_view_selection->signal_changed().connect(sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_new_selection_changed));
   new_view_selection->set_select_function( sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_new_select_func) );
-  
+#else /* GLOM_ENABLE_CLIENT_ONLY */
+  m_notebook->remove_page(NEW_PAGE);
+  m_notebook->set_show_tabs (false);
+#endif /* !GLOM_ENABLE_CLIENT_ONLY */
+    
   update_ui_sensitivity();
 }
 
@@ -530,6 +546,7 @@
   m_select_button->set_sensitive(sensitivity);
 }
 
+#ifndef GLOM_ENABLE_CLIENT_ONLY
 void Dialog_ExistingOrNew::on_enumerate_children(const Glib::RefPtr<Gio::AsyncResult>& res)
 {
   try
@@ -650,6 +667,7 @@
 
   m_examples_enumerator->next_files_async(sigc::mem_fun(*this, &Dialog_ExistingOrNew::on_next_files));
 }
+#endif /* !GLOM_ENABLE_CLIENT_ONLY */
 
 #ifndef G_OS_WIN32
 void Dialog_ExistingOrNew::on_service_found(const Glib::ustring& name, EpcServiceInfo* info)

Modified: trunk/glom/dialog_existing_or_new.h
==============================================================================
--- trunk/glom/dialog_existing_or_new.h	(original)
+++ trunk/glom/dialog_existing_or_new.h	Sat Jul 19 09:18:35 2008
@@ -83,11 +83,13 @@
 
   void update_ui_sensitivity();
 
+#ifndef GLOM_ENABLE_CLIENT_ONLY
   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);
   void on_stream_read(const Glib::RefPtr<Gio::AsyncResult>& res);
-
+#endif /* !GLOM_ENABLE_CLIENT_ONLY */
+    
 #ifndef G_OS_WIN32
   static void on_service_found_static(EpcServiceMonitor* monitor, gchar* name, EpcServiceInfo* info, gpointer user_data) { static_cast<Dialog_ExistingOrNew*>(user_data)->on_service_found(name, info); }
   static void on_service_removed_static(EpcServiceMonitor* monitor, gchar* name, gchar* type, gpointer user_data) { static_cast<Dialog_ExistingOrNew*>(user_data)->on_service_removed(name, type); }
@@ -181,14 +183,16 @@
   std::auto_ptr<Gtk::TreeIter> m_iter_existing_recent_dummy;
   std::auto_ptr<Gtk::TreeIter> m_iter_new_template_dummy;
 
+#ifndef GLOM_ENABLE_CLIENT_ONLY
   Glib::RefPtr<Gio::File> m_examples_dir;
   Glib::RefPtr<Gio::FileEnumerator> m_examples_enumerator;
   Glib::RefPtr<Gio::File> m_current_example;
   Glib::RefPtr<Gio::InputStream> m_current_stream;
-
+    
   struct buffer { static const guint SIZE = 1024; char buf[SIZE]; };
   std::auto_ptr<buffer> m_current_buffer;
-
+#endif /* !GLOM_ENABLE_CLIENT_ONLY */
+    
 #ifndef G_OS_WIN32
   EpcServiceMonitor* m_service_monitor;
 #endif



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