#include <vlc_keys.h>
#include <vlc_intf_strings.h>
#include <vlc_modules.h>
+#include <vlc_plugin.h>
#include <QString>
#include <QVariant>
if( !l )
{
+ widget = new QWidget( _parent );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( label, 0 ); layout->insertSpacing( 1, 10 );
layout->addWidget( text, LAST_COLUMN );
finish( );
}
+int VStringConfigControl::getType() const { return CONFIG_ITEM_STRING; }
+
void StringConfigControl::finish()
{
text->setText( qfu(p_item->value.psz) );
if( !l )
{
+ widget = new QWidget( _parent );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( label, 0 );
layout->insertSpacing( 1, 10 );
font->setCurrentFont( QFont( qfu( p_item->value.psz) ) );
if( !_p_layout )
{
+ widget = new QWidget( _parent );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( label, 0 );
layout->addWidget( font, 1 );
finish( p_module_config );
if( !l )
{
+ widget = new QWidget( _parent );
l = new QGridLayout();
l->addWidget( label, 0, 0 ); l->addWidget( combo, 0, LAST_COLUMN );
widget->setLayout( l );
finish( bycat );
if( !l )
{
+ widget = new QWidget( _parent );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( label ); layout->addWidget( combo, LAST_COLUMN );
widget->setLayout( layout );
if( !l )
{
+ widget = new QWidget( _parent );
QVBoxLayout *layout = new QVBoxLayout();
layout->addWidget( groupBox, line, 0 );
widget->setLayout( layout );
return text->text();
}
-void ModuleListConfigControl::hide()
+void ModuleListConfigControl::changeVisibility( bool b )
{
foreach ( checkBoxListItem *it, modules )
- it->checkBox->hide();
- groupBox->hide();
+ it->checkBox->setVisible( b );
+ groupBox->setVisible( b );
+ ConfigControl::changeVisibility( b );
}
-void ModuleListConfigControl::show()
-{
- foreach ( checkBoxListItem *it, modules )
- it->checkBox->show();
- groupBox->show();
-}
-
-
void ModuleListConfigControl::onUpdate()
{
text->clear();
if( !l )
{
+ widget = new QWidget( _parent );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( label, 0 ); layout->addWidget( spin, LAST_COLUMN );
widget->setLayout( layout );
return spin->value();
}
+int VIntConfigControl::getType() const { return CONFIG_ITEM_INTEGER; }
+
/********* Integer range **********/
IntegerRangeConfigControl::IntegerRangeConfigControl( vlc_object_t *_p_this,
module_config_t *_p_item,
finish( p_module_config );
if( !l )
{
+ widget = new QWidget( _parent );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( label ); layout->addWidget( combo, LAST_COLUMN );
widget->setLayout( layout );
if( !l )
{
+ widget = new QWidget( _parent );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( checkbox, 0 );
widget->setLayout( layout );
finish();
}
+int BoolConfigControl::getType() const { return CONFIG_ITEM_BOOL; }
+
void BoolConfigControl::finish()
{
checkbox->setChecked( p_item->value.i );
if( !l )
{
+ widget = new QWidget( _parent );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( label, 0 ); layout->addWidget( color_but, LAST_COLUMN );
widget->setLayout( layout );
if( !l )
{
+ widget = new QWidget( _parent );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( label, 0 ); layout->addWidget( spin, LAST_COLUMN );
widget->setLayout( layout );
}
}
+int VFloatConfigControl::getType() const { return CONFIG_ITEM_FLOAT; }
+
FloatConfigControl::FloatConfigControl( vlc_object_t *_p_this,
module_config_t *_p_item,
QLabel *_label,
QGridLayout *gLayout = new QGridLayout( keyContainer );
label = new QLabel(
- qtr( "Select an action to change the associated hotkey") );
+ qtr( "Select or double click an action to change the associated "
+ "hotkey. Use delete key to remove hotkeys") );
QLabel *searchLabel = new QLabel( qtr( "Search" ) );
SearchLineEdit *actionSearch = new SearchLineEdit( keyContainer );
this, filter( const QString& ) );
}
+int KeySelectorControl::getType() const { return CONFIG_ITEM_KEY; }
+
void KeySelectorControl::finish()
{
if( label && p_item->psz_longtext )
QMap<QString, QString> global_keys;
for (size_t i = 0; i < confsize; i++)
{
- module_config_t *p_item = p_config + i;
+ module_config_t *p_config_item = p_config + i;
/* If we are a (non-global) key option not empty */
- if( CONFIG_ITEM(p_item->i_type) && p_item->psz_name != NULL
- && !strncmp( p_item->psz_name , "key-", 4 )
- && !EMPTY_STR( p_item->psz_text ) )
+ if( CONFIG_ITEM(p_config_item->i_type) && p_config_item->psz_name != NULL
+ && !strncmp( p_config_item->psz_name , "key-", 4 )
+ && !EMPTY_STR( p_config_item->psz_text ) )
{
/*
Each tree item has:
- KeyValue in String in column 1
*/
QTreeWidgetItem *treeItem = new QTreeWidgetItem();
- treeItem->setText( 0, qtr( p_item->psz_text ) );
+ treeItem->setText( 0, qtr( p_config_item->psz_text ) );
treeItem->setData( 0, Qt::UserRole,
- QVariant( qfu( p_item->psz_name ) ) );
+ QVariant( qfu( p_config_item->psz_name ) ) );
- QString keys = qfu( p_item->value.psz );
+ QString keys = qfu( p_config_item->value.psz );
treeItem->setText( 1, keys );
+ treeItem->setToolTip( 1, qtr("Double click to change") );
+ treeItem->setToolTip( 2, qtr("Double click to change") );
treeItem->setData( 1, Qt::UserRole, QVariant( keys ) );
table->addTopLevelItem( treeItem );
continue;
}
- if( CONFIG_ITEM(p_item->i_type) && p_item->psz_name != NULL
- && !strncmp( p_item->psz_name , "global-key", 10 )
- && !EMPTY_STR( p_item->psz_text )
- && !EMPTY_STR( p_item->value.psz ) )
+ if( CONFIG_ITEM(p_config_item->i_type) && p_config_item->psz_name != NULL
+ && !strncmp( p_config_item->psz_name , "global-key", 10 )
+ && !EMPTY_STR( p_config_item->psz_text )
+ && !EMPTY_STR( p_config_item->value.psz ) )
{
- global_keys.insertMulti( qtr( p_item->psz_text ), qfu( p_item->value.psz ) );
+ global_keys.insertMulti( qtr( p_config_item->psz_text ), qfu( p_config_item->value.psz ) );
}
}
}
else if( keyEv->key() == Qt::Key_Delete )
{
- aTable->currentItem()->setText( aTable->currentColumn(), NULL );
- aTable->currentItem()->setData( aTable->currentColumn(), Qt::UserRole, QVariant() );
+ if( aTable->currentColumn() != 0 )
+ {
+ aTable->currentItem()->setText( aTable->currentColumn(), NULL );
+ aTable->currentItem()->setData( aTable->currentColumn(), Qt::UserRole, QVariant() );
+ }
return true;
}
else
conflicts = false;
table = _table;
- setWindowTitle( b_global ? qtr( "Global" ): ""
- + qtr( "Hotkey for " ) + keyToChange );
+ setWindowTitle( ( b_global ? qtr( "Global" ) + QString(" ") : "" )
+ + qtr( "Hotkey change" ) );
setWindowRole( "vlc-key-input" );
QVBoxLayout *vLayout = new QVBoxLayout( this );
- selected = new QLabel( qtr( "Press the new keys for " ) + keyToChange );
+ selected = new QLabel( qtr( "Press the new key or combination for " )
+ + QString("<b>%1</b>").arg( keyToChange ) );
vLayout->addWidget( selected , Qt::AlignCenter );
warning = new QLabel;
vLayout->insertWidget( 1, warning );
buttonBox = new QDialogButtonBox;
- QPushButton *ok = new QPushButton( qtr("OK") );
+ QPushButton *ok = new QPushButton( qtr("Assign") );
QPushButton *cancel = new QPushButton( qtr("Cancel") );
buttonBox->addButton( ok, QDialogButtonBox::AcceptRole );
buttonBox->addButton( cancel, QDialogButtonBox::RejectRole );
!conflictList[0]->data( b_global ? 2 : 1, Qt::UserRole ).toString().isEmpty() &&
conflictList[0]->data( b_global ? 2 : 1, Qt::UserRole ).toString() != "Unset" )
{
- warning->setText( qtr("Warning: the key is already assigned to \"") +
- conflictList[0]->text( 0 ) + "\"" );
+ warning->setText( qtr("Warning: this key or combination is already assigned to ") +
+ QString( "\"<b>%1</b>\"" ).arg( conflictList[0]->text( 0 ) ) );
warning->show();
buttonBox->show();
e->key() == Qt::Key_AltGr )
return;
int i_vlck = qtEventToVLCKey( e );
- selected->setText( qtr( "Key: " ) + VLCKeyToString( i_vlck ) );
+ selected->setText( qtr( "Key or combination: " )
+ + QString("<b>%1</b>").arg( VLCKeyToString( i_vlck ) ) );
checkForConflicts( i_vlck );
keyValue = i_vlck;
}
checkForConflicts( i_vlck );
keyValue = i_vlck;
}
-