Trivial dialog cleanups.

SVN revision: 8263
This commit is contained in:
Kim Woelders 2004-01-03 12:21:52 +00:00
parent 72466ee352
commit 17c34a3959
19 changed files with 211 additions and 287 deletions

66
src/E.h
View File

@ -224,34 +224,6 @@ if (__xim) XDestroyImage(__xim);}
#define AUDIO_PLAY(sclass) \
ApplySclass(FindItem((sclass), 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
/************************************************************************/
/* dialog macro convenience funcs */
/************************************************************************/
#define DIALOG_OK(title, text) \
{ \
Dialog *__d; \
__d = CreateDialog("DIALOG"); \
DialogSetTitle(__d, title); \
DialogSetText(__d, text); \
DialogAddButton(__d, _("OK"), NULL, 1); \
ShowDialog(__d); \
}
#define DIALOG_PARAM_OK(title) \
{ \
Dialog *__d; \
__d = CreateDialog("DIALOG"); \
DialogSetTitle(__d, title);
#define DIALOG_PARAM \
DialogSetParamText(__d,
#define DIALOG_PARAM_END \
); \
DialogAddButton(__d, _("OK"), NULL, 1); \
ShowDialog(__d); \
}
/************************************************************************/
@ -2621,29 +2593,24 @@ void Quicksort(void **a, int l, int r,
int (*CompareFunc) (void *d1, void *d2));
/* dialog.c */
Dialog *CreateDialog(char *name);
Dialog *DialogCreate(char *name);
void DialogDestroy(Dialog * d);
void DialogBindKey(Dialog * d, char *key,
void (*func) (int val, void *data), int val,
void *data);
void FreeDialog(Dialog * d);
void DialogSetText(Dialog * d, char *text);
void DialogSetTitle(Dialog * d, char *title);
void DialogAddButton(Dialog * d, char *text,
void (*func) (int val, void *data),
char close);
void DialogDrawButton(Dialog * d, int bnum);
void DialogActivateButton(Window win, int inclick);
void DialogDraw(Dialog * d);
void DialogDrawArea(Dialog * d, int x, int y, int w, int h);
void DialogSetExitFunction(Dialog * d,
void (*func) (int val, void *data),
int val, void *data);
void DialogRedraw(Dialog * d);
void DialogMove(Dialog * d);
void ShowDialog(Dialog * d);
void DialogClose(Dialog * d);
void DialogSetParamText(Dialog * d, char *fmt, ...);
void DialogAlert(char *fmt, ...);
void DialogAlertOK(char *fmt, ...);
void DialogRestart(int val, void *data);
void DialogQuit(int val, void *data);
void DialogAddButton(Dialog * d, char *text,
void (*func) (int val, void *data),
char close);
DItem *DialogInitItem(Dialog * d);
DItem *DialogAddItem(DItem * dii, int type);
DItem *DialogItem(Dialog * d);
@ -2657,10 +2624,8 @@ void DialogItemSetPadding(DItem * di, int left, int right,
void DialogItemSetFill(DItem * di, char fill_h, char fill_v);
void DialogItemSetAlign(DItem * di, int align_h, int align_v);
void DialogItemCallCallback(DItem * di);
void DialogRealizeItem(Dialog * d, DItem * di);
void DialogDrawItems(Dialog * d, DItem * di, int x, int y, int w,
int h);
void DialogItemsRealize(Dialog * d);
void DialogItemButtonSetText(DItem * di, char *text);
void DialogItemCheckButtonSetText(DItem * di, char *text);
void DialogItemTextSetText(DItem * di, char *text);
@ -2677,18 +2642,13 @@ void DialogItemSeparatorSetOrientation(DItem * di,
char horizontal);
void DialogItemImageSetFile(DItem * di, char *image);
void DialogFreeItem(DItem * di);
DItem *DialogItemFindWindow(DItem * di, Window win);
void DialogItemSetRowSpan(DItem * di, int row_span);
void DialogItemSetColSpan(DItem * di, int col_span);
void DialogSetExitFunction(Dialog * d,
void (*func) (int val, void *data),
int val, void *data);
void DialogItemRadioButtonSetText(DItem * di, char *text);
void DialogItemRadioButtonSetFirst(DItem * di, DItem * first);
void DialogItemRadioButtonGroupSetValPtr(DItem * di,
int *val_ptr);
void DialogItemRadioButtonGroupSetVal(DItem * di, int val);
void MoveTableBy(Dialog * d, DItem * di, int dx, int dy);
void DialogItemSliderSetVal(DItem * di, int val);
void DialogItemSliderSetBounds(DItem * di, int lower, int upper);
@ -2707,6 +2667,14 @@ Window DialogItemAreaGetWindow(DItem * di);
void DialogItemAreaSetEventFunc(DItem * di,
void (*func) (int val,
void *data));
void DialogOK(const char *title, const char *fmt, ...);
void DialogOKstr(const char *title, const char *txt);
void DialogRestart(int val, void *data);
void DialogQuit(int val, void *data);
void DialogAlert(const char *fmt, ...);
void DialogAlertOK(const char *fmt, ...);
int DialogEventKeyPress(XEvent * ev);
int DialogEventMotion(XEvent * ev);
int DialogEventExpose(XEvent * ev);

View File

@ -277,11 +277,8 @@ RemoveActionClass(ActionClass * ActionClassToRemove)
if (ActionClassToRemove->ref_count > 0)
{
char stuff[255];
Esnprintf(stuff, sizeof(stuff), _("%u references remain\n"),
ActionClassToRemove->ref_count);
DIALOG_OK(_("ActionClass Error!"), stuff);
DialogOK(_("ActionClass Error!"), _("%u references remain\n"),
ActionClassToRemove->ref_count);
EDBUG_RETURN_;
}
while (RemoveItemByPtr(ActionClassToRemove, LIST_TYPE_ACLASS));
@ -3199,7 +3196,7 @@ doAbout(void *params)
ShowDialog(d);
EDBUG_RETURN(0);
}
d = CreateDialog("ABOUT_ENLIGHTENMENT");
d = DialogCreate("ABOUT_ENLIGHTENMENT");
{
char stuff[255];
@ -3829,17 +3826,17 @@ doZoom(void *params)
("You have been warned about the dangers of Zoom mode\n"));
fclose(f);
}
DIALOG_OK(_("Warning !!!"),
_("This feature is heavily reliant on a feature of your\n"
"X Server called the Vid Mode Extension. This feature exists\n"
"in XFree86 Servers, but is not a heavily used part of the\n"
"Server and thus isn't tested much.\n\n"
"It is possible your X Server does not deal well with being\n"
"asked to switch modes quickly and it may hang, glitch,\n"
"display artefacts or perhaps simply refuse to work.\n\n"
"This is a warning and will only be displayed this one time.\n"
"If your Server does not behave well then you will probably\n"
"have to avoid using this feature.\n"));
DialogOK(_("Warning !!!"),
_("This feature is heavily reliant on a feature of your\n"
"X Server called the Vid Mode Extension. This feature exists\n"
"in XFree86 Servers, but is not a heavily used part of the\n"
"Server and thus isn't tested much.\n\n"
"It is possible your X Server does not deal well with being\n"
"asked to switch modes quickly and it may hang, glitch,\n"
"display artefacts or perhaps simply refuse to work.\n\n"
"This is a warning and will only be displayed this one time.\n"
"If your Server does not behave well then you will probably\n"
"have to avoid using this feature.\n"));
EDBUG_RETURN(0);
}
ewin = GetFocusEwin();

