Changeset 2260e1e


Ignore:
Timestamp:
05/26/14 05:56:22 (7 months ago)
Author:
yurkis <yurkis@…>
Branches:
master, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
a72d5d4
Parents:
127fce8
Message:

Control panel next: Make application single instance

Location:
src-qt4/pc-controlpanel-next
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-controlpanel-next/main.cpp

    rd993d87 r2260e1e  
    11#include "mainwindow.h" 
    22#include <QApplication> 
     3 
     4#include "pcbsd-ui.h" 
    35 
    46#include "backend/cp-itemgroup.h" 
     
    68int main(int argc, char *argv[]) 
    79{         
    8     QApplication a(argc, argv); 
    9     MainWindow w; 
     10    PCSingleApplication a(argc, argv); 
    1011 
    11     CItemGroup system("/usr/local/share/pcbsd/pc-controlpanel/items/system", "system"); 
    12     system.read(); 
     12    if ( a.isRunning() ) 
     13              return !(a.sendMessage("show")); 
     14 
     15    MainWindow w;        
    1316 
    1417    w.show(); 
     18 
     19    QObject::connect(&a, SIGNAL(messageReceived(const QString&)), &w, SLOT(slotSingleInstance()) ); 
    1520     
    1621    return a.exec(); 
  • src-qt4/pc-controlpanel-next/mainwindow.cpp

    r127fce8 r2260e1e  
    55 
    66#include "pcbsd-utils.h" 
     7 
    78 
    89#include "mainwindow.h" 
     
    451452        fillGroupWidget(&mItemGropus[i]); 
    452453} 
     454 
     455/////////////////////////////////////////////////////////////////////////////// 
     456void MainWindow::slotSingleInstance() 
     457{ 
     458    this->hide(); 
     459    this->showNormal(); 
     460    this->activateWindow(); 
     461    this->raise(); 
     462} 
  • src-qt4/pc-controlpanel-next/mainwindow.h

    re1cc90e r2260e1e  
    5757    void on_actionSystem_only_triggered(); 
    5858    void on_actionAll_desktops_triggered(); 
     59 
     60    void slotSingleInstance(); 
    5961}; 
    6062 
Note: See TracChangeset for help on using the changeset viewer.