PrefAdvanced::PrefAdvanced(QWidget * parent, Qt::WindowFlags f) : PrefWidget(parent, f ) { setupUi(this); // Monitor aspect monitoraspect_combo->addItem("Auto"); monitoraspect_combo->addItem("4:3"); monitoraspect_combo->addItem("16:9"); monitoraspect_combo->addItem("5:4"); monitoraspect_combo->addItem("16:10"); // MPlayer language combos. endoffile_combo->addItem( "Exiting... \\(End of file\\)" ); endoffile_combo->addItem( "Saliendo... \\(Fin de archivo\\.\\)" ); endoffile_combo->addItem( "Beenden... \\(Dateiende erreicht\\)" ); endoffile_combo->addItem( "Sortie... \\(Fin du fichier\\)" ); endoffile_combo->addItem( "In uscita... \\(Fine del file\\)" ); novideo_combo->addItem( "Video: no video" ); novideo_combo->addItem( QString::fromLatin1("Vídeo: no hay video") ); novideo_combo->addItem( "Video: kein Video" ); novideo_combo->addItem( QString::fromLatin1("Vidéo : pas de vidéo") ); novideo_combo->addItem( "Video: nessun video" ); retranslateStrings(); }
// Language change stuff void ActionsEditor::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { retranslateStrings(); } else { QWidget::changeEvent(e); } }
// Language change stuff void TristateCombo::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { retranslateStrings(); } else { QComboBox::changeEvent(e); } }
// Language change stuff void PreferencesDialog::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { retranslateStrings(); } else { QDialog::changeEvent(e); } }
// Language change stuff void SubChooserDialog::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { retranslateStrings(); } else { QDialog::changeEvent(e); } }
PrefAssociations::PrefAssociations(QWidget * parent, Qt::WindowFlags f) : PrefWidget(parent, f ) { setupUi(this); connect(selectAll, SIGNAL(clicked(bool)), this, SLOT(selectAllClicked(bool))); connect(selectNone, SIGNAL(clicked(bool)), this, SLOT(selectNoneClicked(bool))); connect(listWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(listItemClicked(QListWidgetItem*))); connect(listWidget, SIGNAL(itemPressed(QListWidgetItem*)), this, SLOT(listItemPressed(QListWidgetItem*))); //Video for windows addItem("avi"); addItem("vfw"); addItem("divx"); //MPEG addItem("mpg"); addItem("mpeg"); addItem("m1v"); addItem("m2v"); addItem("mpv"); addItem("dv"); addItem("3gp"); //QT addItem("mov"); addItem("mp4"); addItem("m4v"); addItem("mqv"); //VCD addItem("dat"); addItem("vcd"); //OGG addItem("ogg"); addItem("ogm"); //WMV addItem("asf"); addItem("wmv"); //Matroska addItem("mkv"); //NSV addItem("nsv"); //REAL addItem("ram"); //DVD addItem("bin"); addItem("iso"); addItem("vob"); //FLV addItem("flv"); retranslateStrings(); }
FilePropertiesDialog::FilePropertiesDialog( QWidget* parent, Qt::WindowFlags f ) : QDialog(parent, f) { setupUi(this); // Setup buttons okButton = buttonBox->button(QDialogButtonBox::Ok); cancelButton = buttonBox->button(QDialogButtonBox::Cancel); applyButton = buttonBox->button(QDialogButtonBox::Apply); connect( applyButton, SIGNAL(clicked()), this, SLOT(apply()) ); #if ALLOW_DEMUXER_CODEC_CHANGE codecs_set = false; #else // Hide unused tabs int i = tabWidget->indexOf(demuxer_page); if (i != -1) tabWidget->removeTab(i); i = tabWidget->indexOf(vc_page); if (i != -1) tabWidget->removeTab(i); i = tabWidget->indexOf(ac_page); if (i != -1) tabWidget->removeTab(i); #endif retranslateStrings(); }
LanguagePreferences::LanguagePreferences(QWidget *parent) :AbstractPreferencesPage(parent) { translationGroup = new QGroupBox(this); tranlationsPathLabel = new QLabel(this); tranlationsPathEdit = new QLineEdit(this); connect(tranlationsPathEdit, SIGNAL(textChanged(QString)), this, SLOT(updateTranslationsList())); tranlationsPathButton = new QToolButton(this); tranlationsPathButton->setIcon(style()->standardIcon(QStyle::SP_DialogOpenButton)); connect(tranlationsPathButton, SIGNAL(clicked()), this, SLOT(setTranslationsPath())); translationsList = new QListWidget(this); connect(translationsList, SIGNAL(currentRowChanged(int)), this, SIGNAL(modified())); QHBoxLayout *translatesPathLayout = new QHBoxLayout(); translatesPathLayout->addWidget(tranlationsPathLabel); translatesPathLayout->addWidget(tranlationsPathEdit); translatesPathLayout->addWidget(tranlationsPathButton); QVBoxLayout *translatesLayout = new QVBoxLayout(); translatesLayout->addLayout(translatesPathLayout); translatesLayout->addWidget(translationsList); translationGroup->setLayout(translatesLayout); QVBoxLayout *mainLayout = new QVBoxLayout(); mainLayout->addWidget(translationGroup); setLayout(mainLayout); mainLayout->setContentsMargins(0,0,0,0); loadSettings(); retranslateStrings(); }
PrefInput::PrefInput(QWidget * parent, Qt::WindowFlags f) : PrefWidget(parent, f ) { setupUi(this); retranslateStrings(); }
MenuBar::MenuBar(QWidget *parent) : QMenuBar(parent) { setParent(parent); createActions(); createMenus(); retranslateStrings(); }
PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) { setupUi(this); // Setup buttons okButton = buttonBox->button(QDialogButtonBox::Ok); cancelButton = buttonBox->button(QDialogButtonBox::Cancel); applyButton = buttonBox->button(QDialogButtonBox::Apply); helpButton = buttonBox->button(QDialogButtonBox::Help); connect(applyButton, SIGNAL(clicked()), this, SLOT(apply())); connect(helpButton, SIGNAL(clicked()), this, SLOT(showHelp())); setWindowIcon(Images::icon("logo")); help_window = new QTextBrowser(this); help_window->setWindowFlags(Qt::Window); help_window->resize(300, 450); //help_window->adjustSize(); help_window->setWindowTitle(tr("SMPlayer2 - Help")); help_window->setWindowIcon(Images::icon("logo")); page_general = new PrefGeneral; addSection(page_general); page_drives = new PrefDrives; addSection(page_drives); page_performance = new PrefPerformance; addSection(page_performance); page_subtitles = new PrefSubtitles; addSection(page_subtitles); page_interface = new PrefInterface; addSection(page_interface); page_input = new PrefInput; addSection(page_input); page_playlist = new PrefPlaylist; addSection(page_playlist); page_tv = new PrefTV; addSection(page_tv); #if USE_ASSOCIATIONS page_associations = new PrefAssociations; addSection(page_associations); #endif page_advanced = new PrefAdvanced; addSection(page_advanced); sections->setCurrentRow(General); //adjustSize(); retranslateStrings(); }
// Language change stuff void FindSubtitlesWindow::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { retranslateStrings(); } else { QWidget::changeEvent(e); } }
// Language change stuff void FilePropertiesDialog::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { retranslateStrings(); } else { QDialog::changeEvent(e); } }
PrefAssociations::PrefAssociations(QWidget * parent, Qt::WindowFlags f) : PrefWidget(parent, f ) { setupUi(this); connect(selectAll, SIGNAL(clicked(bool)), this, SLOT(selectAllClicked(bool))); connect(selectNone, SIGNAL(clicked(bool)), this, SLOT(selectNoneClicked(bool))); connect(listWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(listItemClicked(QListWidgetItem*))); connect(listWidget, SIGNAL(itemPressed(QListWidgetItem*)), this, SLOT(listItemPressed(QListWidgetItem*))); if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA) { //Hide Select None - One cannot restore an association in Vista. Go figure. selectNone->hide(); //QPushButton* lpbButton = new QPushButton("Launch Program Defaults", this); //hboxLayout->addWidget(lpbButton); //connect(lpbButton, SIGNAL(clicked(bool)), this, SLOT(launchAppDefaults())); } Extensions e; for (int n=0; n < e.multimedia().count(); n++) { addItem( e.multimedia()[n] ); } // Add the playlist extensions for (int n=0; n < e.playlist().count(); n++) { addItem( e.playlist()[n] ); } retranslateStrings(); something_changed = false; }
// Language change stuff void VolumeControlPanel::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { retranslateStrings(); } else { QWidget::changeEvent(e); } }
// Language change stuff void FloatingControl::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { retranslateStrings(); } else { QWidget::changeEvent(e); } }
bool FilterDialog::event(QEvent *ev) { if (ev->type() == QEvent::LanguageChange) { retranslateStrings(); } return QDialog::event(ev); }
void TToolbarEditor::changeEvent(QEvent* e) { if (e->type() == QEvent::LanguageChange) { retranslateStrings(); } else { QDialog::changeEvent(e); } }
// Language change stuff void VideoPreview::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { retranslateStrings(); } else { QWidget::changeEvent(e); } }
LogWindow::LogWindow( QWidget* parent ) : QWidget(parent, Qt::Window ) { setupUi(this); browser->setFont( QFont("fixed") ); retranslateStrings(); }
ActionsEditor::ActionsEditor(QWidget * parent, Qt::WindowFlags f) : QWidget(parent, f) { latest_dir = Paths::shortcutsPath(); actionsTable = new QTableWidget(0, COL_NAME +1, this); actionsTable->setSelectionMode( QAbstractItemView::SingleSelection ); actionsTable->verticalHeader()->hide(); actionsTable->horizontalHeader()->setResizeMode(COL_DESC, QHeaderView::Stretch); actionsTable->horizontalHeader()->setResizeMode(COL_NAME, QHeaderView::Stretch); actionsTable->setAlternatingRowColors(true); #if USE_SHORTCUTGETTER actionsTable->setSelectionBehavior(QAbstractItemView::SelectRows); actionsTable->setSelectionMode(QAbstractItemView::ExtendedSelection); #endif //actionsTable->setItemDelegateForColumn( COL_SHORTCUT, new MyDelegate(actionsTable) ); #if !USE_SHORTCUTGETTER connect(actionsTable, SIGNAL(currentItemChanged(QTableWidgetItem *,QTableWidgetItem *)), this, SLOT(recordAction(QTableWidgetItem *)) ); connect(actionsTable, SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(validateAction(QTableWidgetItem *)) ); #else connect(actionsTable, SIGNAL(itemActivated(QTableWidgetItem *)), this, SLOT(editShortcut()) ); #endif saveButton = new QPushButton(this); loadButton = new QPushButton(this); connect(saveButton, SIGNAL(clicked()), this, SLOT(saveActionsTable())); connect(loadButton, SIGNAL(clicked()), this, SLOT(loadActionsTable())); #if USE_SHORTCUTGETTER editButton = new QPushButton(this); connect( editButton, SIGNAL(clicked()), this, SLOT(editShortcut()) ); #endif QHBoxLayout *buttonLayout = new QHBoxLayout; buttonLayout->setSpacing(8); #if USE_SHORTCUTGETTER buttonLayout->addWidget(editButton); #endif buttonLayout->addStretch(1); buttonLayout->addWidget(loadButton); buttonLayout->addWidget(saveButton); QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->setMargin(8); mainLayout->setSpacing(8); mainLayout->addWidget(actionsTable); mainLayout->addLayout(buttonLayout); retranslateStrings(); }
MainWindow::MainWindow ( QWidget * parent, Qt::WindowFlags flags ) :QMainWindow ( parent , flags ), m_fullScreenAction ( 0 ), m_closeFullScreenAction ( 0 ), m_adminPanel(0) { init(); initActions(); initMenuBar(); retranslateStrings(); }
void VolumeControlPanel::setActionCollection(QList<QAction*> actions) { //ActionTools::findAction("aaa", actions); volumeBar->setEnabled(true); /* volumeSliderAction->installEventFilter(this); */ SETACTIONTOBUTTON(playlistButton, "show_playlist"); SETACTIONTOBUTTON(fullscreenButton, "fullscreen"); SETACTIONTOBUTTON(equalizerButton, "video_equalizer"); retranslateStrings(); }
PrefInput::PrefInput(QWidget * parent, Qt::WindowFlags f) : PrefWidget(parent, f ) { setupUi(this); // Mouse function combos left_click_combo->addItem( "None" ); double_click_combo->addItem( "None" ); retranslateStrings(); }
FilterDialog::FilterDialog(QHash<int, QString> captions, QWidget *parent, Qt::WindowFlags f) :QDialog(parent, f), m_captions(captions) { model = new QStandardItemModel(this); model->setColumnCount(ColumnCount); filterView = new QTableView(this); filterView->setModel(model); filterView->setItemDelegate(new FilterDelegate(m_captions, filterView)); actionAdd = new QAction(this); actionAdd->setIcon(QIcon(":share/images/add.png")); connect(actionAdd, SIGNAL(triggered()), this, SLOT(add())); addButton = new QToolButton(this); addButton->setDefaultAction(actionAdd); addButton->setAutoRaise(true); actionRemove = new QAction(this); actionRemove->setIcon(QIcon(":share/images/remove.png")); connect(actionRemove, SIGNAL(triggered()), this, SLOT(remove())); removeButton = new QToolButton(this); removeButton->setDefaultAction(actionRemove); removeButton->setAutoRaise(true); QHBoxLayout *buttonsLayout = new QHBoxLayout(); buttonsLayout->addWidget(addButton); buttonsLayout->addWidget(removeButton); buttonsLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Preferred)); QVBoxLayout *viewLayout = new QVBoxLayout(); viewLayout->addLayout(buttonsLayout); viewLayout->addWidget(filterView); QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); buttons->setCenterButtons(true); connect(buttons, SIGNAL(accepted()), this, SLOT(accept())); connect(buttons, SIGNAL(rejected()), this, SLOT(reject())); QVBoxLayout *mainLayout = new QVBoxLayout(); mainLayout->addLayout(viewLayout); mainLayout->addWidget(buttons); setLayout(mainLayout); loadSettings(); retranslateStrings(); }
PrefInterface::PrefInterface(QWidget * parent, Qt::WindowFlags f) : PrefWidget(parent, f ) { setupUi(this); /* volume_icon->hide(); */ // Style combo #if !STYLE_SWITCHING style_label->hide(); style_combo->hide(); #else style_combo->addItem( "<default>" ); style_combo->addItems( QStyleFactory::keys() ); #endif // Icon set combo iconset_combo->addItem( "Default" ); // User QDir icon_dir = Paths::configPath() + "/themes"; qDebug("icon_dir: %s", icon_dir.absolutePath().toUtf8().data()); QStringList iconsets = icon_dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); for (int n=0; n < iconsets.count(); n++) { iconset_combo->addItem( iconsets[n] ); } // Global icon_dir = Paths::themesPath(); qDebug("icon_dir: %s", icon_dir.absolutePath().toUtf8().data()); iconsets = icon_dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); for (int n=0; n < iconsets.count(); n++) { if (iconset_combo->findText( iconsets[n] ) == -1) { iconset_combo->addItem( iconsets[n] ); } } #ifdef SINGLE_INSTANCE connect(single_instance_check, SIGNAL(toggled(bool)), this, SLOT(changeInstanceImages())); #else tabWidget->setTabEnabled(SINGLE_INSTANCE_TAB, false); #endif #ifdef Q_OS_WIN floating_bypass_wm_check->hide(); #endif retranslateStrings(); }
PrefGeneral::PrefGeneral(QWidget * parent, Qt::WindowFlags f) : PrefWidget(parent, f ) { setupUi(this); mplayerbin_edit->setDialogType(FileChooser::GetFileName); screenshot_edit->setDialogType(FileChooser::GetDirectory); // Read driver info from InfoReader: InfoReader * i = InfoReader::obj(); vo_list = i->voList(); ao_list = i->aoList(); #if USE_DSOUND_DEVICES dsound_devices = DeviceInfo::dsoundDevices(); #endif #if USE_ALSA_DEVICES alsa_devices = DeviceInfo::alsaDevices(); #endif #if USE_XV_ADAPTORS xv_adaptors = DeviceInfo::xvAdaptors(); #endif // Screensaver #ifdef Q_OS_WIN screensaver_check->hide(); #else screensaver_group->hide(); #endif #ifdef Q_OS_WIN vdpau_button->hide(); #endif // Channels combo channels_combo->addItem( "2", MediaSettings::ChStereo ); channels_combo->addItem( "4", MediaSettings::ChQuad ); channels_combo->addItem( "6", MediaSettings::Ch51 ); channels_combo->addItem( "8", MediaSettings::Ch71 ); connect(vo_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(vo_combo_changed(int))); connect(ao_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(ao_combo_changed(int))); retranslateStrings(); }
MplayerWindow::MplayerWindow(QWidget* parent, Qt::WindowFlags f) : Screen(parent, f) , allow_video_movement(false) { offset_x = 0; offset_y = 0; zoom_factor = 1.0; setAutoFillBackground(true); ColorUtils::setBackgroundColor( this, QColor(0,0,0) ); mplayerlayer = new MplayerLayer( this ); mplayerlayer->setAutoFillBackground(TRUE); logo = new QLabel( mplayerlayer ); logo->setAutoFillBackground(TRUE); #if QT_VERSION >= 0x040400 logo->setAttribute(Qt::WA_NativeWindow); // Otherwise the logo is not visible in Qt 4.4 #else logo->setAttribute(Qt::WA_PaintOnScreen); // Fixes the problem if compiled with Qt < 4.4 #endif ColorUtils::setBackgroundColor( logo, QColor(0,0,0) ); QVBoxLayout * mplayerlayerLayout = new QVBoxLayout( mplayerlayer ); mplayerlayerLayout->addWidget( logo, 0, Qt::AlignHCenter | Qt::AlignVCenter ); aspect = (double) 4 / 3; monitoraspect = 0; setSizePolicy( QSizePolicy::Expanding , QSizePolicy::Expanding ); setFocusPolicy( Qt::StrongFocus ); installEventFilter(this); mplayerlayer->installEventFilter(this); //logo->installEventFilter(this); #if DELAYED_RESIZE resize_timer = new QTimer(this); resize_timer->setSingleShot(true); resize_timer->setInterval(50); connect( resize_timer, SIGNAL(timeout()), this, SLOT(resizeLater()) ); #endif retranslateStrings(); }
FilePropertiesDialog::FilePropertiesDialog( QWidget* parent, Qt::WindowFlags f ) : QDialog(parent, f) { setupUi(this); // Setup buttons okButton = buttonBox->button(QDialogButtonBox::Ok); cancelButton = buttonBox->button(QDialogButtonBox::Cancel); applyButton = buttonBox->button(QDialogButtonBox::Apply); connect( applyButton, SIGNAL(clicked()), this, SLOT(apply()) ); codecs_set = FALSE; // Read codec info from InfoReader: InfoReader *i = InfoReader::obj(); setCodecs( i->vcList(), i->acList(), i->demuxerList() ); retranslateStrings(); }
void QProgressDialogPrivate::init(const QString &labelText, const QString &cancelText, int min, int max) { Q_Q(QProgressDialog); label = new QLabel(labelText, q); int align = q->style()->styleHint(QStyle::SH_ProgressDialog_TextLabelAlignment, 0, q); label->setAlignment(Qt::Alignment(align)); bar = new QProgressBar(q); bar->setRange(min, max); autoClose = true; autoReset = true; forceHide = false; QObject::connect(q, SIGNAL(canceled()), q, SLOT(cancel())); forceTimer = new QTimer(q); QObject::connect(forceTimer, SIGNAL(timeout()), q, SLOT(forceShow())); if (useDefaultCancelText) { retranslateStrings(); } else { q->setCancelButtonText(cancelText); } }