aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-26 23:57:31 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-26 23:57:31 +0000
commitab2b391ebf40a67a953c2bfecd67c18bb4727b57 (patch)
treeb1c42ac152d701be641377b7acf876fdd60ce052
parent82b61b1bed051ae9e98ba1fe68b5b77ff5fc98fb (diff)
downloadpaludis-ab2b391ebf40a67a953c2bfecd67c18bb4727b57.tar.gz
paludis-ab2b391ebf40a67a953c2bfecd67c18bb4727b57.tar.xz
Lock controls when syncing
-rw-r--r--src/gtkpaludis/browse_tree.cc14
-rw-r--r--src/gtkpaludis/browse_tree.hh3
-rw-r--r--src/gtkpaludis/main_window.cc17
-rw-r--r--src/gtkpaludis/main_window.hh2
4 files changed, 28 insertions, 8 deletions
diff --git a/src/gtkpaludis/browse_tree.cc b/src/gtkpaludis/browse_tree.cc
index d57c8ba..7fd7d92 100644
--- a/src/gtkpaludis/browse_tree.cc
+++ b/src/gtkpaludis/browse_tree.cc
@@ -19,6 +19,7 @@
#include "browse_tree.hh"
#include "information_tree.hh"
+#include "main_window.hh"
#include <gtkmm/treestore.h>
#include <gtkmm/menu.h>
@@ -305,6 +306,7 @@ namespace paludis
struct Implementation<BrowseTree> :
InternalCounted<Implementation<BrowseTree> >
{
+ MainWindow * const main_window;
InformationTree * const information_tree;
BrowseTreeColumns columns;
@@ -314,7 +316,8 @@ namespace paludis
pid_t paludis_child;
- Implementation(InformationTree * const i) :
+ Implementation(MainWindow * const m, InformationTree * const i) :
+ main_window(m),
information_tree(i),
paludis_child(-1)
{
@@ -326,8 +329,10 @@ namespace paludis
};
}
-BrowseTree::BrowseTree(InformationTree * const information_tree) :
- PrivateImplementationPattern<BrowseTree>(new Implementation<BrowseTree>(information_tree))
+BrowseTree::BrowseTree(MainWindow * const main_window,
+ InformationTree * const information_tree) :
+ PrivateImplementationPattern<BrowseTree>(new Implementation<BrowseTree>(
+ main_window, information_tree))
{
_imp->model = Gtk::TreeStore::create(_imp->columns);
set_model(_imp->model);
@@ -384,6 +389,8 @@ BrowseTree::on_menu_sync()
Gtk::TreeModel::iterator i(selection->get_selected());
if (i)
{
+ _imp->main_window->set_children_sensitive(false);
+
pid_t child(fork());
if (0 == child)
{
@@ -446,6 +453,7 @@ BrowseTree::on_child_process_timer()
+ " exited with failure code " + stringify(status));
_imp->paludis_child = -1;
+ _imp->main_window->set_children_sensitive(true);
return false;
}
}
diff --git a/src/gtkpaludis/browse_tree.hh b/src/gtkpaludis/browse_tree.hh
index 51f4de5..c735227 100644
--- a/src/gtkpaludis/browse_tree.hh
+++ b/src/gtkpaludis/browse_tree.hh
@@ -26,13 +26,14 @@
namespace paludis
{
class InformationTree;
+ class MainWindow;
class BrowseTree :
public Gtk::TreeView,
private PrivateImplementationPattern<BrowseTree>
{
public:
- BrowseTree(InformationTree * const);
+ BrowseTree(MainWindow * const, InformationTree * const);
~BrowseTree();
virtual void on_changed();
diff --git a/src/gtkpaludis/main_window.cc b/src/gtkpaludis/main_window.cc
index 0c45afd..d6a4a15 100644
--- a/src/gtkpaludis/main_window.cc
+++ b/src/gtkpaludis/main_window.cc
@@ -65,24 +65,24 @@ namespace paludis
Gtk::ScrolledWindow messages_window;
MessageWindow messages;
- Implementation();
+ Implementation(MainWindow * const main_window);
};
}
-Implementation<MainWindow>::Implementation() :
+Implementation<MainWindow>::Implementation(MainWindow * const main_window) :
main_container(false, 5),
search_container(false, 5),
search_label(" Search: "),
search_button(Gtk::Stock::FIND),
information_frame(" Information: "),
browse_frame(" Browse: "),
- browse_tree(&information_tree),
+ browse_tree(main_window, &information_tree),
messages_frame(" Messages: ")
{
}
MainWindow::MainWindow() :
- PrivateImplementationPattern<MainWindow>(new Implementation<MainWindow>)
+ PrivateImplementationPattern<MainWindow>(new Implementation<MainWindow>(this))
{
set_title("gtkPaludis " + stringify(PALUDIS_VERSION_MAJOR) + "." +
stringify(PALUDIS_VERSION_MINOR) + "." +
@@ -128,3 +128,12 @@ MainWindow::~MainWindow()
{
}
+void
+MainWindow::set_children_sensitive(bool value)
+{
+ _imp->browse_tree.set_sensitive(value);
+ _imp->information_tree.set_sensitive(value);
+ _imp->search_box.set_sensitive(value);
+ _imp->search_button.set_sensitive(value);
+}
+
diff --git a/src/gtkpaludis/main_window.hh b/src/gtkpaludis/main_window.hh
index 9c7ef58..90a5c31 100644
--- a/src/gtkpaludis/main_window.hh
+++ b/src/gtkpaludis/main_window.hh
@@ -32,6 +32,8 @@ namespace paludis
public:
MainWindow();
virtual ~MainWindow();
+
+ void set_children_sensitive(bool value);
};
}