View File

@ -2191,13 +2191,10 @@ FreeBorder(Border * b)
if (b->ref_count > 0)
{
char stuff[255];
Esnprintf(stuff, sizeof(stuff), _("%u references remain\n"),
b->ref_count);
DIALOG_OK(_("Border Error!"), stuff);
DialogOK(_("Border Error!"), _("%u references remain\n"), b->ref_count);
EDBUG_RETURN_;
}
while (RemoveItemByPtr(b, LIST_TYPE_BORDER));
for (i = 0; i < b->num_winparts; i++)

View File

@ -121,12 +121,7 @@ ButtonDestroy(Button * b)
if (b->ref_count > 0)
{
char stuff[255];
Esnprintf(stuff, sizeof(stuff), _("%u references remain\n"),
b->ref_count);
DIALOG_OK(_("Button Error!"), stuff);
DialogOK(_("Button Error!"), _("%u references remain\n"), b->ref_count);
EDBUG_RETURN_;
}

View File

@ -62,13 +62,11 @@ CreateCurve(ModCurve * c)
}
EDBUG_RETURN_;
}
void
FreeModCurve(ModCurve * c)
{
EDBUG(6, "FreeModCurve");
if (!c)
@ -78,13 +76,11 @@ FreeModCurve(ModCurve * c)
Efree(c->py);
EDBUG_RETURN_;
}
void
FreeCMClass(ColorModifierClass * cm)
{
EDBUG(5, "FreeCmClass");
if (!cm)
@ -92,14 +88,9 @@ FreeCMClass(ColorModifierClass * cm)
if (cm->ref_count > 0)
{
char stuff[255];
Esnprintf(stuff, sizeof(stuff), _("%u references remain\n"),
cm->ref_count);
DIALOG_OK(_("ColorModClass Error!"), stuff);
DialogOK(_("ColorModClass Error!"), _("%u references remain\n"),
cm->ref_count);
EDBUG_RETURN_;
}
while (RemoveItemByPtr(cm, LIST_TYPE_COLORMODIFIER));
@ -110,7 +101,6 @@ FreeCMClass(ColorModifierClass * cm)
FreeModCurve(&(cm->blue));
EDBUG_RETURN_;
}
ColorModifierClass *
@ -180,7 +170,6 @@ CreateCMClass(char *name, int rnum, unsigned char *rpx,
CreateCurve(&(cm->blue));
EDBUG_RETURN(cm);
}
void
@ -260,5 +249,4 @@ ModifyCMClass(char *name, int rnum, unsigned char *rpx, unsigned char *rpy,
CreateCurve(&(cm->blue));
EDBUG_RETURN_;
}

