Skip to content

Commit

Permalink
open project with double click
Browse files Browse the repository at this point in the history
Fixes: 2890121

When you double click on a project in the recent project list that
project is opened.
  • Loading branch information
cpackham committed Nov 24, 2009
1 parent a021d08 commit a8a6aa6
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 51 deletions.
11 changes: 11 additions & 0 deletions trunk/app/openprojectdialog.cpp
Expand Up @@ -152,6 +152,17 @@ void OpenProjectDialog::removeProject()
delete item;
}

/**
* Called when an item in the "Recent Projects" list is double clicked.
* This will cause the project to be opened as if it had been selected
* then the open button clicked.
*/
void OpenProjectDialog::recentProjectActivated(QListWidgetItem* item)
{
pathEdit_->setText(item->data(Qt::UserRole).toString());
accept();
}

} // namespace App

} // namespace KScope
1 change: 1 addition & 0 deletions trunk/app/openprojectdialog.h
Expand Up @@ -69,6 +69,7 @@ private slots:
void newProject();
void pathChanged(const QString&);
void recentProjectSelected();
void recentProjectActivated(QListWidgetItem*);
void removeProject();
};

Expand Down
120 changes: 69 additions & 51 deletions trunk/app/openprojectdialog.ui
@@ -1,59 +1,60 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OpenProjectDialog</class>
<widget class="QDialog" name="OpenProjectDialog" >
<property name="enabled" >
<widget class="QDialog" name="OpenProjectDialog">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry" >
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>485</width>
<height>418</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Open Project</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<widget class="QLabel" name="label">
<property name="text">
<string>Path</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="pathEdit_" />
<widget class="QLineEdit" name="pathEdit_"/>
</item>
<item>
<widget class="QToolButton" name="browseButton_" >
<property name="text" >
<widget class="QToolButton" name="browseButton_">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Recent Projects</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QListWidget" name="recentProjectsList_" />
<widget class="QListWidget" name="recentProjectsList_"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer" >
<property name="orientation" >
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
Expand All @@ -62,11 +63,11 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="removeProjectButton_" >
<property name="enabled" >
<widget class="QPushButton" name="removeProjectButton_">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text" >
<property name="text">
<string>Remove</string>
</property>
</widget>
Expand All @@ -77,20 +78,20 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="newButton_" >
<property name="text" >
<widget class="QPushButton" name="newButton_">
<property name="text">
<string>&amp;New...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
Expand All @@ -99,21 +100,21 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="openButton_" >
<property name="enabled" >
<widget class="QPushButton" name="openButton_">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text" >
<property name="text">
<string>&amp;Open</string>
</property>
<property name="default" >
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton_" >
<property name="text" >
<widget class="QPushButton" name="cancelButton_">
<property name="text">
<string>&amp;Cancel</string>
</property>
</widget>
Expand All @@ -139,11 +140,11 @@
<receiver>OpenProjectDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>427</x>
<y>393</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>281</x>
<y>394</y>
</hint>
Expand All @@ -155,11 +156,11 @@
<receiver>OpenProjectDialog</receiver>
<slot>newProject()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>68</x>
<y>392</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>134</x>
<y>387</y>
</hint>
Expand All @@ -171,11 +172,11 @@
<receiver>OpenProjectDialog</receiver>
<slot>pathChanged(QString)</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>355</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>483</x>
<y>42</y>
</hint>
Expand All @@ -187,11 +188,11 @@
<receiver>OpenProjectDialog</receiver>
<slot>recentProjectSelected()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>180</x>
<y>137</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>482</x>
<y>159</y>
</hint>
Expand All @@ -203,11 +204,11 @@
<receiver>OpenProjectDialog</receiver>
<slot>removeProject()</slot>
<hints>
<hint type="sourcelabel" >
<x>439</x>
<y>336</y>
<hint type="sourcelabel">
<x>470</x>
<y>371</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>480</x>
<y>351</y>
</hint>
Expand All @@ -219,11 +220,11 @@
<receiver>OpenProjectDialog</receiver>
<slot>browse()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>462</x>
<y>21</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>482</x>
<y>13</y>
</hint>
Expand All @@ -235,22 +236,39 @@
<receiver>OpenProjectDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>356</x>
<y>399</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>298</x>
<y>374</y>
</hint>
</hints>
</connection>
<connection>
<sender>recentProjectsList_</sender>
<signal>itemDoubleClicked(QListWidgetItem*)</signal>
<receiver>OpenProjectDialog</receiver>
<slot>recentProjectActivated(QListWidgetItem*)</slot>
<hints>
<hint type="sourcelabel">
<x>242</x>
<y>205</y>
</hint>
<hint type="destinationlabel">
<x>242</x>
<y>208</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>newProject()</slot>
<slot>pathChanged(QString)</slot>
<slot>recentProjectSelected()</slot>
<slot>removeProject()</slot>
<slot>browse()</slot>
<slot>recentProjectActivated(QListWidgetItem*)</slot>
</slots>
</ui>

0 comments on commit a8a6aa6

Please sign in to comment.