Trivial function rename, cleanups.

SVN revision: 22374
This commit is contained in:
Kim Woelders 2006-04-26 23:43:07 +00:00
parent 068d2aef43
commit 02dbdc4bdc
17 changed files with 69 additions and 94 deletions

View File

@ -288,7 +288,7 @@ About(void)
d = DialogFind("ABOUT_ENLIGHTENMENT");
if (d)
{
ShowDialog(d);
DialogShow(d);
return;
}
@ -320,7 +320,7 @@ About(void)
DialogItemSetText(di, buf);
DialogAddButton(d, _("OK"), NULL, 1, DLG_BUTTON_OK);
ShowDialog(d);
DialogShow(d);
}
#if 0 /* FIXME - Fix */

View File

@ -2000,7 +2000,7 @@ SettingsBackground(Background * bg)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_BG");
@ -2258,7 +2258,7 @@ SettingsBackground(Background * bg)
DialogAddFooter(d, DLG_OAC, CB_ConfigureBG);
ShowDialog(d);
DialogShow(d);
CB_DesktopMiniDisplayRedraw(NULL, 1, area);
BGSettingsGoTo(tmp_bg);

View File

@ -2356,7 +2356,7 @@ SettingsDesktops(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_DESKTOPS");
@ -2473,7 +2473,7 @@ SettingsDesktops(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureDesktops);
ShowDialog(d);
DialogShow(d);
DialogItemSetCallback(slider, CB_DesktopDisplayRedraw, 0, (void *)area);
CB_DesktopDisplayRedraw(d, 1, area);
@ -2577,7 +2577,7 @@ SettingsArea(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_AREA");
@ -2661,7 +2661,7 @@ SettingsArea(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureAreas);
ShowDialog(d);
DialogShow(d);
CB_AreaDisplayRedraw(d, 1, area);
}

View File

@ -202,6 +202,7 @@ struct _dialog
int xu1, yu1, xu2, yu2;
};
static EWin *FindEwinByDialog(Dialog * d);
static int FindADialog(void);
static void DialogHandleEvents(XEvent * ev, void *prm);
@ -570,8 +571,8 @@ DialogEwinInit(EWin * ewin, void *ptr)
EoSetLayer(ewin, 10);
}
void
ShowDialog(Dialog * d)
static void
DialogShowArranged(Dialog * d, int center)
{
int i, w, h, mw, mh;
EWin *ewin;
@ -652,10 +653,10 @@ ShowDialog(Dialog * d)
else
{
EwinResize(ewin, w, h);
if (FindADialog() > 1)
ArrangeEwin(ewin);
else
if (center || FindADialog() == 1)
ArrangeEwinCentered(ewin);
else
ArrangeEwin(ewin);
}
DialogRedraw(d);
@ -664,6 +665,18 @@ ShowDialog(Dialog * d)
}
void
DialogShow(Dialog * d)
{
DialogShowArranged(d, 0);
}
void
DialogShowCentered(Dialog * d)
{
DialogShowArranged(d, 1);
}
static void
DialogClose(Dialog * d)
{
if (!d)
@ -2075,7 +2088,7 @@ DialogOKstr(const char *title, const char *txt)
DialogAddButton(d, _("OK"), NULL, 1, DLG_BUTTON_OK);
DialogBindKey(d, "Return", DialogCallbackClose, 0);
DialogBindKey(d, "Escape", DialogCallbackClose, 0);
ShowDialog(d);
DialogShow(d);
}
void
@ -2510,7 +2523,7 @@ DButtonHandleEvents(XEvent * ev, void *prm)
* Finders
*/
EWin *
static EWin *
FindEwinByDialog(Dialog * d)
{
EWin *const *ewins;
@ -2541,33 +2554,3 @@ FindADialog(void)
return n;
}
#if 0 /* Unused */
static int
doAlert(EWin * edummy __UNUSED__, const char *params)
{
char *pp;
int i;
pp = Estrdup(params);
if (!pp)
return 1;
if (strlen(pp) <= 0)
return 1;
i = 1;
while (pp[i])
{
if ((pp[i - 1] == '\\') && (params[i] == 'n'))
{
pp[i - 1] = ' ';
pp[i] = '\n';
}
i++;
}
DialogAlertOK(pp);
Efree(pp);
return 0;
}
#endif

View File