View File

@ -2057,13 +2057,10 @@ HandleComms(XClientMessageEvent * ev)
if (!s2)
s2 = sunknown;
{
char buf[FILEPATH_LEN_MAX];
Esnprintf(buf, sizeof(buf),
_("Received Unknown Client Message.\n"
"Client Name: %s\n" "Client Version: %s\n"
"Message Contents:\n\n" "%s\n"), s1, s2, s);
DIALOG_OK(_("E IPC Error"), buf);
DialogOK(_("E IPC Error"),
_("Received Unknown Client Message.\n"
"Client Name: %s\n" "Client Version: %s\n"
"Message Contents:\n\n" "%s\n"), s1, s2, s);
AUDIO_PLAY("SOUND_ERROR_IPC");
}
}

View File

@ -91,25 +91,18 @@ ApplyECursor(Window win, ECursor * ec)
if (!ec)
return;
XDefineCursor(disp, win, ec->cursor);
return;
}
void
FreeECursor(ECursor * ec)
{
if (!ec)
return;
if (ec->ref_count > 0)
{
char stuff[255];
Esnprintf(stuff, sizeof(stuff), _("%u references remain\n"),
ec->ref_count);
DIALOG_OK(_("ECursor Error!"), stuff);
DialogOK(_("ECursor Error!"), _("%u references remain\n"),
ec->ref_count);
return;
}
@ -120,6 +113,4 @@ FreeECursor(ECursor * ec)
if (ec->file)
Efree(ec->file);
Efree(ec);
return;
}

View File

