Skip to content

Commit

Permalink
shutdown: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Bourdeauducq committed Nov 27, 2011
1 parent adc8774 commit 0341890
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
11 changes: 4 additions & 7 deletions src/gui/shutdown.c
@@ -1,6 +1,6 @@
/*
* Flickernoise
* Copyright (C) 2010 Sebastien Bourdeauducq
* Copyright (C) 2010, 2011 Sebastien Bourdeauducq
*
* 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
Expand Down Expand Up @@ -50,21 +50,18 @@ void init_shutdown()
mtk_cmd_seq(appid,
"g = new Grid()",
"g2 = new Grid()",
"l = new Label(-text \"Do you want to power off or reboot the system?\")",
"b_shutdown = new Button(-text \"Power off\")",
"b_reboot = new Button(-text \"Reboot\")",
"l = new Label(-text \"Are you sure?\")",
"b_shutdown = new Button(-text \"Shutdown\")",
"b_cancel = new Button(-text \"Cancel\")",
"g.place(l, -column 1 -row 1)",
"g.rowconfig(1, -size 50)",
"g2.place(b_shutdown, -column 1 -row 1)",
"g2.place(b_reboot, -column 2 -row 1)",
"g2.place(b_cancel, -column 3 -row 1)",
"g2.place(b_cancel, -column 2 -row 1)",
"g.place(g2, -column 1 -row 2)",
"w = new Window(-content g -title \"Shutdown\")",
0);

mtk_bind(appid, "b_shutdown", "clack", shutdown_callback, (void *)1);
mtk_bind(appid, "b_reboot", "clack", shutdown_callback, (void *)0);

mtk_bind(appid, "b_cancel", "clack", cancel_callback, NULL);
mtk_bind(appid, "w", "close", cancel_callback, NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/shortcuts.c
Expand Up @@ -76,7 +76,7 @@ static void shortcuts_callback(mtk_event *e, int count)
else if(e[i].press.code == MTK_KEY_LEFTALT)
alt = 1;
else if(ctrl && alt && (e[i].press.code == MTK_KEY_DELETE))
clean_shutdown(0);
clean_shutdown(1);
else if(ctrl && (e[i].press.code == MTK_KEY_F1))
switch_resolution();
else if(ctrl && (e[i].press.code == MTK_KEY_PAUSE))
Expand Down
4 changes: 1 addition & 3 deletions src/translations/french.c
Expand Up @@ -246,9 +246,7 @@ struct mtk_i18n_entry translation_french[] = {
"Web: www.milkymist.org" },

// Shutdown
{ "Do you want to power off or reboot the system?", "Souhaitez-vous arr\xea""ter ou red\xe9""marrer le syst\xe8""me ?" },
{ "Power off", "Arr\xea""ter" },
{ "Reboot", "Red\xe9""marrer" },
{ "Are you sure?", "Confirmation:" },

{ "Messagebox", "Bo\xee""te de message" },

Expand Down

0 comments on commit 0341890

Please sign in to comment.