BF [ 1824621 ] History button can't be canceled
http://sourceforge.net/tracker/index.php?func=detail&aid=1824621&group_id=176962&atid=879332
This commit is contained in:
parent
8793fa8f6b
commit
8c7f9eacaa
|
@ -50,6 +50,8 @@ import org.compiere.util.*;
|
|||
* Colin Rooney 2007/03/20 RFE#1670185 & related BUG#1684142 - Extend Sec to Info Queries
|
||||
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
|
||||
* @contributor fer_luck@centuryon.com , FR [ 1757088 ]
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
* <li>BF [ 1824621 ] History button can't be canceled
|
||||
*/
|
||||
public final class APanel extends CPanel
|
||||
implements DataStatusListener, ChangeListener, ActionListener, ASyncProcess
|
||||
|
@ -1996,23 +1998,30 @@ public final class APanel extends CPanel
|
|||
Point pt = new Point (0, aHistory.getButton().getBounds().height);
|
||||
SwingUtilities.convertPointToScreen(pt, aHistory.getButton());
|
||||
VOnlyCurrentDays ocd = new VOnlyCurrentDays(Env.getFrame(this), pt);
|
||||
m_onlyCurrentDays = ocd.getCurrentDays();
|
||||
if (m_onlyCurrentDays == 1) // Day
|
||||
{
|
||||
m_onlyCurrentRows = true;
|
||||
m_onlyCurrentDays = 0; // no Created restriction
|
||||
if (!ocd.isCancel()) {
|
||||
m_onlyCurrentDays = ocd.getCurrentDays();
|
||||
if (m_onlyCurrentDays == 1) // Day
|
||||
{
|
||||
m_onlyCurrentRows = true;
|
||||
m_onlyCurrentDays = 0; // no Created restriction
|
||||
}
|
||||
else
|
||||
m_onlyCurrentRows = false;
|
||||
//
|
||||
m_curTab.setQuery(null); // reset previous queries
|
||||
MRole role = MRole.getDefault();
|
||||
int maxRows = role.getMaxQueryRecords();
|
||||
//
|
||||
log.config("OnlyCurrent=" + m_onlyCurrentRows
|
||||
+ ", Days=" + m_onlyCurrentDays
|
||||
+ ", MaxRows=" + maxRows);
|
||||
m_curGC.query(m_onlyCurrentRows, m_onlyCurrentDays, maxRows ); // autoSize
|
||||
}
|
||||
// Restore history button's pressed status
|
||||
else {
|
||||
if (isFirstTab())
|
||||
aHistory.setPressed(!m_curTab.isOnlyCurrentRows());
|
||||
}
|
||||
else
|
||||
m_onlyCurrentRows = false;
|
||||
//
|
||||
m_curTab.setQuery(null); // reset previous queries
|
||||
MRole role = MRole.getDefault();
|
||||
int maxRows = role.getMaxQueryRecords();
|
||||
//
|
||||
log.config("OnlyCurrent=" + m_onlyCurrentRows
|
||||
+ ", Days=" + m_onlyCurrentDays
|
||||
+ ", MaxRows=" + maxRows);
|
||||
m_curGC.query(m_onlyCurrentRows, m_onlyCurrentDays, maxRows ); // autoSize
|
||||
}
|
||||
} // cmd_history
|
||||
|
||||
|
|
|
@ -28,6 +28,9 @@ import org.compiere.util.*;
|
|||
*
|
||||
* @author Jorg Janke
|
||||
* @version $Id: VOnlyCurrentDays.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
|
||||
*
|
||||
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||
* <li>BF [ 1824621 ] History button can't be canceled
|
||||
*/
|
||||
public class VOnlyCurrentDays extends CDialog
|
||||
implements ActionListener
|
||||
|
@ -64,6 +67,8 @@ public class VOnlyCurrentDays extends CDialog
|
|||
|
||||
/** Days (0=all) */
|
||||
private int m_days = 0;
|
||||
/** Is cancel */
|
||||
private boolean m_isCancel = false;
|
||||
/** Margin */
|
||||
private static Insets s_margin = new Insets (2, 2, 2, 2);
|
||||
/** Logger */
|
||||
|
@ -102,6 +107,13 @@ public class VOnlyCurrentDays extends CDialog
|
|||
mainPanel.setToolTipText(Msg.getMsg(Env.getCtx(), "VOnlyCurrentDays", false));
|
||||
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
|
||||
this.getRootPane().setDefaultButton(bShowDay);
|
||||
//
|
||||
addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
m_isCancel = true;
|
||||
}
|
||||
});
|
||||
} // jbInit
|
||||
|
||||
/**
|
||||
|
@ -132,4 +144,10 @@ public class VOnlyCurrentDays extends CDialog
|
|||
return m_days;
|
||||
} // getCurrentDays
|
||||
|
||||
/**
|
||||
* @return true if user has canceled this form
|
||||
*/
|
||||
public boolean isCancel() {
|
||||
return m_isCancel;
|
||||
}
|
||||
} // VOnlyCurrentDays
|
||||
|
|
Loading…
Reference in New Issue