Merge lp:~robert-ancell/deja-dup/unity-control-center2 into lp:deja-dup/30

Proposed by Robert Ancell
Status: Merged
Merge reported by: Michael Terry
Merged at revision: not available
Proposed branch: lp:~robert-ancell/deja-dup/unity-control-center2
Merge into: lp:deja-dup/30
Diff against target: 306 lines (+162/-16)
12 files modified
CMakeLists.txt (+9/-0)
debian/control (+1/-0)
debian/rules (+1/-0)
deja-dup/preferences/CMakeLists.txt (+7/-12)
deja-dup/preferences/PreferencesPanel.c (+4/-0)
deja-dup/preferences/deja-dup-preferences.desktop.in (+1/-1)
deja-dup/preferences/gnome-control-center/CMakeLists.txt (+36/-0)
deja-dup/preferences/gnome-control-center/gnome-deja-dup-panel.desktop.in (+1/-1)
deja-dup/preferences/unity-control-center/CMakeLists.txt (+36/-0)
deja-dup/preferences/unity-control-center/unity-deja-dup-panel.desktop.in (+29/-0)
deja-dup/tests/CMakeLists.txt (+7/-2)
deja-dup/tests/deja_dup_autopilot/test_ccpanel.py (+30/-0)
To merge this branch: bzr merge lp:~robert-ancell/deja-dup/unity-control-center2
Reviewer Review Type Date Requested Status
Michael Terry Approve
Review via email: mp+200950@code.launchpad.net

Description of the change

Compile a Unity Control Center panel.

Things to note:
- unity-control-center is now in Universe, with a MIR in process
- This relies on both control center APIs staying the same, but I don't know of any reason why that would change in the future
- I originally just switched to building against u-c-c since g-c-c doesn't support external panels upstream but the Ubuntu GNOME people said they still wanted to keep using this panel in newer GNOME
- deja-dup/preferences/Preferences.vala is converted into C twice since I couldn't work out how both panels could use it without copying. Doesn't seem to be a problem in practise since the conversion is identical

To post a comment you must log in.
1519. By Robert Ancell

Show GNOME deja-dup panel in Unity so it's still there during migration

1520. By Robert Ancell

Tag with bug number

Revision history for this message
Michael Terry (mterry) wrote :

