[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdenetwork/krdc
From:       Tony Murray <murraytony () gmail ! com>
Date:       2011-02-02 3:10:27
Message-ID: 20110202031027.8C441AC8BD () svn ! kde ! org
[Download RAW message or body]

SVN commit 1218329 by murrant:

Clear the input field when the new connection action is fired, but not when a tab is closed.


 M  +8 -4      mainwindow.cpp  
 M  +1 -1      mainwindow.h  


--- trunk/KDE/kdenetwork/krdc/mainwindow.cpp #1218328:1218329
@@ -604,7 +604,7 @@
 
     // if closing the last connection, create new connection tab
     if (m_tabWidget->count() == 0) {
-        newConnectionPage();
+        newConnectionPage(false);
     }
 
     // if the newConnectionWidget is the only tab and we are fullscreen, switch to window mode
@@ -633,7 +633,7 @@
 
     // if closing the last connection, create new connection tab
     if (m_tabWidget->count() == 0) {
-        newConnectionPage();
+        newConnectionPage(false);
     }
 
     // if the newConnectionWidget is the only tab and we are fullscreen, switch to window mode
@@ -1162,7 +1162,7 @@
     Settings::self()->writeConfig();
 }
 
-void MainWindow::newConnectionPage()
+void MainWindow::newConnectionPage(bool clearInput)
 {
     const int indexOfNewConnectionWidget = m_tabWidget->indexOf(m_newConnectionWidget);
     if (indexOfNewConnectionWidget >= 0)
@@ -1171,9 +1171,13 @@
         const int index = m_tabWidget->addTab(newConnectionWidget(), i18n("New Connection"));
         m_tabWidget->setCurrentIndex(index);
     }
-    m_addressInput->setFocus();
+    if(clearInput) {
+        m_addressInput->clear();
+    } else {
     m_addressInput->selectAll();
 }
+    m_addressInput->setFocus();
+}
 
 QList<RemoteView *> MainWindow::remoteViewList() const
 {
--- trunk/KDE/kdenetwork/krdc/mainwindow.h #1218328:1218329
@@ -102,7 +102,7 @@
     void updateConfiguration();
     void tabChanged(int index);
     QWidget* newConnectionWidget();
-    void newConnectionPage();
+    void newConnectionPage(bool clearInput = true);
     void openFromRemoteDesktopsModel(const QModelIndex &index);
     void createDockWidget();
     void showConnectionContextMenu(const QPoint &pos);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic