From 81f406f9f5e44ad8c659507fb60c8522b1900c4f Mon Sep 17 00:00:00 2001 From: Aiwota Programmer Date: Mon, 21 Aug 2006 12:27:57 +0900 Subject: [PATCH 1/1] Add the participation of thread window in the program quit counter of windowlist --- src/Hage1/board_window.py | 2 +- src/Hage1/thread_window.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Hage1/board_window.py b/src/Hage1/board_window.py index 3ae5be4..a6ff35c 100644 --- a/src/Hage1/board_window.py +++ b/src/Hage1/board_window.py @@ -194,7 +194,7 @@ class WinWrap: iter, ThreadListModel.column_names.index("title")) print thread + ':"' + title + '"', "activated" - thread_window.WinWrap(self.bbs, self.board, thread) + thread_window.open_thread(self.bbs, self.board, thread) def on_treeview_button_press_event(self, widget, event): if event.button == 3: diff --git a/src/Hage1/thread_window.py b/src/Hage1/thread_window.py index 39ddc85..759224b 100644 --- a/src/Hage1/thread_window.py +++ b/src/Hage1/thread_window.py @@ -29,11 +29,26 @@ import misc import datfile import barehtmlparser import idxfile +import windowlist GLADE_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "data") GLADE_FILENAME = "thread_window.glade" +def open_thread(bbs, board, thread): + if not bbs or not board or not thread: + raise ValueError, "parameter must not be empty" + + key = "/" + bbs + "/" + board + "/" + thread + window = windowlist.get_window(key) + if window: + # already opened + window.present() + pass + else: + win_wrap = WinWrap(bbs, board, thread) + windowlist.window_created(key, win_wrap.window) + class WinWrap: -- 2.11.0