[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebase/konqueror/sidebar/trees
From: Nadeem Hasan <nhasan () nadmm ! com>
Date: 2003-08-25 14:19:47
[Download RAW message or body]
CVS commit by nhasan:
Use KInputDialog.
M +7 -3 konqsidebar_tree.cpp 1.14
M +0 -32 konqsidebar_tree.h 1.10
--- kdebase/konqueror/sidebar/trees/konqsidebar_tree.cpp #1.13:1.14
@@ -5,4 +5,6 @@
#include <kstandarddirs.h>
#include <ksimpleconfig.h>
+#include <kinputdialog.h>
+
#include <qclipboard.h>
#include <qdragobject.h>
@@ -119,8 +121,10 @@ extern "C"
names<<sc.readEntry("Name");
}
- KonqSidebarTreeSelectionDialog dlg(0,names);
- if (dlg.exec()==QDialog::Accepted)
+
+ QString item = KInputDialog::getItem( i18n( "Select Type" ),
+ i18n( "Select type:" ), names );
+ if (!item.isEmpty())
{
- int id=dlg.getValue();
+ int id=names.findIndex( item );
if (id==-1) return false;
KSimpleConfig ksc2(*list.at(id));
--- kdebase/konqueror/sidebar/trees/konqsidebar_tree.h #1.9:1.10
@@ -43,35 +43,3 @@ signals:
};
-
-class KonqSidebarTreeSelectionDialog : public KDialogBase
-{
- Q_OBJECT
- public:
- KonqSidebarTreeSelectionDialog(QWidget *parent,const QStringList &list):
- KDialogBase( parent, "konqsidebartreeselectiondialog", \
true,i18n("Select Type"), Ok|Cancel,
- Ok, true ),list_(list)
- {
- QWidget *page = new QWidget( this );
- setMainWidget(page);
- QVBoxLayout *topLayout = new QVBoxLayout( page, 0, \
spacingHint() );
- QLabel *label = new QLabel( i18n("Select type:"), page, \
"caption" );
- topLayout->addWidget( label );
- cb=new QComboBox(page);
- cb->setMinimumWidth(fontMetrics().maxWidth()*20);
- cb->insertStringList(list);
- cb->setEditable(false);
- topLayout->addWidget( cb );
- topLayout->addStretch(10);
-
- }
- int getValue()
- {
- return list_.findIndex(cb->currentText());
- }
- ~KonqSidebarTreeSelectionDialog(){;}
- private:
- QComboBox *cb;
- QStringList list_;
-};
-
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic