aboutsummaryrefslogtreecommitdiff
path: root/lumina-config
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-03-24 08:01:29 -0400
committerKen Moore <ken@pcbsd.org>2015-03-24 08:01:29 -0400
commit120207ea7de7ca6e0973ececb4787e982feefcd1 (patch)
tree3c7dcdf0c2d182f25e5caf1531e13948376c7cd0 /lumina-config
parentMerge branch 'master' of github.com:pcbsd/lumina (diff)
parentAdd a new information file: DeveloperGuidelines.txt (diff)
downloadlumina-120207ea7de7ca6e0973ececb4787e982feefcd1.tar.gz
lumina-120207ea7de7ca6e0973ececb4787e982feefcd1.tar.bz2
lumina-120207ea7de7ca6e0973ececb4787e982feefcd1.zip
Merge branch 'master' of github.com:pcbsd/lumina
Diffstat (limited to 'lumina-config')
-rw-r--r--lumina-config/LPlugins.cpp9
-rw-r--r--lumina-config/mainUI.cpp116
-rw-r--r--lumina-config/mainUI.ui30
3 files changed, 128 insertions, 27 deletions
diff --git a/lumina-config/LPlugins.cpp b/lumina-config/LPlugins.cpp
index 55a5ee9e..94b61f34 100644
--- a/lumina-config/LPlugins.cpp
+++ b/lumina-config/LPlugins.cpp
@@ -135,13 +135,20 @@ void LPlugins::LoadPanelPlugins(){
info.ID = "homebutton";
info.icon = "go-home";
PANEL.insert(info.ID, info);
- //Desktop Bar
+ //Start Menu
info = LPI(); //clear it
info.name = QObject::tr("Start Menu");
info.description = QObject::tr("This provides instant-access to application that are installed on the system.");
info.ID = "appmenu";
info.icon = "Lumina-DE";
PANEL.insert(info.ID, info);
+ //Application Launcher
+ info = LPI(); //clear it
+ info.name = QObject::tr("Application Launcher");
+ info.description = QObject::tr("Pin an application shortcut directly to the panel");
+ info.ID = "applauncher";
+ info.icon = "quickopen";
+ PANEL.insert(info.ID, info);
}
void LPlugins::LoadDesktopPlugins(){
diff --git a/lumina-config/mainUI.cpp b/lumina-config/mainUI.cpp
index 34b25b3d..744d4bdf 100644
--- a/lumina-config/mainUI.cpp
+++ b/lumina-config/mainUI.cpp
@@ -11,6 +11,7 @@
#include <QImageReader>
#include <QTime>
#include <QDate>
+#include <QTimeZone>
MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI()){
ui->setupUi(this); //load the designer file
@@ -235,6 +236,7 @@ void MainUI::setupConnections(){
connect(ui->tool_help_date, SIGNAL(clicked()), this, SLOT(sessionShowDateCodes()) );
connect(ui->line_session_time, SIGNAL(textChanged(QString)), this, SLOT(sessionLoadTimeSample()) );
connect(ui->line_session_date, SIGNAL(textChanged(QString)), this, SLOT(sessionLoadDateSample()) );
+ connect(ui->combo_session_timezone, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionoptchanged()) );
}
void MainUI::setupMenus(){
@@ -273,7 +275,28 @@ void MainUI::setupMenus(){
ui->combo_session_wtheme->addItem(fbstyles[i], fbdir.absoluteFilePath(fbstyles[i]));
}
-
+ //Available Time zones
+ ui->combo_session_timezone->clear();
+ QList<QByteArray> TZList = QTimeZone::availableTimeZoneIds();
+ QDateTime DT = QDateTime::currentDateTime();
+ QStringList tzlist; //Need to create a list which can be sorted appropriately
+ for(int i=0; i<TZList.length(); i++){
+ QTimeZone TZ(TZList[i]);
+ if(TZ.country()<=0){ continue; } //skip this one
+ QString name = QLocale::countryToString(TZ.country());
+ if(name.count() > 20){ name = name.left(20)+"..."; }
+ name = QString(tr("%1 (%2)")).arg(name, TZ.abbreviation(DT));
+ if(tzlist.filter(name).isEmpty()){
+ tzlist << name+"::::"+QString::number(i);
+ }
+ }
+ tzlist.sort();
+ for(int i=0; i<tzlist.length(); i++){
+ ui->combo_session_timezone->addItem( tzlist[i].section("::::",0,0), TZList[tzlist[i].section("::::",1,1).toInt()]);
+ }
+ //ui->combo_session_timezone->sort();
+ //Now set the default/system value
+ ui->combo_session_timezone->insertItem(0,tr("System Time"));
}
int MainUI::currentDesktop(){
@@ -486,11 +509,21 @@ void MainUI::loadCurrentSettings(bool screenonly){
ui->list_panel1_plugins->clear();
for(int i=0; i<plugs.length(); i++){
QString pid = plugs[i].section("---",0,0);
- LPI info = PINFO->panelPluginInfo(pid);
- if(!info.ID.isEmpty()){
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name );
+ if(pid.startsWith("applauncher")){
+ bool ok = false;
+ XDGDesktop desk = LXDG::loadDesktopFile(pid.section("::",1,1),ok);
+ if(ok){
+ QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(desk.icon,""), desk.name );
+ it->setWhatsThis(plugs[i]); //make sure to preserve the entire plugin ID (is the unique version)
+ ui->list_panel1_plugins->addItem(it);
+ }
+ }else{
+ LPI info = PINFO->panelPluginInfo(pid);
+ if(!info.ID.isEmpty()){
+ QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name );
it->setWhatsThis(plugs[i]); //make sure to preserve the entire plugin ID (is the unique version)
- ui->list_panel1_plugins->addItem(it);
+ ui->list_panel1_plugins->addItem(it);
+ }
}
}
QString color = settings->value(PPrefix+"color","rgba(255,255,255,160)").toString();
@@ -951,14 +984,26 @@ void MainUI::addpanel1plugin(){
dlg.exec();
if(!dlg.selected){ return; } //cancelled
QString pan = dlg.plugID; //getNewPanelPlugin();
- if(pan.isEmpty()){ return; } //nothing selected
- //Add the new plugin to the list
- LPI info = PINFO->panelPluginInfo(pan);
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name);
- it->setWhatsThis(info.ID);
- ui->list_panel1_plugins->addItem(it);
- ui->list_panel1_plugins->setCurrentItem(it);
- ui->list_panel1_plugins->scrollToItem(it);
+ if(pan == "applauncher"){
+ //Prompt for the application to add
+ XDGDesktop app = getSysApp();
+ if(app.filePath.isEmpty()){ return; } //cancelled
+ pan.append("::"+app.filePath);
+ QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(app.icon,""), app.name);
+ it->setWhatsThis(pan);
+ ui->list_panel1_plugins->addItem(it);
+ ui->list_panel1_plugins->setCurrentItem(it);
+ ui->list_panel1_plugins->scrollToItem(it);
+ }else{
+ if(pan.isEmpty()){ return; } //nothing selected
+ //Add the new plugin to the list
+ LPI info = PINFO->panelPluginInfo(pan);
+ QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name);
+ it->setWhatsThis(info.ID);
+ ui->list_panel1_plugins->addItem(it);
+ ui->list_panel1_plugins->setCurrentItem(it);
+ ui->list_panel1_plugins->scrollToItem(it);
+ }
checkpanels(); //update buttons
if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
}
@@ -969,14 +1014,26 @@ void MainUI::addpanel2plugin(){
dlg.exec();
if(!dlg.selected){ return; } //cancelled
QString pan = dlg.plugID; //getNewPanelPlugin();
- if(pan.isEmpty()){ return; } //nothing selected
- //Add the new plugin to the list
- LPI info = PINFO->panelPluginInfo(pan);
- QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name);
- it->setWhatsThis(info.ID);
- ui->list_panel2_plugins->addItem(it);
- ui->list_panel2_plugins->setCurrentItem(it);
- ui->list_panel2_plugins->scrollToItem(it);
+ if(pan == "applauncher"){
+ //Prompt for the application to add
+ XDGDesktop app = getSysApp();
+ if(app.filePath.isEmpty()){ return; } //cancelled
+ pan.append("::"+app.filePath);
+ QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(app.icon,""), app.name);
+ it->setWhatsThis(pan);
+ ui->list_panel2_plugins->addItem(it);
+ ui->list_panel2_plugins->setCurrentItem(it);
+ ui->list_panel2_plugins->scrollToItem(it);
+ }else{
+ if(pan.isEmpty()){ return; } //nothing selected
+ //Add the new plugin to the list
+ LPI info = PINFO->panelPluginInfo(pan);
+ QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(info.icon,""), info.name);
+ it->setWhatsThis(info.ID);
+ ui->list_panel2_plugins->addItem(it);
+ ui->list_panel2_plugins->setCurrentItem(it);
+ ui->list_panel2_plugins->scrollToItem(it);
+ }
checkpanels(); //update buttons
if(!loading){ ui->push_save->setEnabled(true); modpan = true; }
}
@@ -1745,6 +1802,14 @@ void MainUI::loadSessionSettings(){
ui->push_session_setUserIcon->setIcon( LXDG::findIcon(QDir::homePath()+"/.loginIcon.png", "user-identity") );
ui->line_session_time->setText( sessionsettings->value("TimeFormat","").toString() );
ui->line_session_date->setText( sessionsettings->value("DateFormat","").toString() );
+ if( !sessionsettings->value("CustomTimeZone", false).toBool() ){
+ //System Time selected
+ ui->combo_session_timezone->setCurrentIndex(0);
+ }else{
+ int index = ui->combo_session_timezone->findData( sessionsettings->value("TimeZoneByteCode",QByteArray()).toByteArray() );
+ if(index>0){ ui->combo_session_timezone->setCurrentIndex(index); }
+ else{ ui->combo_session_timezone->setCurrentIndex(0); }
+ }
//Now do the session theme options
ui->combo_session_themefile->clear();
@@ -1837,6 +1902,14 @@ void MainUI::saveSessionSettings(){
sessionsettings->setValue("PlayLogoutAudio", ui->check_session_playlogoutaudio->isChecked());
sessionsettings->setValue("TimeFormat", ui->line_session_time->text());
sessionsettings->setValue("DateFormat", ui->line_session_date->text());
+ if( ui->combo_session_timezone->currentIndex()==0){
+ //System Time selected
+ sessionsettings->setValue("CustomTimeZone", false);
+ sessionsettings->setValue("TimeZoneByteCode", QByteArray()); //clear the value
+ }else{
+ sessionsettings->setValue("CustomTimeZone", true);
+ sessionsettings->setValue("TimeZoneByteCode", ui->combo_session_timezone->currentData().toByteArray()); //clear the value
+ }
//Now do the theme options
QString themefile = ui->combo_session_themefile->itemData( ui->combo_session_themefile->currentIndex() ).toString();
@@ -1844,6 +1917,7 @@ void MainUI::saveSessionSettings(){
QString iconset = ui->combo_session_icontheme->currentText();
QString font = ui->font_session_theme->currentFont().family();
QString fontsize = QString::number(ui->spin_session_fontsize->value())+"pt";
+ //qDebug() << "Saving theme options:" << themefile << colorfile << iconset << font << fontsize;
LTHEME::setCurrentSettings( themefile, colorfile, iconset, font, fontsize);
}
diff --git a/lumina-config/mainUI.ui b/lumina-config/mainUI.ui
index fcebaff7..07abacab 100644
--- a/lumina-config/mainUI.ui
+++ b/lumina-config/mainUI.ui
@@ -109,7 +109,7 @@
<enum>QFrame::StyledPanel</enum>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>4</number>
</property>
<widget class="QWidget" name="page_desktop">
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -602,8 +602,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>263</width>
- <height>178</height>
+ <width>233</width>
+ <height>150</height>
</rect>
</property>
<attribute name="label">
@@ -799,8 +799,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>263</width>
- <height>178</height>
+ <width>233</width>
+ <height>150</height>
</rect>
</property>
<attribute name="label">
@@ -1634,6 +1634,26 @@
</property>
</widget>
</item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_26">
+ <property name="text">
+ <string>Time Zone:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QComboBox" name="combo_session_timezone">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToMinimumContentsLength</enum>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
<item row="6" column="0" colspan="2">
bgstack15