#include <string.h>
#include <unistd.h>
+#define MSG_NO_PIC_CONTROLS _("Device has no picture controls.")
+//#define MSG_NO_INP_SELECTION _("Device has no input selection.")
ChannelEditThread::ChannelEditThread(ChannelPicker *channel_picker,
ChannelDB *channeldb)
ChannelEditWindow::ChannelEditWindow(ChannelEditThread *thread,
ChannelPicker *channel_picker)
- : BC_Window(PROGRAM_NAME ": Channels",
+ : BC_Window(_(PROGRAM_NAME ": Channels"),
channel_picker->mwindow->session->channels_x,
channel_picker->mwindow->session->channels_y,
- 350, 400, 350, 400, 0, 0, 1)
+ 375, 400, 375, 400, 0, 0, 1)
{
this->thread = thread;
this->channel_picker = channel_picker;
void ChannelEditWindow::create_objects()
{
+ lock_window("ChannelEditWindow::create_objects");
int x = 10, y = 10;
// Create channel list
edit_thread = new ChannelEditEditThread(this, channel_picker);
picture_thread = new ChannelEditPictureThread(channel_picker);
show_window();
+ unlock_window();
}
int ChannelEditWindow::close_event()
}
-
-
-
-
-
-
-
-
-
-
-// ========================= confirm overwrite by channel scannin
-
+// ========================= confirm overwrite by channel scanning
ConfirmScan::ConfirmScan(ChannelEditWindow *gui, int x, int y)
- : BC_Window(PROGRAM_NAME ": Scan confirm",
- x,
- y,
- 350,
- BC_OKButton::calculate_h() + 130,
- 0,
- 0,
- 0,
- 0,
- 1)
+ : BC_Window(_(PROGRAM_NAME ": Scan confirm"),
+ x, y, 350, BC_OKButton::calculate_h() + 130,
+ 0, 0, 0, 0, 1)
{
this->gui = gui;
}
void ConfirmScan::create_objects()
{
+ lock_window("ConfirmScan::create_objects");
int x = 10, y = 10;
int y2 = 0, x2 = 0;
BC_Title *title;
add_subwindow(new BC_OKButton(this));
add_subwindow(new BC_CancelButton(this));
show_window();
+ unlock_window();
}
-
-
-
-
-
-
ConfirmScanThread::ConfirmScanThread(ChannelEditWindow *gui)
: BC_DialogThread()
{
progress = new BC_ProgressBox(
edit->channel_picker->parent_window->get_abs_cursor_x(1),
edit->channel_picker->parent_window->get_abs_cursor_y(1),
- "Scanning",
+ _("Scanning"),
chanlists[edit->scan_params.freqtable].count);
progress->start();
char string[BCTEXTLEN];
sprintf(edit->scan_params.title, "%s",
chanlists[edit->scan_params.freqtable].list[i].name);
- sprintf(string, "Scanning %s", edit->scan_params.title);
+ sprintf(string, _("Scanning %s"), edit->scan_params.title);
progress->update_title(string, 1);
progress->update(i, 1);
edit->channel_picker->set_channel(&edit->scan_params);
edit->window->update_list();
edit->window->unlock_window();
}
+ edit->window->set_done(interrupt || progress->is_cancelled() ? 1 : 0);
}
ChannelEditEditWindow::ChannelEditEditWindow(ChannelEditEditThread *thread,
ChannelEditWindow *window,
ChannelPicker *channel_picker)
- : BC_Window(PROGRAM_NAME ": Edit Channel",
+ : BC_Window(_(PROGRAM_NAME ": Edit Channel"),
channel_picker->parent_window->get_abs_cursor_x(1),
channel_picker->parent_window->get_abs_cursor_y(1),
- 390,
- 300,
- 390,
- 300,
- 0,
- 0,
- 1)
+ 390, 300, 390, 300, 0, 0, 1)
{
this->channel_picker = channel_picker;
this->window = window;
ChannelEditEditWindow::~ChannelEditEditWindow()
{
}
+
void ChannelEditEditWindow::create_objects(Channel *channel)
{
+ lock_window("ChannelEditEditWindow::create_objects");
this->new_channel = channel;
Channel *channel_usage = channel_picker->get_channel_usage();
title_text = 0;
// !channel_usage->use_norm &&
// !channel_usage->use_input))
// {
-// add_subwindow(new BC_Title(x, y, "Device has no input selection."));
+// add_subwindow(new BC_Title(x, y, MSG_NO_INP_SELECTION));
// y += 30;
// }
// else
x += 200;
add_subwindow(new BC_CancelButton(this));
show_window();
+ unlock_window();
}
ChannelEditEditTitle::ChannelEditEditTitle(int x,
ChannelEditPictureWindow::ChannelEditPictureWindow(ChannelEditPictureThread *thread,
ChannelPicker *channel_picker)
- : BC_Window(PROGRAM_NAME ": Picture",
+ : BC_Window(_(PROGRAM_NAME ": Picture"),
channel_picker->mwindow->session->picture_x,
channel_picker->mwindow->session->picture_y,
- calculate_w(channel_picker),
- calculate_h(channel_picker),
- calculate_w(channel_picker),
- calculate_h(channel_picker))
+ calculate_w(channel_picker), calculate_h(channel_picker),
+ calculate_w(channel_picker), calculate_h(channel_picker))
{
this->thread = thread;
this->channel_picker = channel_picker;
{
PictureConfig *picture_usage = channel_picker->get_picture_usage();
int pad = BC_Pot::calculate_h();
- int result = 20 +
- channel_picker->parent_window->get_text_height(MEDIUMFONT) + 5 +
- BC_OKButton::calculate_h();
+ int text_h = channel_picker->parent_window->get_text_height(MEDIUMFONT);
+ int result = 20 + text_h + 5 + BC_OKButton::calculate_h();
// Only used for Video4Linux 1
- if(picture_usage)
+ if( !picture_usage || (
+ !picture_usage->use_brightness &&
+ !picture_usage->use_contrast &&
+ !picture_usage->use_color &&
+ !picture_usage->use_hue &&
+ !picture_usage->use_whiteness &&
+ !channel_picker->get_controls() ) ) {
+ result += BC_Title::calculate_h(channel_picker->parent_window,
+ MSG_NO_PIC_CONTROLS);
+ }
+ else
{
if(picture_usage->use_brightness)
result += pad;
!channel_picker->get_controls()))
{
result = BC_Title::calculate_w(channel_picker->parent_window,
- "Device has no picture controls." +
- 2 * widget_border);
+ MSG_NO_PIC_CONTROLS) + 20;
}
// Only used for Video4Linux 1
{
if(picture_usage->use_brightness)
{
- int new_w = BC_Title::calculate_w(channel_picker->parent_window, "Brightness:") + pad;
+ int new_w = BC_Title::calculate_w(channel_picker->parent_window, _("Brightness:")) + pad;
result = MAX(result, new_w);
}
if(picture_usage->use_contrast)
{
- int new_w = BC_Title::calculate_w(channel_picker->parent_window, "Contrast:") + pad;
+ int new_w = BC_Title::calculate_w(channel_picker->parent_window, _("Contrast:")) + pad;
result = MAX(result, new_w);
}
if(picture_usage->use_color)
{
- int new_w = BC_Title::calculate_w(channel_picker->parent_window, "Color:") + pad;
+ int new_w = BC_Title::calculate_w(channel_picker->parent_window, _("Color:")) + pad;
result = MAX(result, new_w);
}
if(picture_usage->use_hue)
{
- int new_w = BC_Title::calculate_w(channel_picker->parent_window, "Hue:") + pad;
+ int new_w = BC_Title::calculate_w(channel_picker->parent_window, _("Hue:")) + pad;
result = MAX(result, new_w);
}
if(picture_usage->use_whiteness)
{
- int new_w = BC_Title::calculate_w(channel_picker->parent_window, "Whiteness:") + pad;
+ int new_w = BC_Title::calculate_w(channel_picker->parent_window, _("Whiteness:")) + pad;
result = MAX(result, new_w);
}
}
void ChannelEditPictureWindow::create_objects()
{
+ lock_window("ChannelEditPictureWindow::create_objects");
int x = 10, y = 10;
int widget_border = ((Theme*)channel_picker->get_theme())->widget_border;
int x1 = get_w() - BC_Pot::calculate_w() * 2 - widget_border * 2;
!picture_usage->use_whiteness &&
!channel_picker->get_controls()))
{
- add_subwindow(new BC_Title(x, y, "Device has no picture controls."));
+ add_subwindow(new BC_Title(x, y, MSG_NO_PIC_CONTROLS));
y += 50;
}
y += pad;
add_subwindow(new BC_OKButton(this));
show_window();
+ unlock_window();
}
int ChannelEditPictureWindow::translation_event()