From kde-commits Sat Mar 15 15:31:14 2003 From: "Dawit A." Date: Sat, 15 Mar 2003 15:31:14 +0000 To: kde-commits Subject: Re: KDE_3_1_BRANCH: kdebase/kdesktop X-MARC-Message: https://marc.info/?l=kde-commits&m=104774244614043 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_Cd0c+71/W9G83+F" --Boundary-00=_Cd0c+71/W9G83+F Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 15 March 2003 10:07, Dawit A. wrote: > On Saturday 15 March 2003 08:30, Luk=C3=A1=C5=A1 Tinkl wrote: > > CVS commit by lukas: > > > > fix the "non-existant command" error message box popping up twice > > > > (anyone forward port please? :) Can you please try this patch ? It should fix the problem you pointed out= =20 under all circumstances and contains some clean up as well. BTW, I forgot to say thanks. I had completely forgotten about backporting t= his=20 fix... Regards, Dawit A. --Boundary-00=_Cd0c+71/W9G83+F Content-Type: text/x-diff; charset="utf-8"; name="minicli-20030315.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="minicli-20030315.diff" Index: minicli.cpp =================================================================== RCS file: /home/kde/kdebase/kdesktop/minicli.cpp,v retrieving revision 1.136.2.10 diff -u -p -b -B -w -r1.136.2.10 minicli.cpp --- minicli.cpp 15 Mar 2003 13:30:55 -0000 1.136.2.10 +++ minicli.cpp 15 Mar 2003 15:29:00 -0000 @@ -80,14 +80,11 @@ Minicli::Minicli( QWidget *parent, const "of the resource you want to open. This can be a remote URL " "like \"www.kde.org\" or a local one like \"~/.kderc\"")); m_runCombo->setDuplicatesEnabled( false ); - connect( m_runCombo, SIGNAL( textChanged( const QString& ) ), - SLOT( slotCmdChanged(const QString&) ) ); label->setBuddy(m_runCombo); m_runCombo->setFixedWidth( m_runCombo->fontMetrics().width('W') * 23 ); m_parseTimer = new QTimer(this); - connect(m_parseTimer, SIGNAL(timeout()), SLOT(slotParseTimer())); m_bAdvanced = false; mpAdvanced = 0; @@ -101,20 +98,19 @@ Minicli::Minicli( QWidget *parent, const if (!kapp->authorize("shell_access")) m_btnOptions->hide(); bbLay->addWidget( m_btnOptions ); - connect( m_btnOptions, SIGNAL(clicked()), SLOT(slotAdvanced()) ); + bbLay->addStretch( 1 ); - btnRun = new KPushButton( KGuiItem( i18n( "&Run" ), "run" ), btnBox ); - bbLay->addWidget( btnRun ); - btnRun->setDefault( true ); - connect( btnRun, SIGNAL(clicked()), this, SLOT(accept()) ); + m_btnRun = new KPushButton( KGuiItem( i18n( "&Run" ), "run" ), btnBox ); + bbLay->addWidget( m_btnRun ); + m_btnRun->setDefault( true ); m_btnCancel = new KPushButton( KStdGuiItem::cancel(), btnBox ); bbLay->addWidget( m_btnCancel ); - connect(m_btnCancel, SIGNAL(clicked()), this, SLOT(reject())); + m_vbox->addWidget( btnBox, 3, 0 ); - btnRun->setEnabled(!m_runCombo->currentText().isEmpty()); + m_btnRun->setEnabled(!m_runCombo->currentText().isEmpty()); // Very important, to get the size right before showing m_vbox->activate(); @@ -122,13 +118,18 @@ Minicli::Minicli( QWidget *parent, const m_IconName = QString::null; m_FocusWidget = 0; + connect( m_btnRun, SIGNAL(clicked()), this, SLOT(accept()) ); + connect( m_btnCancel, SIGNAL(clicked()), this, SLOT(reject()) ); + connect( m_btnOptions, SIGNAL(clicked()), SLOT(slotAdvanced()) ); + connect( m_parseTimer, SIGNAL(timeout()), SLOT(slotParseTimer()) ); + + connect( m_runCombo, SIGNAL( textChanged( const QString& ) ), + SLOT( slotCmdChanged(const QString&) ) ); + connect( m_runCombo, SIGNAL( activated( const QString& ) ), + m_btnRun, SLOT( animateClick() ) ); + loadConfig(); KWin::setState( winId(), NET::StaysOnTop ); - - finalFilters = KURIFilter::self()->pluginNames(); - finalFilters.remove("kuriikwsfilter"); - middleFilters = finalFilters; - middleFilters.remove("localdomainurifilter"); } Minicli::~Minicli() @@ -159,6 +160,12 @@ void Minicli::loadConfig() m_runCombo->completionObject()->setItems( compList ); int mode = config->readNumEntry( "CompletionMode", KGlobalSettings::completionMode() ); m_runCombo->setCompletionMode( (KGlobalSettings::Completion) mode ); + + finalFilters = KURIFilter::self()->pluginNames(); + finalFilters.remove("kuriikwsfilter"); + + middleFilters = finalFilters; + middleFilters.remove("localdomainurifilter"); } void Minicli::saveConfig() @@ -174,15 +181,17 @@ void Minicli::saveConfig() void Minicli::accept() { - int ret = runCommand(); - - if( ret > 0 ) + hide(); + if( runCommand() == 1 ) + { + exec(); return; + } m_runCombo->addToHistory( m_runCombo->currentText().stripWhiteSpace() ); reset(); - QDialog::accept(); saveConfig(); + QDialog::accept(); } void Minicli::reject() @@ -205,7 +214,7 @@ void Minicli::reset() m_runCombo->setFocus(); m_runCombo->reset(); m_runCombo->blockSignals( block ); - btnRun->setEnabled( false ); + m_btnRun->setEnabled( false ); m_FocusWidget = 0; } @@ -479,7 +488,7 @@ int Minicli::runCommand() void Minicli::slotCmdChanged(const QString& text) { bool state = text.isEmpty(); - btnRun->setEnabled( !state ); + m_btnRun->setEnabled( !state ); if ( state ) { // Reset values to default Index: minicli.h =================================================================== RCS file: /home/kde/kdebase/kdesktop/minicli.h,v retrieving revision 1.38 diff -u -p -b -B -w -r1.38 minicli.h --- minicli.h 30 Oct 2002 09:39:06 -0000 1.38 +++ minicli.h 15 Mar 2003 15:29:00 -0000 @@ -76,7 +76,7 @@ private: KHistoryCombo* m_runCombo; KURIFilterData* m_filterData; QWidget* m_FocusWidget; - QPushButton* btnRun; + QPushButton* m_btnRun; QGridLayout *m_vbox; QStringList terminalAppList; --Boundary-00=_Cd0c+71/W9G83+F--