Merged with some minor changes:
- Typo in new autopilot test (had to change right super() class)
- Dropped the two new directories. I understand why you did that, but I just specified a LIBRARY_OUTPUT_DIRECTORY to stuff the two libdeja-dup.so files in different places.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-12-11 19:23:26 +0000
+++ CMakeLists.txt 2014-01-10 01:44:47 +0000
@@ -26,6 +26,7 @@
26deja_option(ENABLE_CCPANEL "Build gnome-control-center panel" CHECK)26deja_option(ENABLE_CCPANEL "Build gnome-control-center panel" CHECK)
27deja_option(ENABLE_NAUTILUS "Build nautilus plugin" CHECK)27deja_option(ENABLE_NAUTILUS "Build nautilus plugin" CHECK)
28deja_option(ENABLE_UNITY "Integrate with Unity" CHECK)28deja_option(ENABLE_UNITY "Integrate with Unity" CHECK)
29deja_option(ENABLE_UNITY_CCPANEL "Build unity-control-center panel" CHECK)
2930
30find_package(PkgConfig 0.24 REQUIRED)31find_package(PkgConfig 0.24 REQUIRED)
31find_package(Vala 0.20 REQUIRED)32find_package(Vala 0.20 REQUIRED)
@@ -55,6 +56,14 @@
5556
56deja_enable_option(UNITY unity>=3.4.2)57deja_enable_option(UNITY unity>=3.4.2)
5758
59deja_enable_option(UNITY_CCPANEL libunity-control-center)
60if(ENABLE_UNITY_CCPANEL)
61 execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=extensiondir libunity-control-center
62 OUTPUT_VARIABLE UNITY_CCPANEL_EXTENSIONDIR
63 OUTPUT_STRIP_TRAILING_WHITESPACE
64 ERROR_QUIET)
65endif()
66
58# Set up some common configuration values; Vala sees these via config.vapi.67# Set up some common configuration values; Vala sees these via config.vapi.
59include(GNUInstallDirs)68include(GNUInstallDirs)
60set(PACKAGE "deja-dup")69set(PACKAGE "deja-dup")
6170
=== modified file 'debian/control'
--- debian/control 2013-11-07 02:42:47 +0000
+++ debian/control 2014-01-10 01:44:47 +0000
@@ -17,6 +17,7 @@
17 libpeas-dev,17 libpeas-dev,
18 libsecret-1-dev,18 libsecret-1-dev,
19 libunity-dev (>= 5.0.0),19 libunity-dev (>= 5.0.0),
20 libunity-control-center-dev,
20 libxml2-utils,21 libxml2-utils,
21 pkg-config,22 pkg-config,
22 python3,23 python3,
2324
=== modified file 'debian/rules'
--- debian/rules 2013-12-11 19:23:26 +0000
+++ debian/rules 2014-01-10 01:44:47 +0000
@@ -12,6 +12,7 @@
12 dh_auto_configure -- -DENABLE_CCPANEL=ON \12 dh_auto_configure -- -DENABLE_CCPANEL=ON \
13 -DENABLE_NAUTILUS=ON \13 -DENABLE_NAUTILUS=ON \
14 -DENABLE_UNITY=ON \14 -DENABLE_UNITY=ON \
15 -DENABLE_UNITY_CCPANEL=ON \
15 -DCMAKE_INSTALL_LIBEXECDIR="/usr/lib/${DEB_HOST_MULTIARCH}" \16 -DCMAKE_INSTALL_LIBEXECDIR="/usr/lib/${DEB_HOST_MULTIARCH}" \
16 -DCMAKE_INSTALL_SYSCONFDIR="/etc"17 -DCMAKE_INSTALL_SYSCONFDIR="/etc"
1718
1819
=== modified file 'deja-dup/preferences/CMakeLists.txt'
--- deja-dup/preferences/CMakeLists.txt 2013-10-14 22:22:07 +0000
+++ deja-dup/preferences/CMakeLists.txt 2014-01-10 01:44:47 +0000
@@ -16,8 +16,12 @@
16# You should have received a copy of the GNU General Public License16# You should have received a copy of the GNU General Public License
17# along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.17# along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
1818
19# Hide preferences if have control center panel
19if(ENABLE_CCPANEL)20if(ENABLE_CCPANEL)
20 set(CCPANEL_SHOWIN "GNOME;Unity;") # for replacing @CCPANEL_SHOWIN@ in desktop files21 set(PREFERENCES_NOTSHOWIN "GNOME;")
22endif()
23if(ENABLE_UNITY_CCPANEL)
24 set(PREFERENCES_NOTSHOWIN "${PREFERENCES_NOTSHOWIN}Unity;")
21endif()25endif()
2226
23vala_precompile(VALA_C preferences-main.vala27vala_precompile(VALA_C preferences-main.vala
@@ -36,14 +40,5 @@
3640
37deja_merge_po(desktop deja-dup-preferences.desktop "${CMAKE_INSTALL_FULL_DATADIR}/applications")41deja_merge_po(desktop deja-dup-preferences.desktop "${CMAKE_INSTALL_FULL_DATADIR}/applications")
3842
39if(ENABLE_CCPANEL)43add_subdirectory(gnome-control-center)
40add_library(deja-dup-ccpanel MODULE Preferences.c PreferencesPanel.c)44add_subdirectory(unity-control-center)
41target_link_libraries(deja-dup-ccpanel deja widgets ${CCPANEL_LDFLAGS} ${GTK_LDFLAGS} ${PEAS_LDFLAGS} ${SECRET_LDFLAGS})
42set_target_properties(deja-dup-ccpanel PROPERTIES
43 OUTPUT_NAME deja-dup
44 INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/libdeja;${CMAKE_BINARY_DIR}/deja-dup/widgets"
45 COMPILE_FLAGS "${CCPANEL_CFLAGS} ${GTK_CFLAGS} ${PEAS_CFLAGS} ${SECRET_CFLAGS} ${COMMON_CFLAGS}")
46install(TARGETS deja-dup-ccpanel DESTINATION "${CCPANEL_EXTENSIONDIR}")
47
48deja_merge_po(desktop gnome-deja-dup-panel.desktop "${CMAKE_INSTALL_FULL_DATADIR}/applications")
49endif()
5045
=== modified file 'deja-dup/preferences/PreferencesPanel.c'
--- deja-dup/preferences/PreferencesPanel.c 2013-10-14 22:22:07 +0000
+++ deja-dup/preferences/PreferencesPanel.c 2014-01-10 01:44:47 +0000
@@ -22,7 +22,11 @@
22*/22*/
2323
24#include <gtk/gtk.h>24#include <gtk/gtk.h>
25#ifdef USE_UNITY
26#include <libunity-control-center/cc-panel.h>
27#else
25#include <libgnome-control-center/cc-panel.h>28#include <libgnome-control-center/cc-panel.h>
29#endif
26#include "widgets.h"30#include "widgets.h"
2731
28extern void* deja_dup_preferences_new (gboolean show_auto_switch);32extern void* deja_dup_preferences_new (gboolean show_auto_switch);
2933
=== modified file 'deja-dup/preferences/deja-dup-preferences.desktop.in'
--- deja-dup/preferences/deja-dup-preferences.desktop.in 2013-10-14 17:14:15 +0000
+++ deja-dup/preferences/deja-dup-preferences.desktop.in 2014-01-10 01:44:47 +0000
@@ -13,7 +13,7 @@
13Type=Application13Type=Application
14Categories=Settings;Utility;Archiving;GNOME;GTK;X-GNOME-SystemSettings;14Categories=Settings;Utility;Archiving;GNOME;GTK;X-GNOME-SystemSettings;
1515
16NotShowIn=@CCPANEL_SHOWIN@16NotShowIn=@PREFERENCES_NOTSHOWIN@
1717
18# Translators: Add whatever keywords you want in your language, separated by semicolons18# Translators: Add whatever keywords you want in your language, separated by semicolons
19# These keywords are used when searching for applications in dashes, etc.19# These keywords are used when searching for applications in dashes, etc.
2020
=== added directory 'deja-dup/preferences/gnome-control-center'
=== added file 'deja-dup/preferences/gnome-control-center/CMakeLists.txt'
--- deja-dup/preferences/gnome-control-center/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ deja-dup/preferences/gnome-control-center/CMakeLists.txt 2014-01-10 01:44:47 +0000
@@ -0,0 +1,36 @@
1# -*- Mode: CMake; indent-tabs-mode: nil; tab-width: 2 -*-
2#
3# This file is part of Déjà Dup.
4# For copyright information, see AUTHORS.
5#
6# Déjà Dup is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 3 of the License, or
9# (at your option) any later version.
10#
11# Déjà Dup is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
18
19if(ENABLE_CCPANEL)
20vala_precompile(VALA_C ../Preferences.vala
21 PACKAGES gtk+-3.0 libpeas-1.0 libsecret-1
22 CUSTOM_VAPIS ${CMAKE_BINARY_DIR}/libdeja/deja.vapi
23 ${CMAKE_BINARY_DIR}/deja-dup/widgets/widgets.vapi
24 ${CMAKE_SOURCE_DIR}/vapi/config.vapi
25 OPTIONS ${COMMON_VFLAGS})
26
27add_library(deja-dup-ccpanel MODULE ${VALA_C} ../PreferencesPanel.c)
28target_link_libraries(deja-dup-ccpanel deja widgets ${CCPANEL_LDFLAGS} ${GTK_LDFLAGS} ${PEAS_LDFLAGS} ${SECRET_LDFLAGS})
29set_target_properties(deja-dup-ccpanel PROPERTIES
30 OUTPUT_NAME deja-dup
31 INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/libdeja;${CMAKE_BINARY_DIR}/deja-dup/widgets"
32 COMPILE_FLAGS "${CCPANEL_CFLAGS} ${GTK_CFLAGS} ${PEAS_CFLAGS} ${SECRET_CFLAGS} ${COMMON_CFLAGS}")
33install(TARGETS deja-dup-ccpanel DESTINATION "${CCPANEL_EXTENSIONDIR}")
34
35deja_merge_po(desktop gnome-deja-dup-panel.desktop "${CMAKE_INSTALL_FULL_DATADIR}/applications")
36endif()
037
=== renamed file 'deja-dup/preferences/gnome-deja-dup-panel.desktop.in' => 'deja-dup/preferences/gnome-control-center/gnome-deja-dup-panel.desktop.in'
--- deja-dup/preferences/gnome-deja-dup-panel.desktop.in 2013-10-14 17:14:15 +0000
+++ deja-dup/preferences/gnome-control-center/gnome-deja-dup-panel.desktop.in 2014-01-10 01:44:47 +0000
@@ -14,7 +14,7 @@
14Categories=Settings;Utility;Archiving;GNOME;GTK;X-GNOME-SystemSettings;X-GNOME-Settings-Panel;14Categories=Settings;Utility;Archiving;GNOME;GTK;X-GNOME-SystemSettings;X-GNOME-Settings-Panel;
15X-GNOME-Settings-Panel=deja-dup15X-GNOME-Settings-Panel=deja-dup
1616
17OnlyShowIn=@CCPANEL_SHOWIN@17OnlyShowIn=GNOME;Unity;
1818
19# Translators: Add whatever keywords you want in your language, separated by semicolons19# Translators: Add whatever keywords you want in your language, separated by semicolons
20# These keywords are used when searching for applications in dashes, etc.20# These keywords are used when searching for applications in dashes, etc.
2121
=== added directory 'deja-dup/preferences/unity-control-center'
=== added file 'deja-dup/preferences/unity-control-center/CMakeLists.txt'
--- deja-dup/preferences/unity-control-center/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ deja-dup/preferences/unity-control-center/CMakeLists.txt 2014-01-10 01:44:47 +0000
@@ -0,0 +1,36 @@
1# -*- Mode: CMake; indent-tabs-mode: nil; tab-width: 2 -*-
2#
3# This file is part of Déjà Dup.
4# For copyright information, see AUTHORS.
5#
6# Déjà Dup is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 3 of the License, or
9# (at your option) any later version.
10#
11# Déjà Dup is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14# General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
18
19if(ENABLE_UNITY_CCPANEL)
20vala_precompile(VALA_C ../Preferences.vala
21 PACKAGES gtk+-3.0 libpeas-1.0 libsecret-1
22 CUSTOM_VAPIS ${CMAKE_BINARY_DIR}/libdeja/deja.vapi
23 ${CMAKE_BINARY_DIR}/deja-dup/widgets/widgets.vapi
24 ${CMAKE_SOURCE_DIR}/vapi/config.vapi
25 OPTIONS ${COMMON_VFLAGS})
26
27add_library(deja-dup-unity-ccpanel MODULE ${VALA_C} ../PreferencesPanel.c)
28target_link_libraries(deja-dup-unity-ccpanel deja widgets ${UNITY_CCPANEL_LDFLAGS} ${GTK_LDFLAGS} ${PEAS_LDFLAGS} ${SECRET_LDFLAGS})
29set_target_properties(deja-dup-unity-ccpanel PROPERTIES
30 OUTPUT_NAME deja-dup
31 INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/libdeja;${CMAKE_BINARY_DIR}/deja-dup/widgets"
32 COMPILE_FLAGS "-DUSE_UNITY ${UNITY_CCPANEL_CFLAGS} ${GTK_CFLAGS} ${PEAS_CFLAGS} ${SECRET_CFLAGS} ${COMMON_CFLAGS}")
33install(TARGETS deja-dup-unity-ccpanel DESTINATION "${UNITY_CCPANEL_EXTENSIONDIR}")
34
35deja_merge_po(desktop unity-deja-dup-panel.desktop "${CMAKE_INSTALL_FULL_DATADIR}/applications")
36endif()
037
=== added file 'deja-dup/preferences/unity-control-center/unity-deja-dup-panel.desktop.in'
--- deja-dup/preferences/unity-control-center/unity-deja-dup-panel.desktop.in 1970-01-01 00:00:00 +0000
+++ deja-dup/preferences/unity-control-center/unity-deja-dup-panel.desktop.in 2014-01-10 01:44:47 +0000
@@ -0,0 +1,29 @@
1[Desktop Entry]
2Version=1.0
3
4_Name=Backups
5_Comment=Change your backup settings
6
7Icon=deja-dup
8TryExec=unity-control-center
9Exec=unity-control-center deja-dup
10
11StartupNotify=true
12
13Type=Application
14Categories=Settings;Utility;Archiving;GNOME;GTK;X-GNOME-SystemSettings;X-Unity-Settings-Panel;
15X-Unity-Settings-Panel=deja-dup
16
17OnlyShowIn=Unity;
18
19# Translators: Add whatever keywords you want in your language, separated by semicolons
20# These keywords are used when searching for applications in dashes, etc.
21_Keywords=déjà;deja;dup;
22
23X-AppInstall-Ignore=true
24
25Actions=BackUpNow;
26
27[Desktop Action BackUpNow]
28_Name=Back Up
29Exec=deja-dup --backup
030
=== modified file 'deja-dup/tests/CMakeLists.txt'
--- deja-dup/tests/CMakeLists.txt 2013-11-08 07:24:00 +0000
+++ deja-dup/tests/CMakeLists.txt 2014-01-10 01:44:47 +0000
@@ -21,11 +21,16 @@
21else()21else()
22 set(HAS_CCPANEL "0")22 set(HAS_CCPANEL "0")
23endif()23endif()
24if(ENABLE_UNITY_CCPANEL)
25 set(HAS_UNITY_CCPANEL "1")
26else()
27 set(HAS_UNITY_CCPANEL "0")
28endif()
2429
25add_custom_target(autopilot-deja-dup30add_custom_target(autopilot-deja-dup
26 COMMAND env HAS_CCPANEL=${HAS_CCPANEL} LANG=C DEJA_DUP_TESTING=1 PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests/shell" autopilot-py3 run deja_dup_autopilot)31 COMMAND env HAS_CCPANEL=${HAS_CCPANEL} HAS_UNITY_CCPANEL=${HAS_UNITY_CCPANEL} LANG=C DEJA_DUP_TESTING=1 PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests/shell" autopilot-py3 run deja_dup_autopilot)
27add_dependencies(autopilot autopilot-deja-dup)32add_dependencies(autopilot autopilot-deja-dup)
2833
29add_custom_target(autopilot-system-deja-dup34add_custom_target(autopilot-system-deja-dup
30 COMMAND env HAS_CCPANEL=${HAS_CCPANEL} LANG=C DEJA_DUP_TESTING=1 PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests/shell-system" autopilot-py3 run deja_dup_autopilot)35 COMMAND env HAS_CCPANEL=${HAS_CCPANEL} HAS_UNITY_CCPANEL=${HAS_UNITY_CCPANEL} LANG=C DEJA_DUP_TESTING=1 PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests/shell-system" autopilot-py3 run deja_dup_autopilot)
31add_dependencies(autopilot-system autopilot-system-deja-dup)36add_dependencies(autopilot-system autopilot-system-deja-dup)
3237
=== modified file 'deja-dup/tests/deja_dup_autopilot/test_ccpanel.py'
--- deja-dup/tests/deja_dup_autopilot/test_ccpanel.py 2013-10-10 05:55:33 +0000
+++ deja-dup/tests/deja_dup_autopilot/test_ccpanel.py 2014-01-10 01:44:47 +0000
@@ -51,3 +51,33 @@
51 button = window.select_single("GtkButton", label="_All Settings")51 button = window.select_single("GtkButton", label="_All Settings")
52 self.pointer.click_object(button)52 self.pointer.click_object(button)
53 self.assertThat(window.title, Eventually(NotEquals("Backups")))53 self.assertThat(window.title, Eventually(NotEquals("Backups")))
54
55class CCUnityPanelTests(DejaDupTestCase):
56
57 @system_only
58 def setUp(self):
59 super(CCPanelTests, self).setUp()
60 if os.environ.get("HAS_UNITY_CCPANEL") != "1":
61 self.skip("Skipping disabled Unity ccpanel test")
62
63 def test_clean_exit(self):
64 """Launch and close the panel a couple times. If we don't properly
65 clean up after ourselves when we are disposed, this may cause a
66 crash."""
67 app = self.launch_test_application('unity-control-center', 'deja-dup')
68 window = app.select_single("GtkApplicationWindow")
69 self.assertThat(window.title, Eventually(Equals("Backups")))
70 self.close_backup_panel(window)
71 self.open_backup_panel(window)
72 self.close_backup_panel(window)
73
74 def open_backup_panel(self, window):
75 # This is dumb, but GtkIconView doesn't seem to list its contents to
76 # autopilot. TODO: make this actually click on Backup icon in window
77 os.system('unity-control-center deja-dup')
78 self.assertThat(window.title, Eventually(Equals("Backups")))
79
80 def close_backup_panel(self, window):
81 button = window.select_single("GtkButton", label="_All Settings")
82 self.pointer.click_object(button)
83 self.assertThat(window.title, Eventually(NotEquals("Backups")))

Subscribers

People subscribed via source and target branches