projects
/
led-pattern-ed
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3ab4349
)
LED program dialog: add a Copy button to copy pattern to clipboard
author
Philipp Zabel
<philipp.zabel@gmail.com>
Mon, 1 Mar 2010 11:00:50 +0000
(12:00 +0100)
committer
Philipp Zabel
<philipp.zabel@gmail.com>
Mon, 1 Mar 2010 16:09:32 +0000
(17:09 +0100)
src/led-program-dialog.vala
patch
|
blob
|
history
diff --git
a/src/led-program-dialog.vala
b/src/led-program-dialog.vala
index
ff47d6a
..
a1cec5e
100644
(file)
--- a/
src/led-program-dialog.vala
+++ b/
src/led-program-dialog.vala
@@
-75,6
+75,7
@@
class LedProgramDialog : Gtk.Dialog {
action_area.show_all ();
action_area.show_all ();
+ add_button ("Copy", 2);
add_button ("Test", 1);
add_button ("Done", Gtk.ResponseType.ACCEPT);
add_button ("Test", 1);
add_button ("Done", Gtk.ResponseType.ACCEPT);
@@
-112,9
+113,13
@@
class LedProgramDialog : Gtk.Dialog {
void on_response (int response) {
if (response == 1) {
Timeout.add (200, delayed_spawn);
void on_response (int response) {
if (response == 1) {
Timeout.add (200, delayed_spawn);
- return;
- }
- if (response == Gtk.ResponseType.ACCEPT) {
+ } else if (response == 2) {
+ var clipboard = Gtk.Clipboard.@get (Gdk.SELECTION_CLIPBOARD);
+
+ clipboard.set_text (lpv.pattern.dump (), -1);
+ clipboard.store ();
+ Hildon.Banner.show_information (null, null, "Copied");
+ } else if (response == Gtk.ResponseType.ACCEPT) {
if (pattern.dump () != lpv.pattern.dump ()) {
pattern.replace_with (lpv.pattern);
}
if (pattern.dump () != lpv.pattern.dump ()) {
pattern.replace_with (lpv.pattern);
}