~ubuntu-branches/ubuntu/precise/glom/precise-updates

« back to all changes in this revision

Viewing changes to glom/libglom/dialog_progress_creating.cc

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2009-10-09 16:50:36 UTC
  • mfrom: (1.1.42 upstream)
  • Revision ID: james.westby@ubuntu.com-20091009165036-orinvwmohk838xxl
Tags: 1.12.2-0ubuntu1
* New upstream version:
  - FFE LP: #391664
* debian/control:
  - Bump python-gnome2-extras-dev build-dep to >= 2.25.3.
  - Bump libgdamm3.0-dev build-dep to libgdamm4.0-dev >= 3.99.14.
  - Change libgda3-dev build-dep to libgda-4.0-dev.
  - Change libgda3-postgres dependency to libgda-4.0-postgres.
  - Bump libgtkmm-2.4-dev build-dep to >= 2.14.
  - Add build-dep on libgconfmm-2.6-dev.
  - Bump libgoocanvasmm-dev build-dep to >= 0.14.0.
  - Remove build-dep on libbakery-2.6-dev.
  - Bump postgresql-8.3 dependency to postgresql-8.4.
  - Change scrollkeeper build-dep to rarian-compat.
  - Rename libglom{0,-dev} -> libglom-1.12-{0,dev}. Upstream include
    APIVER in the library name now.
* debian/rules:
  - Update --with-postgres-utils configure flag to point to the new
    path.
  - Drop deprecated --disable-scrollkeeper configure flag.
  - Update DEB_SHLIBDEPS_INCLUDE with new libglom-1.12-0 package name.
  - Don't include /usr/share/cdbs/1/rules/simple-patchsys.mk - there
    are currently no patches.
* debian/libglom-1.12-0.install:
  - Updated for new version.
* debian/libglom-1.12-dev.install:
  - Install pc and header files.
* debian/glom-doc.install:
  - Updated for new version.
* debian/glom.install:
  - Updated for new version.
* Fix debian/watch.
* Dropped obsolete 10-distro-install-postgres-change.patch.
* Built against latest libgoocanvasmm (LP: #428445).
* Also closes LP: #230007, LP: #393229, LP: #393231, LP: #394507,
  LP: #394887, LP: #394894, LP: #397409, LP: #381563.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Glom
2
 
 *
3
 
 * Copyright (C) 2001-2004 Murray Cumming
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or
6
 
 * modify it under the terms of the GNU General Public License as
7
 
 * published by the Free Software Foundation; either version 2 of the
8
 
 * License, or (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful, but
11
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 
 * General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public
16
 
 * License along with this program; if not, write to the
17
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
 
 * Boston, MA 02111-1307, USA.
19
 
 */
20
 
 
21
 
#include "dialog_progress_creating.h"
22
 
#include <gtkmm/main.h>
23
 
#include <gtkmm/dialog.h>
24
 
#include <glibmm/i18n.h>
25
 
 
26
 
namespace Glom
27
 
{
28
 
 
29
 
Dialog_ProgressCreating::Dialog_ProgressCreating(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade)
30
 
: Gtk::Window(cobject),
31
 
  m_progress(0),
32
 
  m_label_message(0),
33
 
  m_response_id(Gtk::RESPONSE_OK),
34
 
  m_running(false)
35
 
{
36
 
  //set_modal();
37
 
  refGlade->get_widget("progressbar", m_progress);
38
 
  refGlade->get_widget("label_message", m_label_message);
39
 
  //m_progress->show();
40
 
}
41
 
 
42
 
Dialog_ProgressCreating::~Dialog_ProgressCreating()
43
 
{
44
 
}
45
 
 
46
 
void Dialog_ProgressCreating::pulse()
47
 
{
48
 
  m_progress->pulse();
49
 
  raise();
50
 
 
51
 
  //Allow GTK+ to perform all updates for us
52
 
  //Without this, the progress bar will appear to do nothing.
53
 
 
54
 
  // People are supposed to either use run(), or run their own mainloop.
55
 
  // This method is a rather bad hack. I changed spawn.cc to use this
56
 
  // properly, and it does not seem to be used elsewhere. armin.
57
 
 
58
 
  //while(Gtk::Main::instance()->events_pending())
59
 
  //  Gtk::Main::instance()->iteration();
60
 
}
61
 
 
62
 
void Dialog_ProgressCreating::set_message(const Glib::ustring& title, const Glib::ustring& secondary_text)
63
 
{
64
 
  set_title(title);
65
 
  m_label_message->set_text(secondary_text);
66
 
}
67
 
 
68
 
void Dialog_ProgressCreating::response(int response_id)
69
 
{
70
 
  if(!m_running) return;
71
 
 
72
 
  m_response_id = response_id;
73
 
  Gtk::Main::quit();
74
 
  m_running = false;
75
 
}
76
 
 
77
 
int Dialog_ProgressCreating::run()
78
 
{
79
 
  // Cannot nest
80
 
  if(m_running) return Gtk::RESPONSE_CANCEL;
81
 
 
82
 
  show();
83
 
  m_running = true;
84
 
  Gtk::Main::run();
85
 
  return m_response_id;
86
 
}
87
 
 
88
 
bool Dialog_ProgressCreating::on_delete_event(GdkEventAny* event)
89
 
{
90
 
  if(m_running) response(Gtk::RESPONSE_DELETE_EVENT);
91
 
  return true;
92
 
}
93
 
 
94
 
} //namespace Glom