-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from AlphaTechnolog/feature/export-to-curl
Export request to CURL format
- Loading branch information
Showing
22 changed files
with
1,061 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright 2024 the Cartero authors | ||
* | ||
* 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 <https://www.gnu.org/licenses/>. | ||
*/ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
using Gtk 4.0; | ||
using GtkSource 5; | ||
|
||
template $CarteroCodeExportPane: $CarteroBaseExportPane { | ||
ScrolledWindow { | ||
hexpand: true; | ||
vexpand: true; | ||
|
||
Gtk.Overlay { | ||
vexpand: true; | ||
hexpand: true; | ||
|
||
GtkSource.View view { | ||
left-margin: 10; | ||
right-margin: 10; | ||
top-margin: 10; | ||
bottom-margin: 10; | ||
smart-backspace: true; | ||
monospace: true; | ||
buffer: buffer; | ||
editable: false; | ||
} | ||
|
||
[overlay] | ||
Gtk.Button copy_button { | ||
valign: end; | ||
halign: end; | ||
margin-end: 10; | ||
margin-bottom: 10; | ||
clicked => $on_copy_button_clicked() swapped; | ||
|
||
Gtk.Box { | ||
orientation: horizontal; | ||
spacing: 6; | ||
|
||
Image { | ||
icon-name: "edit-copy-symbolic"; | ||
} | ||
|
||
Label { | ||
label: _("Copy"); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
GtkSource.Buffer buffer {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright 2024 the Cartero authors | ||
* | ||
* 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 <https://www.gnu.org/licenses/>. | ||
*/ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
using Gtk 4.0; | ||
using Adw 1; | ||
|
||
template $CarteroExportTab: Gtk.Box { | ||
styles [ | ||
"background" | ||
] | ||
|
||
orientation: vertical; | ||
spacing: 15; | ||
|
||
Adw.Clamp { | ||
margin-top: 10; | ||
vexpand: false; | ||
|
||
Adw.PreferencesGroup { | ||
Adw.ComboRow combo { | ||
title: _("Export to"); | ||
model: entries; | ||
notify::selected => $on_selection_changed() swapped; | ||
} | ||
} | ||
} | ||
|
||
Gtk.Box { | ||
orientation: vertical; | ||
vexpand: true; | ||
valign: fill; | ||
|
||
Gtk.Separator sep {} | ||
|
||
Gtk.Stack stack { | ||
Gtk.StackPage { | ||
name: "none"; | ||
|
||
child: Adw.Bin {}; | ||
} | ||
|
||
Gtk.StackPage { | ||
name: "code"; | ||
|
||
child: $CarteroCodeExportPane code {}; | ||
} | ||
|
||
visible-child-name: "none"; | ||
} | ||
} | ||
} | ||
|
||
Gtk.StringList entries { | ||
strings [ | ||
_("(none)"), | ||
"cURL", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.