Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update and show system settings dialog box on resolution switch shortcut

  • Loading branch information...
commit fcbd4c3eb0a09f70422d0e1a4e7e4985437dec2b 1 parent 2e18cbb
Sébastien Bourdeauducq sbourdeauducq authored
Showing with 17 additions and 14 deletions.
  1. +12 −9 src/shortcuts.c
  2. +4 −5 src/sysettings.c
  3. +1 −0  src/sysettings.h
21 src/shortcuts.c
View
@@ -25,6 +25,7 @@
#include "shutdown.h"
#include "fbgrab.h"
#include "sysconfig.h"
+#include "sysettings.h"
#include "fb.h"
static int ctrl, alt;
@@ -35,15 +36,17 @@ static void switch_resolution()
{
int res;
- if(fb_get_mode()) return;
-
- res = sysconfig_get_resolution();
- res++;
-
- if (res > SC_RESOLUTION_1024_768)
- res = SC_RESOLUTION_640_480;
-
- sysconfig_set_resolution(res);
+ if(!fb_get_mode()) {
+ open_sysettings_window();
+
+ res = sysconfig_get_resolution();
+ res++;
+ if (res > SC_RESOLUTION_1024_768)
+ res = SC_RESOLUTION_640_480;
+ sysconfig_set_resolution(res);
+
+ sysettings_update_resolution();
+ }
}
static void shortcuts_callback(mtk_event *e, int count)
9 src/sysettings.c
View
@@ -30,7 +30,6 @@ static struct filedialog *browse_wallpaper_dlg;
static struct filedialog *browse_autostart_dlg;
static void close_sysettings_window(int save);
-static void update_resolution();
static void update_language();
static void update_layout();
static void update_network();
@@ -41,7 +40,7 @@ static void resolution_callback(mtk_event *e, void *arg)
int resolution = (int)arg;
sysconfig_set_resolution(resolution);
- update_resolution();
+ sysettings_update_resolution();
}
static int current_language;
@@ -302,11 +301,11 @@ void init_sysettings()
mtk_bind(appid, "w", "close", cancel_callback, NULL);
- browse_wallpaper_dlg = create_filedialog("Select wallpaper", 0, "png", wallpaper_ok_callback, NULL, NULL, NULL);
+ browse_wallpaper_dlg = create_filedialog("Select wallpaper", 0, "png", wallpaper_ok_callback, NULL, NULL, NULL);
browse_autostart_dlg = create_filedialog("Select autostart performance", 0, "per", autostart_ok_callback, NULL, NULL, NULL);
}
-static void update_resolution()
+void sysettings_update_resolution()
{
int resolution;
@@ -453,7 +452,7 @@ void open_sysettings_window()
current_language = sysconfig_get_language();
current_asmode = sysconfig_get_autostart_mode();
- update_resolution();
+ sysettings_update_resolution();
update_wallpaper();
update_language();
update_layout();
1  src/sysettings.h
View
@@ -20,5 +20,6 @@
void init_sysettings();
void open_sysettings_window();
+void sysettings_update_resolution();
#endif /* __SYSETTINGS_H */
Please sign in to comment.
Something went wrong with that request. Please try again.