Skip to content

Commit

Permalink
moved tools button to new location
Browse files Browse the repository at this point in the history
  • Loading branch information
kapitainsky committed Mar 10, 2020
1 parent fb06081 commit 1c2a433
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 32 deletions.
36 changes: 33 additions & 3 deletions src/remote_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ RemoteWidget::RemoteWidget(IconCache *iconCache, const QString &remote,
QIcon(":remotes/images/qbutton_icons/link" + img_add + ".png"));
ui.export_->setIcon(
QIcon(":remotes/images/qbutton_icons/export" + img_add + ".png"));
ui.actionTools->setIcon(
ui.buttonTools->setIcon(
QIcon(":remotes/images/qbutton_icons/tools" + img_add + ".png"));
ui.getInfo->setIcon(
QIcon(":remotes/images/qbutton_icons/info" + img_add + ".png"));
Expand All @@ -115,7 +115,6 @@ RemoteWidget::RemoteWidget(IconCache *iconCache, const QString &remote,
ui.buttonLink->setDefaultAction(ui.link);
ui.buttonExport->setDefaultAction(ui.export_);
ui.buttonInfo->setDefaultAction(ui.getInfo);
ui.buttonTools->setDefaultAction(ui.actionTools);
ui.buttonDedupe->setDefaultAction(ui.actionDedupe);

// buttons and icons size
Expand Down Expand Up @@ -256,6 +255,35 @@ RemoteWidget::RemoteWidget(IconCache *iconCache, const QString &remote,
}
}

ui.refresh->setStatusTip("Refresh (F5)");
ui.mkdir->setStatusTip("New Folder (F7) - rclone mkdir");
ui.rename->setStatusTip("Rename (F2) - rclone moveto");
ui.move->setStatusTip("Move - rclone move");
ui.purge->setStatusTip("Delete (Del) - rclone purge|delete");
ui.mount->setStatusTip("Mount - rclone mount");
ui.stream->setStatusTip("Stream file - rclone cat | player -");
ui.upload->setStatusTip("Upload file/directory");
ui.download->setStatusTip("Download file/directory");
ui.getSize->setStatusTip("Get folder size - rclone size");
ui.getTree->setStatusTip("Show folders tree - rclone tree");
ui.link->setStatusTip("Fetch public link - rclone link");
ui.export_->setStatusTip("Export files list");
ui.actionCheck->setStatusTip(
"Check remote's integrity - rclone check/cryptcheck");
ui.actionDedupe->setStatusTip("Remove duplicated files - rclone dedupe");

QMenu *menuMode = new QMenu(this);
menuMode->addAction(ui.getTree);
menuMode->addAction(ui.link);
menuMode->addAction(ui.export_);
menuMode->addAction(ui.actionCheck);
if (remoteType == "drive") {
menuMode->addAction(ui.actionDedupe);
}

ui.buttonTools->setMenu(menuMode);
ui.buttonTools->setPopupMode(QToolButton::InstantPopup);

ui.tree->sortByColumn(0, Qt::AscendingOrder);
ui.tree->header()->setSectionsMovable(false);

Expand Down Expand Up @@ -907,7 +935,9 @@ RemoteWidget::RemoteWidget(IconCache *iconCache, const QString &remote,
menu.addAction(ui.link);
menu.addAction(ui.export_);
menu.addAction(ui.actionCheck);
menu.addAction(ui.actionDedupe);
if (remoteType == "drive") {
menu.addAction(ui.actionDedupe);
}
menu.exec(ui.tree->viewport()->mapToGlobal(pos));
});

Expand Down
58 changes: 29 additions & 29 deletions src/remote_widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<item alignment="Qt::AlignVCenter">
<widget class="QWidget" name="buttons" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
Expand Down Expand Up @@ -71,7 +71,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<width>15</width>
<height>20</height>
</size>
</property>
Expand Down Expand Up @@ -127,7 +127,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<width>15</width>
<height>20</height>
</size>
</property>
Expand Down Expand Up @@ -163,7 +163,7 @@
</property>
</widget>
</item>
<item>
<item alignment="Qt::AlignVCenter">
<widget class="QToolButton" name="buttonDownload">
<property name="text">
<string>Download</string>
Expand All @@ -183,12 +183,35 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<width>15</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="buttonSize">
<property name="text">
<string>Size</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonTools">
<property name="text">
<string>Tools</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
<property name="arrowType">
<enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
Expand All @@ -199,7 +222,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<width>15</width>
<height>5</height>
</size>
</property>
Expand Down Expand Up @@ -265,19 +288,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="buttonTools">
<property name="text">
<string>Tools</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonInfo">
<property name="text">
Expand Down Expand Up @@ -322,16 +332,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="buttonSize">
<property name="text">
<string>Size</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonTree">
<property name="text">
Expand Down

0 comments on commit 1c2a433

Please sign in to comment.