glom r2014 - in trunk: . glom glom/bakery
- From: murrayc svn gnome org
- To: svn-commits-list gnome org
- Subject: glom r2014 - in trunk: . glom glom/bakery
- Date: Sun, 22 Mar 2009 18:01:31 +0000 (UTC)
Author: murrayc
Date: Sun Mar 22 18:01:31 2009
New Revision: 2014
URL: http://svn.gnome.org/viewvc/glom?rev=2014&view=rev
Log:
2009-03-19 Murray Cumming <murrayc murrayc com>
* glom/bakery/Makefile.am:
* glom/bakery/AppInstanceManager.[h|cc]: Removed this class.
* glom/application.cc:
* glom/bakery/App.cc:
* glom/bakery/App.h:
* glom/bakery/App_Gtk.cc:
* glom/bakery/App_Gtk.h:
* glom/bakery/App_WithDoc.cc:
* glom/bakery/App_WithDoc_Gtk.cc: Removed management of multiple
instances. Each Glom window is now isolated. That is necessary anyway
because we have been storing a global application pointer separately
anyway for a while now, which broke this.
This would need to use some single-instance DBus thing anyway to make
it work properly between processes (started from the Application menu.)
That would be nice. Then we could really check if a file is already
open, like gedit does.
Removed:
trunk/glom/bakery/AppInstanceManager.cc
trunk/glom/bakery/AppInstanceManager.h
Modified:
trunk/ChangeLog
trunk/glom/application.cc
trunk/glom/bakery/App.cc
trunk/glom/bakery/App.h
trunk/glom/bakery/App_Gtk.cc
trunk/glom/bakery/App_Gtk.h
trunk/glom/bakery/App_WithDoc.cc
trunk/glom/bakery/App_WithDoc_Gtk.cc
trunk/glom/bakery/Makefile.am
Modified: trunk/glom/application.cc
==============================================================================
--- trunk/glom/application.cc (original)
+++ trunk/glom/application.cc Sun Mar 22 18:01:31 2009
@@ -318,8 +318,6 @@
m_refFileActionGroup->add(Gtk::Action::create("BakeryAction_File_Close", Gtk::Stock::CLOSE),
sigc::mem_fun((App_WithDoc&)*this, &App_WithDoc::on_menu_file_close));
- /*m_refFileActionGroup->add(Gtk::Action::create("BakeryAction_File_Exit", Gtk::Stock::QUIT),
- sigc::mem_fun((App&)*this, &App::on_menu_file_exit));*/
m_refUIManager->insert_action_group(m_refFileActionGroup);
Modified: trunk/glom/bakery/App.cc
==============================================================================
--- trunk/glom/bakery/App.cc (original)
+++ trunk/glom/bakery/App.cc Sun Mar 22 18:01:31 2009
@@ -24,7 +24,6 @@
{
//Initialize static member data:
-AppInstanceManager App::m_AppInstanceManager;
HelpInfo App::m_HelpInfo;
bool App::m_bAboutShown = false;
@@ -35,18 +34,10 @@
App::App(const Glib::ustring& appname)
{
init_app_name(appname);
-
- //Register an instance of this app:
- m_AppInstanceManager.add_app(this);
}
App::~App()
{
- //If this was the last instance:
- if(m_AppInstanceManager.get_app_count() == 0)
- {
-
- }
}
void App::init_app_name(const Glib::ustring& appname) //static
@@ -99,16 +90,7 @@
void App::on_menu_file_close()
{
- ui_hide(); //AppInstanceManager will delete this when the hide signal is emitted..
-}
-
-void App::on_menu_file_exit()
-{
- // we don't want to quit directly as we should save our work
- // therefore we need to send close to each window.
-
- //Close each instance:
- m_AppInstanceManager.close_all();
+ ui_hide();
}
void App::on_menu_edit_cut()
Modified: trunk/glom/bakery/App.h
==============================================================================
--- trunk/glom/bakery/App.h (original)
+++ trunk/glom/bakery/App.h Sun Mar 22 18:01:31 2009
@@ -19,7 +19,6 @@
#ifndef GLOM_BAKERY_APP_H
#define GLOM_BAKERY_APP_H
-#include <glom/bakery/AppInstanceManager.h>
#include <glibmm/object.h>
#include <vector>
@@ -60,7 +59,6 @@
class App : virtual public Glib::ObjectBase
{
public:
- friend class AppInstanceManager;
//The constructor has a default argument so that there is a default constructor,
//so that derived classes do not need to call a specific constructor. This is
@@ -121,7 +119,6 @@
//Menus:
virtual void on_menu_file_new();
virtual void on_menu_file_close();
- virtual void on_menu_file_exit();
//Edit menu handlers overriden in App_WithDoc:
virtual void on_menu_edit_cut();
@@ -154,7 +151,6 @@
static HelpInfo m_HelpInfo;
//Instances
- static AppInstanceManager m_AppInstanceManager;
static bool m_bOperationCancelled; //see set/get_operation_cancelled().
Modified: trunk/glom/bakery/App_Gtk.cc
==============================================================================
--- trunk/glom/bakery/App_Gtk.cc (original)
+++ trunk/glom/bakery/App_Gtk.cc Sun Mar 22 18:01:31 2009
@@ -68,15 +68,10 @@
m_pVBox = 0;
}
- //If this was the last instance:
- if(m_AppInstanceManager.get_app_count() == 0)
+ if(m_pAbout)
{
- //Delete shared static widgets if this was the last instance:
- if(m_pAbout)
- {
- delete m_pAbout;
- m_pAbout = 0;
- }
+ delete m_pAbout;
+ m_pAbout = 0;
}
}
@@ -250,8 +245,6 @@
sigc::mem_fun((GlomBakery::App&)*this, &App_Gtk::on_menu_file_new));
m_refFileActionGroup->add(Action::create("BakeryAction_File_Close", Gtk::Stock::CLOSE),
sigc::mem_fun((GlomBakery::App&)*this, &App_Gtk::on_menu_file_close));
- m_refFileActionGroup->add(Action::create("BakeryAction_File_Exit", Gtk::Stock::QUIT),
- sigc::mem_fun((GlomBakery::App&)*this, &App_Gtk::on_menu_file_exit));
m_refUIManager->insert_action_group(m_refFileActionGroup);
//Build part of the menu structure, to be merged in by using the "PH" placeholders:
@@ -266,7 +259,6 @@
" <menu action='BakeryAction_Menu_File'>"
" <menuitem action='BakeryAction_File_New' />"
" <menuitem action='BakeryAction_File_Close' />"
- " <menuitem action='BakeryAction_File_Exit' />"
" </menu>"
" </placeholder>"
#ifdef GLOM_ENABLE_MAEMO
Modified: trunk/glom/bakery/App_Gtk.h
==============================================================================
--- trunk/glom/bakery/App_Gtk.h (original)
+++ trunk/glom/bakery/App_Gtk.h Sun Mar 22 18:01:31 2009
@@ -57,7 +57,6 @@
#else
typedef Gtk::Window ParentWindow;
#endif
- friend class AppInstanceManager;
///Don't forget to call init() too.
App_Gtk(const Glib::ustring& appname);
Modified: trunk/glom/bakery/App_WithDoc.cc
==============================================================================
--- trunk/glom/bakery/App_WithDoc.cc (original)
+++ trunk/glom/bakery/App_WithDoc.cc Sun Mar 22 18:01:31 2009
@@ -63,7 +63,7 @@
}
if(!get_operation_cancelled())
- ui_hide(); //The AppInstanceManager will delete it.
+ ui_hide();
}
bool App_WithDoc::open_document_from_data(const guchar* data, std::size_t length)
@@ -100,40 +100,6 @@
bool App_WithDoc::open_document(const Glib::ustring& file_uri)
{
- //Check whether it's already open:
- //It could even be open in this instance.
- bool bAlreadyOpen = false;
- App_WithDoc* pAppAlreadyOpen = 0;
-
- AppInstanceManager::type_listAppInstances apps = m_AppInstanceManager.get_instances();
- for(AppInstanceManager::type_listAppInstances::iterator iter = apps.begin(); iter != apps.end(); iter++)
- {
- App_WithDoc* pApp = dynamic_cast<App_WithDoc*>(*iter);
- if(pApp)
- {
- Document* pDoc = pApp->get_document();
- if(pDoc->get_file_uri() == file_uri)
- {
- bAlreadyOpen = true;
- pAppAlreadyOpen = pApp;
- }
- }
- }
-
- if(bAlreadyOpen)
- {
- //Bring it to the front:
- if(pAppAlreadyOpen)
- {
- pAppAlreadyOpen->ui_bring_to_front();
- }
-
- //Tell user that it's already open:
- ui_warning(_("Document already open"), _("This document is already open."));
-
- return true; //success.
- }
- else
{
//Open it:
@@ -436,7 +402,6 @@
{
set_operation_cancelled();
m_bCloseAfterSave = false;
- m_AppInstanceManager.cancel_close_all();
//exit_destroy_marked_instances(); //Clean up after an exit.
}
Modified: trunk/glom/bakery/App_WithDoc_Gtk.cc
==============================================================================
--- trunk/glom/bakery/App_WithDoc_Gtk.cc (original)
+++ trunk/glom/bakery/App_WithDoc_Gtk.cc Sun Mar 22 18:01:31 2009
@@ -150,8 +150,6 @@
m_refFileActionGroup->add(Gtk::Action::create("BakeryAction_File_Close", Gtk::Stock::CLOSE),
sigc::mem_fun((App_WithDoc&)*this, &App_WithDoc::on_menu_file_close));
- m_refFileActionGroup->add(Gtk::Action::create("BakeryAction_File_Exit", Gtk::Stock::QUIT),
- sigc::mem_fun((App&)*this, &App::on_menu_file_exit));
m_refUIManager->insert_action_group(m_refFileActionGroup);
@@ -173,7 +171,6 @@
" <menuitem action='BakeryAction_File_SaveAs' />"
" <separator/>"
" <menuitem action='BakeryAction_File_Close' />"
- " <menuitem action='BakeryAction_File_Exit' />"
" </menu>"
" </placeholder>"
#ifdef GLOM_ENABLE_MAEMO
Modified: trunk/glom/bakery/Makefile.am
==============================================================================
--- trunk/glom/bakery/Makefile.am (original)
+++ trunk/glom/bakery/Makefile.am Sun Mar 22 18:01:31 2009
@@ -1,7 +1,7 @@
AM_CPPFLAGS = -I top_srcdir@/ -I top_srcdir@/glom $(GLOM_CFLAGS)
-h_sources = App_Gtk.h AppInstanceManager.h App_WithDoc.h GtkDialogs.h App.h App_WithDoc_Gtk.h Dialog_OfferSave.h
-cc_sources = App_Gtk.cc AppInstanceManager.cc App_WithDoc.cc GtkDialogs.cc App.cc App_WithDoc_Gtk.cc Dialog_OfferSave.cc
+h_sources = App_Gtk.h App_WithDoc.h GtkDialogs.h App.h App_WithDoc_Gtk.h Dialog_OfferSave.h
+cc_sources = App_Gtk.cc App_WithDoc.cc GtkDialogs.cc App.cc App_WithDoc_Gtk.cc Dialog_OfferSave.cc
noinst_LIBRARIES = libbakery_app.a
libbakery_app_a_SOURCES = $(h_sources) $(cc_sources)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]