Use a KURLRequester widget for variables of type CONFIG_ITEM_FILE. This

crates a little button next to the textarea that pops up a file open dialog
where the user can point and click on the file to select. It also drops down
a list of possible completions as the user types.
parent 63f553ea
......@@ -2,7 +2,7 @@
* preferences.cpp: preferences window for the kde gui
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: preferences.cpp,v 1.7 2002/10/13 14:26:47 sigmunau Exp $
* $Id: preferences.cpp,v 1.8 2002/10/16 23:34:27 sigmunau Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> Mon Aug 12 2002
*
......@@ -38,6 +38,7 @@
#include <klineedit.h>
#include <klocale.h>
#include <knuminput.h>
#include <kurlrequester.h>
#include "QConfigItem.h"
#include "pluginsbox.h"
......@@ -148,8 +149,6 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
break;
case CONFIG_ITEM_STRING:
case CONFIG_ITEM_FILE:
{
QHBox *hb = new QHBox(category_table);
hb->setSpacing(spacingHint());
......@@ -173,6 +172,32 @@ KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
}
break;
case CONFIG_ITEM_FILE:
{
QHBox *hb = new QHBox(category_table);
hb->setSpacing(spacingHint());
new QLabel(p_item->psz_text, hb);
/* add input box with default value */
vlc_mutex_lock( p_item->p_lock );
// KLineEdit *kl = new KLineEdit( p_item->psz_value ?
// p_item->psz_value : "", hb);
QConfigItem *ci = new QConfigItem(this, p_item->psz_name,
p_item->i_type,
p_item->psz_value ?
p_item->psz_value : "");
// QPushButton *bbrowse = new QPushButton( _("Browse"), hb );
KURLRequester *kfile = new KURLRequester( p_item->psz_value ?
p_item->psz_value : "",
hb );
connect(kfile, SIGNAL(textChanged ( const QString & )),
ci, SLOT(setValue( const QString &)));
QToolTip::add(kfile, p_item->psz_longtext);
vlc_mutex_unlock( p_item->p_lock );
}
break;
case CONFIG_ITEM_INTEGER:
/* add input box with default value */
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment