Permalink
Browse files

Monitor module changed

  • Loading branch information...
1 parent a83c60c commit e82cef9aacf08805f1f7ef0e8bf50b9a97259ef5 Manu Gupta committed Oct 28, 2011
View
1 CMakeLists.txt
@@ -3,5 +3,4 @@ project(SaX3)
find_package(Libyui)
set(CMAKE_CXX_FLAGS "-Wall -pedantic -laugeas")
-#install(FILES COPYING.GPL-3.0 DESTINATION /usr/share/ax3/)
add_subdirectory(src)
View
9 README
@@ -1,6 +1,12 @@
SaX3 - SUSE Advanced X Configuration V3
Authors - Manu Gupta, Michal Hrusecky
+
+SaX3 is an utility to configure XOrg when X autodetection fails. SaX3 is able to
+handle various peripherals supported by X. Currently, it supports keyboard, mouse, monitor and touchpad.
+
+Source code : http://github.com/manugupt1/sax3
+
----------------------------------------
Artwork Contributions
@@ -10,3 +16,6 @@ Monitor.png - kuba - http://www.openclipart.org/detail/89275/computer-ic
Mouse.png - Ehecatl1138 - http://www.openclipart.org/detail/80743/black-mouse-by-ehecatl1138
Touchpad.png - kuba - http://www.openclipart.org/detail/97501/touchpad-icon-by-kuba
+------------------------------------------
+
+Code Contributions : Varsha Saha
View
2 src/CMakeLists.txt
@@ -14,7 +14,7 @@ add_executable(sax3-mouse mouse.cxx)
add_executable(sax3-monitor monitors.cxx)
add_executable(sax3-touchpad touchpad.cxx)
install(PROGRAMS sax3 sax3-keyboard sax3-mouse sax3-monitor sax3-touchpad DESTINATION sbin)
-install(FILES sax3.1.gz sax3-keyboard.1.gz sax3-mouse.1.gz sax3-monitor.1.gz sax3-touchpad.1.gz DESTINATION /usr/share/man/man1)
+#install(FILES sax3.1.gz sax3-keyboard.1.gz sax3-mouse.1.gz sax3-monitor.1.gz sax3-touchpad.1.gz DESTINATION /usr/share/man/man1)
target_link_libraries(sax3 sax3-yuif ${LIBYUI_LIBRARY} augeas)
target_link_libraries(sax3-keyboard sax3-yuif ${LIBYUI_LIBRARY} augeas)
target_link_libraries(sax3-mouse sax3-yuif ${LIBYUI_LIBRARY} augeas)
View
2 src/modules.d/CMakeLists.txt
@@ -1,3 +1,5 @@
#FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.desktop")
#INSTALL(FILES ${files} DESTINATION /usr/share/sax3/modules.d)
install(FILES touchpad.desktop keyboard.desktop mouse.desktop monitor.desktop DESTINATION /usr/share/sax3/modules.d)
+install(FILES sax3.desktop DESTINATION /usr/share/applications)
+install(FILES sax3.png DESTINATION /usr/share/icons/hicolor/32x32/apps/)
View
20 src/modules.d/sax3.desktop
@@ -0,0 +1,20 @@
+[Desktop Entry]
+Comment[lt]=SUSE pagerintas X konfigūravimo įrankis V3
+Comment=SUSE Advanced X Configuration V3
+Exec=/usr/bin/xdg-su -c "/usr/sbin/sax3"
+GenericName[lt]=SaX3 įrankis
+GenericName=SaX3
+Icon=sax3
+MimeType=
+Name[lt]=SAX3
+Name=SAX3
+Categories=System;Settings;Utility;
+StartupNotify=true
+Terminal=false
+Type=Application
+X-DBUS-ServiceName=
+X-DBUS-StartupType=
+#X-KDE-SubstituteUID=false
+#X-KDE-Username=
+X-SuSE-translate=true
+X-Desktop-File-Install-Version=0.18
View
BIN src/modules.d/sax3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
46 src/monitors.cxx
@@ -141,7 +141,6 @@ void Monitors::detectDrivers(){
DIR * dp;
dp = opendir("/tmp/");
if(dp!=NULL){
-// cerr<<"Directory Opened"<<endl;
while(ep=readdir(dp)){
temp = ep->d_name;
if(temp.find("sax3")!=-1 && temp.find(".old")==-1)
@@ -152,29 +151,30 @@ void Monitors::detectDrivers(){
cout<<temp;
ifstream file(temp.c_str());
string temp1;
- int pos;
+ int pos,pos1;
if(file.is_open()){
while(file.good()){
getline(file,temp1);
- pos = temp1.find("Matched ");
- if(pos!=-1)
- break;
+ pos = temp1.find("/usr/lib64/xorg/modules/drivers/");
+ pos1 = temp1.find("/usr/lib/xorg/modules/drivers/");
+ string matched;
+ if(pos!=-1 || pos1!=-1){
+ cout<<endl<<"Found atleast one";
+ if(pos!=-1)
+ matched = "/usr/lib64/xorg/modules/drivers/";
+ if(pos1!=-1)
+ matched = "/usr/lib/xorg/modules/drivers/";
+ int next_pos = pos + matched.size();
+ temp1.erase(0,next_pos);
+ next_pos = temp1.find('_');
+ temp1.erase(next_pos,string::npos);
+ cout<<"\t"<<temp1<<endl;
+ driverList.push_back(temp1);
+ }
}
+
}
-
- while(pos!=-1){
- cout<<temp1<<endl;
- pos = temp1.find("Matched ");
- if(pos!=-1){
- string matched = "Matched ";
- int next_pos = pos+matched.size();
- temp1.erase(0,next_pos);
- next_pos = temp1.find(' ');
- temp1.erase(next_pos,string::npos);
- driverList.push_back(temp1);
- }
- getline(file,temp1);
- };
+ driverList.pop_back();
}
void Monitors::initUI(){
@@ -191,14 +191,14 @@ void Monitors::initUI(){
enableAdvance = factory->createCheckBox(vL1,"Enable Advanced Settings",false);
hL2 = factory->createHLayout(vL1);
- horizontalLow = factory->createIntField(hL2,"Horizontal Refresh Rate(min value)",20,40,30);
+ horizontalLow = factory->createIntField(hL2,"Horizontal Refresh Rate(min value)",20,60,30);
horizontalLow->setDisabled();
- horizontalHigh = factory->createIntField(hL2,"Horizontal Refresh Rate(max value)",20,40,30);
+ horizontalHigh = factory->createIntField(hL2,"Horizontal Refresh Rate(max value)",20,60,30);
horizontalHigh->setDisabled();
hL3 = factory->createHLayout(vL1);
- verticalLow = factory->createIntField(hL3,"Vertical Refresh Rate(min value)",20,40,30);
+ verticalLow = factory->createIntField(hL3,"Vertical Refresh Rate(min value)",20,60,30);
verticalLow->setDisabled();
- verticalHigh = factory->createIntField(hL3,"Vertical Refresh Rate(max value)",20,40,30);
+ verticalHigh = factory->createIntField(hL3,"Vertical Refresh Rate(max value)",20,60,30);
verticalHigh->setDisabled();
customCVT = factory->createCheckBox(vL1,"I want my own CVT",false);
View
BIN src/sax3-keyboard.1.gz
Binary file not shown.
View
BIN src/sax3-monitor.1.gz
Binary file not shown.
View
BIN src/sax3-mouse.1.gz
Binary file not shown.
View
BIN src/sax3-touchpad.1.gz
Binary file not shown.
View
BIN src/sax3.1.gz
Binary file not shown.

0 comments on commit e82cef9

Please sign in to comment.