Ejemplo n.º 1
0
void StretchTextEdit::focusOutEvent(QFocusEvent *e)
{
    emit focusOut();
    QTextEdit::focusOutEvent(e);
}
Ejemplo n.º 2
0
		void focusOutEvent(QFocusEvent *event)
		{
			this->QLineEdit::focusOutEvent(event);
			emit focusOut();
		}
Ejemplo n.º 3
0
PageInput::PageInput(MainWindow* main_window)
	: QWidget(main_window->centralWidget()) {

	m_main_window = main_window;

	m_grabbing = false;
	m_selecting_window = false;

	m_profile_box = new ProfileBox(this, "input-profiles", &LoadProfileSettingsCallback, &SaveProfileSettingsCallback, this);

	QGroupBox *groupbox_video = new QGroupBox(tr("Video input"), this);
	{
		m_buttongroup_video_area = new QButtonGroup(groupbox_video);
		QRadioButton *radio_area_screen = new QRadioButton(tr("Record the entire screen"), groupbox_video);
		QRadioButton *radio_area_fixed = new QRadioButton(tr("Record a fixed rectangle"), groupbox_video);
		QRadioButton *radio_area_cursor = new QRadioButton(tr("Follow the cursor"), groupbox_video);
		QRadioButton *radio_area_glinject = new QRadioButton(tr("Record OpenGL (experimental)"), groupbox_video);
		m_buttongroup_video_area->addButton(radio_area_screen, VIDEO_AREA_SCREEN);
		m_buttongroup_video_area->addButton(radio_area_fixed, VIDEO_AREA_FIXED);
		m_buttongroup_video_area->addButton(radio_area_cursor, VIDEO_AREA_CURSOR);
		m_buttongroup_video_area->addButton(radio_area_glinject, VIDEO_AREA_GLINJECT);
		m_combobox_screens = new QComboBoxWithSignal(groupbox_video);
		m_combobox_screens->setToolTip(tr("Select what monitor should be recorded in a multi-monitor configuration."));
		m_pushbutton_video_select_rectangle = new QPushButton(tr("Select rectangle..."), groupbox_video);
		m_pushbutton_video_select_rectangle->setToolTip(tr("Use the mouse to select the recorded rectangle."));
		m_pushbutton_video_select_window = new QPushButton(tr("Select window..."), groupbox_video);
		m_pushbutton_video_select_window->setToolTip(tr("Use the mouse to select a window to record.\n"
														"Hint: If you click the border of a window, the entire window will be recorded (including the borders). Otherwise only\n"
														"the client area of the window will be recorded."));
		m_pushbutton_video_opengl_settings = new QPushButton(tr("OpenGL settings..."), groupbox_video);
		m_pushbutton_video_opengl_settings->setToolTip(tr("Change the settings for OpenGL recording."));
		m_label_video_x = new QLabel(tr("Left:"), groupbox_video);
		m_spinbox_video_x = new QSpinBoxWithSignal(groupbox_video);
		m_spinbox_video_x->setRange(0, 10000);
		m_spinbox_video_x->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_spinbox_video_x->setToolTip(tr("The x coordinate of the upper-left corner of the recorded rectangle.\n"
										 "Hint: You can also change this value with the scroll wheel or the up/down arrows."));
		m_label_video_y = new QLabel(tr("Top:"), groupbox_video);
		m_spinbox_video_y = new QSpinBoxWithSignal(groupbox_video);
		m_spinbox_video_y->setRange(0, 10000);
		m_spinbox_video_y->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_spinbox_video_y->setToolTip(tr("The y coordinate of the upper-left corner of the recorded rectangle.\n"
										 "Hint: You can also change this value with the scroll wheel or the up/down arrows."));
		m_label_video_w = new QLabel(tr("Width:"), groupbox_video);
		m_spinbox_video_w = new QSpinBoxWithSignal(groupbox_video);
		m_spinbox_video_w->setRange(0, 10000);
		m_spinbox_video_w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_spinbox_video_w->setToolTip(tr("The width of the recorded rectangle.\n"
										 "Hint: You can also change this value with the scroll wheel or the up/down arrows."));
		m_label_video_h = new QLabel(tr("Height:"), groupbox_video);
		m_spinbox_video_h = new QSpinBoxWithSignal(groupbox_video);
		m_spinbox_video_h->setRange(0, 10000);
		m_spinbox_video_h->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_spinbox_video_h->setToolTip(tr("The height of the recorded rectangle.\n"
										 "Hint: You can also change this value with the scroll wheel or the up/down arrows."));
		QLabel *label_frame_rate = new QLabel(tr("Frame rate:"), groupbox_video);
		m_spinbox_video_frame_rate = new QSpinBox(groupbox_video);
		m_spinbox_video_frame_rate->setRange(1, 1000);
		m_spinbox_video_frame_rate->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_spinbox_video_frame_rate->setToolTip(tr("The number of frames per second in the final video. Higher frame rates use more CPU time."));
		m_checkbox_scale = new QCheckBox(tr("Scale video"), groupbox_video);
		m_checkbox_scale->setToolTip(tr("Enable or disable scaling. Scaling uses more CPU time, but if the scaled video is smaller, it could make the encoding faster."));
		m_label_video_scaled_w = new QLabel(tr("Scaled width:"), groupbox_video);
		m_spinbox_video_scaled_w = new QSpinBox(groupbox_video);
		m_spinbox_video_scaled_w->setRange(0, 10000);
		m_spinbox_video_scaled_w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_label_video_scaled_h = new QLabel(tr("Scaled height:"), groupbox_video);
		m_spinbox_video_scaled_h = new QSpinBox(groupbox_video);
		m_spinbox_video_scaled_h->setRange(0, 10000);
		m_spinbox_video_scaled_h->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_checkbox_record_cursor = new QCheckBox(tr("Record cursor"), groupbox_video);

		connect(m_buttongroup_video_area, SIGNAL(buttonClicked(int)), this, SLOT(OnUpdateVideoAreaFields()));
		connect(m_combobox_screens, SIGNAL(activated(int)), this, SLOT(OnUpdateVideoAreaFields()));
		connect(m_combobox_screens, SIGNAL(popupShown()), this, SLOT(OnIdentifyScreens()));
		connect(m_combobox_screens, SIGNAL(popupHidden()), this, SLOT(OnStopIdentifyScreens()));
		connect(m_spinbox_video_x, SIGNAL(focusIn()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_x, SIGNAL(focusOut()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_x, SIGNAL(valueChanged(int)), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_y, SIGNAL(focusIn()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_y, SIGNAL(focusOut()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_y, SIGNAL(valueChanged(int)), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_w, SIGNAL(focusIn()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_w, SIGNAL(focusOut()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_w, SIGNAL(valueChanged(int)), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_h, SIGNAL(focusIn()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_h, SIGNAL(focusOut()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_h, SIGNAL(valueChanged(int)), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_pushbutton_video_select_rectangle, SIGNAL(clicked()), this, SLOT(OnStartSelectRectangle()));
		connect(m_pushbutton_video_select_window, SIGNAL(clicked()), this, SLOT(OnStartSelectWindow()));
		connect(m_pushbutton_video_opengl_settings, SIGNAL(clicked()), this, SLOT(OnGLInjectDialog()));
		connect(m_checkbox_scale, SIGNAL(clicked()), this, SLOT(OnUpdateVideoScaleFields()));

		QVBoxLayout *layout = new QVBoxLayout(groupbox_video);
		{
			QHBoxLayout *layout2 = new QHBoxLayout();
			layout->addLayout(layout2);
			layout2->addWidget(radio_area_screen);
			layout2->addWidget(m_combobox_screens);
		}
		layout->addWidget(radio_area_fixed);
		layout->addWidget(radio_area_cursor);
		layout->addWidget(radio_area_glinject);
		{
			QHBoxLayout *layout2 = new QHBoxLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_pushbutton_video_select_rectangle);
			layout2->addWidget(m_pushbutton_video_select_window);
			layout2->addWidget(m_pushbutton_video_opengl_settings);
			layout2->addStretch();
		}
		{
			QGridLayout *layout2 = new QGridLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_label_video_x, 0, 0);
			layout2->addWidget(m_spinbox_video_x, 0, 1);
			layout2->addWidget(m_label_video_y, 0, 2);
			layout2->addWidget(m_spinbox_video_y, 0, 3);
			layout2->addWidget(m_label_video_w, 1, 0);
			layout2->addWidget(m_spinbox_video_w, 1, 1);
			layout2->addWidget(m_label_video_h, 1, 2);
			layout2->addWidget(m_spinbox_video_h, 1, 3);
		}
		{
			QGridLayout *layout2 = new QGridLayout();
			layout->addLayout(layout2);
			layout2->addWidget(label_frame_rate, 0, 0);
			layout2->addWidget(m_spinbox_video_frame_rate, 0, 1);
		}
		layout->addWidget(m_checkbox_scale);
		{
			QGridLayout *layout2 = new QGridLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_label_video_scaled_w, 0, 0);
			layout2->addWidget(m_spinbox_video_scaled_w, 0, 1);
			layout2->addWidget(m_label_video_scaled_h, 0, 2);
			layout2->addWidget(m_spinbox_video_scaled_h, 0, 3);
		}
		layout->addWidget(m_checkbox_record_cursor);
	}
	QGroupBox *groupbox_audio = new QGroupBox(tr("Audio input"), this);
	{
		m_checkbox_audio_enable = new QCheckBox(tr("Record audio"), groupbox_audio);
		m_label_audio_backend = new QLabel(tr("Backend:"), groupbox_audio);
		m_combobox_audio_backend = new QComboBox(groupbox_audio);
		m_combobox_audio_backend->addItem("ALSA");
#if SSR_USE_PULSEAUDIO
		m_combobox_audio_backend->addItem("PulseAudio");
#endif
#if SSR_USE_JACK
		m_combobox_audio_backend->addItem("JACK");
#endif
		m_combobox_audio_backend->setToolTip(tr("The audio backend that will be used for recording.\n"
												"The ALSA backend will also work on systems that use PulseAudio, but it is better to use the PulseAudio backend directly."));
		m_label_alsa_source = new QLabel(tr("Source:"), groupbox_audio);
		m_combobox_alsa_source = new QComboBox(groupbox_audio);
		m_combobox_alsa_source->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_combobox_alsa_source->setToolTip(tr("The ALSA source that will be used for recording.\n"
											  "The default is usually fine. The 'shared' sources allow multiple programs to record at the same time, but they may be less reliable."));
		m_pushbutton_alsa_refresh = new QPushButton(tr("Refresh"), groupbox_audio);
		m_pushbutton_alsa_refresh->setToolTip(tr("Refreshes the list of ALSA sources."));
#if SSR_USE_PULSEAUDIO
		m_label_pulseaudio_source = new QLabel(tr("Source:"), groupbox_audio);
		m_combobox_pulseaudio_source = new QComboBox(groupbox_audio);
		m_combobox_pulseaudio_source->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_combobox_pulseaudio_source->setToolTip(tr("The PulseAudio source that will be used for recording.\n"
													"A 'monitor' is a source that records the audio played by other applications.", "Don't translate 'monitor' unless PulseAudio does this as well"));
		m_pushbutton_pulseaudio_refresh = new QPushButton(tr("Refresh"), groupbox_audio);
		m_pushbutton_pulseaudio_refresh->setToolTip(tr("Refreshes the list of PulseAudio sources."));
#endif
#if SSR_USE_JACK
		m_checkbox_jack_connect_system_capture = new QCheckBox(tr("Record system microphone"));
		m_checkbox_jack_connect_system_capture->setToolTip(tr("If checked, the ports will be automatically connected to the system capture ports."));
		m_checkbox_jack_connect_system_playback = new QCheckBox(tr("Record system speakers"));
		m_checkbox_jack_connect_system_playback->setToolTip(tr("If checked, the ports will be automatically connected to anything that connects to the system playback ports."));
#endif

		connect(m_checkbox_audio_enable, SIGNAL(clicked()), this, SLOT(OnUpdateAudioFields()));
		connect(m_combobox_audio_backend, SIGNAL(activated(int)), this, SLOT(OnUpdateAudioFields()));
		connect(m_pushbutton_alsa_refresh, SIGNAL(clicked()), this, SLOT(OnUpdateALSASources()));
#if SSR_USE_PULSEAUDIO
		connect(m_pushbutton_pulseaudio_refresh, SIGNAL(clicked()), this, SLOT(OnUpdatePulseAudioSources()));
#endif

		QVBoxLayout *layout = new QVBoxLayout(groupbox_audio);
		layout->addWidget(m_checkbox_audio_enable);
		{
			QGridLayout *layout2 = new QGridLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_label_audio_backend, 0, 0);
			layout2->addWidget(m_combobox_audio_backend, 0, 1, 1, 2);
			layout2->addWidget(m_label_alsa_source, 2, 0);
			layout2->addWidget(m_combobox_alsa_source, 2, 1);
			layout2->addWidget(m_pushbutton_alsa_refresh, 2, 2);
#if SSR_USE_PULSEAUDIO
			layout2->addWidget(m_label_pulseaudio_source, 2, 0);
			layout2->addWidget(m_combobox_pulseaudio_source, 2, 1);
			layout2->addWidget(m_pushbutton_pulseaudio_refresh, 2, 2);
#endif
		}
#if SSR_USE_JACK
		{
			QHBoxLayout *layout2 = new QHBoxLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_checkbox_jack_connect_system_capture);
			layout2->addWidget(m_checkbox_jack_connect_system_playback);
		}
#endif
	}
	QPushButton *button_back = new QPushButton(QIcon::fromTheme("go-previous"), tr("Back"), this);
	QPushButton *button_continue = new QPushButton(QIcon::fromTheme("go-next"), tr("Continue"), this);

	connect(button_back, SIGNAL(clicked()), m_main_window, SLOT(GoPageWelcome()));
	connect(button_continue, SIGNAL(clicked()), this, SLOT(OnContinue()));

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(m_profile_box);
	layout->addWidget(groupbox_video);
	layout->addWidget(groupbox_audio);
	layout->addStretch();
	{
		QHBoxLayout *layout2 = new QHBoxLayout();
		layout->addLayout(layout2);
		layout2->addWidget(button_back);
		layout2->addWidget(button_continue);
	}

	connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(OnUpdateScreenConfiguration()));
	connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(OnUpdateScreenConfiguration()));

	LoadScreenConfigurations();
	LoadALSASources();
#if SSR_USE_PULSEAUDIO
	LoadPulseAudioSources();
#endif

	OnUpdateVideoAreaFields();
	OnUpdateVideoScaleFields();
	OnUpdateAudioFields();

}
Ejemplo n.º 4
0
TLMEditor::TLMEditor(ModelWidget *pModelWidget)
  : BaseEditor(pModelWidget), mTextChanged(false)
{
  connect(this, SIGNAL(focusOut()), mpModelWidget, SLOT(TLMEditorTextChanged()));
}
Ejemplo n.º 5
0
	SearchWidget::SearchWidget(int _offset, bool _isWithButton, QWidget* _parent)
        : QWidget(_parent)
	{
        if (this->objectName().isEmpty())
            this->setObjectName(QStringLiteral("search_widget"));
        active_ = false;
        parent_search_vertical_layout_ = new QVBoxLayout(this);
        parent_search_vertical_layout_->setContentsMargins(0, 0, 0, 0);
        parent_search_vertical_layout_->setSpacing(0);
        horizontal_search_layout_ = new QHBoxLayout();
        horizontal_search_layout_->setContentsMargins(0, 0, 0, Utils::scale_value(0));
        parent_search_vertical_layout_->addLayout(horizontal_search_layout_);

        horizontal_search_layout_->addSpacing(Utils::scale_value(_offset - 8));

        search_icon_ = new Ui::CustomButton(this, ":/resources/contr_search_100.png");
        search_icon_->setOffsets(Utils::scale_value(8), Utils::scale_value(0));
        search_icon_->setActiveImage(":/resources/contr_search_100_active.png");
        search_icon_->setFixedWidth(Utils::scale_value(34));
        search_icon_->setFixedHeight(Utils::scale_value(53));
        search_icon_->setStyleSheet("border: none;");
        horizontal_search_layout_->addWidget(search_icon_);

        parent_widget_ = new QWidget(this);
        search_vertical_layout_ = new QVBoxLayout(parent_widget_);
        search_vertical_layout_->setContentsMargins(0, Utils::scale_value(5), 0, 0);
        search_edit_ = new LineEditEx(this);
        search_edit_->setProperty("SearchEdit", true);
        search_edit_->setPlaceholderText(QT_TRANSLATE_NOOP("search_widget", "Search"));
        search_edit_->setContentsMargins(Utils::scale_value(6), 0, Utils::scale_value(22), 0);
        search_edit_->setAttribute(Qt::WA_MacShowFocusRect, false);
        search_edit_->setStyleSheet(QString("background-color: transparent"));
        Testing::setAccessibleName(search_edit_, "search_edit");
        search_vertical_layout_->addSpacing(Utils::scale_value(0));
        search_vertical_layout_->addWidget(search_edit_);
        horizontal_search_layout_->addWidget(parent_widget_);

        search_edit_icon_ = new CustomButton(this, ":/resources/contr_compose_100.png");
        search_edit_icon_->setOffsets(Utils::scale_value(0), Utils::scale_value(0));
		search_edit_icon_->setOffsetsForActive(Utils::scale_value(2), Utils::scale_value(0));
        search_edit_icon_->setHoverImage(":/resources/contr_compose_100_hover.png");
        search_edit_icon_->setActiveImage(":/resources/contr_clear_100.png");
        search_edit_icon_->setFixedWidth(Utils::scale_value(50));
        search_edit_icon_->setFixedHeight(Utils::scale_value(53));
		search_edit_icon_->setCursor(Qt::PointingHandCursor);
		search_edit_icon_->setFocusPolicy(Qt::NoFocus);
        search_edit_icon_->setStyleSheet("background-color: transparent;");
        Testing::setAccessibleName(search_edit_icon_, "CreateGroupChat");
		horizontal_search_layout_->addWidget(search_edit_icon_);

        horizontal_line_widget_ = new QWidget(this);
        horizontal_line_widget_->setFixedHeight(Utils::scale_value(1));
        horizontal_line_widget_->setStyleSheet(QString("background-color: #dadada;"));
        parent_search_vertical_layout_->addSpacing(0);
        widget_2_ = new QWidget(this);
        horizontal_layout_2_ = new QHBoxLayout(widget_2_);
        horizontal_layout_2_->setContentsMargins(Utils::scale_value(_isWithButton ? 24 : 16), 0, Utils::scale_value(_isWithButton ? 24 : 60), Utils::scale_value(10));
        horizontal_layout_2_->addWidget(horizontal_line_widget_);
        parent_search_vertical_layout_->addWidget(widget_2_);

        QMetaObject::connectSlotsByName(this);
        connect(search_edit_, SIGNAL(textEdited(QString)), this, SLOT(searchChanged(QString)), Qt::QueuedConnection);
        connect(search_edit_, SIGNAL(clicked()), this, SLOT(searchStarted()), Qt::QueuedConnection);
        connect(search_edit_, SIGNAL(escapePressed()), this, SLOT(searchCompleted()), Qt::QueuedConnection);
        connect(search_edit_, SIGNAL(enter()), this, SLOT(editEnterPressed()), Qt::QueuedConnection);
        connect(search_edit_, SIGNAL(upArrow()), this, SLOT(editUpPressed()), Qt::QueuedConnection);
        connect(search_edit_, SIGNAL(downArrow()), this, SLOT(editDownPressed()), Qt::QueuedConnection);
        connect(search_edit_, SIGNAL(focusOut()), this, SLOT(focusedOut()), Qt::QueuedConnection);
        connect(search_edit_icon_, SIGNAL(clicked()), this, SLOT(clearPressed()), Qt::QueuedConnection);

		setActive(false);
	}
Ejemplo n.º 6
0
void IntLineEdit::focusOutEvent(QFocusEvent *e)
{
    QLineEdit::focusOutEvent(e);
    emit focusOut();
}
Ejemplo n.º 7
0
PageInput::PageInput(MainWindow* main_window)
	: QWidget(main_window->centralWidget()) {

	m_main_window = main_window;

	m_grabbing = false;
	m_selecting_window = false;

	m_glinject_command = "";
	m_glinject_max_megapixels = 0;

	QGroupBox *group_video = new QGroupBox("Video input", this);
	{
		m_buttongroup_video_area = new QButtonGroup(group_video);
		QRadioButton *radio_area_screen = new QRadioButton("Record the entire screen", group_video);
		QRadioButton *radio_area_fixed = new QRadioButton("Record a fixed rectangle", group_video);
		QRadioButton *radio_area_cursor = new QRadioButton("Follow the cursor", group_video);
		QRadioButton *radio_area_glinject = new QRadioButton("Record OpenGL (experimental)", group_video);
		m_buttongroup_video_area->addButton(radio_area_screen, VIDEO_AREA_SCREEN);
		m_buttongroup_video_area->addButton(radio_area_fixed, VIDEO_AREA_FIXED);
		m_buttongroup_video_area->addButton(radio_area_cursor, VIDEO_AREA_CURSOR);
		m_buttongroup_video_area->addButton(radio_area_glinject, VIDEO_AREA_GLINJECT);
		m_combobox_screens = new QComboBoxWithSignal(group_video);
		m_combobox_screens->setToolTip("Select what monitor should be recorded in a multi-monitor configuration.");
		m_pushbutton_video_select_rectangle = new QPushButton("Select rectangle...", group_video);
		m_pushbutton_video_select_rectangle->setToolTip("Use the mouse to select the recorded rectangle.");
		m_pushbutton_video_select_window = new QPushButton("Select window...", group_video);
		m_pushbutton_video_select_window->setToolTip("Use the mouse to select a window to record.\n"
													 "Hint: If you click the border of a window, the entire window will be recorded (including the borders). Otherwise only\n"
													 "the client area of the window will be recorded.");
		m_pushbutton_video_opengl_settings = new QPushButton("OpenGL settings...", group_video);
		m_pushbutton_video_opengl_settings->setToolTip("Change the settings for OpenGL recording.");
		m_label_video_x = new QLabel("Left:", group_video);
		m_spinbox_video_x = new QSpinBoxWithSignal(group_video);
		m_spinbox_video_x->setRange(0, 10000);
		m_spinbox_video_x->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_spinbox_video_x->setToolTip("The x coordinate of the upper-left corner of the recorded rectangle.\n"
									  "Hint: You can also change this value with the scroll wheel or the up/down arrows.");
		m_label_video_y = new QLabel("Top:", group_video);
		m_spinbox_video_y = new QSpinBoxWithSignal(group_video);
		m_spinbox_video_y->setRange(0, 10000);
		m_spinbox_video_y->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_spinbox_video_y->setToolTip("The y coordinate of the upper-left corner of the recorded rectangle.\n"
									  "Hint: You can also change this value with the scroll wheel or the up/down arrows.");
		m_label_video_w = new QLabel("Width:", group_video);
		m_spinbox_video_w = new QSpinBoxWithSignal(group_video);
		m_spinbox_video_w->setRange(0, 10000);
		m_spinbox_video_w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_spinbox_video_w->setToolTip("The width of the recorded rectangle.\n"
									  "Hint: You can also change this value with the scroll wheel or the up/down arrows.");
		m_label_video_h = new QLabel("Height:", group_video);
		m_spinbox_video_h = new QSpinBoxWithSignal(group_video);
		m_spinbox_video_h->setRange(0, 10000);
		m_spinbox_video_h->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_spinbox_video_h->setToolTip("The height of the recorded rectangle.\n"
									  "Hint: You can also change this value with the scroll wheel or the up/down arrows.");
		QLabel *label_frame_rate = new QLabel("Frame rate:", group_video);
		m_spinbox_video_frame_rate = new QSpinBox(group_video);
		m_spinbox_video_frame_rate->setRange(1, 1000);
		m_spinbox_video_frame_rate->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_spinbox_video_frame_rate->setToolTip("The number of frames per second in the final video. Higher frame rates use more CPU time.");
		m_checkbox_scale = new QCheckBox("Scale video", group_video);
		m_checkbox_scale->setToolTip("Enable or disable scaling. Scaling uses more CPU time, but if the scaled video is smaller, it could make the encoding faster.");
		m_label_video_scaled_w = new QLabel("Scaled width:", group_video);
		m_spinbox_video_scaled_w = new QSpinBox(group_video);
		m_spinbox_video_scaled_w->setRange(0, 10000);
		m_spinbox_video_scaled_w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_label_video_scaled_h = new QLabel("Scaled height:", group_video);
		m_spinbox_video_scaled_h = new QSpinBox(group_video);
		m_spinbox_video_scaled_h->setRange(0, 10000);
		m_spinbox_video_scaled_h->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_checkbox_record_cursor = new QCheckBox("Record cursor", group_video);

		connect(m_buttongroup_video_area, SIGNAL(buttonClicked(int)), this, SLOT(OnUpdateVideoAreaFields()));
		connect(m_combobox_screens, SIGNAL(activated(int)), this, SLOT(OnUpdateVideoAreaFields()));
		connect(m_combobox_screens, SIGNAL(popupShown()), this, SLOT(OnIdentifyScreens()));
		connect(m_combobox_screens, SIGNAL(popupHidden()), this, SLOT(OnStopIdentifyScreens()));
		connect(m_spinbox_video_x, SIGNAL(focusIn()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_x, SIGNAL(focusOut()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_x, SIGNAL(valueChanged(int)), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_y, SIGNAL(focusIn()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_y, SIGNAL(focusOut()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_y, SIGNAL(valueChanged(int)), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_w, SIGNAL(focusIn()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_w, SIGNAL(focusOut()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_w, SIGNAL(valueChanged(int)), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_h, SIGNAL(focusIn()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_h, SIGNAL(focusOut()), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_spinbox_video_h, SIGNAL(valueChanged(int)), this, SLOT(OnUpdateRecordingFrame()));
		connect(m_pushbutton_video_select_rectangle, SIGNAL(clicked()), this, SLOT(OnStartSelectRectangle()));
		connect(m_pushbutton_video_select_window, SIGNAL(clicked()), this, SLOT(OnStartSelectWindow()));
		connect(m_pushbutton_video_opengl_settings, SIGNAL(clicked()), this, SLOT(OnGLInjectDialog()));
		connect(m_checkbox_scale, SIGNAL(clicked()), this, SLOT(OnUpdateVideoScaleFields()));

		QVBoxLayout *layout = new QVBoxLayout(group_video);
		{
			QHBoxLayout *layout2 = new QHBoxLayout();
			layout->addLayout(layout2);
			layout2->addWidget(radio_area_screen);
			layout2->addWidget(m_combobox_screens);
		}
		layout->addWidget(radio_area_fixed);
		layout->addWidget(radio_area_cursor);
		layout->addWidget(radio_area_glinject);
		{
			QHBoxLayout *layout2 = new QHBoxLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_pushbutton_video_select_rectangle);
			layout2->addWidget(m_pushbutton_video_select_window);
			layout2->addWidget(m_pushbutton_video_opengl_settings);
			layout2->addStretch();
		}
		{
			QGridLayout *layout2 = new QGridLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_label_video_x, 0, 0);
			layout2->addWidget(m_spinbox_video_x, 0, 1);
			layout2->addWidget(m_label_video_y, 0, 2);
			layout2->addWidget(m_spinbox_video_y, 0, 3);
			layout2->addWidget(m_label_video_w, 1, 0);
			layout2->addWidget(m_spinbox_video_w, 1, 1);
			layout2->addWidget(m_label_video_h, 1, 2);
			layout2->addWidget(m_spinbox_video_h, 1, 3);
		}
		{
			QGridLayout *layout2 = new QGridLayout();
			layout->addLayout(layout2);
			layout2->addWidget(label_frame_rate, 0, 0);
			layout2->addWidget(m_spinbox_video_frame_rate, 0, 1);
		}
		layout->addWidget(m_checkbox_scale);
		{
			QGridLayout *layout2 = new QGridLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_label_video_scaled_w, 0, 0);
			layout2->addWidget(m_spinbox_video_scaled_w, 0, 1);
			layout2->addWidget(m_label_video_scaled_h, 0, 2);
			layout2->addWidget(m_spinbox_video_scaled_h, 0, 3);
		}
		layout->addWidget(m_checkbox_record_cursor);
	}
	QGroupBox *group_audio = new QGroupBox("Audio input", this);
	{
		m_checkbox_audio_enable = new QCheckBox("Record microphone", group_audio);
		m_label_audio_backend = new QLabel("Backend:", group_audio);
		m_combobox_audio_backend = new QComboBox(group_audio);
		m_combobox_audio_backend->addItem("ALSA");
		m_combobox_audio_backend->addItem("PulseAudio");
		m_combobox_audio_backend->setToolTip("The audio backend that will be used for recording.\n"
											 "The ALSA backend will also work on systems that use PulseAudio, but it is better to use the PulseAudio backend directly.");
		m_label_alsa_device = new QLabel("Device:", group_audio);
		m_lineedit_alsa_device = new QLineEdit(group_audio);
		m_lineedit_alsa_device->setToolTip("The ALSA device that will be used for recording. Normally this should be 'default'.\n"
										   "You can change this to something like plughw:0,0 (which means sound card 0 input 0 with plugins enabled).");
		m_label_pulseaudio_source = new QLabel("Source:", group_audio);
		m_combobox_pulseaudio_source = new QComboBox(group_audio);
		m_combobox_pulseaudio_source->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
		m_combobox_pulseaudio_source->setToolTip("The PulseAudio source that will be used for recording.\n"
												 "A 'monitor' is a source that records the audio played by other applications.");
		m_pushbutton_pulseaudio_refresh = new QPushButton("Refresh", group_audio);
		m_pushbutton_pulseaudio_refresh->setToolTip("Refreshes the list of PulseAudio sources.");

		connect(m_checkbox_audio_enable, SIGNAL(clicked()), this, SLOT(OnUpdateAudioFields()));
		connect(m_combobox_audio_backend, SIGNAL(activated(int)), this, SLOT(OnUpdateAudioFields()));
		connect(m_pushbutton_pulseaudio_refresh, SIGNAL(clicked()), this, SLOT(OnUpdatePulseAudioSources()));

		QVBoxLayout *layout = new QVBoxLayout(group_audio);
		layout->addWidget(m_checkbox_audio_enable);
		{
			QGridLayout *layout2 = new QGridLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_label_audio_backend, 0, 0);
			layout2->addWidget(m_combobox_audio_backend, 0, 1, 1, 2);
			layout2->addWidget(m_label_alsa_device, 1, 0);
			layout2->addWidget(m_lineedit_alsa_device, 1, 1, 1, 2);
			layout2->addWidget(m_label_pulseaudio_source, 2, 0);
			layout2->addWidget(m_combobox_pulseaudio_source, 2, 1);
			layout2->addWidget(m_pushbutton_pulseaudio_refresh, 2, 2);
		}
	}
	QPushButton *button_back = new QPushButton(QIcon::fromTheme("go-previous"), "Back", this);
	QPushButton *button_continue = new QPushButton(QIcon::fromTheme("go-next"), "Continue", this);

	connect(button_back, SIGNAL(clicked()), m_main_window, SLOT(GoPageWelcome()));
	connect(button_continue, SIGNAL(clicked()), this, SLOT(OnContinue()));

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(group_video);
	layout->addWidget(group_audio);
	layout->addStretch();
	{
		QHBoxLayout *layout2 = new QHBoxLayout();
		layout->addLayout(layout2);
		layout2->addWidget(button_back);
		layout2->addWidget(button_continue);
	}

	connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(OnUpdateScreenConfiguration()));
	connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(OnUpdateScreenConfiguration()));
	LoadScreenConfigurations();
	LoadPulseAudioSources();

	OnUpdateVideoAreaFields();
	OnUpdateVideoScaleFields();
	OnUpdateAudioFields();

}
Ejemplo n.º 8
0
void LogEdit::focusOutEvent( QFocusEvent *e ) {
    emit focusOut();
    QWidget::focusOutEvent(e);
}
Ejemplo n.º 9
0
void
Engine::FocusOut()
{
    focusOut();
}
Ejemplo n.º 10
0
void ParupaintChatInput::focusOutEvent(QFocusEvent* e)
{
	emit focusOut();
	this->QLineEdit::focusOutEvent(e);
}
Ejemplo n.º 11
0
void QG_CommandEdit::focusOutEvent(QFocusEvent *e) {
	emit focusOut();
	QLineEdit::focusOutEvent(e);
}
Ejemplo n.º 12
0
void SchematicName::focusOutEvent(QFocusEvent *fe) {
  qApp->removeEventFilter(this);
  if (fe->reason() == Qt::MouseFocusReason) emit focusOut();
}
Ejemplo n.º 13
0
void TextItem::focusOutEvent(QFocusEvent* event)
{
    emit focusOut();
}
Ejemplo n.º 14
0
void TikzEditor::focusOutEvent(QFocusEvent *event)
{
	emit focusOut();
	QPlainTextEdit::focusOutEvent(event);
}
Ejemplo n.º 15
0
void CharLineEdit::focusOutEvent(QFocusEvent* event)
{
	QLineEdit::focusOutEvent(event);

	emit focusOut(event);
}
Ejemplo n.º 16
0
void PEMetadataView::initMetadata(const QDomDocument & doc) 
{
    QWidget * widget = QApplication::focusWidget();
    if (widget) {
        QList<QWidget *> children = m_mainFrame->findChildren<QWidget *>();
        if (children.contains(widget)) {
            widget->blockSignals(true);
        }
    }

    if (m_mainFrame) {
        this->setWidget(NULL);
        delete m_mainFrame;
        m_mainFrame = NULL;
    }

    QDomElement root = doc.documentElement();
    QDomElement label = root.firstChildElement("label");
    QDomElement author = root.firstChildElement("author");
    QDomElement descr = root.firstChildElement("description");
    QDomElement title = root.firstChildElement("title");
    QDomElement date = root.firstChildElement("date");
    QDomElement url = root.firstChildElement("url");

	QStringList readOnlyKeys;
    QHash<QString, QString> tagHash;    
    QDomElement tags = root.firstChildElement("tags");
    QDomElement tag = tags.firstChildElement("tag");
    while (!tag.isNull()) {
        tagHash.insert(tag.text(), "");
        tag = tag.nextSiblingElement("tag");
    }

    QString family;
    QString variant;

    QHash<QString, QString> propertyHash;    
    QDomElement properties = root.firstChildElement("properties");
    QDomElement prop = properties.firstChildElement("property");
    while (!prop.isNull()) {
        QString name = prop.attribute("name");
        QString value = prop.text();
        if (name.compare("family", Qt::CaseInsensitive) == 0) {
            family = value;
        }
        else if (name.compare("variant", Qt::CaseInsensitive) == 0) {
            variant = value;
        }
        else {
            propertyHash.insert(name, value);
        }

        prop = prop.nextSiblingElement("property");
    }


	m_mainFrame = new QFrame(this);
	m_mainFrame->setObjectName("metadataMainFrame");
	QVBoxLayout *mainLayout = new QVBoxLayout(m_mainFrame);
    mainLayout->setSizeConstraint( QLayout::SetMinAndMaxSize );

    QLabel *explanation = new QLabel(tr("This is where you edit the metadata for the part ..."));
    mainLayout->addWidget(explanation);

    QFormLayout * formLayout = new QFormLayout();
    QFrame * formFrame = new QFrame;
    mainLayout->addWidget(formFrame);

    m_titleEdit = new QLineEdit();
    m_titleEdit->setText(title.text());
	connect(m_titleEdit, SIGNAL(editingFinished()), this, SLOT(titleEntry()));
	m_titleEdit->setObjectName("PartsEditorLineEdit");
    m_titleEdit->setStatusTip(tr("Set the part's title"));
    formLayout->addRow(tr("Title"), m_titleEdit);

    m_dateEdit = new QLineEdit();
    m_dateEdit->setText(date.text());
	connect(m_dateEdit, SIGNAL(editingFinished()), this, SLOT(dateEntry()));
	m_dateEdit->setObjectName("PartsEditorLineEdit");
    m_dateEdit->setStatusTip(tr("Set the part's date"));
    m_dateEdit->setEnabled(false);
    formLayout->addRow(tr("Date"), m_dateEdit);

    m_authorEdit = new QLineEdit();
    m_authorEdit->setText(author.text());
	connect(m_authorEdit, SIGNAL(editingFinished()), this, SLOT(authorEntry()));
	m_authorEdit->setObjectName("PartsEditorLineEdit");
    m_authorEdit->setStatusTip(tr("Set the part's author"));
    formLayout->addRow(tr("Author"), m_authorEdit);

    m_descriptionEdit = new FocusOutTextEdit();
    m_descriptionEdit->setText(descr.text());
	m_descriptionEdit->document()->setModified(false);
	connect(m_descriptionEdit, SIGNAL(focusOut()), this, SLOT(descriptionEntry()));
	m_descriptionEdit->setObjectName("PartsEditorTextEdit");
    m_descriptionEdit->setStatusTip(tr("Set the part's description--you can use simple html (as defined by Qt's Rich Text)"));
    formLayout->addRow(tr("Description"), m_descriptionEdit);

    m_labelEdit = new QLineEdit();
    m_labelEdit->setText(label.text());
	connect(m_labelEdit, SIGNAL(editingFinished()), this, SLOT(labelEntry()));
	m_labelEdit->setObjectName("PartsEditorLineEdit");
    m_labelEdit->setStatusTip(tr("Set the default part label prefix"));
    formLayout->addRow(tr("Label"), m_labelEdit);

    m_urlEdit = new QLineEdit();
    m_urlEdit->setText(url.text());
	connect(m_urlEdit, SIGNAL(editingFinished()), this, SLOT(urlEntry()));
	m_urlEdit->setObjectName("PartsEditorLineEdit");
    m_urlEdit->setStatusTip(tr("Set the part's url if it is described on a web page"));
    formLayout->addRow(tr("URL"), m_urlEdit);

    m_familyEdit = new QLineEdit();
    m_familyEdit->setText(family);
	connect(m_familyEdit, SIGNAL(editingFinished()), this, SLOT(familyEntry()));
	m_familyEdit->setObjectName("PartsEditorLineEdit");
    m_familyEdit->setStatusTip(tr("Set the part's family--what other parts is this part related to"));
    formLayout->addRow(tr("Family"), m_familyEdit);

    m_variantEdit = new QLineEdit();
    m_variantEdit->setText(variant);
	connect(m_variantEdit, SIGNAL(editingFinished()), this, SLOT(variantEntry()));
	m_variantEdit->setObjectName("PartsEditorLineEdit");
    m_variantEdit->setStatusTip(tr("Set the part's variant--this makes it unique from all other parts in the same family"));
    formLayout->addRow(tr("Variant"), m_variantEdit);

    m_propertiesEdit = new HashPopulateWidget("", propertyHash, readOnlyKeys, false, this);
	m_propertiesEdit->setObjectName("PartsEditorPropertiesEdit");
    m_propertiesEdit->setStatusTip(tr("Set the part's properties"));
    connect(m_propertiesEdit, SIGNAL(changed()), this, SLOT(propertiesEntry()));
    formLayout->addRow(tr("Properties"), m_propertiesEdit);

    m_tagsEdit = new HashPopulateWidget("", tagHash, readOnlyKeys, true, this);
	m_tagsEdit->setObjectName("PartsEditorPropertiesEdit");
    m_tagsEdit->setStatusTip(tr("Set the part's tags"));
    connect(m_tagsEdit, SIGNAL(changed()), this, SLOT(tagsEntry()));
    formLayout->addRow(tr("Tags"), m_tagsEdit);

    formFrame->setLayout(formLayout);
    m_mainFrame->setLayout(mainLayout);

    this->setWidget(m_mainFrame);
}
Ejemplo n.º 17
0
void KatapultDisplay::focusOutEvent(QFocusEvent *)
{
	emit focusOut();
}
Ejemplo n.º 18
0
UserView::UserView()
        : UserListBase(NULL)
{
    m_bBlink = false;
    m_bUnreadBlink = false;
    m_bShowOnline = CorePlugin::m_plugin->getShowOnLine();

    setBackgroundMode(NoBackground);
    viewport()->setBackgroundMode(NoBackground);

    mTipItem = NULL;
    m_tip = NULL;
    m_searchTip = NULL;
    m_current = NULL;

    setTreeStepSize(0);

    tipTimer = new QTimer(this);
    connect(tipTimer, SIGNAL(timeout()), this, SLOT(showTip()));
    blinkTimer = new QTimer(this);
    connect(blinkTimer, SIGNAL(timeout()), this, SLOT(blink()));
    unreadTimer = new QTimer(this);
    connect(unreadTimer, SIGNAL(timeout()), this, SLOT(unreadBlink()));

    topLevelWidget()->installEventFilter(this);
    viewport()->installEventFilter(this);

    m_dropContactId = 0;
    m_dropItem = NULL;
    m_searchItem = NULL;

    setFrameStyle(QFrame::Panel);
    setFrameShadow(QFrame::Sunken);
    WindowDef wnd;
    wnd.widget = this;
    wnd.bDown  = true;
    Event e(EventAddWindow, &wnd);
    e.process();
    clear();

    setGroupMode(CorePlugin::m_plugin->getGroupMode(), true);

    edtGroup = new IntLineEdit(viewport());
    edtContact = new IntLineEdit(viewport());
    edtGroup->hide();
    edtContact->hide();
    QFont font(font());
    int size = font.pixelSize();
    if (size <= 0){
        size = font.pointSize();
        font.setPointSize(size * 3 / 4);
    }else{
        font.setPixelSize(size * 3 / 4);
    }
    font.setBold(true);
    edtGroup->setFont(font);
    connect(edtGroup, SIGNAL(escape()), this, SLOT(editEscape()));
    connect(edtGroup, SIGNAL(returnPressed()), this, SLOT(editGroupEnter()));
    connect(edtGroup, SIGNAL(focusOut()), this, SLOT(editGroupEnter()));
    connect(edtContact, SIGNAL(escape()), this, SLOT(editEscape()));
    connect(edtContact, SIGNAL(returnPressed()), this, SLOT(editContactEnter()));
    connect(edtContact, SIGNAL(focusOut()), this, SLOT(editContactEnter()));
}
Ejemplo n.º 19
0
void QSpinBoxWithSignal::focusOutEvent(QFocusEvent* event) {
	emit focusOut();
	QSpinBox::focusOutEvent(event);
}
Ejemplo n.º 20
0
TikzEditorView::TikzEditorView(QWidget *parent) : QWidget(parent)
{
	m_parentWidget = parent;

	m_tikzEditor = new TikzEditor;
	m_tikzEditor->setWhatsThis(tr("<p>Enter your TikZ code here.  "
	    "The code should begin with \\begin{tikzpicture} and end with "
	    "\\end{tikzpicture}.</p>"));
/*
	commandInserter = new TikzCommandInserter(tikzEditor, this);
	tikzHighlighter = new TikzHighlighter(commandInserter, tikzEditor->document());
	tikzHighlighter->rehighlight(); // avoid that textEdit emits the signal contentsChanged() when it is still empty
	tikzController = new TikzPngPreviewer(textEdit);
*/

	m_replaceWidget = new ReplaceWidget(this);
	m_replaceWidget->setVisible(false);
	m_replaceCurrentWidget = new ReplaceCurrentWidget(this);
	m_replaceCurrentWidget->setVisible(false);

	m_goToLineWidget = new GoToLineWidget(this);
	m_goToLineWidget->setVisible(false);

//	QFrame *mainWidget = new QFrame;
//	mainWidget->setLineWidth(1);
//	mainWidget->setFrameShape(QFrame::StyledPanel);
//	mainWidget->setFrameShadow(QFrame::Sunken);
	QVBoxLayout *mainLayout = new QVBoxLayout(this);
	mainLayout->setSpacing(0);
	mainLayout->setMargin(0);
	mainLayout->addWidget(m_tikzEditor);
	mainLayout->addWidget(m_replaceWidget);
	mainLayout->addWidget(m_replaceCurrentWidget);
	mainLayout->addWidget(m_goToLineWidget);

	createActions();

	connect(m_tikzEditor->document(), SIGNAL(modificationChanged(bool)),
	        this, SIGNAL(modificationChanged(bool)));
	connect(m_tikzEditor->document(), SIGNAL(contentsChanged()),
	        this, SIGNAL(contentsChanged()));
	connect(m_tikzEditor, SIGNAL(cursorPositionChanged(int,int)),
	        this, SIGNAL(cursorPositionChanged(int,int)));
	connect(m_tikzEditor, SIGNAL(showStatusMessage(QString,int)),
	        this, SIGNAL(showStatusMessage(QString,int)));

	connect(m_tikzEditor, SIGNAL(focusIn()),
	        this, SIGNAL(focusIn()));
	connect(m_tikzEditor, SIGNAL(focusOut()),
	        this, SIGNAL(focusOut()));

	connect(m_replaceWidget, SIGNAL(search(QString,bool,bool,bool)),
	        this, SLOT(search(QString,bool,bool,bool)));
	connect(m_replaceWidget, SIGNAL(replace(QString,QString,bool,bool,bool)),
	        this, SLOT(replace(QString,QString,bool,bool,bool)));
	connect(m_replaceWidget, SIGNAL(focusEditor()),
	        m_tikzEditor, SLOT(setFocus()));

	connect(m_replaceCurrentWidget, SIGNAL(showReplaceWidget()),
	        m_replaceWidget, SLOT(show()));
	connect(m_replaceCurrentWidget, SIGNAL(search(QString,bool,bool,bool,bool)),
	        this, SLOT(search(QString,bool,bool,bool,bool)));
	connect(m_replaceCurrentWidget, SIGNAL(replace(QString)),
	        this, SLOT(replace(QString)));
	connect(m_replaceCurrentWidget, SIGNAL(replaceAll(QString,QString,bool,bool,bool,bool)),
	        this, SLOT(replaceAll(QString,QString,bool,bool,bool,bool)));
	connect(m_replaceCurrentWidget, SIGNAL(setSearchFromBegin(bool)),
	        this, SIGNAL(setSearchFromBegin(bool)));

	connect(m_goToLineWidget, SIGNAL(goToLine(int)),
	        this, SLOT(goToLine(int)));
}
Ejemplo n.º 21
0
MainWindow::MainWindow()
{
//QTime t = QTime::currentTime();
#ifndef KTIKZ_USE_KDE
	m_aboutDialog = 0;
	m_assistantController = 0;
#endif
	m_configDialog = 0;
	m_isModifiedExternally = false;
	m_insertAction = 0;

	s_mainWindowList.append(this);

#ifndef KTIKZ_USE_KDE
	QStringList themeSearchPaths;
	themeSearchPaths << QDir::homePath() + QLatin1String("/.local/share/icons/");
	themeSearchPaths << QIcon::themeSearchPaths();
	QIcon::setThemeSearchPaths(themeSearchPaths);
#endif

	setAttribute(Qt::WA_DeleteOnClose);
#ifdef KTIKZ_USE_KDE
	setObjectName(QLatin1String("ktikz#"));
	setWindowIcon(KIcon(QLatin1String("ktikz")));
	Action::setActionCollection(actionCollection());
#else
	setObjectName(QLatin1String("qtikz#") + QString::number(s_mainWindowList.size()));
	setWindowIcon(QIcon(QLatin1String(":/icons/qtikz-22.png")));
#endif

	setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
	setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
	setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
	setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);

//qCritical() << t.msecsTo(QTime::currentTime());
	m_tikzPreviewController = new TikzPreviewController(this);
//qCritical() << "TikzPreviewController" << t.msecsTo(QTime::currentTime());
	m_tikzEditorView = new TikzEditorView(this);
//qCritical() << "TikzEditorView" << t.msecsTo(QTime::currentTime());
	m_commandInserter = new TikzCommandInserter(this);
	m_tikzHighlighter = new TikzHighlighter(m_tikzEditorView->editor()->document());
	m_userCommandInserter = new UserCommandInserter(this);

	QWidget *mainWidget = new QWidget(this);
	QVBoxLayout *mainLayout = new QVBoxLayout(mainWidget);
	mainLayout->setSpacing(0);
	mainLayout->setMargin(0);
	mainLayout->addWidget(m_tikzPreviewController->templateWidget());
	mainLayout->addWidget(m_tikzEditorView);

	m_logDock = new QDockWidget(this);
	m_logDock->setObjectName(QLatin1String("LogDock"));
	m_logDock->setAllowedAreas(Qt::AllDockWidgetAreas);
	m_logDock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
	m_logDock->setWindowTitle(tr("&Messages"));
	addDockWidget(Qt::BottomDockWidgetArea, m_logDock);
	m_logTextEdit = new LogTextEdit;
	m_logTextEdit->setWhatsThis(tr("<p>The messages produced by "
	                               "LaTeX are shown here.  If your TikZ code contains errors, "
	                               "then a red border will appear and the errors will be "
	                               "highlighted.</p>"));
	m_logDock->setWidget(m_logTextEdit);

	m_previewDock = new QDockWidget(this);
	m_previewDock->setObjectName(QLatin1String("PreviewDock"));
	m_previewDock->setAllowedAreas(Qt::AllDockWidgetAreas);
	m_previewDock->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
	m_previewDock->setWindowTitle(tr("Previe&w"));
	m_previewDock->setWidget(m_tikzPreviewController->tikzPreview());
	addDockWidget(Qt::RightDockWidgetArea, m_previewDock);

	setCentralWidget(mainWidget);

	createActions();
#ifndef KTIKZ_USE_KDE
	createToolBars(); // run first in order to be able to add file/editToolBar->toggleViewAction() to the menu
	createMenus();
#endif
//qCritical() << "createMenus" << t.msecsTo(QTime::currentTime());
	createCommandInsertWidget(); // must happen after createMenus and before readSettings
	createStatusBar();

#ifdef KTIKZ_USE_KDE
	setupGUI(ToolBar | Keys | StatusBar | Save);
	setXMLFile(QLatin1String("ktikzui.rc"));
	createGUI();
	guiFactory()->addClient(this);
#endif
	setTabOrder(m_tikzPreviewController->templateWidget()->lastTabOrderWidget(), m_tikzEditorView->editor());

	connect(m_commandInserter, SIGNAL(showStatusMessage(QString,int)),
	        statusBar(), SLOT(showMessage(QString,int)));

	connect(m_tikzEditorView, SIGNAL(modificationChanged(bool)),
	        this, SLOT(setDocumentModified(bool)));
	connect(m_tikzEditorView, SIGNAL(cursorPositionChanged(int,int)),
	        this, SLOT(showCursorPosition(int,int)));
	connect(m_tikzEditorView, SIGNAL(showStatusMessage(QString,int)),
	        statusBar(), SLOT(showMessage(QString,int)));

	connect(m_tikzEditorView, SIGNAL(focusIn()),
	        this, SLOT(checkForFileChanges()));
	connect(m_tikzEditorView, SIGNAL(focusOut()),
	        this, SLOT(saveLastInternalModifiedDateTime()));

	connect(m_tikzPreviewController, SIGNAL(updateLog(QString,bool)),
	        m_logTextEdit, SLOT(updateLog(QString,bool)));
	connect(m_tikzPreviewController, SIGNAL(appendLog(QString,bool)),
	        m_logTextEdit, SLOT(appendLog(QString,bool)));
	connect(m_tikzPreviewController, SIGNAL(showMouseCoordinates(qreal,qreal,int,int)),
	        this, SLOT(showMouseCoordinates(qreal,qreal,int,int)));

	connect(m_userCommandInserter, SIGNAL(updateCompleter()),
	        this, SLOT(updateCompleter()));

	readSettings(); // must be run after defining tikzController and tikzHighlighter, and after creating the toolbars, and after the connects
//qCritical() << "readSettings()" << t.msecsTo(QTime::currentTime());

	setCurrentUrl(Url());
	setDocumentModified(false);
	saveLastInternalModifiedDateTime();
	m_tikzEditorView->editor()->setFocus();

	// delayed initialization
//	QTimer::singleShot(0, this, SLOT(init())); // this causes flicker at startup and init() is not executed in a separate thread anyway :(
	init();
//qCritical() << "mainwindow" << t.msecsTo(QTime::currentTime());
}
Ejemplo n.º 22
0
MSBoolean MSWidget::loseFocus(void) 
{ return focusOut(),MSTrue; }