diff options
-rw-r--r-- | lumina-fileinfo/dialog.cpp | 11 | ||||
-rw-r--r-- | lumina-fileinfo/dialog.ui | 41 |
2 files changed, 40 insertions, 12 deletions
diff --git a/lumina-fileinfo/dialog.cpp b/lumina-fileinfo/dialog.cpp index 29b5fd21..f44ace8f 100644 --- a/lumina-fileinfo/dialog.cpp +++ b/lumina-fileinfo/dialog.cpp @@ -153,6 +153,16 @@ void Dialog::LoadDesktopFile(QString input) else{ type = info.suffix().toUpper(); } if(info.isHidden()){ type = QString(tr("Hidden %1")).arg(type); } ui->label_file_type->setText(type); + double bytes = info.size(); + QStringList lab; lab << "B" << "KB" << "MB" << "GB" << "TB" << "PB"; + int i=0; + while(i<lab.length() && bytes>1024){ + bytes = bytes/1024; + i++; //next label + } + //convert the size to two decimel places and add the label + QString sz = QString::number( qRound(bytes*100)/100.0 )+lab[i]; + ui->label_file_size->setText( sz ); ui->label_file_owner->setText(info.owner()); ui->label_file_group->setText(info.group()); QString perms; @@ -187,6 +197,7 @@ void Dialog::LoadDesktopFile(QString input) if (DF.useTerminal) ui->cbRunInTerminal->setChecked(true); else ui->cbRunInTerminal->setChecked(false); iconFileName=""; ui->pbIcon->setIcon(LXDG::findIcon(DF.icon,"")); + if(!info.isWritable()){ ui->tab_deskedit->setEnabled(false); } } else { ui->tabWidget->removeTab(1); return; diff --git a/lumina-fileinfo/dialog.ui b/lumina-fileinfo/dialog.ui index 16ad6158..ef0554f5 100644 --- a/lumina-fileinfo/dialog.ui +++ b/lumina-fileinfo/dialog.ui @@ -27,6 +27,9 @@ <string>File Properties</string> </attribute> <layout class="QFormLayout" name="formLayout"> + <property name="labelAlignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> <item row="0" column="0"> <widget class="QLabel" name="label_file_icon"> <property name="text"> @@ -37,7 +40,7 @@ </property> </widget> </item> - <item row="3" column="0" colspan="2"> + <item row="4" column="0" colspan="2"> <widget class="Line" name="line_2"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> @@ -50,56 +53,56 @@ </property> </widget> </item> - <item row="4" column="0"> + <item row="5" column="0"> <widget class="QLabel" name="label"> <property name="text"> <string>Owner:</string> </property> </widget> </item> - <item row="4" column="1"> + <item row="5" column="1"> <widget class="QLabel" name="label_file_owner"> <property name="text"> <string notr="true"/> </property> </widget> </item> - <item row="5" column="0"> + <item row="6" column="0"> <widget class="QLabel" name="label_3"> <property name="text"> <string>Group:</string> </property> </widget> </item> - <item row="5" column="1"> + <item row="6" column="1"> <widget class="QLabel" name="label_file_group"> <property name="text"> <string notr="true"/> </property> </widget> </item> - <item row="6" column="0"> + <item row="7" column="0"> <widget class="QLabel" name="label_11"> <property name="text"> <string>Permissions:</string> </property> </widget> </item> - <item row="9" column="0" colspan="2"> + <item row="10" column="0" colspan="2"> <widget class="Line" name="line_3"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> </item> - <item row="10" column="0"> + <item row="11" column="0"> <widget class="QLabel" name="label_7"> <property name="text"> <string>Created:</string> </property> </widget> </item> - <item row="10" column="1"> + <item row="11" column="1"> <widget class="QLabel" name="label_file_created"> <property name="toolTip"> <string>Note: The time a file was created might be more recent than the time modified if the file permissions were changed recently.</string> @@ -109,7 +112,7 @@ </property> </widget> </item> - <item row="11" column="0"> + <item row="12" column="0"> <widget class="QLabel" name="label_2"> <property name="text"> <string>Last Modified:</string> @@ -144,20 +147,34 @@ </property> </widget> </item> - <item row="6" column="1"> + <item row="7" column="1"> <widget class="QLabel" name="label_file_perms"> <property name="text"> <string notr="true"/> </property> </widget> </item> - <item row="11" column="1"> + <item row="12" column="1"> <widget class="QLabel" name="label_file_modified"> <property name="text"> <string notr="true"/> </property> </widget> </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>File Size:</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QLabel" name="label_file_size"> + <property name="text"> + <string notr="true"/> + </property> + </widget> + </item> </layout> </widget> <widget class="QWidget" name="tab_deskedit"> |