Ignore:
Timestamp:
07/08/13 12:26:45 (13 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2
Children:
4f9718b
Parents:
d9b0b9e8
Message:

Set the default theme to use the "simple" desktop switcher, and disable the virtual keyboard button for now (need to figure out why it is not working right now)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/PCDM/src/pcdm-gui.cpp

    rd9b0b9e8 rabea4e8  
    1515#include "fancySwitcher.h" 
    1616 
    17 bool DEBUG_MODE=FALSE; 
     17bool DEBUG_MODE=TRUE; 
     18QString VIRTUALKBDBIN="/usr/local/bin/xvkbd -compact"; 
    1819 
    1920PCDMgui::PCDMgui() : QMainWindow() 
     
    6061  QString tmpIcon; //used for checking image files before loading them 
    6162  //Set the background image 
     63  if(DEBUG_MODE){ qDebug() << "Setting Background Image"; } 
    6264  if( currentTheme->itemIsEnabled("background") ){ 
    6365    tmpIcon = currentTheme->itemIcon("background"); 
     
    7678   
    7779  //get the default translation directory 
     80  if(DEBUG_MODE){ qDebug() << "Load Translations"; } 
    7881  translationDir = QApplication::applicationDirPath() + "/i18n/"; 
    7982  //Fill the translator 
     
    8285  toolbar = new QToolBar(); 
    8386  //Add the Toolbar to the window 
     87  if(DEBUG_MODE){ qDebug() << "Create Toolbar"; } 
    8488    //use the theme location    
    8589    QString tarea = currentTheme->itemValue("toolbar"); 
     
    108112  //Populate the Toolbar with items (starts at leftmost/topmost) 
    109113    //----Virtual Keyboard 
    110     tmpIcon = currentTheme->itemIcon("vkeyboard"); 
    111     if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/input-keyboard.png"; } 
    112     virtkeyboardButton = new QAction( QIcon(tmpIcon),tr("Virtual Keyboard"),this ); 
    113     toolbar->addAction(virtkeyboardButton); 
    114     connect( virtkeyboardButton, SIGNAL(triggered()), this, SLOT(slotPushVirtKeyboard()) ); 
     114    if(currentTheme->itemIsEnabled("vkeyboard") ){ 
     115      if(DEBUG_MODE){ qDebug() << " - Create Virtual Keyboard Button"; } 
     116      tmpIcon = currentTheme->itemIcon("vkeyboard"); 
     117      if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/input-keyboard.png"; } 
     118      virtkeyboardButton = new QAction( QIcon(tmpIcon),tr("Virtual Keyboard"),this ); 
     119      toolbar->addAction(virtkeyboardButton); 
     120      connect( virtkeyboardButton, SIGNAL(triggered()), this, SLOT(slotPushVirtKeyboard()) ); 
     121    }else{ 
     122      virtkeyboardButton = new QAction(this); 
     123    } 
    115124 
    116125    //----Locale Switcher 
     126    if(DEBUG_MODE){ qDebug() << " - Create Locale Button"; } 
    117127    tmpIcon = currentTheme->itemIcon("locale"); 
    118128    if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/language.png"; } 
     
    122132     
    123133    //----Keyboard Layout Switcher 
     134    if(DEBUG_MODE){ qDebug() << " - Create Keyboard Layout Button"; } 
    124135    tmpIcon = currentTheme->itemIcon("keyboard"); 
    125136    if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/keyboard.png"; } 
     
    134145     
    135146    if(simpleDESwitcher){ 
     147      if(DEBUG_MODE){ qDebug() << " - Create Simple DE Switcher"; } 
    136148      //Create the simple DE Switcher 
    137149      sdeSwitcher = new QComboBox(this);  
     
    145157     
    146158    //----System Shutdown/Restart 
     159    if(DEBUG_MODE){ qDebug() << " - Create System Button"; } 
    147160    tmpIcon = currentTheme->itemIcon("system"); 
    148161    if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/system.png"; } 
     
    157170  //Create the grid layout 
    158171  QGridLayout* grid = new QGridLayout; 
     172  if(DEBUG_MODE){ qDebug() << "Fill Desktop Area"; } 
    159173  //Populate the grid with items 
    160174    //----Header Image 
    161175    QLabel* header = new QLabel;  
    162176    if( currentTheme->itemIsEnabled("header") ){ 
     177      if(DEBUG_MODE){ qDebug() << " - Create Header"; } 
    163178      tmpIcon = currentTheme->itemIcon("header"); 
    164179      if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/banner.png"; } 
     
    172187     
    173188    //Username/Password/Login widget 
     189    if(DEBUG_MODE){ qDebug() << " - Create Login Widget"; } 
    174190    loginW = new LoginWidget; 
    175191    loginW->setUsernames(Backend::getSystemUsers()); //add in the detected users 
     
    202218    //----Desktop Environment Switcher 
    203219    if(!simpleDESwitcher){ 
     220      if(DEBUG_MODE){ qDebug() << " - Create DE Switcher"; } 
    204221      //Create the switcher 
    205222      deSwitcher = new FancySwitcher(this, !currentTheme->itemIsVertical("desktop") ); 
     
    239256     
    240257  //Now translate the UI and set all the text 
     258  if(DEBUG_MODE){ qDebug() << " - Fill GUI with data"; } 
    241259  retranslateUi(); 
     260  if(DEBUG_MODE){ qDebug() << "Done with initialization"; } 
    242261 
    243262} 
     
    418437// Start xvkbd 
    419438void PCDMgui::slotPushVirtKeyboard(){ 
    420    system("killall -9 xvkbd; xvkbd -compact &"); 
     439   QString cmd = "killall -9 "+VIRTUALKBDBIN.section(" ",0,0).section("/",-1)+"; "+VIRTUALKBDBIN+" &"; 
     440   qDebug() << "Starting Virtual Keyboard:"; 
     441   qDebug() << " - CMD: "+cmd; 
     442   system( cmd.toUtf8() ); 
    421443   loginW->resetFocus("password"); 
    422444} 
     
    425447  //All the text-setting for the main interface needs to be done here 
    426448  //virtual keyboard button 
    427   virtkeyboardButton->setToolTip(tr("Virtual Keyboard")); 
    428   virtkeyboardButton->setText(tr("Virtual Keyboard")); 
     449  //if(currentTheme->itemIsEnabled("vkeyboard")){ 
     450    virtkeyboardButton->setToolTip(tr("Virtual Keyboard")); 
     451    virtkeyboardButton->setText(tr("Virtual Keyboard")); 
     452  //} 
    429453  //locale switcher button 
    430454  localeButton->setToolTip(tr("Change locale")); 
Note: See TracChangeset for help on using the changeset viewer.