remove progress button

This commit is contained in:
ochibani 2022-10-20 18:55:58 +02:00
parent d1c470681a
commit 257c5b42c7
3 changed files with 11 additions and 32 deletions

View File

@ -100,16 +100,6 @@
<property name="margin-end">10</property>
</object>
</child>
<child>
<object class="GtkButton" id="progressbutton">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="label" translatable="yes">Finish Recording</property>
<property name="margin-top">15</property>
</object>
</child>
</object>
</child>
</object>

View File

@ -2,7 +2,7 @@ extern crate subprocess;
use chrono::prelude::*;
use gettextrs::gettext;
use gtk::prelude::*;
use gtk::{Button, CheckButton, ComboBoxText, Entry, FileChooserNative, ProgressBar, SpinButton, Window};
use gtk::{CheckButton, ComboBoxText, Entry, FileChooserNative, ProgressBar, SpinButton, Window};
use gtk::{ButtonsType, DialogFlags, MessageDialog, MessageType, ResponseType};
use std::path::PathBuf;
use std::process::Command;
@ -15,19 +15,16 @@ use subprocess::Exec;
pub struct ProgressWidget {
pub progress_dialog: MessageDialog,
pub progressbar: ProgressBar,
pub progress_button: Button,
}
impl ProgressWidget {
pub fn new(
progress_dialog: MessageDialog,
progressbar: ProgressBar,
progress_button: Button,
) -> ProgressWidget {
ProgressWidget {
progress_dialog,
progressbar,
progress_button,
}
}
@ -43,7 +40,6 @@ impl ProgressWidget {
}
pub fn hide(&self) {
self.progress_button.set_sensitive(true);
self.progress_dialog.hide();
}
}

View File

@ -82,7 +82,6 @@ pub fn build_ui(application: &Application) {
let mouse_switch: CheckButton = builder.object("mouseswitch").unwrap();
let overwrite_switch: CheckButton = builder.object("overwriteswitch").unwrap();
let play_button: Button = builder.object("playbutton").unwrap();
let progress_button: Button = builder.object("progressbutton").unwrap();
let progress_dialog: MessageDialog = builder.object("progress_dialog").unwrap();
let progressbar: ProgressBar = builder.object("progressbar").unwrap();
let record_button: Button = builder.object("recordbutton").unwrap();
@ -367,12 +366,6 @@ pub fn build_ui(application: &Application) {
_area_capture.borrow_mut().get_area();
});
let _progress_button = progress_button.clone();
let _progress_dialog = progress_dialog.clone();
_progress_button.connect_clicked(move |_| {
_progress_dialog.hide();
});
// Init record struct
let ffmpeg_record_interface: Rc<RefCell<Ffmpeg>> = Rc::new(RefCell::new(Ffmpeg {
filename: (folder_chooser_native, filename_entry, format_chooser_combobox),
@ -388,7 +381,7 @@ pub fn build_ui(application: &Application) {
audio_process_id: None,
saved_filename: None,
unbound: None,
progress_widget: ProgressWidget::new(progress_dialog, progressbar, progress_button),
progress_widget: ProgressWidget::new(progress_dialog, progressbar),
window: main_window.clone(),
overwrite: overwrite_switch,
}));