From 39b5181ad59c69451f0914d8288f929e1e5e8f9f Mon Sep 17 00:00:00 2001 From: Sanel Zukan Date: Sun, 28 Mar 2010 12:54:45 +0000 Subject: [PATCH] Use EDE_APPLICATION to init localization code and set default (and much saner) font size. --- ede-about/ede-about.cpp | 4 +- ede-autostart/ede-autostart.cpp | 4 +- ede-bell-conf/ede-bell-conf.cpp | 6 ++- .../ede-bug-report/ede-bug-report.cpp | 4 +- ede-bug-tools/ede-crasher/ede-crasher.cpp | 7 ++++ ede-conf/ede-conf.cpp | 8 +++- ede-desktop-conf/ede-desktop-conf.cpp | 4 +- ede-desktop/ede-desktop.cpp | 4 +- ede-dialog/ede-dialog.cpp | 6 ++- ede-image-view/Jamfile | 2 +- ede-image-view/ede-image-view.cpp | 41 ++++++++----------- ede-keyboard-conf/ede-keyboard-conf.cpp | 4 +- ede-launch/ede-launch.cpp | 4 +- ede-panel/ede-panel.cpp | 7 ++++ ede-screensaver-conf/ede-screensaver-conf.cpp | 8 +++- ede-timedate/ede-timedate.cpp | 30 +++++++------- ede-tip/ede-tip.cpp | 8 +++- evoke/evoke.cpp | 3 ++ 18 files changed, 100 insertions(+), 54 deletions(-) diff --git a/ede-about/ede-about.cpp b/ede-about/ede-about.cpp index ae2e866..26c8c1c 100644 --- a/ede-about/ede-about.cpp +++ b/ede-about/ede-about.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include "icons/ede.xpm" static Fl_Pixmap image_ede((const char**)ede_xpm); @@ -123,6 +123,8 @@ char* prepare_style(char* txt, int len) { } int main(int argc, char **argv) { + EDE_APPLICATION("ede-about"); + win = new Fl_Window(440, 335, _("About EDE")); win->begin(); Fl_Group* title_group = new Fl_Group(0, 0, 440, 65); diff --git a/ede-autostart/ede-autostart.cpp b/ede-autostart/ede-autostart.cpp index 0ee7a14..d7b8529 100644 --- a/ede-autostart/ede-autostart.cpp +++ b/ede-autostart/ede-autostart.cpp @@ -30,13 +30,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include EDELIB_NS_USING_AS(Window, AppWindow) EDELIB_NS_USING(String) @@ -346,6 +346,8 @@ static const char* next_param(int curr, char** argv, int argc) { } int main(int argc, char** argv) { + EDE_APPLICATION("ede-autostart"); + if(argc == 1) { perform_autostart(false); return 0; diff --git a/ede-bell-conf/ede-bell-conf.cpp b/ede-bell-conf/ede-bell-conf.cpp index 8148a1f..6534e45 100644 --- a/ede-bell-conf/ede-bell-conf.cpp +++ b/ede-bell-conf/ede-bell-conf.cpp @@ -10,7 +10,7 @@ * See COPYING for details. */ -#ifndef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include #endif @@ -23,8 +23,8 @@ #include #include -#include #include +#include EDELIB_NS_USING(XSettingsClient) EDELIB_NS_USING(XSettingsAction) @@ -132,6 +132,8 @@ static void test_cb(Fl_Widget*, void*) { } static void window_create(int argc, char** argv) { + EDE_APPLICATION("ede-bell-conf"); + win = new edelib::Window(330, 210, _("System bell configuration"), edelib::WIN_INIT_NONE); win->begin(); vol_slide = new Fl_Value_Slider(10, 30, 310, 25, _("Volume")); diff --git a/ede-bug-tools/ede-bug-report/ede-bug-report.cpp b/ede-bug-tools/ede-bug-report/ede-bug-report.cpp index 358ab2a..d632f67 100644 --- a/ede-bug-tools/ede-bug-report/ede-bug-report.cpp +++ b/ede-bug-tools/ede-bug-report/ede-bug-report.cpp @@ -25,11 +25,11 @@ #include #include -#include #include #include #include #include +#include #ifdef HAVE_CURL # include "BugzillaSender.h" @@ -136,6 +136,8 @@ int main(int argc, char** argv) { "it from http://curl.haxx.se. After this, you'll have to recompile ede-bug-report again")); return 1; #else + EDE_APPLICATION("ede-bug-report"); + /* in case if debugger output was given */ const char *gdb_output = NULL; diff --git a/ede-bug-tools/ede-crasher/ede-crasher.cpp b/ede-bug-tools/ede-crasher/ede-crasher.cpp index 15537b8..507886b 100644 --- a/ede-bug-tools/ede-crasher/ede-crasher.cpp +++ b/ede-bug-tools/ede-crasher/ede-crasher.cpp @@ -10,8 +10,13 @@ * See COPYING for details. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include +#include #include "CrashDialog.h" #define CHECK_ARGV(argv, pshort, plong) ((strcmp(argv, pshort) == 0) || (strcmp(argv, plong) == 0)) @@ -44,6 +49,8 @@ int main(int argc, char** argv) { return 0; } + EDE_APPLICATION("ede-crasher"); + const char* a; ProgramDetails p; diff --git a/ede-conf/ede-conf.cpp b/ede-conf/ede-conf.cpp index 7d5efab..1eb8d9c 100644 --- a/ede-conf/ede-conf.cpp +++ b/ede-conf/ede-conf.cpp @@ -10,6 +10,10 @@ * See COPYING for details. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -22,10 +26,10 @@ #include #include #include -#include #include #include #include +#include EDELIB_NS_USING(list) EDELIB_NS_USING(Resource) @@ -146,6 +150,8 @@ static void load_buttons(Fl_Group* g) { } int main(int argc, char** argv) { + EDE_APPLICATION("ede-conf"); + edelib::Window* win = new edelib::Window(455, 330, _("EDE Configuration Place")); win->begin(); diff --git a/ede-desktop-conf/ede-desktop-conf.cpp b/ede-desktop-conf/ede-desktop-conf.cpp index 020f916..186e6b6 100644 --- a/ede-desktop-conf/ede-desktop-conf.cpp +++ b/ede-desktop-conf/ede-desktop-conf.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -42,6 +41,7 @@ #include #include #include +#include #define EDE_DESKTOP_CONFIG "ede-desktop" @@ -363,6 +363,8 @@ int main(int argc, char** argv) { show_group = 3; } + EDE_APPLICATION("ede-desktop-conf"); + edelib::Window* win = new edelib::Window(550, 285, _("Desktop options"), edelib::WIN_INIT_IMAGES); win->begin(); Fl_Tabs* tabs = new Fl_Tabs(10, 10, 530, 230); diff --git a/ede-desktop/ede-desktop.cpp b/ede-desktop/ede-desktop.cpp index 4dce11d..c2d8cee 100644 --- a/ede-desktop/ede-desktop.cpp +++ b/ede-desktop/ede-desktop.cpp @@ -35,12 +35,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include "ede-desktop.h" #include "DesktopIcon.h" @@ -1137,6 +1137,8 @@ int Desktop::handle(int event) { } int main() { + EDE_APPLICATION("ede-desktop"); + signal(SIGTERM, exit_signal); signal(SIGKILL, exit_signal); signal(SIGINT, exit_signal); diff --git a/ede-dialog/ede-dialog.cpp b/ede-dialog/ede-dialog.cpp index 8d76483..ecc5a0f 100644 --- a/ede-dialog/ede-dialog.cpp +++ b/ede-dialog/ede-dialog.cpp @@ -10,7 +10,7 @@ * See COPYING for details. */ -#ifndef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include #endif @@ -20,7 +20,7 @@ #include #include #include -#include +#include EDELIB_NS_USING(MessageBox) EDELIB_NS_USING(MessageBoxType) @@ -159,6 +159,8 @@ int main(int argc, char **argv) { return EDE_DIALOG_ERROR_RET; } + EDE_APPLICATION("ede-dialog"); + /* * Use a trick to load icon theme and colors using xsettings stuff. edelib::Window will load them * and fill static FLTK values; every further window will use those values, including our will use them diff --git a/ede-image-view/Jamfile b/ede-image-view/Jamfile index 7bf9a45..19647d9 100644 --- a/ede-image-view/Jamfile +++ b/ede-image-view/Jamfile @@ -10,5 +10,5 @@ SubDir TOP ede-image-view ; -FltkProgram ede-image-view : ede-image-view.cpp ; +EdeProgram ede-image-view : ede-image-view.cpp ; TranslationStrings locale : ede-image-view.cpp ; diff --git a/ede-image-view/ede-image-view.cpp b/ede-image-view/ede-image-view.cpp index 622876e..ddf6f2b 100644 --- a/ede-image-view/ede-image-view.cpp +++ b/ede-image-view/ede-image-view.cpp @@ -10,6 +10,16 @@ * See COPYING for details. */ +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + #include #include #include @@ -18,27 +28,10 @@ #include #include #include - -#include -#include -#include -#include -#include - +#include #define DEBUG 1 -// Can this be moved to Jamfile/configure? -//#define USE_EDELIB - - -#ifdef USE_EDELIB -#include -#else -#define _(stuff) stuff -#endif - - // Supported image types const char* supported[] = {"bm","bmp","gif","jpg","pbm","pgm","png","ppm","xbm","xpm",0}; @@ -371,7 +364,7 @@ int main (int argc, char **argv) { snprintf(directory, FL_PATH_MAX, "%s", getenv("HOME")); else { if (strcmp(argv[unknown],"--help")==0) { - printf(_("EImage - EDE Image Viewer\nPart of Equinox Desktop Environment (EDE).\nCopyright (c) 2000-2007 EDE Authors.\n\nThis program is licenced under terms of the\nGNU General Public Licence version 2 or newer.\nSee COPYING for details.\n\n")); + printf(_("ede-image-view - EDE Image Viewer\nPart of Equinox Desktop Environment (EDE).\nCopyright (c) 2000-2007 EDE Authors.\n\nThis program is licenced under terms of the\nGNU General Public Licence version 2 or newer.\nSee COPYING for details.\n\n")); printf(_("Usage: ede-image-view [OPTIONS] [IMAGE_FILE]\n\n")); printf(_("Available options:\n%s\n"),Fl::help); return 1; @@ -395,13 +388,11 @@ int main (int argc, char **argv) { } } - zoomfactor=1; im=0; // defaults + EDE_APPLICATION("ede-image-view"); + fl_register_images(); - - FL_NORMAL_SIZE=12; - fl_message_font(FL_HELVETICA, 12); - - + zoomfactor=1; im=0; // defaults + // Main window w = new Fl_Double_Window(400, 200, _("View picture")); diff --git a/ede-keyboard-conf/ede-keyboard-conf.cpp b/ede-keyboard-conf/ede-keyboard-conf.cpp index c96ef33..663e8d9 100644 --- a/ede-keyboard-conf/ede-keyboard-conf.cpp +++ b/ede-keyboard-conf/ede-keyboard-conf.cpp @@ -15,7 +15,7 @@ #endif #include -#include +#include EDELIB_NS_USING(alert) #ifdef HAVE_XKBRULES @@ -242,6 +242,8 @@ int main(int argc, char **argv) { read_config(NULL); } + EDE_APPLICATION("ede-keyboard-conf"); + String cl; dialog_canceled = false; diff --git a/ede-launch/ede-launch.cpp b/ede-launch/ede-launch.cpp index 2894075..1dc4a45 100644 --- a/ede-launch/ede-launch.cpp +++ b/ede-launch/ede-launch.cpp @@ -36,11 +36,11 @@ #include #include #include -#include #include #include #include #include +#include #include "icons/run.xpm" @@ -332,6 +332,8 @@ static int start_dialog(int argc, char** argv) { } int main(int argc, char** argv) { + EDE_APPLICATION("ede-launch"); + if(argc <= 1) return start_dialog(argc, argv); diff --git a/ede-panel/ede-panel.cpp b/ede-panel/ede-panel.cpp index 3b8db2f..ddb9324 100644 --- a/ede-panel/ede-panel.cpp +++ b/ede-panel/ede-panel.cpp @@ -1,7 +1,12 @@ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include #include +#include #include "Panel.h" #include "AppletManager.h" @@ -13,6 +18,8 @@ static void exit_signal(int signum) { } int main(int argc, char **argv) { + EDE_APPLICATION("ede-panel"); + signal(SIGTERM, exit_signal); signal(SIGKILL, exit_signal); signal(SIGINT, exit_signal); diff --git a/ede-screensaver-conf/ede-screensaver-conf.cpp b/ede-screensaver-conf/ede-screensaver-conf.cpp index a6ab5e7..eae061a 100644 --- a/ede-screensaver-conf/ede-screensaver-conf.cpp +++ b/ede-screensaver-conf/ede-screensaver-conf.cpp @@ -10,6 +10,10 @@ * See COPYING for the details. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -21,8 +25,8 @@ #include #include -#include #include +#include #include "XScreenSaver.h" #include "icons/energy.xpm" @@ -107,6 +111,8 @@ static void ok_cb(Fl_Widget*, void* s) { } int main(int argc, char **argv) { + EDE_APPLICATION("ede-screensaver-conf"); + fl_open_display(); /* start daemon if not started */ xscreensaver_run_daemon(fl_display); diff --git a/ede-timedate/ede-timedate.cpp b/ede-timedate/ede-timedate.cpp index eb474ad..15faef7 100644 --- a/ede-timedate/ede-timedate.cpp +++ b/ede-timedate/ede-timedate.cpp @@ -10,9 +10,21 @@ * See COPYING for details. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include "ede-timedate.h" -#include +#include +#include +#include +#include +#include +#include +#include +#define FL_PATH_MAX 1024 + #include #include #include @@ -20,16 +32,7 @@ #include #include #include - -#include -#include -#include -#define FL_PATH_MAX 1024 - -#include -#include -#include -#include +#include #include "icons/world2.xpm" @@ -430,10 +433,9 @@ static void tick(void *v) { int main(int argc, char **argv) { + EDE_APPLICATION("ede-timedate"); -FL_NORMAL_SIZE=12; -time_changed = format_changed = tz_changed = date_changed = false; - + time_changed = format_changed = tz_changed = date_changed = false; { timedateWindow = new edelib::Window(415, 320, _("Time and date")); { Fl_Tabs* o = new Fl_Tabs(5, 5, 405, 270); diff --git a/ede-tip/ede-tip.cpp b/ede-tip/ede-tip.cpp index 3f404a2..1bf4bac 100644 --- a/ede-tip/ede-tip.cpp +++ b/ede-tip/ede-tip.cpp @@ -10,6 +10,10 @@ * See COPYING for the details. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -22,7 +26,6 @@ #include #include -#include #include #include #include @@ -30,6 +33,7 @@ #include #include #include +#include #include "icons/hint.xpm" #include "Fortune.h" @@ -164,6 +168,8 @@ void prev_cb(Fl_Widget*, void*) { } int main(int argc, char **argv) { + EDE_APPLICATION("ede-tip"); + ffile = load_fortune_file(); // initialize random number only if we loaded tips diff --git a/evoke/evoke.cpp b/evoke/evoke.cpp index 5192f8b..94c2045 100644 --- a/evoke/evoke.cpp +++ b/evoke/evoke.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include "EvokeService.h" @@ -75,6 +76,8 @@ int main(int argc, char** argv) { } } + EDE_APPLICATION("evoke"); + /* make sure X11 is running before rest of code is called */ fl_open_display();