Merge lp:~ris/unity-2d/fix-729478 into lp:unity-2d/3.0

Proposed by Robert Sajdok
Status: Merged
Approved by: Aurélien Gâteau
Approved revision: 493
Merged at revision: 504
Proposed branch: lp:~ris/unity-2d/fix-729478
Merge into: lp:unity-2d/3.0
Diff against target: 109 lines (+24/-1)
8 files modified
launcher/LauncherItem.qml (+1/-1)
launcher/LauncherList.qml (+3/-0)
launcher/UnityApplications/launcherapplication.cpp (+6/-0)
launcher/UnityApplications/launcherapplication.h (+1/-0)
launcher/UnityApplications/launcheritem.cpp (+5/-0)
launcher/UnityApplications/launcheritem.h (+1/-0)
launcher/UnityApplications/trash.cpp (+6/-0)
launcher/UnityApplications/trash.h (+1/-0)
To merge this branch: bzr merge lp:~ris/unity-2d/fix-729478
Reviewer Review Type Date Requested Status
Aurélien Gâteau (community) Approve
Review via email: mp+55000@code.launchpad.net

Commit message

[launcher] Clicking middle mouse button now launches another instance of the application.

To post a comment you must log in.
Revision history for this message
Aurélien Gâteau (agateau) wrote :

Hi Robert,

Thanks for this patch, works well! I just have a few nitpicks:

- Indentation in launcher/LauncherList.qml is wrong: it mixes tabs and spaces

- Since LauncherApplication::newInstance() just calls LauncherApplication::launch(), it is simpler to just call launch(). You only have to make it a public slot.

review: Needs Fixing
lp:~ris/unity-2d/fix-729478 updated
492. By Robert Sajdok

Fixed: "Indentation in launcher/LauncherList.qml is wrong: it mixes tabs and spaces"

Revision history for this message
Robert Sajdok (ris) wrote :

> Hi Robert,
>
> Thanks for this patch, works well! I just have a few nitpicks:
>
> - Indentation in launcher/LauncherList.qml is wrong: it mixes tabs and spaces
Done

>
> - Since LauncherApplication::newInstance() just calls
> LauncherApplication::launch(), it is simpler to just call launch(). You only
> have to make it a public slot.
Did you notice that the class: Trash does not have a function: "launch()" ?

Revision history for this message
Aurélien Gâteau (agateau) wrote :

> > - Since LauncherApplication::newInstance() just calls
> > LauncherApplication::launch(), it is simpler to just call launch(). You only
> > have to make it a public slot.
> Did you notice that the class: Trash does not have a function: "launch()" ?

Of course I did not, otherwise I wouldn't have made such a dumb suggestion :)

Can you then just rename newInstance() to launchNewInstance() for consistency?

lp:~ris/unity-2d/fix-729478 updated
493. By Robert Sajdok

Rename newInstance() to launchNewInstance() for consistency

Revision history for this message
Robert Sajdok (ris) wrote :

> Can you then just rename newInstance() to launchNewInstance() for consistency?
Of Course, done.

Revision history for this message
Aurélien Gâteau (agateau) wrote :

Thanks a lot Robert!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/LauncherItem.qml'
2--- launcher/LauncherItem.qml 2011-03-22 06:01:23 +0000
3+++ launcher/LauncherItem.qml 2011-03-31 08:15:59 +0000
4@@ -359,7 +359,7 @@
5 anchors.fill: parent
6
7 hoverEnabled: true
8- acceptedButtons: Qt.LeftButton | Qt.RightButton
9+ acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MidButton
10 onClicked: item.clicked(mouse)
11 onEntered: item.entered()
12 onExited: item.exited()
13
14=== modified file 'launcher/LauncherList.qml'
15--- launcher/LauncherList.qml 2011-03-23 13:27:37 +0000
16+++ launcher/LauncherList.qml 2011-03-31 08:15:59 +0000
17@@ -118,6 +118,9 @@
18 showMenu()
19 item.menu.folded = false
20 }
21+ else if (mouse.button == Qt.MidButton) {
22+ item.launchNewInstance()
23+ }
24 }
25
26 /* Display the tooltip when hovering the item only when the list
27
28=== modified file 'launcher/UnityApplications/launcherapplication.cpp'
29--- launcher/UnityApplications/launcherapplication.cpp 2011-03-30 14:01:35 +0000
30+++ launcher/UnityApplications/launcherapplication.cpp 2011-03-31 08:15:59 +0000
31@@ -611,6 +611,12 @@
32 }
33 }
34
35+void
36+LauncherApplication::launchNewInstance()
37+{
38+ launch();
39+}
40+
41 bool
42 LauncherApplication::launch()
43 {
44
45=== modified file 'launcher/UnityApplications/launcherapplication.h'
46--- launcher/UnityApplications/launcherapplication.h 2011-03-22 22:55:11 +0000
47+++ launcher/UnityApplications/launcherapplication.h 2011-03-31 08:15:59 +0000
48@@ -89,6 +89,7 @@
49 Q_INVOKABLE void close();
50 Q_INVOKABLE void spread();
51 Q_INVOKABLE void setIconGeometry(int x, int y, int width, int height, uint xid=0);
52+ Q_INVOKABLE virtual void launchNewInstance();
53
54 Q_INVOKABLE virtual void createMenuActions();
55
56
57=== modified file 'launcher/UnityApplications/launcheritem.cpp'
58--- launcher/UnityApplications/launcheritem.cpp 2011-02-16 11:03:59 +0000
59+++ launcher/UnityApplications/launcheritem.cpp 2011-03-31 08:15:59 +0000
60@@ -51,3 +51,8 @@
61 /* Default to doing nothing. */
62 }
63
64+void
65+LauncherItem::launchNewInstance()
66+{
67+ /* Default to doing nothing. */
68+}
69
70=== modified file 'launcher/UnityApplications/launcheritem.h'
71--- launcher/UnityApplications/launcheritem.h 2011-03-09 13:23:04 +0000
72+++ launcher/UnityApplications/launcheritem.h 2011-03-31 08:15:59 +0000
73@@ -58,6 +58,7 @@
74 /* methods */
75 Q_INVOKABLE virtual void activate() = 0;
76 Q_INVOKABLE virtual void createMenuActions() = 0;
77+ Q_INVOKABLE virtual void launchNewInstance();
78
79 protected:
80 LauncherContextualMenu* m_menu;
81
82=== modified file 'launcher/UnityApplications/trash.cpp'
83--- launcher/UnityApplications/trash.cpp 2011-03-16 17:37:58 +0000
84+++ launcher/UnityApplications/trash.cpp 2011-03-31 08:15:59 +0000
85@@ -95,6 +95,12 @@
86 }
87
88 void
89+Trash::launchNewInstance()
90+{
91+ open();
92+}
93+
94+void
95 Trash::open() const
96 {
97 GError* error = NULL;
98
99=== modified file 'launcher/UnityApplications/trash.h'
100--- launcher/UnityApplications/trash.h 2011-03-09 13:23:04 +0000
101+++ launcher/UnityApplications/trash.h 2011-03-31 08:15:59 +0000
102@@ -48,6 +48,7 @@
103 /* methods */
104 Q_INVOKABLE virtual void activate();
105 Q_INVOKABLE virtual void createMenuActions();
106+ Q_INVOKABLE virtual void launchNewInstance();
107
108 public Q_SLOTS:
109 /* Custom implementation of drag’n’drop handling. Dropping files on the

Subscribers

People subscribed via source and target branches