Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Finished Monitor module

  • Loading branch information...
commit ef1aee182a795e9014a66280ea74e5cb43db8276 1 parent 23902ab
Manu Gupta authored
Showing with 35 additions and 23 deletions.
  1. +4 −4 src/lens/xorg.aug
  2. +31 −19 src/monitors.cxx
8 src/lens/xorg.aug
View
@@ -177,11 +177,11 @@ let match_is_pointer = entry_str "MatchIsPointer" /[mM]atchIsPointer/
*************************************************************************)
-(* View: display_modes *)
+(* View: display_modes
let display_modes = [ indent . del /[mM]odes/ "Modes" . label "Modes"
- . [ label "mode" . sep_spc . quoted_string_val ]+
+ . [ label "mode" . sep_spc . entry_generic ]+
. eol ]
-
+*)
(*************************************************************************
* View: display_entry
* Known values for entries in the Display subsection
@@ -204,7 +204,7 @@ let display_entry = entry_int "Depth" /[dD]epth/ |
entry_rgb "Weight" /[wW]eight/ |
entry_xy "Virtual" /[vV]irtual/ |
entry_xy "ViewPort" /[vV]iew[pP]ort/ |
- display_modes |
+ entry_str "Modes" /[mM]odes/ |
entry_str "Visual" /[vV]isual/ |
entry_rgb "Black" /[bB]lack/ |
entry_rgb "White" /[wW]hite/ |
50 src/monitors.cxx
View
@@ -21,9 +21,9 @@ class Monitors{
UI::YUIFactory * factory;
UI::yDialog * dialog;
- UI::yVLayout * vL1;
- UI::yHLayout * hL1;
- UI::yPushButton * ok,*cancel,*Advanced;
+ UI::yVLayout * vL1,*vL2,*vL3,*vL4;
+ UI::yHLayout * hL1,*hL2,*hL3,*hL4;
+ UI::yPushButton * ok,*cancel;
UI::yComboBox * driverCombo,*resolutionCombo,*depthCombo;
UI::yIntField * horizontalLow,*horizontalHigh;
UI::yIntField * verticalLow,*verticalHigh;
@@ -157,23 +157,28 @@ void Monitors::detectDrivers(){
}
void Monitors::initUI(){
- dialog = factory->createDialog(200,200);
+ dialog = factory->createDialog(60,12);
vL1 = factory->createVLayout(dialog);
- hL1 = factory->createHLayout(vL1);
- driverCombo = factory->createComboBox(hL1,"Select the driver");
+ driverCombo = factory->createComboBox(vL1,"Select the driver");
fillUpDriverCombo();
- horizontalLow = factory->createIntField(hL1,"Horizontal Refresh Rate(min value)",20,40,30);
- horizontalHigh = factory->createIntField(hL1,"Horizontal Refresh Rate(max value)",20,40,30);
- verticalLow = factory->createIntField(hL1,"Vertical Refresh Rate(min value)",20,40,30);
- verticalHigh = factory->createIntField(hL1,"Vertical Refresh Rate(max value)",20,40,30);
+ vL2 = factory->createVLayout(vL1);
+ hL1 = factory->createHLayout(vL2);
resolutionCombo = factory->createComboBox(hL1,"Select resolution");
fillUpResolutionCombo();
depthCombo = factory->createComboBox(hL1,"Depth");
fillUpDepthCombo();
- enableAdvance = factory->createCheckBox(hL1,"Enable Advanced Settings",false);
- Advanced = factory->createPushButton(hL1,"Advanced Settings");
- ok = factory->createPushButton(hL1,"Ok");
- cancel = factory->createPushButton(hL1,"Cancel");
+ enableAdvance = factory->createCheckBox(vL1,"Enable Advanced Settings",false);
+
+ hL2 = factory->createHLayout(vL1);
+ horizontalLow = factory->createIntField(hL2,"Horizontal Refresh Rate(min value)",20,40,30);
+ horizontalHigh = factory->createIntField(hL2,"Horizontal Refresh Rate(max value)",20,40,30);
+ hL3 = factory->createHLayout(vL1);
+ verticalLow = factory->createIntField(hL3,"Vertical Refresh Rate(min value)",20,40,30);
+ verticalHigh = factory->createIntField(hL3,"Vertical Refresh Rate(max value)",20,40,30);
+
+ hL4 = factory->createHLayout(vL1);
+ ok = factory->createPushButton(hL4,"Ok");
+ cancel = factory->createPushButton(hL4,"Cancel");
}
bool Monitors::respondToEvent(){
@@ -181,10 +186,16 @@ bool Monitors::respondToEvent(){
dialog->wait();
if(dialog->eventWidget()==enableAdvance->getElement()){
if(!enableAdvance->isChecked()){
- Advanced->setEnabled(false);
- }else
- Advanced->setEnabled(true);
-
+ horizontalLow->setDisabled();
+ horizontalHigh->setDisabled();
+ verticalHigh->setDisabled();
+ verticalLow->setDisabled();
+ }else{
+ horizontalLow->setEnabled();
+ horizontalHigh->setEnabled();
+ verticalHigh->setEnabled();
+ verticalLow->setEnabled();
+ }
}
if(dialog->eventWidget()==ok->getElement()){
saveConf();
@@ -281,7 +292,8 @@ void Monitors::saveConf(){
writeConf(line,false,"Monitor",false,"","SaX3-monitor") ? cout<<"no error\n" : cout<<"error\n";
writeConf(line,false,"DefaultDepth",false,"",depthCombo->value().c_str()) ? cout<<"no error\n" : cout<<"error\n";
writeConf(line,false,"Display",true,"/Depth",depthCombo->value().c_str()) ? cout<<"no error\n" : cout<<"error\n";
-
+ string mode = resolutionCombo->value();mode.append("_60.00");
+ writeConf(line,false,"Display",false,"/Modes",mode.c_str()) ? cout<<"no error\n" : cout<<"error\n";
aug_save(aug);
}
Please sign in to comment.
Something went wrong with that request. Please try again.