Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial paginated search implementation #688

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Gtk: Implement paginated search
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
  • Loading branch information
ahmubashshir committed Apr 21, 2023
commit ad9d6c2a81f45965917e54214d9d698cd4a6929b
203 changes: 160 additions & 43 deletions trackma/ui/gtk/data/searchwindow.ui
Original file line number Diff line number Diff line change
@@ -3,56 +3,32 @@
<interface>
<requires lib="gtk+" version="3.20"/>
<template class="SearchWindow" parent="GtkWindow">
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="modal">True</property>
<property name="default_width">800</property>
<property name="default_height">400</property>
<property name="type_hint">dialog</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Search</property>
<property name="show_close_button">True</property>
<child>
<object class="GtkButton" id="btn_add_show">
<property name="label" translatable="yes">Add</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="_on_btn_add_show_clicked" swapped="no"/>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
</object>
</child>
<property name="default-width">800</property>
<property name="default-height">400</property>
<property name="type-hint">dialog</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="spacing">9</property>
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="primary_icon_name">edit-find-symbolic</property>
<property name="primary_icon_activatable">False</property>
<property name="primary_icon_sensitive">False</property>
<property name="can-focus">True</property>
<property name="primary-icon-name">edit-find-symbolic</property>
<property name="primary-icon-activatable">False</property>
<property name="primary-icon-sensitive">False</property>
<signal name="search-changed" handler="_on_search_entry_search_changed" swapped="no"/>
</object>
<packing>
@@ -64,7 +40,7 @@
<child>
<object class="GtkSpinner" id="progress_spinner">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
</object>
@@ -84,7 +60,7 @@
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
@@ -95,16 +71,16 @@
<child>
<object class="GtkPaned" id="search_paned">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can-focus">True</property>
<child>
<object class="GtkViewport" id="shows_viewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<property name="can-focus">False</property>
<property name="shadow-type">none</property>
<child>
<placeholder/>
</child>
@@ -119,7 +95,7 @@
<child>
<object class="GtkBox" id="show_info_container">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can-focus">False</property>
<child>
<placeholder/>
</child>
@@ -138,5 +114,146 @@
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="title" translatable="yes">Search</property>
<property name="show-close-button">True</property>
<child>
<object class="GtkButton" id="btn_add_show">
<property name="label" translatable="yes">Add</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="_on_btn_add_show_clicked" swapped="no"/>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="pack-type">end</property>
</packing>
</child>
<child>
<object class="GtkButtonBox" id="paginator">
<property name="can-focus">False</property>
<property name="no-show-all">True</property>
<property name="layout-style">start</property>
<child type="center">
<object class="GtkButton" id="next_page">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="_on_next_page_clicked" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">go-next</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
<property name="non-homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="prev_page">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="_on_prev_page_clicked" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">go-previous</property>
<property name="icon_size">2</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
<property name="non-homogeneous">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="select_page">
<property name="label" translatable="yes">-</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="_on_select_page_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="non-homogeneous">True</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</template>
<object class="GtkPopover" id="page_popover">
<property name="can-focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">8</property>
<property name="margin-end">8</property>
<property name="margin-top">8</property>
<property name="margin-bottom">8</property>
<property name="spacing">6</property>
<child>
<object class="GtkEntry" id="page_entry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<signal name="activate" handler="_on_page_change" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="entry_done">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<signal name="clicked" handler="_on_page_change" swapped="no"/>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="icon-name">object-select-symbolic</property>
</object>
</child>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
1 change: 0 additions & 1 deletion trackma/ui/gtk/mainview.py
Original file line number Diff line number Diff line change
@@ -534,7 +534,6 @@ def _on_show_action(self, page, event_type, data):
self.emit('show-action', event_type, data)

def get_current_status(self):
print(self._engine.mediainfo['statuses'])
return self._current_page.status if self._current_page.status is not None else self._engine.mediainfo['statuses'][-1]

def get_selected_show(self):
Loading