@ -369,7 +369,6 @@ RemoveImagesFromBG(Background * bg)
void
FreeDesktopBG(Background * bg)
{
EDBUG(6, "FreeDesktopBG");
if (!bg)
@ -377,12 +376,8 @@ FreeDesktopBG(Background * bg)
if (bg->ref_count > 0)
{
char stuff[255];
Esnprintf(stuff, sizeof(stuff), _("%u references remain\n"),
bg->ref_count);
DIALOG_OK(_("Background Error!"), stuff);
DialogOK(_("Background Error!"), _("%u references remain\n"),
bg->ref_count);
EDBUG_RETURN_;
}

View File

@ -22,17 +22,7 @@
*/
#include "E.h"
typedef struct _ditembutton DItemButton;
typedef struct _ditemcheckbutton DItemCheckButton;
typedef struct _ditemtext DItemText;
typedef struct _ditemimage DItemImage;
typedef struct _ditemseparator DItemSeparator;
typedef struct _ditemtable DItemTable;
typedef struct _ditemradiobutton DItemRadioButton;
typedef struct _ditemslider DItemSlider;
typedef struct _ditemarea DItemArea;
struct _ditemslider
typedef struct
{
char horizontal;
@ -67,45 +57,45 @@ struct _ditemslider
Window base_win;
Window knob_win;
Window border_win;
};
} DItemSlider;
struct _ditemarea
typedef struct
{
Window area_win;
int w, h;
void (*event_func) (int val, void *data);
};
} DItemArea;
struct _ditembutton
typedef struct
{
char *text;
};
} DItemButton;
struct _ditemcheckbutton
typedef struct
{
char *text;
Window check_win;
int check_orig_w, check_orig_h;
char onoff;
char *onoff_ptr;
};
} DItemCheckButton;
struct _ditemtext
typedef struct
{
char *text;
};
} DItemText;
struct _ditemimage
typedef struct
{
char *image;
};
} DItemImage;
struct _ditemseparator
typedef struct
{
char horizontal;
};
} DItemSeparator;
struct _ditemtable
typedef struct
{
int num_columns;
char border;
@ -113,9 +103,9 @@ struct _ditemtable
char homogenous_v;
int num_items;
DItem **items;
};
} DItemTable;
struct _ditemradiobutton
typedef struct
{
char *text;
Window radio_win;
@ -126,7 +116,7 @@ struct _ditemradiobutton
DItem *next;
DItem *first;
void (*event_func) (int val, void *data);
};
} DItemRadioButton;
struct _ditem
{
@ -205,6 +195,9 @@ struct _dialog
DKeyBind *keybindings;
};
static void MoveTableBy(Dialog * d, DItem * di, int dx, int dy);
static void DialogItemsRealize(Dialog * d);
static ImageClass *d_ic_default = NULL;
static TextClass *d_tc_default = NULL;
@ -306,7 +299,7 @@ DialogBindKey(Dialog * d, char *key, void (*func) (int val, void *data),
}
Dialog *
CreateDialog(char *name)
DialogCreate(char *name)
{
Dialog *d;
@ -360,7 +353,7 @@ FreeDButton(DButton * db)
}
void
FreeDialog(Dialog * d)
DialogDestroy(Dialog * d)
{
int i;
@ -385,60 +378,6 @@ FreeDialog(Dialog * d)
Efree(d);
}
void
DialogRestart(int val, void *data)
{
doExit("restart");
val = 0;
data = NULL;
}
void
DialogQuit(int val, void *data)
{
doExit("error");
val = 0;
data = NULL;
}
void
DialogAlert(char *fmt, ...)
{
char text[10240];
va_list ap;
va_start(ap, fmt);
Evsnprintf(text, 10240, fmt, ap);
va_end(ap);
Alert(text);
}
void
DialogAlertOK(char *fmt, ...)
{
char text[10240];
va_list ap;
va_start(ap, fmt);
Evsnprintf(text, 10240, fmt, ap);
va_end(ap);
ASSIGN_ALERT(_("Attention !!!"), _("OK"), " ", " ");
Alert(text);
RESET_ALERT;
}
void
DialogSetParamText(Dialog * d, char *fmt, ...)
{
char text[10240];
va_list ap;
va_start(ap, fmt);
Evsnprintf(text, 10240, fmt, ap);
va_end(ap);
DialogSetText(d, text);
}
void
DialogSetText(Dialog * d, char *text)
{
@ -523,7 +462,7 @@ DialogAddButton(Dialog * d, char *text, void (*func) (int val, void *data),
ButtonReleaseMask | ExposureMask);
}
void
static void
DialogDrawButton(Dialog * d, int bnum)
{
int state;
@ -548,7 +487,7 @@ DialogDrawButton(Dialog * d, int bnum)
d->button[bnum]->tclass, d->button[bnum]->text);
}
void
static void
DialogActivateButton(Window win, int inclick)
{
Dialog *d;
@ -576,7 +515,7 @@ DialogActivateButton(Window win, int inclick)
DialogClose(d);
}
void
static void
DialogDraw(Dialog * d)
{
if ((!d->tclass) || (!d->iclass))
@ -593,7 +532,7 @@ DialogDraw(Dialog * d)
}
}
void
static void
DialogDrawArea(Dialog * d, int x, int y, int w, int h)
{
if ((!d->tclass) || (!d->iclass))
@ -766,7 +705,7 @@ DialogClose(Dialog * d)
if (d->exit_func)
(d->exit_func) (d->exit_val, d->exit_data);
RemoveItem(NULL, d->win, LIST_FINDBY_ID, LIST_TYPE_DIALOG);
FreeDialog(d);
DialogDestroy(d);
}
DItem *
@ -1016,7 +955,7 @@ DialogItemCallCallback(DItem * di)
di->func(di->val, di->data);
}
void
static void
DialogRealizeItem(Dialog * d, DItem * di)
{
char *def = NULL;
@ -1596,7 +1535,7 @@ DialogRealizeItem(Dialog * d, DItem * di)
}
}
void
static void
MoveTableBy(Dialog * d, DItem * di, int dx, int dy)
{
int i;
@ -1844,7 +1783,7 @@ DialogDrawItems(Dialog * d, DItem * di, int x, int y, int w, int h)
}
}
void
static void
DialogItemsRealize(Dialog * d)
{
char pq;
@ -2124,7 +2063,7 @@ DialogFreeItem(DItem * di)
Efree(di);
}
DItem *
static DItem *
DialogItemFindWindow(DItem * di, Window win)
{
DItem *dii = NULL;
@ -2156,6 +2095,78 @@ DialogItem(Dialog * d)
return d->item;
}
/*
* Predefined dialogs
*/
void
DialogOK(const char *title, const char *fmt, ...)
{
char text[10240];
va_list ap;
va_start(ap, fmt);
Evsnprintf(text, sizeof(text), fmt, ap);
va_end(ap);
DialogOKstr(title, text);
}
void
DialogOKstr(const char *title, const char *txt)
{
Dialog *d;
d = DialogCreate("DIALOG");
DialogSetTitle(d, title);
DialogSetText(d, txt);
DialogAddButton(d, _("OK"), NULL, 1);
ShowDialog(d);
}
void
DialogRestart(int val, void *data)
{
doExit("restart");
val = 0;
data = NULL;
}
void
DialogQuit(int val, void *data)
{
doExit("error");
val = 0;
data = NULL;
}
void
DialogAlert(const char *fmt, ...)
{
char text[10240];
va_list ap;
va_start(ap, fmt);
Evsnprintf(text, 10240, fmt, ap);
va_end(ap);
Alert(text);
}
void
DialogAlertOK(const char *fmt, ...)
{
char text[10240];
va_list ap;
va_start(ap, fmt);
Evsnprintf(text, 10240, fmt, ap);
va_end(ap);
ASSIGN_ALERT(_("Attention !!!"), _("OK"), " ", " ");
Alert(text);
RESET_ALERT;
}
/*
* Dialog event handlers
*/

