main_window.ui: Remove unused search widget

There is no point to carry this widget in the ui file until such
functionality is implemented.
This commit is contained in:
Jordan Petridis 2018-08-18 06:20:39 +03:00
parent e2ae94ec11
commit 7a424fcdb9
No known key found for this signature in database
GPG key ID: CEABAD9F5683B9A6
6 changed files with 0 additions and 126 deletions

View file

@ -117,79 +117,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkRevealer" id="search_revealer">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="spacing">6</property>
<child>
<object class="GtkSearchEntry" id="search_input">
<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>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkStack" id="search_button_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkButton" id="search">
<property name="label">gtk-find</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<style>
<class name="suggested-action"/>
</style>
</object>
<packing>
<property name="name">normal</property>
<property name="title">normal</property>
</packing>
</child>
<child>
<object class="GtkSpinner" id="search_spinner">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active">True</property>
</object>
<packing>
<property name="name">searching</property>
<property name="title" translatable="yes">Searching</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkOverlay">
<property name="visible">True</property>

View file

@ -63,7 +63,6 @@ impl App {
room.connect_activate(clone!(op => move |_, _| op.lock().unwrap().show_room_settings() ));
inv.connect_activate(clone!(op => move |_, _| op.lock().unwrap().show_invite_user_dialog() ));
chat.connect_activate(clone!(op => move |_, _| op.lock().unwrap().show_direct_chat_dialog() ));
search.connect_activate(clone!(op => move |_, _| op.lock().unwrap().toggle_search() ));
leave.connect_activate(clone!(op => move |_, _| op.lock().unwrap().leave_active_room() ));
newr.connect_activate(clone!(op => move |_, _| op.lock().unwrap().new_room_dialog() ));
joinr.connect_activate(clone!(op => move |_, _| op.lock().unwrap().join_to_room_dialog() ));

View file

@ -185,9 +185,6 @@ pub fn backend_loop(rx: Receiver<BKResponse>) {
Ok(BKResponse::AttachedFile(msg)) => {
APPOP!(attached_file, (msg));
}
Ok(BKResponse::SearchEnd) => {
APPOP!(search_end);
}
Ok(BKResponse::NewRoom(r, internal_id)) => {
let id = Some(internal_id);
APPOP!(new_room, (r, id));

View file

@ -18,7 +18,6 @@ mod media_viewer;
mod new_room;
mod roomlist_search;
mod scroll;
mod search;
mod send;
mod spellcheck;
mod stickers;
@ -90,8 +89,6 @@ impl App {
self.connect_join_room_dialog();
self.connect_account_settings();
self.connect_search();
self.connect_invite_dialog();
self.connect_invite_user();
self.connect_direct_chat();

View file

@ -1,21 +0,0 @@
extern crate gtk;
use self::gtk::prelude::*;
use app::App;
impl App {
pub fn connect_search(&self) {
let input: gtk::Entry = self.ui.builder
.get_object("search_input")
.expect("Couldn't find search_input in ui file.");
let btn: gtk::Button = self.ui.builder
.get_object("search")
.expect("Couldn't find search in ui file.");
let op = self.op.clone();
input.connect_activate(move |inp| op.lock().unwrap().search(inp.get_text()));
let op = self.op.clone();
btn.connect_clicked(move |_| op.lock().unwrap().search(input.get_text()));
}
}

View file

@ -414,31 +414,6 @@ impl AppOp {
self.roomlist.filter_rooms(term);
}
pub fn toggle_search(&self) {
let r: gtk::Revealer = self.ui.builder
.get_object("search_revealer")
.expect("Couldn't find search_revealer in ui file.");
r.set_reveal_child(!r.get_child_revealed());
}
pub fn search(&mut self, term: Option<String>) {
let r = self.active_room.clone().unwrap_or_default();
self.remove_messages();
self.backend.send(BKCommand::Search(r, term)).unwrap();
self.ui.builder
.get_object::<gtk::Stack>("search_button_stack")
.expect("Can't find search_button_stack in ui file.")
.set_visible_child_name("searching");
}
pub fn search_end(&self) {
self.ui.builder
.get_object::<gtk::Stack>("search_button_stack")
.expect("Can't find search_button_stack in ui file.")
.set_visible_child_name("normal");
}
pub fn new_room_dialog(&self) {
let dialog = self.ui.builder
.get_object::<gtk::Dialog>("new_room_dialog")