Merge lp:~teemperor/simple-scan/elementary-ui into lp:~simple-scan-team/simple-scan/trunk

Proposed by Raphael Isemann
Status: Rejected
Rejected by: Robert Ancell
Proposed branch: lp:~teemperor/simple-scan/elementary-ui
Merge into: lp:~simple-scan-team/simple-scan/trunk
Diff against target: 148 lines (+74/-5)
3 files modified
configure.ac (+1/-0)
src/Makefile.am (+2/-1)
src/ui.vala (+71/-4)
To merge this branch: bzr merge lp:~teemperor/simple-scan/elementary-ui
Reviewer Review Type Date Requested Status
Robert Ancell Needs Fixing
Review via email: mp+147199@code.launchpad.net

Description of the change

I changed the UI as seen here ( https://lists.launchpad.net/elementary-dev-community/msg01568.html ) to meet the elementary-HIG.

My code shouldn't affect simple-scan on other desktops then pantheon in any way.

I get the DE-name from the DESKTOP_SESSION variable, so to test the changes from another distribution you need to run "export DESKTOP_SESSION=pantheon" before executing simple-scan (from the same shell as the export-command).

New dependencies are only the granite library.

For quick feedback i'm also available on #elementary-dev (freenode) as "teemperor".

Have a nice evening!

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

So sorry! It appears I wasn't subscribed to merge requests so I didn't see this merge (I was expecting it though). Feel free to ping me directly if you think I've missed something like this.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

What I like here is the removal of the menubar and the cog menu design - that is good to go upstream.

Issues with the branch as it stands:
- You have a hard dependency on granite - this needs to be optional.
- In saying that, I don't see the value in us taking a dependency on granite since it's Elementary specific. So I'd expect to get the majority of the functional changes into upstream simple-scan but still need a small patch for Elementary specific functionality.
- By removing the menu you have broken the right click functionality on a page.
- The cog menu is missing important functionality like email and print.
- You don't need the crop option in the cog menu (it is in right click on the page). Though it might be worth having the whole page menu as a submenu so it is discoverable.
- The about dialog renames and points at lp:elementary-scan - if this is upstreamed code it should point at lp:simple-scan
- Coding style doesn't match existing code (whitespace, comment style etc).
- Unnecessary changes in the branch - newline at the end of a function.

What I recommend you do is make this branch:
- Remove the current menubar (keeping the right click menu)
- Add the cog menu and populate with existing functionality.

We can then look in a second patch the value of adding an optional granite dependency.

review: Needs Fixing
Revision history for this message
Eduard Gotwig (gotwig) wrote :

this code is outdated, and the merge request should be removed.

Unmerged revisions

606. By Raphael Isemann

removed libgee from dependencies

605. By Raphael Isemann

removed the contractor-section that was already commented out

604. By Raphael Isemann

added an optional ui that meets the elementary-guidelines

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2013-01-19 02:45:11 +0000
+++ configure.ac 2013-02-07 18:13:26 +0000
@@ -28,6 +28,7 @@
28 gdk-pixbuf-2.028 gdk-pixbuf-2.0
29 gudev-1.029 gudev-1.0
30 sqlite330 sqlite3
31 granite
31])32])
3233
33PKG_CHECK_MODULES(COLORD, [34PKG_CHECK_MODULES(COLORD, [
3435
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2012-02-03 20:49:21 +0000
+++ src/Makefile.am 2013-02-07 18:13:26 +0000
@@ -19,7 +19,8 @@
19 --pkg=gudev-1.0 \19 --pkg=gudev-1.0 \
20 --pkg=gio-2.0 \20 --pkg=gio-2.0 \
21 --pkg=gtk+-3.0 \21 --pkg=gtk+-3.0 \
22 --pkg=sqlite322 --pkg=sqlite3 \
23 --pkg=granite
2324
24if HAVE_COLORD25if HAVE_COLORD
25simple_scan_VALAFLAGS += -D HAVE_COLORD26simple_scan_VALAFLAGS += -D HAVE_COLORD
2627
=== modified file 'src/ui.vala'
--- src/ui.vala 2013-01-19 02:45:11 +0000
+++ src/ui.vala 2013-02-07 18:13:26 +0000
@@ -1,7 +1,7 @@
1/*1/*
2 * Copyright (C) 2009-2011 Canonical Ltd.2 * Copyright (C) 2009-2011 Canonical Ltd.
3 * Author: Robert Ancell <robert.ancell@canonical.com>3 * Authors: Robert Ancell <robert.ancell@canonical.com>
4 *4 * Raphael Isemann <teemperor@googlemail.com>
5 * This program is free software: you can redistribute it and/or modify it under5 * This program is free software: you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option) any later7 * Foundation, either version 3 of the License, or (at your option) any later
@@ -92,6 +92,9 @@
92 private int window_height;92 private int window_height;
93 private bool window_is_maximized;93 private bool window_is_maximized;
9494
95 //indicates if the current enviroment is the pantheon shell
96 private bool is_pantheon;
97
95 public signal void start_scan (string? device, ScanOptions options);98 public signal void start_scan (string? device, ScanOptions options);
96 public signal void stop_scan ();99 public signal void stop_scan ();
97 public signal void email (string profile);100 public signal void email (string profile);
@@ -104,9 +107,13 @@
104107
105 settings = new Settings ("org.gnome.SimpleScan");108 settings = new Settings ("org.gnome.SimpleScan");
106109
110 string? env = Environment.get_variable("DESKTOP_SESSION");
111 is_pantheon = (env == "pantheon");
112
107 load ();113 load ();
108114
109 autosave_manager = AutosaveManager.create (ref book);115 autosave_manager = AutosaveManager.create (ref book);
116
110 }117 }
111118
112 ~UserInterface ()119 ~UserInterface ()
@@ -1095,8 +1102,29 @@
10951102
1096 /* Description of program */1103 /* Description of program */
1097 string description = _("Simple document scanning tool");1104 string description = _("Simple document scanning tool");
10981105 if(is_pantheon)
1099 Gtk.show_about_dialog (window,1106 Granite.Widgets.show_about_dialog ((Gtk.Window) widget,
1107 "program_name", "Simple Scan with elementary UI",
1108 "version", VERSION,
1109 "logo_icon_name", "scanner",
1110
1111 "comments", description,
1112 "copyright", "2009-2011 Canonical Ltd.",
1113 "website", "https://launchpad.net/elementary-scan",
1114 "website_label", "Website",
1115
1116 "authors", authors,
1117 //"documenters", about_documenters,
1118 //"artists", about_artists,
1119 "translator_credits", _("translator-credits"),
1120 "license", license,
1121 "license_type", Gtk.License.GPL_3_0,
1122
1123 "help", "https://answers.launchpad.net/elementary-scan",
1124 "translate", "https://translations.launchpad.net/simple-scan",
1125 "bug", "https://bugs.launchpad.net/elementary-scan");
1126 else
1127 Gtk.show_about_dialog (window,
1100 "title", title,1128 "title", title,
1101 "program-name", "Simple Scan",1129 "program-name", "Simple Scan",
1102 "version", VERSION,1130 "version", VERSION,
@@ -1109,6 +1137,7 @@
1109 "license", license,1137 "license", license,
1110 "wrap-license", true,1138 "wrap-license", true,
1111 null);1139 null);
1140
1112 }1141 }
11131142
1114 private bool on_quit ()1143 private bool on_quit ()
@@ -1316,6 +1345,44 @@
1316 photo_toolbar_menuitem = (Gtk.RadioMenuItem) builder.get_object ("photo_toolbutton_menuitem");1345 photo_toolbar_menuitem = (Gtk.RadioMenuItem) builder.get_object ("photo_toolbutton_menuitem");
1317 photo_menu_menuitem = (Gtk.RadioMenuItem) builder.get_object ("photo_menuitem");1346 photo_menu_menuitem = (Gtk.RadioMenuItem) builder.get_object ("photo_menuitem");
13181347
1348 if(is_pantheon) {
1349 //hide the menubar to follow elementary-guidelines
1350 var menubar = (Gtk.MenuBar) builder.get_object ("menubar");
1351 menubar.hide();
1352
1353 //unparent menuitems that we want in the appmenu
1354 var crop_menuitem = (Gtk.MenuItem) builder.get_object ("crop_menuitem");
1355 crop_menuitem.unparent ();
1356 var content_menuitem = (Gtk.MenuItem) builder.get_object ("help_contents_menuitem");
1357 content_menuitem.unparent ();
1358 var about_menuitem = (Gtk.MenuItem) builder.get_object ("about_menuitem");
1359 about_menuitem.unparent ();
1360 var preferences_menuitem = (Gtk.MenuItem) builder.get_object ("preferences_menuitem");
1361 preferences_menuitem.unparent ();
1362
1363 //build the appmenu
1364 var menu = new Gtk.Menu ();
1365 menu.append (crop_menuitem);
1366 menu.append (preferences_menuitem);
1367 menu.append (new Gtk.SeparatorMenuItem ());
1368 menu.append (content_menuitem);
1369 menu.append (about_menuitem);
1370
1371 var appmenu = new Granite.Widgets.ToolButtonWithMenu.from_stock (
1372 Gtk.Stock.PROPERTIES, Gtk.IconSize.MENU, _("Menu"), menu);
1373 var appmenu_toolitem = new Gtk.ToolItem ();
1374 appmenu_toolitem.add (appmenu);
1375
1376 //create a spacer to align the elementary-menuitems on the right side
1377 var spacer = new Gtk.ToolItem ();
1378 spacer.set_expand (true);
1379
1380 var toolbar = (Gtk.Toolbar) builder.get_object ("toolbar1");
1381 toolbar.insert (spacer, 8);
1382 toolbar.insert (appmenu_toolitem, 9);
1383 toolbar.show_all ();
1384 }
1385
1319 authorize_dialog = (Gtk.Dialog) builder.get_object ("authorize_dialog");1386 authorize_dialog = (Gtk.Dialog) builder.get_object ("authorize_dialog");
1320 authorize_label = (Gtk.Label) builder.get_object ("authorize_label");1387 authorize_label = (Gtk.Label) builder.get_object ("authorize_label");
1321 username_entry = (Gtk.Entry) builder.get_object ("username_entry");1388 username_entry = (Gtk.Entry) builder.get_object ("username_entry");

Subscribers

People subscribed via source and target branches