View File

@ -114,10 +114,10 @@ BuildWindowGroup(EWin ** ewins, int num)
AddEwinToGroup(ewins[i], g);
else
{
DIALOG_OK(_("Cannot comply"),
_("Iconboxes and Pagers are disallowed from being\n"
"members of a group. You cannot add these windows\n"
"to a group.\n"));
DialogOK(_("Cannot comply"),
_("Iconboxes and Pagers are disallowed from being\n"
"members of a group. You cannot add these windows\n"
"to a group.\n"));
}
}
}
@ -146,10 +146,10 @@ AddEwinToGroup(EWin * ewin, Group * g)
}
else
{
DIALOG_OK(_("Cannot comply"),
_("Iconboxes and Pagers are disallowed from being\n"
"members of a group. You cannot add these windows\n"
"to a group.\n"));
DialogOK(_("Cannot comply"),
_("Iconboxes and Pagers are disallowed from being\n"
"members of a group. You cannot add these windows\n"
"to a group.\n"));
}
}
}
@ -592,26 +592,26 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
if ((num_groups == 0)
&& (action == ACTION_BREAK_GROUP || action == ACTION_REMOVE_FROM_GROUP))
{
DIALOG_OK(_("Window Group Error"),
_
("\n This window currently does not belong to any groups. \n"
" You can only destroy groups or remove windows from groups \n"
" through a window that actually belongs to at least one group.\n\n"));
DialogOK(_("Window Group Error"),
_
("\n This window currently does not belong to any groups. \n"
" You can only destroy groups or remove windows from groups \n"
" through a window that actually belongs to at least one group.\n\n"));
return;
}
if ((num_groups == 0) && (group_select == GROUP_SELECT_ALL_EXCEPT_EWIN))
{
DIALOG_OK(_("Window Group Error"),
_("\n Currently, no groups exist or this window \n"
" already belongs to all existing groups. \n"
" You have to start other groups first. \n\n"));
DialogOK(_("Window Group Error"),
_("\n Currently, no groups exist or this window \n"
" already belongs to all existing groups. \n"
" You have to start other groups first. \n\n"));
return;
}
if (!tmp_groups)
{
DIALOG_OK(_("Window Group Error"),
_
("\n Currently, no groups exist. You have to start a group first.\n\n"));
DialogOK(_("Window Group Error"),
_
("\n Currently, no groups exist. You have to start a group first.\n\n"));
return;
}
@ -625,7 +625,7 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
}
AUDIO_PLAY("SOUND_SETTINGS_GROUP");
d = CreateDialog("GROUP_SELECTION");
d = DialogCreate("GROUP_SELECTION");
DialogSetTitle(d, _("Window Group Selection"));
table = DialogInitItem(d);

