gui update

This commit is contained in:
ochibani 2024-06-16 08:24:23 +02:00
parent 7fe3a99bcd
commit 68aea8349f
No known key found for this signature in database
GPG Key ID: 2C6B61CE0C704ED4
7 changed files with 56 additions and 69 deletions

View File

@ -7,18 +7,18 @@
<property name="logo-icon-name">blue-recorder</property>
<property name="modal">True</property>
</object>
<object class="GtkAdjustment" id="adjustment1">
<object class="GtkAdjustment" id="adjustment-delay">
<property name="upper">10</property>
<property name="step-increment">1</property>
<property name="page-increment">2</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<object class="GtkAdjustment" id="adjustment-frames">
<property name="lower">1</property>
<property name="upper">200</property>
<property name="step-increment">1</property>
<property name="page-increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment3">
<object class="GtkAdjustment" id="adjustment-quality">
<property name="lower">0</property>
<property name="upper">51</property>
<property name="step-increment">1</property>
@ -412,16 +412,6 @@
</layout>
</object>
</child>
<child>
<object class="GtkSeparator" id="followmouse-separator">
<property name="visible">True</property>
<property name="opacity">0.0</property>
<layout>
<property name="column">1</property>
<property name="row">2</property>
</layout>
</object>
</child>
</object>
</child>
<child>
@ -445,7 +435,7 @@
<property name="max-width-chars">2</property>
<property name="width-chars">2</property>
<property name="text">number</property>
<property name="adjustment">adjustment2</property>
<property name="adjustment">adjustment-frames</property>
<property name="has-tooltip">True</property>
</object>
</child>
@ -468,7 +458,7 @@
<property name="max-width-chars">2</property>
<property name="width-chars">2</property>
<property name="text">number</property>
<property name="adjustment">adjustment1</property>
<property name="adjustment">adjustment-delay</property>
<property name="climb-rate">1</property>
<property name="has-tooltip">True</property>
<layout>
@ -505,7 +495,7 @@
<property name="max-width-chars">2</property>
<property name="width-chars">2</property>
<property name="text">number</property>
<property name="adjustment">adjustment3</property>
<property name="adjustment">adjustment-quality</property>
<property name="climb-rate">1</property>
<property name="has-tooltip">True</property>
<layout>
@ -514,16 +504,6 @@
</layout>
</object>
</child>
<child>
<object class="GtkSeparator" id="quality-separator">
<property name="visible">True</property>
<property name="opacity">0.0</property>
<layout>
<property name="column">1</property>
<property name="row">2</property>
</layout>
</object>
</child>
</object>
</child>
</object>

View File

@ -109,10 +109,10 @@ quality = الجودة:
record = سجل
# Record audio label
record-audio = تسجيل الصوت
record-audio = تسجيل صوت اللاقط
# Record speaker label
record-speaker = تسجيل المكبر
record-speaker = تسجيل صوت المكبر
# Record video label
record-video = تسجيل الصورة
@ -138,7 +138,7 @@ website = الموقع
about-tooltip = ما يُستَحسَنُ أن تعلمه عن المسجل الأزرق
area-tooltip = يحدد المنطقة المُراد تسجيلها
audio-source-tooltip = لاختيار مدخل الصوت
audio-tooltip = يسجل مع الصوت
audio-tooltip = يسجل باستخدام مدخل الصوت
delay-tooltip = مُهلة قبل بدء التسجيل
folder-tooltip = لاختيار مكان التخزين
follow-mouse-tooltip = يميز مؤشر الفأرة عند التسجيل
@ -149,7 +149,7 @@ mouse-tooltip = يظهر مؤشر الفأرة عند التسجيل
quality-tooltip = جودة التسجيل (CRF)
record-tooltip = يبدأ تسجيل الشاشة
screen-tooltip = يحدد الشاشة ليسجلها
speaker-tooltip = تسجيل صوت المكبر
speaker-tooltip = يسجل باستخدام مخرج الصوت
stop-tooltip = وقف تسجيل الشاشة
video-tooltip = يسجل الشاشة
wayland-tooltip = غير مدعوم في وايلاند

View File

@ -109,10 +109,10 @@ quality = الجودة:
record = سجل
# Record audio label
record-audio = تسجيل الصوت
record-audio = تسجيل صوت اللاقط
# Record speaker label
record-speaker = تسجيل المكبر
record-speaker = تسجيل صوت المكبر
# Record video label
record-video = تسجيل الصورة
@ -138,7 +138,7 @@ website = الموقع
about-tooltip = ما يُستَحسَنُ أن تعلمه عن المسجل الأزرق
area-tooltip = يحدد المنطقة المُراد تسجيلها
audio-source-tooltip = لاختيار مدخل الصوت
audio-tooltip = يسجل مع الصوت
audio-tooltip = يسجل باستخدام مدخل الصوت
delay-tooltip = مُهلة قبل بدء التسجيل
folder-tooltip = لاختيار مكان التخزين
follow-mouse-tooltip = يميز مؤشر الفأرة عند التسجيل
@ -149,7 +149,7 @@ mouse-tooltip = يظهر مؤشر الفأرة عند التسجيل
quality-tooltip = جودة التسجيل (CRF)
record-tooltip = يبدأ تسجيل الشاشة
screen-tooltip = يحدد الشاشة ليسجلها
speaker-tooltip = تسجيل صوت المكبر
speaker-tooltip = يسجل باستخدام مخرج الصوت
stop-tooltip = وقف تسجيل الشاشة
video-tooltip = يسجل الشاشة
wayland-tooltip = غير مدعوم في وايلاند

