Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gnome-builder
Commits
6467345e
Commit
6467345e
authored
Aug 19, 2022
by
Christian Hergert
Browse files
plugins/copyright: add tweaks and rename schema
parent
9f4dabb7
Pipeline
#433898
passed with stages
in 72 minutes and 33 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/copyright/copyright-plugin.c
View file @
6467345e
...
...
@@ -26,14 +26,18 @@
#include
"gbp-copyright-buffer-addin.h"
#include
"gbp-copyright-preferences-addin.h"
#include
"gbp-copyright-tweaks-addin.h"
_IDE_EXTERN
void
_gbp_copyright_register_types
(
PeasObjectModule
*
module
)
{
peas_object_module_register_extension_type
(
module
,
IDE_TYPE_BUFFER_ADDIN
,
GBP_TYPE_COPYRIGHT_BUFFER_ADDIN
);
peas_object_module_register_extension_type
(
module
,
IDE_TYPE_PREFERENCES_ADDIN
,
GBP_TYPE_COPYRIGHT_PREFERENCES_ADDIN
);
peas_object_module_register_extension_type
(
module
,
IDE_TYPE_
BUFFER
_ADDIN
,
GBP_TYPE_COPYRIGHT_
BUFFER
_ADDIN
);
IDE_TYPE_
TWEAKS
_ADDIN
,
GBP_TYPE_COPYRIGHT_
TWEAKS
_ADDIN
);
}
src/plugins/copyright/copyright.gresource.xml
0 → 100644
View file @
6467345e
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource
prefix=
"/plugins/copyright"
>
<file>
copyright.plugin
</file>
<file
preprocess=
"xml-stripblanks"
>
tweaks.ui
</file>
</gresource>
</gresources>
src/plugins/copyright/copyright.plugin
View file @
6467345e
...
...
@@ -2,6 +2,7 @@
Authors=Christian Hergert <chergert@redhat.com>
Builtin=true
Copyright=Copyright © 2020 Christian Hergert
Depends=editorui;
Description=Update copyright when files are saved
Embedded=_gbp_copyright_register_types
Module=copyright_plugin
...
...
src/plugins/copyright/gbp-copyright-tweaks-addin.c
0 → 100644
View file @
6467345e
/* gbp-copyright-tweaks-addin.c
*
* Copyright 2022 Christian Hergert <chergert@redhat.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#define G_LOG_DOMAIN "gbp-copyright-tweaks-addin"
#include
"config.h"
#include
"gbp-copyright-tweaks-addin.h"
struct
_GbpCopyrightTweaksAddin
{
IdeTweaksAddin
parent_instance
;
};
G_DEFINE_FINAL_TYPE
(
GbpCopyrightTweaksAddin
,
gbp_copyright_tweaks_addin
,
IDE_TYPE_TWEAKS_ADDIN
)
static
void
gbp_copyright_tweaks_addin_class_init
(
GbpCopyrightTweaksAddinClass
*
klass
)
{
}
static
void
gbp_copyright_tweaks_addin_init
(
GbpCopyrightTweaksAddin
*
self
)
{
ide_tweaks_addin_set_resource_paths
(
IDE_TWEAKS_ADDIN
(
self
),
IDE_STRV_INIT
(
"/plugins/copyright/tweaks.ui"
));
}
src/plugins/copyright/gbp-copyright-tweaks-addin.h
0 → 100644
View file @
6467345e
/* gbp-copyright-tweaks-addin.h
*
* Copyright 2022 Christian Hergert <chergert@redhat.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include
<libide-tweaks.h>
G_BEGIN_DECLS
#define GBP_TYPE_COPYRIGHT_TWEAKS_ADDIN (gbp_copyright_tweaks_addin_get_type())
G_DECLARE_FINAL_TYPE
(
GbpCopyrightTweaksAddin
,
gbp_copyright_tweaks_addin
,
GBP
,
COPYRIGHT_TWEAKS_ADDIN
,
IdeTweaksAddin
)
G_END_DECLS
src/plugins/copyright/meson.build
View file @
6467345e
if
get_option
(
'plugin_copyright'
)
plugins_sources
+=
files
(
'copyright-plugin.c'
,
'gbp-copyright-buffer-addin.c'
,
'gbp-copyright-preferences-addin.c'
,
'gbp-copyright-util.c'
,
)
install_data
(
'org.gnome.builder.plugins.copyright.gschema.xml'
,
install_dir
:
schema_dir
)
plugins_sources
+=
files
(
'copyright-plugin.c'
,
'gbp-copyright-buffer-addin.c'
,
'gbp-copyright-preferences-addin.c'
,
'gbp-copyright-tweaks-addin.c'
,
'gbp-copyright-util.c'
,
)
plugins_sources
+=
gnome
.
compile_resources
(
'copyright-resources'
,
'copyright.gresource.xml'
,
c_name
:
'gbp_copyright'
,
)
install_data
(
'org.gnome.builder.copyright.gschema.xml'
,
install_dir
:
schema_dir
)
test_copyright
=
executable
(
'test-copyright'
,
[
'test-copyright.c'
,
'gbp-copyright-util.c'
],
dependencies
:
[
libglib_dep
],
)
test
(
'test-copyright'
,
test_copyright
)
test_copyright
=
executable
(
'test-copyright'
,
[
'test-copyright.c'
,
'gbp-copyright-util.c'
],
dependencies
:
[
libglib_dep
],
)
test
(
'test-copyright'
,
test_copyright
)
endif
src/plugins/copyright/org.gnome.builder.
plugins.
copyright.gschema.xml
→
src/plugins/copyright/org.gnome.builder.copyright.gschema.xml
View file @
6467345e
<schemalist>
<schema
id=
"org.gnome.builder.
plugins.
copyright"
path=
"/org/gnome/builder/
plugins/
copyright/"
gettext-domain=
"gnome-builder"
>
<schema
id=
"org.gnome.builder.copyright"
path=
"/org/gnome/builder/copyright/"
gettext-domain=
"gnome-builder"
>
<key
name=
"update-on-save"
type=
"b"
>
<default>
false
</default>
<summary>
Update Copyright before Saving
</summary>
...
...
src/plugins/copyright/tweaks.ui
0 → 100644
View file @
6467345e
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template
class=
"IdeTweaks"
>
<child
internal-child=
"visual_section"
>
<object
class=
"IdeTweaksSection"
>
<child
internal-child=
"editor_page"
>
<object
class=
"IdeTweaksPage"
>
<child
internal-child=
"editor_page_internal_section"
>
<object
class=
"IdeTweaksSection"
>
<child
internal-child=
"editor_session_page"
>
<object
class=
"IdeTweaksPage"
>
<child>
<object
class=
"IdeTweaksSettings"
id=
"settings_org_gnome_builder_copyright"
>
<property
name=
"schema-id"
>
org.gnome.builder.copyright
</property>
<property
name=
"application-only"
>
true
</property>
</object>
</child>
<child>
<object
class=
"IdeTweaksGroup"
>
<child>
<object
class=
"IdeTweaksSwitch"
>
<property
name=
"title"
translatable=
"yes"
>
Update Copyright
</property>
<property
name=
"subtitle"
translatable=
"yes"
>
Update copyright headers when saving documents
</property>
<property
name=
"action-name"
>
settings.org.gnome.builder.copyright.update-on-save
</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
Binh Truong
@nguyenbinh07
mentioned in merge request
!622 (merged)
·
Aug 21, 2022
mentioned in merge request
!622 (merged)
mentioned in merge request !622
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment