Skip to content

Commit 65eb6d9

Browse files
danirabbitjeremypw
andauthored
Drop Contractor (#908)
Co-authored-by: Jeremy Wootten <jeremywootten@gmail.com>
1 parent 863a70c commit 65eb6d9

3 files changed

Lines changed: 6 additions & 48 deletions

File tree

io.elementary.calendar.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ finish-args:
1616
- --talk-name=org.gnome.evolution.dataserver.Sources5
1717
- --talk-name=org.gnome.evolution.dataserver.Subprocess.Backend.*
1818

19-
- --talk-name=org.elementary.Contractor
2019
- --talk-name=org.freedesktop.Notifications
2120
- --system-talk-name=org.freedesktop.GeoClue2
2221
- --system-talk-name=org.freedesktop.login1

src/Grid/CalendarView.vala

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -47,45 +47,6 @@ public class Maya.View.CalendarView : Gtk.Box {
4747
var action_group = new SimpleActionGroup ();
4848
action_group.add_action (export_action);
4949

50-
var contractor_menu = new GLib.Menu ();
51-
52-
try {
53-
var contracts = Granite.Services.ContractorProxy.get_contracts_by_mime ("text/calender");
54-
55-
int i = 0;
56-
foreach (var contract in contracts) {
57-
var contract_action = new SimpleAction ("contract-%i".printf (i), null);
58-
contract_action.activate.connect (() => {
59-
/* creates a .ics file */
60-
Util.save_temp_selected_calendars ();
61-
62-
var file_path = GLib.Environment.get_tmp_dir () + "/calendar.ics";
63-
var cal_file = File.new_for_path (file_path);
64-
65-
try {
66-
contract.execute_with_file (cal_file);
67-
} catch (Error err) {
68-
warning (err.message);
69-
}
70-
});
71-
72-
action_group.add_action (contract_action);
73-
74-
contractor_menu.append (
75-
contract.get_display_name (),
76-
ACTION_PREFIX + "contract-%i".printf (i)
77-
);
78-
i++;
79-
}
80-
} catch (GLib.Error error) {
81-
critical (error.message);
82-
}
83-
84-
contractor_menu.append (
85-
_("Export Calendar…"),
86-
"calendar.export"
87-
);
88-
8950
insert_action_group (ACTION_GROUP_PREFIX, action_group);
9051

9152
selected_date = Maya.Application.get_selected_datetime ();
@@ -123,13 +84,6 @@ public class Maya.View.CalendarView : Gtk.Box {
12384

12485
var spinner = new Maya.View.Widgets.DynamicSpinner ();
12586

126-
var contractor = new Gtk.MenuButton () {
127-
image = new Gtk.Image.from_icon_name ("document-export", LARGE_TOOLBAR),
128-
menu_model = contractor_menu,
129-
tooltip_text = _("Export or Share the default Calendar"),
130-
use_popover = false
131-
};
132-
13387
var source_popover = new Calendar.Widgets.SourcePopover ();
13488

13589
var menu_button = new Gtk.MenuButton () {
@@ -145,7 +99,6 @@ public class Maya.View.CalendarView : Gtk.Box {
14599
header_bar.pack_start (year_switcher);
146100
header_bar.pack_start (button_today);
147101
header_bar.pack_end (menu_button);
148-
header_bar.pack_end (contractor);
149102
header_bar.pack_end (spinner);
150103

151104
header_bar.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);

src/Widgets/SourcePopover.vala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover {
4848
text = _("Import iCalendar File…")
4949
};
5050

51+
var export_calendar_button = new Gtk.ModelButton () {
52+
action_name = "calendar.export",
53+
text = _("Export Calendar…")
54+
};
55+
5156
var accounts_button = new Gtk.ModelButton () {
5257
text = _("Online Accounts Settings…")
5358
};
@@ -60,6 +65,7 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover {
6065
main_box.add (separator);
6166
main_box.add (add_calendar_button);
6267
main_box.add (import_calendar_button);
68+
main_box.add (export_calendar_button);
6369
main_box.add (accounts_button);
6470
main_box.show_all ();
6571

0 commit comments

Comments
 (0)