Skip to content

Commit ba96b84

Browse files
authored
Remove TemplateManager related code (#1740)
1 parent 5a85e43 commit ba96b84

5 files changed

Lines changed: 0 additions & 295 deletions

File tree

src/MainWindow.vala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ namespace Scratch {
9393
public const string ACTION_REVERT = "action-revert";
9494
public const string ACTION_SAVE = "action-save";
9595
public const string ACTION_SAVE_AS = "action-save-as";
96-
public const string ACTION_TEMPLATES = "action-templates";
9796
public const string ACTION_SHOW_REPLACE = "action-show-replace";
9897
public const string ACTION_TO_LOWER_CASE = "action-to-lower-case";
9998
public const string ACTION_TO_UPPER_CASE = "action-to-upper-case";
@@ -149,7 +148,6 @@ namespace Scratch {
149148
{ ACTION_SAVE, action_save },
150149
{ ACTION_SAVE_AS, action_save_as },
151150
{ ACTION_TOGGLE_SHOW_FIND, action_toggle_show_find, null, "false" },
152-
{ ACTION_TEMPLATES, action_templates },
153151
{ ACTION_GO_TO, action_go_to },
154152
{ ACTION_SORT_LINES, action_sort_lines },
155153
{ ACTION_NEW_TAB, action_new_tab },
@@ -342,10 +340,6 @@ namespace Scratch {
342340
// Show/Hide widgets
343341
show_all ();
344342

345-
toolbar.templates_button.visible = (plugins.plugin_iface.template_manager.template_available);
346-
plugins.plugin_iface.template_manager.notify["template_available"].connect (() => {
347-
toolbar.templates_button.visible = (plugins.plugin_iface.template_manager.template_available);
348-
});
349343

350344
// Create folder for unsaved documents
351345
create_unsaved_documents_directory ();
@@ -1371,9 +1365,6 @@ namespace Scratch {
13711365
toolbar.format_bar.line_menubutton.active = true;
13721366
}
13731367

1374-
private void action_templates () {
1375-
plugins.plugin_iface.template_manager.show_window (this);
1376-
}
13771368

13781369
private void action_to_lower_case () {
13791370
var doc = document_view.current_document;

src/Services/PluginManager.vala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public class Scratch.Services.Interface : GLib.Object {
2222
public signal void hook_preferences_dialog (Scratch.Dialogs.Preferences dialog);
2323
public signal void hook_folder_item_change (File file, File? other_file, FileMonitorEvent event_type);
2424

25-
public Scratch.TemplateManager template_manager { get; private set; }
2625
public Scratch.Services.PluginsManager manager { get; construct; }
2726

2827
public Interface (Scratch.Services.PluginsManager _manager) {
@@ -31,10 +30,6 @@ public class Scratch.Services.Interface : GLib.Object {
3130
);
3231
}
3332

34-
construct {
35-
template_manager = new Scratch.TemplateManager ();
36-
}
37-
3833
public Scratch.Services.Document open_file (File file) {
3934
var doc = new Scratch.Services.Document (manager.window.actions, file);
4035
manager.window.open_document.begin (doc);

src/Services/TemplateManager.vala

Lines changed: 0 additions & 274 deletions
This file was deleted.

src/Widgets/HeaderBar.vala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public class Scratch.HeaderBar : Hdy.HeaderBar {
1010
public GLib.Menu share_menu;
1111
public Gtk.MenuButton share_menu_button;
1212

13-
public Gtk.Button templates_button { get; private set; }
1413
public Gtk.ToggleButton find_button { get; private set; }
1514
public Gtk.ToggleButton outline_button { get; private set; }
1615
public Gtk.ToggleButton sidebar_button { get; private set; }
@@ -38,10 +37,6 @@ public class Scratch.HeaderBar : Hdy.HeaderBar {
3837
_("Open a file")
3938
);
4039

41-
templates_button = new Gtk.Button.from_icon_name ("text-x-generic-template", Gtk.IconSize.LARGE_TOOLBAR) {
42-
action_name = MainWindow.ACTION_PREFIX + MainWindow.ACTION_TEMPLATES
43-
};
44-
templates_button.tooltip_text = _("Project templates");
4540

4641
var save_button = new Gtk.Button.from_icon_name ("document-save", Gtk.IconSize.LARGE_TOOLBAR) {
4742
action_name = MainWindow.ACTION_PREFIX + MainWindow.ACTION_SAVE
@@ -246,7 +241,6 @@ public class Scratch.HeaderBar : Hdy.HeaderBar {
246241
set_custom_title (format_bar);
247242

248243
pack_start (open_button);
249-
pack_start (templates_button);
250244
pack_start (save_button);
251245
pack_start (save_as_button);
252246
pack_start (revert_button);

src/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ code_files = files(
4646
'Services/PluginManager.vala',
4747
'Services/RestoreOverride.vala',
4848
'Services/Settings.vala',
49-
'Services/TemplateManager.vala',
5049
'Widgets/ChooseProjectButton.vala',
5150
'Widgets/DocumentView.vala',
5251
'Widgets/FormatBar.vala',

0 commit comments

Comments
 (0)