Fix inconsistent message log action state (GTK client) (#2167)
This commit is contained in:
parent
250a2e3cc5
commit
a26400c3dc
|
@ -151,8 +151,6 @@ private:
|
||||||
void on_add_torrent(tr_ctor* ctor);
|
void on_add_torrent(tr_ctor* ctor);
|
||||||
void on_prefs_changed(tr_quark key);
|
void on_prefs_changed(tr_quark key);
|
||||||
|
|
||||||
void on_message_window_closed();
|
|
||||||
|
|
||||||
std::vector<int> get_selected_torrent_ids() const;
|
std::vector<int> get_selected_torrent_ids() const;
|
||||||
tr_torrent* get_first_selected_torrent() const;
|
tr_torrent* get_first_selected_torrent() const;
|
||||||
counts_data get_selected_torrent_counts() const;
|
counts_data get_selected_torrent_counts() const;
|
||||||
|
@ -1320,11 +1318,6 @@ bool Application::Impl::call_rpc_for_selected_torrents(std::string const& method
|
||||||
return invoked;
|
return invoked;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::Impl::on_message_window_closed()
|
|
||||||
{
|
|
||||||
gtr_action_set_toggled("toggle-message-log", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Application::Impl::remove_selected(bool delete_files)
|
void Application::Impl::remove_selected(bool delete_files)
|
||||||
{
|
{
|
||||||
std::vector<int> l;
|
std::vector<int> l;
|
||||||
|
@ -1513,14 +1506,13 @@ void Application::Impl::actions_handler(Glib::ustring const& action_name)
|
||||||
{
|
{
|
||||||
if (msgwin_ == nullptr)
|
if (msgwin_ == nullptr)
|
||||||
{
|
{
|
||||||
gtr_action_set_toggled("toggle-message-log", true);
|
|
||||||
msgwin_ = MessageLogWindow::create(*wind_, core_);
|
msgwin_ = MessageLogWindow::create(*wind_, core_);
|
||||||
msgwin_->signal_hide().connect(sigc::mem_fun(*this, &Impl::on_message_window_closed));
|
msgwin_->signal_hide().connect([this]() { msgwin_.reset(); });
|
||||||
|
msgwin_->show();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gtr_action_set_toggled("toggle-message-log", false);
|
msgwin_->hide();
|
||||||
msgwin_.reset();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (action_name == "show-about-dialog")
|
else if (action_name == "show-about-dialog")
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <libtransmission/transmission.h>
|
#include <libtransmission/transmission.h>
|
||||||
#include <libtransmission/log.h>
|
#include <libtransmission/log.h>
|
||||||
|
|
||||||
|
#include "Actions.h"
|
||||||
#include "HigWorkarea.h"
|
#include "HigWorkarea.h"
|
||||||
#include "MessageLogWindow.h"
|
#include "MessageLogWindow.h"
|
||||||
#include "Prefs.h"
|
#include "Prefs.h"
|
||||||
|
@ -548,5 +549,17 @@ MessageLogWindow::Impl::Impl(MessageLogWindow& window, Glib::RefPtr<Session> con
|
||||||
SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS);
|
SECONDARY_WINDOW_REFRESH_INTERVAL_SECONDS);
|
||||||
|
|
||||||
scroll_to_bottom();
|
scroll_to_bottom();
|
||||||
window_.show_all();
|
window_.show_all_children();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MessageLogWindow::on_show()
|
||||||
|
{
|
||||||
|
Gtk::Window::on_show();
|
||||||
|
gtr_action_set_toggled("toggle-message-log", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MessageLogWindow::on_hide()
|
||||||
|
{
|
||||||
|
Gtk::Window::on_hide();
|
||||||
|
gtr_action_set_toggled("toggle-message-log", false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
MessageLogWindow(Gtk::Window& parent, Glib::RefPtr<Session> const& core);
|
MessageLogWindow(Gtk::Window& parent, Glib::RefPtr<Session> const& core);
|
||||||
|
|
||||||
|
void on_show() override;
|
||||||
|
void on_hide() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Impl;
|
class Impl;
|
||||||
std::unique_ptr<Impl> const impl_;
|
std::unique_ptr<Impl> const impl_;
|
||||||
|
|
Loading…
Reference in New Issue