View File

@ -110,11 +110,8 @@ FreeImageClass(ImageClass * i)
if (i->ref_count > 0)
{
char stuff[255];
Esnprintf(stuff, sizeof(stuff), _("%u references remain\n"),
i->ref_count);
DIALOG_OK(_("ImageClass Error!"), stuff);
DialogOK(_("ImageClass Error!"), _("%u references remain\n"),
i->ref_count);
EDBUG_RETURN_;
}
while (RemoveItemByPtr(i, LIST_TYPE_ICLASS));

View File

@ -2232,9 +2232,7 @@ IPC_DialogOK(char *params, Client * c)
buf[0] = 0;
if (params)
{
DIALOG_OK(_("Message"), params);
}
DialogOKstr(_("Message"), params);
else
Esnprintf(buf, sizeof(buf), "Error: No text for dialog specified");

View File

@ -605,7 +605,7 @@ doSMExit(void *params)
LIST_TYPE_DIALOG)))
{
AUDIO_PLAY("SOUND_LOGOUT");
d = CreateDialog("LOGOUT_DIALOG");
d = DialogCreate("LOGOUT_DIALOG");
DialogSetTitle(d, "Are you sure?");
DialogSetText(d,
"\n" "\n"
@ -1157,7 +1157,7 @@ doSMExit(void *params)
FindItem("LOGOUT_DIALOG", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
{
AUDIO_PLAY("SOUND_LOGOUT");
d = CreateDialog("LOGOUT_DIALOG");
d = DialogCreate("LOGOUT_DIALOG");
DialogSetTitle(d, _("Are you sure?"));
DialogSetText(d,
_("\n" "\n"

View File

@ -123,7 +123,7 @@ SettingsPager(void)
tmp_pager_do_scan = 1;
tmp_pager_scan_speed = mode.pager_scanspeed;
d = pager_settings_dialog = CreateDialog("CONFIGURE_PAGER");
d = pager_settings_dialog = DialogCreate("CONFIGURE_PAGER");
DialogSetTitle(d, _("Pager Settings"));
table = DialogInitItem(d);
@ -413,7 +413,7 @@ SettingsFocus(void)
#endif /* WITH_TARTY_WARP */
tmp_clickalways = mode.clickalways;
d = CreateDialog("CONFIGURE_FOCUS");
d = DialogCreate("CONFIGURE_FOCUS");
DialogSetTitle(d, _("Focus Settings"));
table = DialogInitItem(d);
@ -798,7 +798,7 @@ SettingsMoveResize(void)
tmp_resize = mode.resizemode;
tmp_geominfo = mode.geominfomode;
d = CreateDialog("CONFIGURE_MOVERESIZE");
d = DialogCreate("CONFIGURE_MOVERESIZE");
DialogSetTitle(d, _("Move & Resize Settings"));
table = DialogInitItem(d);
@ -981,7 +981,7 @@ SettingsMoveResize(void)
ShowDialog(d);
/*
* dexp = CreateDialog("CONFIGURE_MOVERESIZE_EXAMPLE");
* dexp = DialogCreate("CONFIGURE_MOVERESIZE_EXAMPLE");
* DialogSetTitle(dexp, _("Move & Resize Settings Example"));
*/
@ -1118,7 +1118,7 @@ SettingsDesktops(void)
tmp_desktops = mode.numdesktops;
tmp_desktop_wraparound = mode.desktop_wraparound;
d = tmp_desk_dialog = CreateDialog("CONFIGURE_DESKTOPS");
d = tmp_desk_dialog = DialogCreate("CONFIGURE_DESKTOPS");
DialogSetTitle(d, _("Multiple Desktop Settings"));
table = DialogInitItem(d);
@ -1318,7 +1318,7 @@ SettingsArea(void)
GetAreaSize(&tmp_area_x, &tmp_area_y);
tmp_area_y = 9 - tmp_area_y;
d = tmp_area_dialog = CreateDialog("CONFIGURE_AREA");
d = tmp_area_dialog = DialogCreate("CONFIGURE_AREA");
DialogSetTitle(d, _("Virtual Desktop Settings"));
table = DialogInitItem(d);
@ -1496,7 +1496,7 @@ SettingsPlacement(void)
tmp_extra_head = mode.extra_head;
#endif
d = CreateDialog("CONFIGURE_PLACEMENT");
d = DialogCreate("CONFIGURE_PLACEMENT");
DialogSetTitle(d, _("Window Placement Settings"));
table = DialogInitItem(d);
@ -1626,7 +1626,7 @@ SettingsAutoRaise(void)
tmp_autoraise = mode.autoraise;
tmp_autoraisetime = (int)(mode.autoraisetime * 100);
d = CreateDialog("CONFIGURE_AUTORAISE");
d = DialogCreate("CONFIGURE_AUTORAISE");
DialogSetTitle(d, _("Autoraise Settings"));
table = DialogInitItem(d);
@ -1727,7 +1727,7 @@ SettingsTooltips(void)
tmp_tooltiptime = (int)(mode.tiptime * 100);
tmp_roottip = mode.showroottooltip;
d = CreateDialog("CONFIGURE_TOOLTIPS");
d = DialogCreate("CONFIGURE_TOOLTIPS");
DialogSetTitle(d, _("Tooltip Settings"));
table = DialogInitItem(d);
@ -1829,7 +1829,7 @@ SettingsMiscellaneous(void)
tmp_dialog_headers = mode.dialog_headers;
d = CreateDialog("CONFIGURE_MISCELLANEOUS");
d = DialogCreate("CONFIGURE_MISCELLANEOUS");
DialogSetTitle(d, _("Miscellaneous Settings"));
table = DialogInitItem(d);
@ -1912,7 +1912,7 @@ SettingsAudio(void)
tmp_audio = mode.sound;
d = CreateDialog("CONFIGURE_AUDIO");
d = DialogCreate("CONFIGURE_AUDIO");
DialogSetTitle(d, _("Audio Settings"));
table = DialogInitItem(d);
@ -2072,7 +2072,7 @@ SettingsSpecialFX(void)
tmp_effect_ripples = FX_IsOn("ripples");
tmp_effect_waves = FX_IsOn("waves");
d = CreateDialog("CONFIGURE_FX");
d = DialogCreate("CONFIGURE_FX");
DialogSetTitle(d, _("Special FX Settings"));
table = DialogInitItem(d);
@ -3301,7 +3301,7 @@ SettingsBackground(Background * bg)
tmp_userbg = mode.user_bg;
tmp_bg_timeout = mode.desktop_bg_timeout;
d = bg_sel_dialog = CreateDialog("CONFIGURE_BG");
d = bg_sel_dialog = DialogCreate("CONFIGURE_BG");
DialogSetTitle(d, _("Desktop Background Settings"));
table = DialogInitItem(d);
@ -3770,7 +3770,7 @@ SettingsIconbox(char *name)
Efree(tmp_ib_name);
tmp_ib_name = duplicate(name);
d = CreateDialog("CONFIGURE_ICONBOX");
d = DialogCreate("CONFIGURE_ICONBOX");
DialogSetTitle(d, _("Iconbox Settings"));
table = DialogInitItem(d);
@ -4143,9 +4143,9 @@ SettingsGroups(EWin * ewin)
return;
if (ewin->num_groups == 0)
{
DIALOG_OK(_("Window Group Error"),
_
("\n This window currently does not belong to any groups. \n\n"));
DialogOK(_("Window Group Error"),
_
("\n This window currently does not belong to any groups. \n\n"));
return;
}
if ((d = FindItem("CONFIGURE_GROUP", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
@ -4167,7 +4167,7 @@ SettingsGroups(EWin * ewin)
for (i = 0; i < ewin->num_groups; i++)
CopyGroupConfig(&(ewin->groups[i]->cfg), &(tmp_cfgs[i]));
d = CreateDialog("CONFIGURE_GROUP");
d = DialogCreate("CONFIGURE_GROUP");
DialogSetTitle(d, _("Window Group Settings"));
table = DialogInitItem(d);
@ -4371,7 +4371,7 @@ SettingsDefaultGroupControl(void)
CopyGroupConfig(&(mode.group_config), &tmp_group_cfg);
tmp_group_swap = mode.group_swapmove;
d = CreateDialog("CONFIGURE_DEFAULT_GROUP_CONTROL");
d = DialogCreate("CONFIGURE_DEFAULT_GROUP_CONTROL");
DialogSetTitle(d, _("Default Group Control Settings"));
table = DialogInitItem(d);
@ -4619,7 +4619,7 @@ SettingsRemember()
}
AUDIO_PLAY("SOUND_SETTINGS_REMEMBER");
d = CreateDialog("REMEMBER_WINDOW");
d = DialogCreate("REMEMBER_WINDOW");
DialogSetTitle(d, _("Remembered Windows Settings"));
table = DialogInitItem(d);

View File

@ -280,7 +280,7 @@ SnapshotEwinDialog(EWin * ewin)
ShowDialog(d);
return;
}
d = CreateDialog("SNAPSHOT_WINDOW");
d = DialogCreate("SNAPSHOT_WINDOW");
DialogSetTitle(d, _("Remembered Application Attributes"));
table = DialogInitItem(d);

View File

@ -50,13 +50,11 @@ LoadWav(char *file)
find = FindFile(file);
if (!find)
{
DIALOG_PARAM_OK(_("Error finding sound file"));
DIALOG_PARAM _("Warning! Enlightenment was unable "
"to load the\nfollowing sound file:\n%s\n"
"Enlightenment will continue to operate, but you\n"
"may wish to check your configuration settings.\n"),
file DIALOG_PARAM_END;
DialogOK(_("Error finding sound file"),
_("Warning! Enlightenment was unable to load the\n"
"following sound file:\n%s\n"
"Enlightenment will continue to operate, but you\n"
"may wish to check your configuration settings.\n"), file);
EDBUG_RETURN(NULL);
}
in_file = afOpenFile(find, "r", NULL);

View File

@ -66,11 +66,8 @@ DeleteTclass(TextClass * t)
if (t->ref_count > 0)
{
char stuff[255];
Esnprintf(stuff, sizeof(stuff), _("%u references remain\n"),
t->ref_count);
DIALOG_OK(_("TextClass Error!"), stuff);
DialogOK(_("TextClass Error!"), _("%u references remain\n"),
t->ref_count);
EDBUG_RETURN_;
}
if (t->name)

View File

@ -344,16 +344,13 @@ FindTheme(char *theme)
void
BadThemeDialog(void)
{
char s[1024];
if (!badtheme)
return;
Esnprintf(s, sizeof(s),
_("The theme:\n" "%s\n"
"Is a badly formed theme package and is thus not being used.\n"
"Enlightenment has fallen back to using the DEFAULT theme.\n"
"\n" "The reason this theme is bad is:\n" "%s"), badtheme,
badreason);
DIALOG_OK(_("Bad Theme"), s);
DialogOK(_("Bad Theme"),
_("The theme:\n" "%s\n"
"Is a badly formed theme package and is thus not being used.\n"
"Enlightenment has fallen back to using the DEFAULT theme.\n"
"\n" "The reason this theme is bad is:\n" "%s"),
badtheme, badreason);
}

View File

@ -858,11 +858,9 @@ FreeToolTip(ToolTip * tt)
if (tt->ref_count > 0)
{
char stuff[255];
Esnprintf(stuff, sizeof(stuff), _("%u references remain\n"),
tt->ref_count);
DIALOG_OK(_("ToolTip Error!"), stuff);
DialogOK(_("ToolTip Error!"), _("%u references remain\n"),
tt->ref_count);
}
EDBUG_RETURN_;
}