[repo.or.cz] wmaker-crm.git branch next updated: wmaker-0.95.6-330-gfee129b

crmafra <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  fee129b18179b467f3f248857712ef0fe5bc5140 (commit)
      from  e545b2abf99b1c4114799a3957d5d94c42d61bb7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/fee129b18179b467f3f248857712ef0fe5bc5140

commit fee129b18179b467f3f248857712ef0fe5bc5140
Author: Carlos R. Mafra <[email protected]>
Date:   Tue Jul 7 14:36:13 2015 -0300

    Revert "wmaker: fix clearing of window attribute that was not saved properly"
    
    This reverts commit 14d1d3f141bc6740e7c8704f7883ed9c56fc45d5.
    
    Conflicts:
    	src/winspector.c
    
    Signed-off-by: Carlos R. Mafra <[email protected]>

diff --git a/src/winspector.c b/src/winspector.c
index 3d701e5..0d6d57d 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -203,7 +203,6 @@ typedef struct InspectorPanel {
 
 	/* second page. attributes */
 	WMFrame *attrFrm;
-	WMButton *attrClient[sizeof(window_attribute) / sizeof(window_attribute[0])];
 	WMButton *attrChk[sizeof(window_attribute) / sizeof(window_attribute[0])];
 
 	/* 3rd page. more attributes */
@@ -643,27 +642,8 @@ static void saveSettings(WMWidget *button, void *client_data)
 
 	/* Attributes... --> Window Attributes */
 	for (i = 0; i < wlengthof(window_attribute); i++) {
-		WMPropList *old_value;
-		int state;
-
-		old_value = WMGetFromPLDictionary(winDic, pl_attribute[i]);
-		state = WMGetButtonSelected(panel->attrChk[i]);
-		if (state > 0) {
-			if ((old_value == NULL) || !getBool(old_value)) {
-				WMPutInPLDictionary(winDic, pl_attribute[i], Yes);
-				different |= 1;
-			}
-		} else if (state == 0) {
-			if ((old_value == NULL) || getBool(old_value)) {
-				WMPutInPLDictionary(winDic, pl_attribute[i], No);
-				different |= 1;
-			}
-		} else {	/* (state < 0) */
-			if (old_value != NULL) {
-				WMRemoveFromPLDictionary(winDic, pl_attribute[i]);
-				different |= 1;
-			}
-		}
+		value = (WMGetButtonSelected(panel->attrChk[i]) != 0) ? Yes : No;
+		different |= insertAttribute(dict, winDic, pl_attribute[i], value, flags);
 	}
 
 	/* Attributes... --> Advanced Options */
@@ -746,19 +726,12 @@ static void applySettings(WMWidget *button, void *client_data)
 
 	/* Attributes... --> Window Attributes */
 	for (i = 0; i < wlengthof(window_attribute); i++) {
-		int state;
-
-		state = WMGetButtonSelected(panel->attrChk[i]);
-
-		if (state > 0)
+		if (WMGetButtonSelected(panel->attrChk[i]))
 			set_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
 		else
 			clear_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
 
-		if (state < 0)
-			clear_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
-		else
-			set_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
+		set_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
 	}
 
 	/* Attributes... --> Advanced Options */
@@ -931,7 +904,7 @@ static void revertSettings(WMWidget *button, void *client_data)
 		if (is_userdef)
 			flag = get_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
 		else
-			flag = -1;
+			flag = get_attr_flag(&wwin->client_flags, &window_attribute[i].flag);
 
 		WMSetButtonSelected(panel->attrChk[i], flag);
 	}
@@ -1342,31 +1315,15 @@ static void create_tab_window_attributes(WWindow *wwin, InspectorPanel *panel, i
 	for (i = 0; i < wlengthof(window_attribute); i++) {
 		int is_userdef, flag;
 
-		/* Read-only button to display the state requested by the application */
-		flag = get_attr_flag(&wwin->client_flags, &window_attribute[i].flag);
-
-		panel->attrClient[i] = WMCreateSwitchButton(panel->attrFrm);
-		WMMoveWidget(panel->attrClient[i], 10, 20 * (i + 1));
-		WMResizeWidget(panel->attrClient[i], 20, 20);
-		WMSetButtonText(panel->attrClient[i], NULL);
-		WMSetButtonSelected(panel->attrClient[i], flag);
-		WMSetButtonEnabled(panel->attrClient[i], False);
-
-		WMSetBalloonTextForView(_("Shows the state that was asked by the application.\n"
-		                          "You can use the checkbox on the right to change this setting;\n"
-		                          "when it is grayed it means to follow application's choice."),
-		                        WMWidgetView(panel->attrClient[i]));
-
-		/* Button to let user override this choice */
 		is_userdef = get_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
 		if (is_userdef)
 			flag = get_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
 		else
-			flag = -1;
+			flag = get_attr_flag(&wwin->client_flags, &window_attribute[i].flag);
 
-		panel->attrChk[i] = WMCreateButton(panel->attrFrm, WBTTriState);
-		WMMoveWidget(panel->attrChk[i], 30, 20 * (i + 1));
-		WMResizeWidget(panel->attrChk[i], frame_width - 45, 20);
+		panel->attrChk[i] = WMCreateSwitchButton(panel->attrFrm);
+		WMMoveWidget(panel->attrChk[i], 10, 20 * (i + 1));
+		WMResizeWidget(panel->attrChk[i], frame_width - 15, 20);
 		WMSetButtonSelected(panel->attrChk[i], flag);
 		WMSetButtonText(panel->attrChk[i], _(window_attribute[i].caption));
 

-----------------------------------------------------------------------

Summary of changes:
 src/winspector.c | 61 +++++++++-----------------------------------------------
 1 file changed, 9 insertions(+), 52 deletions(-)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.