@ -65,9 +65,9 @@ void DialogSetExitFunction(Dialog * d, DialogCallbackFunc * func,
void DialogSetData(Dialog * d, void *data);
void *DialogGetData(Dialog * d);
void DialogShow(Dialog * d);
void DialogShowCentered(Dialog * d);
void DialogRedraw(Dialog * d);
void ShowDialog(Dialog * d);
void DialogClose(Dialog * d);
void DialogAddButton(Dialog * d, const char *text,
DialogCallbackFunc * func, char doclose,
@ -129,6 +129,4 @@ void DialogCallbackClose(Dialog * d, int val, void *data);
void DialogsInit(void);
EWin *FindEwinByDialog(Dialog * d);
#endif /* _DIALOG_H_ */

View File

@ -685,7 +685,7 @@ SettingsFocus(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_FOCUS");
@ -851,7 +851,7 @@ SettingsFocus(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureFocus);
ShowDialog(d);
DialogShow(d);
}
/*

View File

@ -981,7 +981,7 @@ FxSettings(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_FX");
@ -1018,7 +1018,7 @@ FxSettings(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureFX);
ShowDialog(d);
DialogShow(d);
}
static void

View File

@ -687,7 +687,7 @@ ChooseGroupDialog(EWin * ewin, const char *message, char group_select,
if (d)
{
SoundPlay("GROUP_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
}
SoundPlay("SOUND_SETTINGS_GROUP");
@ -730,7 +730,7 @@ ChooseGroupDialog(EWin * ewin, const char *message, char group_select,
DialogAddFooter(d, DLG_OC, ChooseGroup);
ShowDialog(d);
DialogShow(d);
}
typedef struct
@ -810,7 +810,7 @@ SettingsGroups(EWin * ewin)
if (d)
{
SoundPlay("GROUP_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
@ -922,7 +922,7 @@ SettingsGroups(EWin * ewin)
DialogAddFooter(d, DLG_OAC, CB_ConfigureGroup);
ShowDialog(d);
DialogShow(d);
}
static GroupConfig tmp_group_cfg;
@ -949,7 +949,7 @@ SettingsDefaultGroupControl(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_GROUP");
@ -1031,7 +1031,7 @@ SettingsDefaultGroupControl(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureDefaultGroupSettings);
ShowDialog(d);
DialogShow(d);
}
/*

View File

@ -2134,7 +2134,7 @@ IconboxConfigure(Iconbox * ib)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_ICONBOX");
@ -2333,7 +2333,7 @@ IconboxConfigure(Iconbox * ib)
DialogAddFooter(d, DLG_OAC, CB_ConfigureIconbox);
ShowDialog(d);
DialogShow(d);
}
/*

View File

@ -2037,7 +2037,7 @@ MenusSettings(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_MENUS");
@ -2073,7 +2073,7 @@ MenusSettings(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureMenus);
ShowDialog(d);
DialogShow(d);
}
static void

View File

@ -119,7 +119,7 @@ SettingsTransparency(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_TRANS");
@ -283,7 +283,7 @@ SettingsTransparency(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureTrans);
ShowDialog(d);
DialogShow(d);
}
static void

View File

@ -1736,7 +1736,7 @@ SettingsPager(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_PAGER");
@ -1890,7 +1890,7 @@ SettingsPager(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigurePager);
ShowDialog(d);
DialogShow(d);
}
/*

View File

@ -633,7 +633,6 @@ static void
SessionLogoutConfirm(void)
{
Dialog *d;
EWin *ewin;
d = DialogFind("LOGOUT_DIALOG");
if (!d)
@ -657,12 +656,7 @@ SessionLogoutConfirm(void)
DialogBindKey(d, "Return", LogoutCB, 0);
}
ShowDialog(d);
ewin = FindEwinByDialog(d);
if (ewin)
ArrangeEwinCentered(ewin);
return;
DialogShowCentered(d);
}
void
@ -760,7 +754,7 @@ SettingsSession(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_SESSION");
@ -796,5 +790,5 @@ SettingsSession(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureSession);
ShowDialog(d);
DialogShow(d);
}

View File

@ -52,7 +52,7 @@ SettingsMoveResize(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_MOVERESIZE");
@ -180,7 +180,7 @@ SettingsMoveResize(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureMoveResize);
ShowDialog(d);
DialogShow(d);
}
static char tmp_with_leader;
@ -241,7 +241,7 @@ SettingsPlacement(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_PLACEMENT");
@ -410,7 +410,7 @@ SettingsPlacement(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigurePlacement);
ShowDialog(d);
DialogShow(d);
}
static char tmp_autoraise;
@ -437,7 +437,7 @@ SettingsAutoRaise(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_AUTORAISE");
@ -474,7 +474,7 @@ SettingsAutoRaise(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureAutoraise);
ShowDialog(d);
DialogShow(d);
}
static char tmp_dialog_headers;
@ -505,7 +505,7 @@ SettingsMiscellaneous(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_MISCELLANEOUS");
@ -553,7 +553,7 @@ SettingsMiscellaneous(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureMiscellaneous);
ShowDialog(d);
DialogShow(d);
}
#if USE_COMPOSITE
@ -588,7 +588,7 @@ SettingsComposite(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_COMPOSITE");
@ -661,6 +661,6 @@ SettingsComposite(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureComposite);
ShowDialog(d);
DialogShow(d);
}
#endif

View File

@ -680,7 +680,7 @@ SnapshotEwinDialog(const EWin * ewin)
d = DialogFind(s);
if (d)
{
ShowDialog(d);
DialogShow(d);
return;
}
d = DialogCreate(s);
@ -945,7 +945,7 @@ SnapshotEwinDialog(const EWin * ewin)
DialogAddFooter(d, DLG_OAC, CB_ApplySnap);
ShowDialog(d);
DialogShow(d);
}
/* list of remembered items for the remember dialog -- it's either
@ -1018,7 +1018,7 @@ SettingsRemember(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_REMEMBER");
@ -1096,7 +1096,7 @@ SettingsRemember(void)
DialogAddFooter(d, DLG_OC, CB_ApplyRemember);
ShowDialog(d);
DialogShow(d);
}
/* ... combine writes, only save after a timeout */

View File

@ -448,7 +448,7 @@ SettingsAudio(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_AUDIO");
@ -480,7 +480,7 @@ SettingsAudio(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureAudio);
ShowDialog(d);
DialogShow(d);
}
/*

View File

@ -847,7 +847,7 @@ SettingsTooltips(void)
if (d)
{
SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d);
DialogShow(d);
return;
}
SoundPlay("SOUND_SETTINGS_TOOLTIPS");
@ -888,7 +888,7 @@ SettingsTooltips(void)
DialogAddFooter(d, DLG_OAC, CB_ConfigureTooltips);
ShowDialog(d);
DialogShow(d);
}
static void