Commit 7cf74a79 authored by Nico Alt's avatar Nico Alt
Browse files

Use name "conversation" instead of "main_window" in all occurrences

parent 95b663ef
......@@ -29,7 +29,7 @@ class WindowActions(Actions):
self._setup_open_about_page_action()
self._setup_open_add_contact_action()
self._setup_open_emoji_menu_action()
self._setup_open_main_window_action()
self._setup_open_conversation_action()
self._setup_open_private_chat_action()
def _setup_back_to_sidebar_action(self):
......@@ -59,8 +59,8 @@ class WindowActions(Actions):
def _setup_open_emoji_menu_action(self):
self._setup_action("open-emoji-menu", None, self._open_emoji_menu)
def _setup_open_main_window_action(self):
self._setup_action("open-main-window", None, self._open_main_window)
def _setup_open_conversation_action(self):
self._setup_action("open-conversation", None, self._open_conversation)
def _setup_open_private_chat_action(self):
self._setup_action("open-private-chat", GLib.VariantType.new("i"),
......@@ -108,8 +108,8 @@ class WindowActions(Actions):
self.widget.current_view.presenter.open_emoji_menu()
# pylint: disable=unused-argument
def _open_main_window(self, action, parameter):
self.widget.show_main_window_view()
def _open_conversation(self, action, parameter):
self.widget.show_conversation_view()
# pylint: disable=unused-argument
def _open_private_chat(self, action, contact_id):
......
......@@ -66,7 +66,7 @@ class AddContactView(Gtk.Overlay):
return
alias_error_label.hide()
self._add_contact()
APP().window.show_main_window_view()
APP().window.show_conversation_view()
def _setup_view(self):
self._add_from_resource(self.ADD_CONTACT_UI)
......
......@@ -30,19 +30,19 @@ class MainWindowView(Gtk.Overlay):
os.path.join(RESOURCES_DIR, "chat_menu.ui")
)
builder.add_from_resource(
os.path.join(RESOURCES_DIR, "main_window.ui")
os.path.join(RESOURCES_DIR, "conversation.ui")
)
builder.connect_signals(self)
return builder
def _setup_view(self, window):
self._setup_main_window_stack()
self._setup_conversation_stack()
self._setup_header_bar_stack_holder(window)
def _setup_main_window_stack(self):
main_window_stack = self.builder.get_object("main_window_stack")
main_window_stack.show_all()
self.add(main_window_stack)
def _setup_conversation_stack(self):
conversation_stack = self.builder.get_object("conversation_stack")
conversation_stack.show_all()
self.add(conversation_stack)
self.show_all()
def _setup_header_bar_stack_holder(self, window):
......
......@@ -145,11 +145,11 @@ class PrivateChatPresenter:
chat_view.show()
def _show_main_content_container(self):
main_window_leaflet = self._view.builder.get_object(
"main_window_leaflet")
conversation_leaflet = self._view.builder.get_object(
"conversation_leaflet")
main_content_container = self._view.builder.get_object(
"main_content_container")
main_window_leaflet.set_visible_child(main_content_container)
conversation_leaflet.set_visible_child(main_content_container)
def _set_contact_name_label(self, contact_name):
contact_name_label = self._view.builder.get_object("contact_name")
......@@ -237,10 +237,10 @@ class PrivateChatPresenter:
chat_menu_button.hide()
def _show_sidebar_box(self):
main_window_leaflet = self._view.builder.get_object(
"main_window_leaflet")
conversation_leaflet = self._view.builder.get_object(
"conversation_leaflet")
sidebar_box = self._view.builder.get_object("sidebar_box")
main_window_leaflet.set_visible_child(sidebar_box)
conversation_leaflet.set_visible_child(sidebar_box)
def _delete_all_messages(self, widget, response_id):
if response_id == Gtk.ResponseType.OK:
......
......@@ -89,7 +89,7 @@ class PrivateChatView(Gtk.Overlay):
def _setup_clamp(self):
clamp = Handy.Clamp.new()
clamp.set_maximum_size(800) # same as in main_window.ui
clamp.set_maximum_size(800) # same as in conversation.ui
clamp.set_tightening_threshold(600)
clamp.set_hexpand(True)
clamp.set_vexpand(True)
......
......@@ -82,7 +82,7 @@ class LoginView(Gtk.Overlay):
def _login_completed(self, succeeded):
function = self._login_failed
if succeeded:
function = self._window.show_main_window_view
function = self._window.show_conversation_view
GLib.idle_add(function)
def _login_failed(self):
......
......@@ -144,7 +144,7 @@ class RegistrationView(Gtk.Overlay):
def _registration_completed(self, succeeded):
function = self._registration_failed
if succeeded:
function = self._window.show_main_window_view
function = self._window.show_conversation_view
GLib.idle_add(function)
def _registration_failed(self):
......
......@@ -25,8 +25,8 @@ class Window(Gtk.ApplicationWindow):
self._setup_content()
self._setup_focus_listener()
def show_main_window_view(self):
self._setup_main_window_view()
def show_conversation_view(self):
self._setup_conversation_view()
def show_add_contact_view(self):
self._setup_add_contact_view()
......@@ -98,7 +98,7 @@ class Window(Gtk.ApplicationWindow):
def _setup_startup_view(self):
self._setup_view(StartupView(self))
def _setup_main_window_view(self):
def _setup_conversation_view(self):
self._setup_view(MainWindowView(self))
def _setup_add_contact_view(self):
......
......@@ -188,7 +188,7 @@
<object class="GtkButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="action_name">win.open-main-window</property>
<property name="action_name">win.open-conversation</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
......
......@@ -4,9 +4,9 @@
<file compressed="true">application.css</file>
<file compressed="true" preprocess="xml-stripblanks">add_contact.ui</file>
<file compressed="true" preprocess="xml-stripblanks">chat_menu.ui</file>
<file compressed="true" preprocess="xml-stripblanks">conversation.ui</file>
<file compressed="true" preprocess="xml-stripblanks">login.ui</file>
<file compressed="true" preprocess="xml-stripblanks">main_menu.ui</file>
<file compressed="true" preprocess="xml-stripblanks">main_window.ui</file>
<file compressed="true" preprocess="xml-stripblanks">private_chat.ui</file>
<file compressed="true" preprocess="xml-stripblanks">registration.ui</file>
<file compressed="true" preprocess="xml-stripblanks">about_dialog.ui</file>
......
......@@ -11,11 +11,11 @@
-->
<interface>
<requires lib="gtk+" version="3.22"/>
<object class="GtkStack" id="main_window_stack">
<object class="GtkStack" id="conversation_stack">
<property name="can_focus">False</property>
<property name="hhomogeneous">False</property>
<child>
<object class="HdyLeaflet" id="main_window_leaflet">
<object class="HdyLeaflet" id="conversation_leaflet">
<property name="child-transition-duration" bind-source="header_leaflet" bind-property="child-transition-duration" bind-flags="bidirectional|sync-create"/>
<property name="transition-type" bind-source="header_leaflet" bind-property="transition-type" bind-flags="bidirectional|sync-create"/>
<property name="mode-transition-duration" bind-source="header_leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
......
......@@ -41,7 +41,7 @@ def test_window_add_at_init(mocker, startup_container, window_actions,
def test_show_main_container(main_window_container, mocker,
startup_container, window_actions,
window_add, window_resize):
Window().show_main_window_view()
Window().show_conversation_view()
main_window_container.assert_called_once()
......@@ -51,7 +51,7 @@ def test_show_main_shown(main_window_container, mocker,
window_add, window_resize):
window = Window()
window.show_main_window_view()
window.show_conversation_view()
window.current_view.show_all.assert_called_once()
......@@ -62,7 +62,7 @@ def test_show_main_add(main_window_container, mocker,
window = Window()
window_add = mocker.patch(MODULE % "Window.add")
window.show_main_window_view()
window.show_conversation_view()
window_add.assert_called_once_with(window.current_view)
......@@ -74,7 +74,7 @@ def test_show_main_destroy_old(main_window_container, mocker,
current_container_mock = mocker.MagicMock()
window.current_view = current_container_mock
window.show_main_window_view()
window.show_conversation_view()
current_container_mock.destroy.assert_called_once()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment