Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion io.elementary.calendar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ finish-args:
- --talk-name=org.gnome.evolution.dataserver.Sources5
- --talk-name=org.gnome.evolution.dataserver.Subprocess.Backend.*

- --talk-name=org.elementary.Contractor
- --talk-name=org.freedesktop.Notifications
- --system-talk-name=org.freedesktop.GeoClue2
- --system-talk-name=org.freedesktop.login1
Expand Down
47 changes: 0 additions & 47 deletions src/Grid/CalendarView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -47,45 +47,6 @@ public class Maya.View.CalendarView : Gtk.Box {
var action_group = new SimpleActionGroup ();
action_group.add_action (export_action);

var contractor_menu = new GLib.Menu ();

try {
var contracts = Granite.Services.ContractorProxy.get_contracts_by_mime ("text/calender");

int i = 0;
foreach (var contract in contracts) {
var contract_action = new SimpleAction ("contract-%i".printf (i), null);
contract_action.activate.connect (() => {
/* creates a .ics file */
Util.save_temp_selected_calendars ();

var file_path = GLib.Environment.get_tmp_dir () + "/calendar.ics";
var cal_file = File.new_for_path (file_path);

try {
contract.execute_with_file (cal_file);
} catch (Error err) {
warning (err.message);
}
});

action_group.add_action (contract_action);

contractor_menu.append (
contract.get_display_name (),
ACTION_PREFIX + "contract-%i".printf (i)
);
i++;
}
} catch (GLib.Error error) {
critical (error.message);
}

contractor_menu.append (
_("Export Calendar…"),
"calendar.export"
);

insert_action_group (ACTION_GROUP_PREFIX, action_group);

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

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

var contractor = new Gtk.MenuButton () {
image = new Gtk.Image.from_icon_name ("document-export", LARGE_TOOLBAR),
menu_model = contractor_menu,
tooltip_text = _("Export or Share the default Calendar"),
use_popover = false
};

var source_popover = new Calendar.Widgets.SourcePopover ();

var menu_button = new Gtk.MenuButton () {
Expand All @@ -145,7 +99,6 @@ public class Maya.View.CalendarView : Gtk.Box {
header_bar.pack_start (year_switcher);
header_bar.pack_start (button_today);
header_bar.pack_end (menu_button);
header_bar.pack_end (contractor);
header_bar.pack_end (spinner);

header_bar.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
Expand Down
6 changes: 6 additions & 0 deletions src/Widgets/SourcePopover.vala
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover {
text = _("Import iCalendar File…")
};

var export_calendar_button = new Gtk.ModelButton () {
action_name = "calendar.export",
text = _("Export Calendar…")
};

var accounts_button = new Gtk.ModelButton () {
text = _("Online Accounts Settings…")
};
Expand All @@ -60,6 +65,7 @@ public class Calendar.Widgets.SourcePopover : Gtk.Popover {
main_box.add (separator);
main_box.add (add_calendar_button);
main_box.add (import_calendar_button);
main_box.add (export_calendar_button);
main_box.add (accounts_button);
main_box.show_all ();

Expand Down