View File

@ -106,7 +106,7 @@ quality = Quality:
record = Record
# Record audio label
record-audio = Record Audio
record-audio = Record Mic
# Record speaker label
record-speaker = Record Speaker
@ -135,7 +135,7 @@ website = Website
about-tooltip = Information about Blue Recorder
area-tooltip = Select area to record
audio-source-tooltip = Select audio source
audio-tooltip = Audio recording
audio-tooltip = Mic audio recording
delay-tooltip = Delay time before starting record
folder-tooltip = Select storage location
follow-mouse-tooltip = Highlight mouse

View File

@ -106,7 +106,7 @@ quality = Quality:
record = Record
# Record audio label
record-audio = Record Audio
record-audio = Record Mic
# Record speaker label
record-speaker = Record Speaker
@ -135,7 +135,7 @@ website = Website
about-tooltip = Information about Blue Recorder
area-tooltip = Select area to record
audio-source-tooltip = Select audio source
audio-tooltip = Audio recording
audio-tooltip = Mic audio recording
delay-tooltip = Delay time before starting record
folder-tooltip = Select storage location
follow-mouse-tooltip = Highlight mouse

View File

@ -27,10 +27,12 @@ pub fn initialize() -> PathBuf {
}
fn default() {
for format in 0..7 {
set_default_quality(&format.to_string());
}
set("default", "frame", "60");
set("default", "delay", "0");
set("default", "format", "0");
set("default", "quality", get_quality(&self::get("default", "format")));
set(
"default",
"folder",
@ -129,16 +131,16 @@ pub fn folder_icon(folder_chooser_name: Option<&str>) -> &str {
}
}
pub fn get_quality(format: &str) -> &str {
pub fn set_default_quality(format: &str) -> bool {
let crf = match format {
"0" => "23",
"1" => "23",
"2" => "10.0",
"3" => "23",
"4" => "23",
"5" => "23",
"6" => "23.0",
_=> "23", // Default value
"0" => self::set("default", "quality-0", "23"),
"1" => self::set("default", "quality-1", "23"),
"2" => self::set("default", "quality-2", "10"),
"3" => self::set("default", "quality-3", "23"),
"4" => self::set("default", "quality-4", "23"),
"5" => self::set("default", "quality-5", "23"),
"6" => self::set("default", "quality-6", "23"),
_ => self::set("default", "quality-0", "23"), // Default value
};
crf
}

View File

@ -186,7 +186,7 @@ pub fn build_ui(application: &Application) {
.value().unwrap(), None, &mut vec![]).to_string());
format_chooser_combobox.append(Some("nut"), &bundle.format_pattern(bundle.get_message("nut-format").unwrap()
.value().unwrap(), None, &mut vec![]).to_string());
//format_chooser_combobox.set_active(Some(config_management::get("default", "format").parse::<u32>().unwrap()));
format_chooser_combobox.set_active(Some(config_management::get("default", "format").parse::<u32>().unwrap()));
// Get audio sources
let input_device = host_audio_device.input_devices().unwrap();
@ -407,29 +407,33 @@ pub fn build_ui(application: &Application) {
.parse::<f64>()
.unwrap(),
);
//quality_spin.set_value(
//config_management::get("default", "quality")
//.parse::<f64>()
//.unwrap(),
//);
quality_spin.set_value(
config_management::get("default",
&format!
("quality-{}",
&format_chooser_combobox.active().unwrap().to_string()))
.parse::<f64>()
.unwrap(),
);
let _format_chooser_combobox = format_chooser_combobox.clone();
let _quality_spin = quality_spin.clone();
format_chooser_combobox.connect_changed(move |_| {
let format_chooser_combobox = _format_chooser_combobox.clone();
if _format_chooser_combobox.active_text().is_some() {
config_management::set(
"default",
"format",
&_format_chooser_combobox.active().unwrap().to_string(),
);
let quality_spin = _quality_spin.clone();
_quality_spin.connect_value_changed(move |_| {
config_management::set(
"default",
"quality",
quality_spin.to_string().as_str(),
);
});
_quality_spin.set_value(
config_management::get("default",
&format!
("quality-{}",
&format_chooser_combobox.active().unwrap().to_string()))
.parse::<f64>()
.unwrap(),
);
}
});
@ -447,14 +451,15 @@ pub fn build_ui(application: &Application) {
"delay",
_delay_spin.value().to_string().as_str());
});
let _quality_spin = delay_spin.to_owned();
let _quality_spin = quality_spin.to_owned();
let _format_chooser_combobox = format_chooser_combobox.clone();
quality_spin.connect_value_changed(move |_| {
config_management::set(
"default",
"quality",
_quality_spin.value().to_string().as_str(),
);
});
config_management::set("default",
&format!
("quality-{}",
&_format_chooser_combobox.active().unwrap().to_string()),
_quality_spin.value().to_string().as_str());
});
// Labels
command_label.set_label(&bundle.format_pattern(bundle.get_message("run-command").unwrap()